Skip to content

Harden multi-worktree reconciliation and process safety - #1089

Merged
BigSimmo merged 3 commits into
mainfrom
codex/reconciliation-guardrails-437505
Jul 23, 2026
Merged

Harden multi-worktree reconciliation and process safety#1089
BigSimmo merged 3 commits into
mainfrom
codex/reconciliation-guardrails-437505

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a read-only reconciliation preflight for cached-ref, worktree, operation-marker, and optional metadata-only process inventory
  • redact secret-bearing command data at the test-lock boundary and remove raw process command lines from evaluation diagnostics
  • add the reusable reconciliation playbook, final cloud-chat postmortem, and durable process guidance
  • add focused regression coverage for preflight classification, process safety, lifecycle planning, and secret redaction
  • record the separate P1 Next.js security-upgrade debt surfaced by the first hosted dependency audit

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 passed
  • npm run format:changed — passed
  • git diff --check — passed
  • npm run docs:check-links — passed, 1,122 repository path references resolved
  • npm run docs:check-scripts — passed, 335 documented npm references valid
  • npm run verify:cheap — passed, 3,229 tests passed and 1 skipped
  • npm run verify:pr-local — passed, including production build, client-bundle secret scan, and 36-case offline RAG fixture validation

Checks not run

  • UI/browser verification was not run because this changes no UI or browser behavior.
  • No live Supabase, OpenAI, Railway, production migration, or live RAG command was run because this changes workflow tooling only.

Risk and rollback

  • The preflight is read-only and does not fetch or mutate Git state.
  • Process command lines are used only inside the local PowerShell filtering boundary and are never serialized.
  • Enforcement remains cooperative for manually issued Git commands; the workflow documents that limitation.
  • The convenience npm alias was removed after CI correctly exposed an existing Next.js advisory whenever package.json appears in a PR; the framework upgrade is tracked separately as P1 Save Codex local changes #50.
  • Rollback is a two-commit revert of this PR.

RAG impact: no retrieval behaviour change — workflow metadata, process redaction, tests, and documentation only.

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.
@supabase

supabase Bot commented Jul 23, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread scripts/reconciliation-preflight.mjs Outdated
Comment thread scripts/reconciliation-preflight.mjs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/reconciliation-preflight.mjs Outdated
Comment thread scripts/sensitive-text.mjs Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@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.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0add4e3b-e657-4f6c-9546-8409a3db2d90

📥 Commits

Reviewing files that changed from the base of the PR and between 5047bee and 81df220.

📒 Files selected for processing (17)
  • AGENTS.md
  • docs/archive/cloud-chat-reconciliation-2026-07-22.md
  • docs/archive/cloud-chat-reconciliation-postmortem-2026-07-23.md
  • docs/branch-cleanup-guide.md
  • docs/outstanding-issues.md
  • docs/process-hardening.md
  • docs/productivity-workflows.md
  • docs/reconciliation-playbook.md
  • scripts/productivity-core.mjs
  • scripts/reconciliation-preflight.mjs
  • scripts/run-eval-safe.mjs
  • scripts/sensitive-text.mjs
  • scripts/test-run-lock.mjs
  • tests/eval-process-safety.test.ts
  • tests/productivity-workflow.test.ts
  • tests/reconciliation-preflight.test.ts
  • tests/test-runner-safety.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/reconciliation-guardrails-437505

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docs/process-hardening.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Safety and config checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

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.
@BigSimmo
BigSimmo merged commit 6d5062e into main Jul 23, 2026
57 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@BigSimmo
BigSimmo deleted the codex/reconciliation-guardrails-437505 branch July 23, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant