Repository navigation
fix(cloister): reaper safety follow-ups: unheld commits, precious ignored files, .overdeck names, pan-sync paths, GitLab parity (PAN-5990) - #6005
Conversation
… merge proof (PAN-5990) The closed-issue reaper force-removes a merged workspace. It now also keeps the folder, branches and volumes when: - a checkout holds commits on neither the target nor the verified branch (detached HEAD, another branch, a .swarm worker branch), or a rebase/merge/cherry-pick/revert/bisect is in progress; the remote-less polyrepo wrapper may hold only .gitignore and pipeline-record commits - a known-precious gitignored file exists (.env*, *.sql/.dump/.sqlite/.db outside node_modules, anything under .tmp/); bounded listing with --directory, build/cache folders never inspected - an untracked .overdeck/ file is not one of the exact runtime names Overdeck's writers produce - a file in the synced .claude/skills|commands|agents folders was not written by the sync (manifest entries with matching hash, the agent template's copy_dirs and rendered templates, generated .env and .hume-config are recognised by exact path), even when .claude/ is gitignored The GitLab merged-MR path now refuses a fork MR, a different target or a merge/squash commit not on the target, as the GitHub path does. Closes #5990 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Conversation: conv-20261204-38bc
…AN-5990) A checkout inherits a member's branches only when it shares that member's repository; local refs, other branches and stash entries count only when the repository lives outside the workspace folder. The wrapper check covers every branch and stash entry. context/workspace.md and the pan sync mirror of a checkout's own skills/ are recognised as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Conversation: conv-20261204-38bc
|
Overdeck has not verified or reviewed this PR. It could not adopt PR #6005 (feature/pan-5990) is checked out in /home/eltmon/Projects/hoff-pan-5990, so Overdeck cannot create the pipeline workspace and nothing has verified or reviewed it. Push any unpushed commits on feature/pan-5990, run |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Flywheel review: APPROVE Head: CI when I posted:
Tests: on an exported copy of the head I ran the 6 touched test files plus the polyrepo reaper, member-forge, workflows and merge-completeness suites: 207 passed, 1 skipped. Revert check: I swapped Earlier reaper protections still hold
The new checks narrow deletion and never widen itMain deletes everything the dirty check cannot see. Every new check is an extra reason to keep the workspace, and every exemption only takes something out of a new keep reason. Nothing that main keeps is deleted now. Every new git call has a 30 s timeout and a 32 MB buffer. An error, a timeout or exceeding a bound keeps the workspace. The written-paths walk is capped at 5,000 files and depth 8. The author's own calls(a) Wrapper commits may touch only The allowed paths are pipeline records: continues, The blind spot is merge commits. This cannot be exploited today. Every non-merge commit is checked, so the wrapper's tracked files are all allowed paths, and a stash of unstaged edits can only touch those. A (b) Nested clones: not inverted. It is correct.
(c) Agreed. It needs no code; it is a pin only. The
|
Closes #5990. Follow-ups to #5989 (PAN-5979): the closed-issue reaper force-removes a merged workspace, and these changes close the remaining ways it could still delete work. Every new check fails closed: a git call that errors or times out keeps the workspace.
What changed
1. Commits the merged branch does not hold (
src/lib/workspaces/unheld-commits.ts)rebase-merge/,rebase-apply/,MERGE_HEAD,CHERRY_PICK_HEAD,REVERT_HEADorBISECT_LOG.git rev-list HEAD --not <target> <verified branch>is non-empty. This covers a detached HEAD, another branch, and a.swarm/worker branch.--git-common-dir). A separate clone nested in the folder is kept.origin/refs count as holding, and every local branch and every stash entry is judged too..gitignoreand pipeline records (isStatePlanePath); anything else, such as a.pan/drafts/PRD, keeps the workspace. The literal rule would refuse every polyrepo reap forever, because every wrapper has at least one local commit.2. Precious gitignored files: keep, don't archive (
src/lib/workspaces/ignored-work.ts).envand.env.*(not.env.example), for*.sql,*.dump,*.sqliteand*.dboutsidenode_modules/, and for anything under.tmp/.git ls-files --others --ignored --exclude-standard --directory --no-empty-directory. A collapsed folder that is not build, cache or Overdeck output is listed once more, without itsnode_modules/, with a cap of 50 such folders. Every call has a timeout and a buffer cap..envthat Overdeck rendered fromworkspace.env.templatedoes not count.git status.3. The
.overdeck/exemption (src/lib/workspaces/overdeck-runtime-files.ts)context/workspace.mdis among them..overdeck/is work.pan doneand spawn gates keep the blanket prefix, because there the file stays on disk.4. pan-sync output by exact path (
src/lib/workspaces/overdeck-written-paths.ts).claude/.overdeck-manifest.jsonentries whose hash still matches (an edited synced file is work);.claude/files the sync writes;copy_dirsfiles and rendered*.templatetargets such as.mcp.json;.env;.hume-configholding exactly the two lines the writer produces;pan syncmirror of a checkout's ownskills/, when byte-identical..claude/skills|commands|agents/that the sync did not write keep the workspace. This matters because the generated wrapper.gitignoreignores.claude/as a whole..gitignore: since PAN-5199 the generated wrapper.gitignorealready lists.claude/,.mcp.json,.hume-configand.env, which covers every pan-sync path. No generator change was needed. A real-git test pins that it ignores each path, but that test does not fail on revert because nothing was reverted..mcp.jsonand the rendered.envare exempt by path, not content, because placeholders are substituted when they are written.5. GitLab parity (
src/lib/forge.ts,src/lib/lifecycle/verify-merged.ts)findMergedGitLabArtifactnow reportstarget_branch,merge_commit_sha(orsquash_commit_sha) and whethersource_project_iddiffers fromtarget_project_id. A listed MR known to come from a fork is skipped, asgh pr listrows are. This also applies to the DoD and merge-completeness lookups that share the adapter.requireBranchCoveredmode the merged-MR path runsmergedIntoTargetRefusalbefore the head match. A missing fact is a refusal, so a fast-forward MR without squash (no merge or squash commit reported) always refuses that path. Its branch is normally an ancestor of the target and passes on the earlier git check.The reaper's skip line now reads
work kept (<reason>)for every one of these reasons.Tests
Every item has real-git tests in a temp repo:
src/lib/workspaces/__tests__/reap-work-checks.test.ts,tests/unit/lib/lifecycle/verify-merged-gitlab-mr.test.ts, plus cases inreap-issue-residue-forge-merged.test.ts,uncommitted-work.test.tsandforge-merged-artifact.test.ts. Reverting each fix by hand made its tests fail: item 1 (5 tests), the shared-repository check (1), the local-refs rule (3), the stash reflog walk (1), item 2 (7), item 3 (4), item 4 status filter (3), item 4 ignored-folder check (1), item 5 (5).A read-only run of the new check over this machine's live workspaces found that the old MYN polyrepo workspaces that were kept only for pan-sync files now reap. Workspaces stay kept for wrapper
package.json/package-lock.jsonfiles that no Overdeck writer produces, and for PRD drafts committed into the wrapper repo.Gates
npm run typecheck: passnpm run lint: passnpx vitest runon the touched and affected files (35 files, 521 tests): pass🤖 Generated with Claude Code