Skip to content

feat(devtools): verify-worktree check + lane-brief prior-satisfaction section - #3501

Merged
Sinity merged 2 commits into
masterfrom
feature/devtools/orchestration-audit
Aug 1, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/devtools/orchestration-audit

Conversation

@Sinity

@Sinity Sinity commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Orchestration-machinery hardening from the 2026-08-01 fanout audit: a new devtools workspace verify-worktree command that catches the worktree-isolation-escape failure mode before a lane's output is trusted, a lane-brief "Recently merged on master (footprint overlap)" section with an explicit PRIOR-SATISFACTION CHECK, standing-hazard updates (no background idle-waits, no lane-side bd writes), and a .agent/CONVENTIONS.md fix that scopes background execution to coordinator sessions only.

Problem

Four verified failure modes from the 2026-08-01 20-lane fanout (each re-verified against source/git, not taken from the incident narrative):

  1. An isolation: "worktree" dispatch silently ran in the main checkout and left ~1700 uncommitted lines in the coordinator's live tree; no tooling existed to verify a lane's claimed worktree (confirmed via the devtools command catalog).
  2. Lane agents' bd calls from stale worktrees reverted 5+ live coordinator bead writes twice (polylogue-2ara, P1 open). Live evidence in this lane: a plain git switch -c inside the worktree fired the beads post-checkout JSONL import. Note: feature/devtools/worktree-import-guard is NOT this fix — its commit f51f373 is content-identical to merged PR fix(devtools): refuse to run when polylogue resolves outside the checkout #3475 (checkout_guard); the branch is superseded and deletable. Remaining polylogue-2ara scope: bd-invocation-time skip-import-if-older.
  3. Three lanes stalled for multiple turns idle-waiting on backgrounded devtools test runs — and .agent/CONVENTIONS.md itself recommended "long test runs ... go to background execution".
  4. Lane polylogue-2cuv burned its budget on a bead already satisfied by a same-session merge; the brief's per-path last-3-commits crumbs did not surface this.

Incidents 5/6 (master-red via narrow gates, repaired in #3498/#3500) are assessed in the companion memo as a process-economics tradeoff, deliberately not addressed with new tooling here.

Solution

  • devtools/verify_worktree.py (+ catalog entry, regenerated docs/devtools.md): hard checks — path exists, inside a git repo, is a LINKED worktree (--absolute-git-dir vs --git-common-dir), toplevel distinct from the main checkout, --expect-branch match; advisory checks — uncommitted changes, stale .beads/issues.jsonl (max updated_at vs main checkout, string-comparable ISO-8601). --json, --strict, exit 1 on hard failure.
  • devtools/lane_brief.py: _recent_master_commits() aggregates git log --since=N days origin/master -- <footprint paths> into a dedicated section headed by a PRIOR-SATISFACTION CHECK instruction; new --recent-days; hazards now forbid background idle-waits and lane-side bd writes (polylogue-2ara).
  • .agent/CONVENTIONS.md: async execution scoped to coordinator sessions; new coordinator dispatch-hygiene bullet (run verify-worktree after every spawn).

Companion memo (out-of-blast-radius recommendations, incl. sinnix doctrine edits): .agent/scratch/2026-08-01-orchestration-audit-recommendations.md (gitignored; copy preserved in the session scratchpad).

Verification

  • devtools test tests/unit/devtools/test_verify_worktree.py tests/unit/devtools/test_lane_brief.py — 24 passed in 5.18s.
  • Live smoke: devtools workspace verify-worktree <this lane's worktree> --expect-branch feature/devtools/orchestration-audit → verdict: OK; devtools workspace verify-worktree /realm/project/polylogue → [FAIL] linked_worktree ... MAIN checkout, exit 1.
  • devtools verify --quick — exit 0 (87.3s, all 18 steps green).
  • Not run: full suite / verify --all (no substrate code touched; testmon-affected + focused tests cover the changed surface).

Anti-vacuity

The verify-worktree tests build real git repos + git worktree add and exercise real git rev-parse semantics — dropping the git-dir/common-dir comparison flips test_main_checkout_fails_isolation_check; dropping the updated_at comparison flips test_stale_beads_jsonl_is_flagged. The production caller is the coordinator dispatch flow documented in .agent/CONVENTIONS.md (and exercised live in this PR's verification). test_render_markdown_prior_satisfaction_warning_lists_recent_commits fails if the new section is dropped from _render_markdown.

Ref polylogue-2ara.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P7dQJSbhvx7LSu5PW9Ns9S

Sinity and others added 2 commits August 1, 2026 11:48
…faction check

Problem: three orchestration failure modes from the 2026-08-01 fanout had
no tooling net: (1) an isolation:worktree dispatch silently ran in the main
checkout, leaving ~1700 uncommitted lines in the coordinator's live tree,
caught only via a file mtime; (2) lane briefs buried recent-master churn in
per-path commit crumbs, so lane polylogue-2cuv burned its budget on a bead
already satisfied by a same-session merge; (3) the standing lane hazards and
.agent/CONVENTIONS.md actively recommended background execution, which
stalled three lanes idle-waiting on backgrounded test runs, and said nothing
about the stale-worktree bd reimport hazard (polylogue-2ara).

What changed: new devtools workspace verify-worktree checks a claimed lane
worktree is a real linked worktree (git-dir vs git-common-dir), not the main
checkout, on the expected branch, plus advisory dirty-tree and stale
.beads/issues.jsonl (max updated_at vs main checkout) findings; lane-brief
gains a 'Recently merged on master (footprint overlap)' section with a loud
PRIOR-SATISFACTION CHECK and --recent-days, and its hazards now forbid
background idle-waits and lane-side bd writes; CONVENTIONS.md scopes async
execution to coordinator sessions and adds coordinator dispatch hygiene.

Ref polylogue-2ara.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P7dQJSbhvx7LSu5PW9Ns9S
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 5 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: ASSERTIVE

Plan: Pro Plus

Run ID: cbbf192f-cffe-46b2-806d-756d9458a14a

📥 Commits

Reviewing files that changed from the base of the PR and between b695a3a and 4b9ca0f.

📒 Files selected for processing (7)
  • .agent/CONVENTIONS.md
  • devtools/command_catalog.py
  • devtools/lane_brief.py
  • devtools/verify_worktree.py
  • docs/devtools.md
  • tests/unit/devtools/test_lane_brief.py
  • tests/unit/devtools/test_verify_worktree.py

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.

@Sinity
Sinity merged commit d8e25f4 into master Aug 1, 2026
3 checks passed
@Sinity
Sinity deleted the feature/devtools/orchestration-audit branch August 1, 2026 09:53

@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: 4b9ca0f420

ℹ️ 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 devtools/verify_worktree.py Resolved
Comment thread devtools/verify_worktree.py Resolved
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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