This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Clean up stale Codex Lab worktrees and planning artifacts after sync classification #233
Copy link
Copy link
Closed
Labels
planDurable planning issueDurable planning issueplan:donePlan completed or supersededPlan completed or superseded
Description
Finish Line
Codex Lab local state is clean enough for the upstream sync: stale detached auto-review diagnostics, obsolete worktrees/branches, scratch artifacts, and local handoff reliance are inventoried and either removed safely or explicitly preserved with a durable GitHub issue reference.
Current Status
July 1, 2026 cleanup pass after PRs #234, #235, and #236.
Captured state before cleanup:
- Open PRs: none.
- Main shared checkout: clean but behind
origin/mainby 7 commits; not fast-forwarded here because another write-capable Every Code session owns that checkout. - Worktrees before cleanup included main, three older
.code/workingworktrees, and three task worktrees from this sync/review workstream.
Cleaned safely in this pass:
- Removed merged task worktrees:
/Users/cbusillo/.code/worktrees/codex-lab/review-primitives/Users/cbusillo/.code/worktrees/codex-lab/review-scope-preflight/Users/cbusillo/.code/worktrees/codex-lab/upstream-substrate-sync
- Pruned deleted remote branches and deleted matching local branches:
rework/upstream-review-primitivesrework/review-scope-preflightchore/upstream-substrate-sync
Preserved intentionally; do not delete without follow-up classification/user confidence:
/Users/cbusillo/.code/working/codex-lab/branches/auto-reviewonfix/login-auth-plumbingataf6f400905/Users/cbusillo/.code/working/codex-lab/branches/auto-review-126bc649detached at126bc649f0/Users/cbusillo/.code/working/codex-lab/branches/fix-pr96-agent-session-contractonfix/pr96-agent-session-contractat00a136517c
Current worktrees after cleanup:
/Users/cbusillo/Developer/codex-labonmainata21dfb3a3d(clean, behindorigin/main)- three preserved older worktrees listed above.
Related durable state:
- Rework durable Background Review around upstream review primitives #231 updated with merged PRs Consolidate durable auto-review projections #235 and Skip oversized background review scopes #236.
- Classify Codex Lab feature ownership after upstream sync #232 updated with the feature ownership matrix.
- Codex Lab multi-auth MVP #115 and Plugin lifecycle hooks for workspace preparation and quality providers #149 now have comments pointing to Classify Codex Lab feature ownership after upstream sync #232 as the current classification source for auth/account and plugin/skill/hook work.
Next #233 action:
- Classify the three preserved older worktrees/branches against their linked PRs/issues, then remove only those proven stale or already merged. Fast-forward the shared main checkout only from a session that owns that checkout or after confirming the other write-capable session is done.
Acceptance Criteria
git status --short --branchandgit worktree listare captured before cleanup.- Each extra worktree/branch is classified as active, stale but preserved, safe to remove, or needs user decision.
- Detached auto-review worktrees are removed only after confirming their relevant findings are stale or migrated into GitHub plan state.
- Any local handoff content needed for recovery is captured in Upstream sync and Codex Lab feature reclassification #229/Sync Codex Lab with current openai/codex substrate #230/Rework durable Background Review around upstream review primitives #231/Classify Codex Lab feature ownership after upstream sync #232/Clean up stale Codex Lab worktrees and planning artifacts after sync classification #233 or related issues before removing or ignoring local handoff files.
- Scratch artifacts and generated diagnostics are removed only when clearly produced by this workstream or explicitly obsolete.
- No user-owned local edits, hidden caches, or unrelated worktrees are deleted without explicit approval.
- Final cleanup leaves the next upstream sync session with one durable recovery surface and no stale local artifact required to resume.
Cleanup Policy
- Inventory first.
- Prefer preserving with an issue reference over deleting when ownership is unclear.
- Do not merge or cherry-pick from stale worktrees during cleanup.
- Do not remove active task branches until their PR/issue state is known.
- Treat repo cleanup as a reviewable step, not as background tidying.
Relationships
- Child of Upstream sync and Codex Lab feature reclassification #229.
- Should usually wait until Classify Codex Lab feature ownership after upstream sync #232 has enough classification to know what is stale.
- Related to Define Every Code-owned convergence contracts #126 handoff cleanup and old auto-review diagnostics.
Metadata
Metadata
Assignees
Labels
planDurable planning issueDurable planning issueplan:donePlan completed or supersededPlan completed or superseded
Activity
shiny-code-bot commentedon Jul 1, 2026
Completed cleanup pass after #232 classification.
Evidence:
/Users/cbusillo/.code/working/codex-lab/branches/fix-pr96-agent-session-contract,/Users/cbusillo/.code/working/codex-lab/branches/auto-review, and/Users/cbusillo/.code/working/codex-lab/branches/auto-review-126bc649.fix/pr96-agent-session-contractandfix/login-auth-plumbing.git worktree list --porcelainnow shows only the shared checkout and the isolatedwork/main-syncrecovery worktree.git branch --list fix/pr96-agent-session-contract fix/login-auth-plumbingis empty.work/main-sync...origin/main.The remaining durable work is back on #231/#230 under parent #229.