Repository navigation
fix: repair two master-red root causes — origin-vocab v3 latch, clock-guard isinstance - #3500
Merged
Merged
Conversation
…n-session Problem: PR #3422 added claude-design-session to core.enums.Origin without bumping CURRENT_ORIGIN_VOCABULARY_VERSION, tripping origin_vocab.py's drift latch — resolve_current_origin_vocabulary() asserts on every encode, failing 22+ material-protocol tests (and every downstream test that encodes a revision) on master since 2026-07-31 10:23. Per-PR CI's heavy- test skip let it land unnoticed. What changed: CURRENT_ORIGIN_VOCABULARY_VERSION 2→3 with the new frozen digest (computed via the module's own documented command) and the v3 provenance comment; the checked-in small-session fixture regenerated via write_revision — segment bytes identical, only the manifest's vocabulary version/digest fields changed. Verification: devtools test tests/unit/material_protocol/v1/ — 43 passed (was 22 failed). Co-Authored-By: Claude <[email protected]>
…ansparent Problem: the guard installs a raising datetime subclass into guarded test modules' `datetime` symbol; `isinstance(production_datetime, datetime)` inside such a module became a subclass check that always fails — breaking 20+ tests (test_models timestamp parsing, timestamp guards, null-guard display_date, and downstream) whenever the guard is active. The guard exists to block clock reads, not to change type identity. What changed: GuardedDateTime now carries a metaclass whose __instancecheck__ delegates to real datetime, so isinstance behaves identically to the unguarded module while now()/utcnow() still raise. Verification: devtools test tests/unit/sources/test_models.py tests/unit/core/test_timestamp_guards.py tests/unit/sources/test_null_guard_properties.py tests/unit/infra/test_clock_guard.py — 405 passed (test_models was 11 failed). Co-Authored-By: Claude <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe origin vocabulary advances to version 3 with a registered digest and updated fixture manifest. The clock guard adds delegated datetime instance checks while preserving blocked clock reads. ChangesOrigin vocabulary version 3
Clock guard type checks
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Sinity
added a commit
that referenced
this pull request
Aug 1, 2026
…3500) Co-Authored-By: Claude <[email protected]>
Sinity
added a commit
that referenced
this pull request
Aug 1, 2026
… section (#3501) ## 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 #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.com/claude-code) https://claude.ai/code/session_01P7dQJSbhvx7LSu5PW9Ns9S --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent full-suite-red root causes on master, both invisible to per-PR CI's heavy-test skip: the material-protocol origin-vocabulary drift latch (tripped by #3422 adding
claude-design-session) and the clock guard'sdatetimereplacement breakingisinstancein guarded test modules. Together they account for ~50 of the 128 failures in adevtools verify --allrun on master.Problem
claude-design-sessiontocore.enums.Originwithout bumpingCURRENT_ORIGIN_VOCABULARY_VERSION—resolve_current_origin_vocabulary()'s deliberate drift latch asserts on every encode, failing all 22 material-protocol tests and downstream encoders.datetimesubclass into guarded modules;isinstance(production_datetime, datetime)there became an always-false subclass check, failing 20+ tests (test_models timestamp parsing, timestamp guards, null-guard properties).Solution
origin_vocab.py: version 2→3, frozen digest computed via the module's own documented command, v3 provenance comment; checked-in small-session fixture regenerated viawrite_revision(segment bytes identical, only manifest vocabulary fields changed).clock_guard.py:GuardedDateTimegains a metaclass (_DelegatingInstanceCheck(type)) whose__instancecheck__delegates to realdatetime— clock reads still raise; type identity restored.Verification
devtools test tests/unit/material_protocol/v1/— 43 passed (was 22 failed)devtools test tests/unit/sources/test_models.py tests/unit/core/test_timestamp_guards.py tests/unit/sources/test_null_guard_properties.py tests/unit/infra/test_clock_guard.py— 405 passed (test_models was 11 failed)mypy --stricton both changed files — cleanCo-Authored-By: Claude [email protected]
Summary by CodeRabbit
New Features
claude-design-sessionorigins.Bug Fixes