Harden multi-worktree reconciliation and process safety - #1089
Conversation
Add read-only reconciliation preflight, secret-safe process metadata, lifecycle checks, tests, and the final cloud-chat postmortem. Verified with focused tests, verify:cheap, and verify:pr-local.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c1e046d. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1e046d878
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (17)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Use the direct Node command so the workflow-only PR does not trigger dependency-change policy. Record the separate Next.js security upgrade debt surfaced by CI.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bca03cfad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #4513 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Distinguish inspection failures from active Git operations, scan process ownership across every worktree, redact Supabase secret tokens, and correct direct CLI guidance. Focused tests pass 47/47 and typecheck is clean.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81df220c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export function collectProcessDiagnostics(worktrees, listProcesses = listRepoNodeProcesses) { | ||
| const roots = worktrees.map((item) => item.path).filter(Boolean); | ||
| return { | ||
| matchingWorktreeNodeProcesses: listProcesses(roots).length, |
There was a problem hiding this comment.
Count non-Windows worktree processes before cleanup
When --include-processes is run from a Linux/macOS checkout or Codex worktree, this count still comes from listRepoNodeProcesses, which immediately returns [] outside Windows before inspecting any roots. The preflight can therefore report 0 registered-worktree Node process(es) even while a dev/test/build process is active under /workspace/Database-*, leaving broad reconciliation/cleanup without the process-ownership guard it now advertises; the smallest proof is to start any long-running Node command in a linked Linux worktree and run this preflight with --include-processes. Fresh evidence beyond the earlier roots issue is that the roots are now aggregated here, but the delegated lister remains Windows-only.
AGENTS.md reference: AGENTS.md:L168-L168
Useful? React with 👍 / 👎.

Summary
Why
The cloud-chat reconciliation exposed repeated delays from stale bases, competing worktrees, ambiguous dirty state, and unsafe process-command diagnostics. These guardrails make the safe path repeatable without adding blocking network calls or broad startup checks.
Verification
npx vitest run tests/eval-process-safety.test.ts tests/productivity-workflow.test.ts tests/reconciliation-preflight.test.ts tests/test-runner-safety.test.ts— 4 files, 45 tests passednpm run format:changed— passedgit diff --check— passednpm run docs:check-links— passed, 1,122 repository path references resolvednpm run docs:check-scripts— passed, 335 documented npm references validnpm run verify:cheap— passed, 3,229 tests passed and 1 skippednpm run verify:pr-local— passed, including production build, client-bundle secret scan, and 36-case offline RAG fixture validationChecks not run
Risk and rollback
package.jsonappears in a PR; the framework upgrade is tracked separately as P1 Save Codex local changes #50.RAG impact: no retrieval behaviour change — workflow metadata, process redaction, tests, and documentation only.