Repository navigation
Fix scope-globs archive-gate to resolve the ratified proposal by change id - #723
Conversation
…ge id `scope_retention_at_archive` derived the ratified-side proposal path from CHANGE_DIR's CURRENT path, so once a change had moved to `openspec/changes/archive/<date>-<id>/` the gate asked git for that archived path at `--ratified-ref` — a commit before the rename, where it never existed — and died with an unhandled CalledProcessError traceback instead of a finding, on exactly the archived directory the gate exists to check (#705). The ratified-side proposal is now located BY CHANGE ID against the ref's own tree, REUSING the sibling `scripts/sequenced_after.py`'s `change_id_of_dir` and `proposal_path_at_ref` (added by #638 for the identical defect in the parent-declaration gate) rather than re-implementing the convention, so the two archive gates cannot drift apart. The sibling is loaded on first use, by location, under `sequenced_after_substrate`: deferred because this module is vendored byte-for-byte into codexFactory's merge gate, which vendors only this file and `frontmatter_strict.py` and never calls the archive freeze; by that name because `tests/sequenced_after/` is itself an importable package called `sequenced_after`. An unresolvable id raises the new named `ScopeGlobsResolutionError` (a `ScopeGlobsError` subclass, so callers keep one error class) and the CLI reports it as a named finding with exit 2. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟡 Changes recommended
There are still concrete edge cases that can produce incorrect results or an unexpected traceback (notably the cached substrate-module validation and missing current proposal.md handling) that should be fixed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes the validate-scope-globs.py --archive-gate path-resolution failure when the change directory has already been renamed into openspec/changes/archive/<date>-<id>/, by resolving the ratified-side proposal.md by change id against the ratified ref’s tree (reusing the existing sequenced_after substrate logic via a deferred, by-location import). Adds targeted fixtures to ensure the archive-rename scenario is covered and the deferred import remains load-bearing.
Changes:
- Rework
scope_retention_at_archive()to locate the ratified proposal path viasequenced_after.proposal_path_at_ref()using the change id, not the current directory path. - Update the validator CLI’s
--archive-gatebehavior/documentation to report “cannot run” cases as a named finding (exit 2) instead of a traceback. - Add new integrity tests covering archive-rename behavior, missing-proposal-at-ref reporting, archived-ref resolution branch coverage, and the deferred-import guard.
File summaries
| File | Description |
|---|---|
| scripts/scope_globs.py | Resolves ratified-side proposal by change id at the ref via deferred loading of sequenced_after substrate; introduces ScopeGlobsResolutionError. |
| scripts/validate-scope-globs.py | Updates --archive-gate usage docs and catches ScopeGlobsError to emit a named “CANNOT RUN” finding with exit 2. |
| tests/scope_globs/test_integrity.py | Adds fixtures for archive-rename scenarios and pins the deferred-import requirement. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…efusal Adversarial review of the by-id resolution found the archive gate still refusing directories it can check, and still tracing back on the operator error class #705 filed. Four fixes, all inside the declared scope. - `scope_retention_at_archive` RESOLVES `change_dir` before the change id is read. The id is decided from the directory's own name and its PARENT's name ('archive' or not), so an unresolved relative spelling carries neither: `cd <archived dir> && --archive-gate .` read the id as '' (a REGRESSION from main, which derived the path from the resolved location), and `cd archive && --archive-gate <date>-<id>` never stripped the date prefix. Both were exit 2 CANNOT RUN on the previous head, both are exit 0 now, measured on this repository's own archived corpus. - `_git_toplevel` converts a failed `rev-parse --show-toplevel` into `ScopeGlobsResolutionError` naming the directory, so a mistyped or outside-the-work-tree CHANGE_DIR — the same class of operator error #705 filed — is a named finding with exit 2 rather than an unhandled `CalledProcessError` traceback. - The ratified ref is confirmed to name a COMMIT before the by-id lookup. The lookup's probes deliberately swallow git's exit status, so an unresolvable ref or a non-commit object was reported in the wording of a change absent at a good ref, pointing the operator at the wrong thing. - The deferred sibling loader probes EVERY attribute the gate uses (`change_id_of_dir`, `proposal_path_at_ref`, `SequencedAfterError`) before reusing a cached module, and pops a failed load out of `sys.modules` on ANY exception rather than only ImportError/OSError, so a half-initialized stub is never left behind. Registration still precedes `exec_module`, as importlib does it and as measured necessary: executing the sibling unregistered dies with "'NoneType' object has no attribute '__dict__'". The CLI catch is widened to `CalledProcessError` beside `ScopeGlobsError` as a backstop, and the usage text states the anchoring (CHANGE_DIR must live under `openspec/changes/`) and every CANNOT-RUN case. Six fixtures added; the two cwd-relative ones fail on the previous head. The identical relative-path defect exists in the sibling `validate-sequenced-after.py --archive-gate .` and is NOT fixed here: that is `scripts/sequenced_after.py`, outside this PR's declared scope, and closing it in both gates at once keeps the single implementation this PR preserves. Refs #705 Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv
Catch-up so the recorded verification describes the tree that would merge. Main advanced 1897f28 -> 31cc52b (README.md, docs/, four tasks.md); no file this PR touches is among them. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to the archive-gate path, matches the stated fix strategy, and includes targeted regression/behavioral tests for the previously crashing scenarios.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
Lane: openxfactory-1 (openXfactory-1) Bot round taken on head Copilot, Copilot, Adversarial review, taken in this round (detail in the updated PR body): the cwd-relative Not taken, with reasons. The identical cwd-relative defect in the sibling Codex: requested on this PR below, so the response — or the usage-limit refusal that has met every request since 2026-09-03 — is recorded here rather than asserted from elsewhere. Absence is recorded as absence, never read as clearance. |
|
Lane: openxfactory-1 (openXfactory-1) @codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… what the narrowing costs (#719 review round) The three adversarial reviews of PR #719 returned four MINOR findings and five NOTE-level ones. Taken here, in the packet's own files and its one module: - **TWO SCENARIOS ADDED to the MODIFIED block.** The amended sentence promoted with no scenario exercising it, so the rule would have been pinned only by this packet's tests — running code standing in for canon, which is the exact shape the proposal refuses. *A marker's reason quotes a code span* and *A marker's tail carries no separator outside a code span*, appended at the end so no promoted scenario moves. The marker names a BODY unit, so `suppression`'s `adds_new_title` gate has nothing to withhold; measured, the block still raises ZERO findings from its own family. - **THE CORPUS FIGURES ARE SCOPED TO THE TREE THEY WERE TAKEN ON.** SEVEN markers and 17,566 units re-derive only with this packet's own delta excluded — with it the same walk gives EIGHT markers over 109 files. Every place the figures appear now says "other than this one" (the delta's AMENDED BY note, which promotes into canon, plus proposal.md, design.md, README.md, .openspec.yaml and tasks.md 2.1/2.2). The substantive claim is unchanged and holds on both readings: no derived unit is literally `WHEN` or `AND`. - **THE NARROWING OF `document-lifecycle`'s MARKER GRAMMAR IS DISCLOSED.** Its "naming each deleted unit as a CommonMark code span" was true of every span under the retired rule and is true only of the spans before the boundary under the amended one, so an author separating two names with the separator now declares only the first. Named in proposal.md as a NEW failure mode this amendment creates, deliberate and conservative (the second unit is REPORTED, never silently dropped), with its reporting scoped into the owed successor at tasks.md 5.1. - **A SUPPRESSION-LEVEL TEST.** The six added tests held the boundary at parse level; the harm lands one level down, where a reason quoting a real canon unit makes the retired rule suppress that unit silently. 121 -> 128 (was 127), the new test running the SAME marker paragraph under both rules. The corpus test's docstring now says its same-document unit set is a PROXY for the promoted requirement's units. - **ONE GRAMMAR TOKEN, ONE SPELLING.** The pairing branch's literal " - " and its hardcoded [3:] become `_REASON_SEP` and `len(_REASON_SEP)`. Parse unchanged. - **RESIDUE NAMED RATHER THAN EDITED**: specs/019-modified-block-currency-family FR-016 and reading A1 still state the retired rule and are deliberately not touched (a build record, not promoted canon, pinned by no gate) — tasks.md 5.3; and the estate-wide run is owed at landing, this lane being confined to its own clone — tasks.md 5.4. REFUSED, with reasons, in the pull request comment: the vendored-scope_globs note (it is about PR #723, whose file this pull request does not touch), the estate-wide MEASUREMENT itself (other clones are outside this lane's limits; the obligation is recorded instead), and the merge-from-main re-measure (owed at landing, on Brett Heap's word, not in a review round). Verification re-run at this head and reported in the body. NOTHING IS RATIFIED by this commit: every document still carries `Status: draft`, .openspec.yaml still carries drafting provenance with no approval pair, and tasks.md 1.1/1.2 are still unticked. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv
…verdict `scope_retention_at_archive` read an ABSENT current-side `proposal.md` as "no scope declared" (`current = ... if proposal.is_file() else None`) and compared on. That made the gate answer a question it had never asked: with a scope ratified at REF it reported a contested MUTATION -- a removal nobody made, because the file that would hold the declaration is simply not there; with nothing ratified it reported RETAINED. Both readings are verdicts about a declaration the gate never read. The CLI's own contract already said the other thing: every failure to READ the current front matter is a named finding with exit 2. So an absent working-tree proposal now raises `ScopeGlobsResolutionError` naming the change directory and the path, which `_archive_gate` already catches and prints as `scope_globs SCOPE-RETENTION gate CANNOT RUN:` with exit 2 and no traceback. Known divergence, deliberately NOT fixed here: the sibling `sequenced_after.retention_at_archive` reads the same case as ABSENT and compares on. `scripts/sequenced_after.py` is outside this PR's declared scope, so the alignment is recorded in the code as a comment and in the PR body as a follow-on rather than taken here. Also: `--archive-gate` usage text names the new arm, and the `scope_retention_at_archive` docstring lists the new raise. New fixture: `test_a_MISSING_WORKING_TREE_PROPOSAL_is_a_CANNOT_RUN_finding_not_a_verdict` -- git fixture in the shape of the neighbouring archive-gate tests (ratified commit carrying the scope, then `git rm` of the proposal in a later commit, the directory surviving because it carries a `tasks.md`). Asserts the direct call raises the named error and that the CLI exits 2 with `CANNOT RUN`, no `Traceback` on either stream, and no `contested` (the verdict it used to be mistaken for). Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
There was a problem hiding this comment.
🟢 Approval recommended
The fix is tightly scoped to the archive-gate resolution path, aligns behavior with the established sequenced_after approach, and is backed by comprehensive new fixtures for the failure modes described in #705.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
Lane: openxfactory-1 (openXfactory-1) FROZEN at Provenance for the admin merge of #723 (plain fix PR for #705; no OpenSpec change — the #638 precedent). Word: Brett Heap, 2026-09-06 09:2xZ, in session, verbatim "merge 705 when green, then ratify 692" — recorded on #705 ahead of this PR existing. Self-authored PR (brettheap) → REVIEW_REQUIRED is structural → admin merge (standing pattern B2). No Rule 6 window: no 🤖 Generated with Claude Code |
…ord, capture the records (#719) RATIFIED 2026-09-06 by Brett Heap (openxFactory operator authority), in session, verbatim: "merge 705 when green, then ratify 692". The first clause landed PR #723 (merge 6295e38); this is the second. THE VETO POINT WAS PUT AND WAS NOT TAKEN. design.md D1 — option A (the reason begins at the first ` — ` standing outside every code span) against option B (require the removed units in a fenced list) — was carried in the pull request body, in tasks.md § 1.2 and in the README row. A is RATIFIED AS DESIGNED, and A's stated cost is ratified with it: the conservative narrowing of what document-lifecycle's "naming each deleted unit as a CommonMark code span" reaches is a NEW failure mode this amendment creates, it is silently corrected today, and its reporting is the owed successor at tasks.md § 5.1. WHAT MOVES. proposal.md, design.md and tasks.md carry Status: ratified with EXACTLY ONE citation line each (Ratified: in the proposal's front matter, Ratified by: in the other two), which is what ratified-provenance counts. .openspec.yaml gains approved_by + approved_on BESIDE the drafting provenance it was authored with — kind and id unmoved, the addition-not-rewrite shape add-drafted-proposal-origin defined, and the shape the archive gate's origin-retention arm reads, which is why the status flip and the approval pair move in ONE commit. The README OpenSpec Records row flips. Two records are captured beside the packet: review/ratification-2026-09-06.md and review/verification-2026-09-06.md. WHAT DOES NOT MOVE. The spec delta is byte-identical; no promoted canon is touched; no ledger row moves (a row's derived keys read no lifecycle status); § 5.1–§ 5.5 stay UNTICKED — the archive is a separate act on merged-plus-green realization evidence and on a separate word, so #692 closes at archive and not at this landing. VERIFIED ON THE MERGED TREE (origin/main 6295e38), every number re-derived after the encode: openspec validate amend-marker-reason-boundary --strict valid; --all --strict 96 passed / 1 failed (the pre-existing skip_specs change, an INFO under the pinned 1.12); the pinned entrypoint 95 passed / 2 failed with both dispositioned and 0 undispositioned; doc-health 9 critical / 8 error / 44 warning / 13 info, finding-set diff EMPTY against both origin/main and the pre-ratification branch, and the family names this change ZERO times; --family modified-block-currency 0/0/0/8 info; pytest tests/doc-health 1587 passed (test_modified_block_currency.py 128); sequenced_after passed (37 active, 2 declaring) and the ledger consistent (177 rows); scope_globs passed. Two probes fired and cleared: the proposal-origin class-7 ERROR with the approval pair removed, and the modified-block-currency carriage finding with the block's marker removed. The self-reference discharge re-run on the merged tree: names=1 and the same 550-character reason under BOTH the amended and the retired grammar, IDENTICAL True. Refs #692 Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Lane: openxfactory-1 (openXfactory-1)
Fixes the
--archive-gatecrash filed in #705:scope_globs.scope_retention_at_archivederived the ratified-side proposal path fromCHANGE_DIR's CURRENT path, so once a change had moved toopenspec/changes/archive/<date>-<id>/the gate asked git for that archived path at--ratified-ref— a commit before the rename, where it never existed — and died with an unhandledCalledProcessErrortraceback instead of a finding, on exactly the archived directory the gate exists to check. Same defect, same shape as #638 (issue #633) in the siblingsequenced_aftergate.Fix
scope_retention_at_archivenow locates the ratified-sideproposal.mdBY CHANGE ID against--ratified-ref's own tree — active path first, then anyopenspec/changes/archive/<date>-<id>/— by REUSINGscripts/sequenced_after.py'schange_id_of_dirandproposal_path_at_ref(the Fix archive-gate to resolve the ratified proposal by change id #638 functions) rather than re-implementing the convention. One implementation, so the two archive gates cannot drift apart; no cycle (sequenced_afterdoes not importscope_globs), and no mirror/lockstep test is needed because there is no second copy.sequenced_after_substrate, and both halves of that are deliberate:scripts/scope_globs.pyis VENDORED BYTE-FOR-BYTE into codexFactory's merge gate (scripts/merge_master/scope_globs.py, pinned bytests/merge-master/test_vendored_scope_globs.py), which vendors only this module andfrontmatter_strict.py. A module-level import would make the vendored copy UNIMPORTABLE — breaking every merge-gate path — until the whole 1,600-linesequenced_aftersubstrate were vendored beside it, for a function the merge gate never calls. Deferred, the vendored copy is unaffected, and a caller that does reach this path without the sibling present gets a namedScopeGlobsResolutionErrorrather than an import traceback. Nothing in codexFactory is touched by this PR, and no re-vendor is required by it.sequenced_after_substrate, not via_sibling("sequenced_after"), because the bare name is AMBIENT in this repository's test run:tests/sequenced_after/is itself an importable package by that name (its__init__.pyexists to stop a same-named-module collision), so under pytest's prepend import modeimport sequenced_afterresolves to the TEST PACKAGE, not toscripts/sequenced_after.py.sequenced_after_substrateis the name that package already documents for the implementation under test. Measured, not assumed: the plain-_siblingroute fails in a full-suite run.proposal.mdat the ref at all, the sibling'sSequencedAfterErroris re-raised (message intact) as the newScopeGlobsResolutionError— a SUBCLASS ofScopeGlobsError, so this module still presents one error class to its callers while the "could not run" fact stays distinguishable.validate-scope-globs.py::_archive_gatecatches it and prints a named finding with exit 2 —scope_globs SCOPE-RETENTION gate CANNOT RUN:then- <exc>— mirroringvalidate-sequenced-after.py's wording. A retention mutation is still exit 1; a traceback is now unreachable on this path.CHANGE_DIRbehaviour are unchanged (the pre-existing archive-gate fixtures still pass untouched). Docstrings and--archive-gateusage text updated to say the ratified-side proposal is located by change id at the ref.New fixtures (
tests/scope_globs/test_integrity.py, mirroring #638's) — TWELVE in all across three rounds; the five below are the original set, the review rounds added seven more (listed under Review round 1 and Review round 2)test_the_archive_gate_PASSES_across_the_archive_renametest_the_archive_gate_FAILS_across_the_archive_rename_on_a_real_mutationtest_the_archive_gate_CLI_reports_a_ref_with_NO_PROPOSAL_as_a_finding_not_a_tracebacktest_the_archive_gate_resolves_a_ratified_ref_that_is_ITSELF_ALREADY_ARCHIVED— a fourth, covering the archived-directory-enumeration branch (theratified_refis the archival commit itself, so the active-path shortcut cannot resolve it). Stated plainly: this one PASSES onmaintoo — it is branch coverage, not a regression witness.test_the_sequenced_after_sibling_is_NOT_imported_at_module_import_time— a fifth, pinning the DEFERRAL itself: it loadsscripts/scope_globs.pyin a fresh interpreter and asserts neithersequenced_afternorsequenced_after_substrateis insys.modulesafterwards, so a future refactor that hoists the import to module level fails in THIS repository rather than in codexFactory's vendored copy.Negative control, run before pushing: with only the two
scripts/changes stashed and the rename fixtures in place, three of them fail on the unfixed implementation (the fourth, the branch-coverage one, passes there by construction; the fifth was added afterwards and is a forward guard, not a regression witness):Verification (all commands run in a clone at
origin/main1897f28; every figure below is measured, not estimated)python3 -m pytest tests/scope_globs tests/sequenced_after -q→247 passed in 8.86sat headd9569096(235 measured onorigin/mainin a worktree of the same clone, + 12 added by this PR across its three rounds: 5 original, 6 in review round 1, 1 in review round 2).pytest-suitegate uses (python3 -m pytest tests/ -q -m "not postgres"), run twice on this machine — once on this branch, once onorigin/mainin a worktree of the same clone:98 failed, 9485 passed, 110 skipped, 338 deselected, 9 warnings, 50 errors, 72 subtests passed in 2111.75s (0:35:11)origin/main:97 failed, 9481 passed, 110 skipped, 338 deselected, 9 warnings, 50 errors, 72 subtests passed in 2000.55s (0:33:20)openXwalletsubmodule, no pinnedopenspecCLI on PATH, noPINNED_CORE_CHECKOUT). The gate on GitHub is the authority; what is measurable locally is the DIFFERENCE, and it is fully accounted for. Diffing the two failure/error sets by test id leaves exactly three entries, none of them mine:tests/client-identity-roster/…::test_packaged_corpus_self_test_is_strict_and_greenandtests/ideation_dashboard/…::test_end_to_end_self_test_passes— both artifacts of the temporary.baseline-main/worktree sitting inside the clone during the run (their validators walk the filesystem and reported[misplaced-roster-instance] .baseline-main/examples/…).origin/main-only:tests/doc-health/…::test_the_resolver_fails_on_a_checkout_it_cannot_confirm_and_never_walks_up— an artifact of the baseline being a worktree rather than a clone.3 passed in 58.24s.python3 scripts/validate-scope-globs.py .→scope_globs validation passed (all active changes conform).(exit 0)origin/main1897f28 (verbatim, this clone's paths):python3 scripts/doc-health.py --single-repo .→ unchanged (no docs touched): headline identical on both trees —Findings: 9 critical, 8 error, 44 warning, 13 info. New regressions vs previous report: 0.183753fa,pytest-suiteamong them (run 34027573546, 22m39s) —selected=9836 passed=9815 skipped=21 failures=0 errors=0, meeting the EXACT skip pin of 21 and both floors (selected>=7090,passed>=7070), with the freshness verifier and the vector replay bothpassed.d9569096, in this clone:python3 -m pytest tests/scope_globs tests/sequenced_after -q→247 passed in 8.86s; full suitepython3 -m pytest -q→95 failed, 9833 passed, 110 skipped, 9 warnings, 50 errors, 72 subtests passed in 2689.61s (0:44:49)— SKIPPED 110, identical to BOTH round-0 local runs (branch andorigin/main) recorded above, and the failure/error counts are the same environment-dependency set (three fewer failures than round 0 because the temporary.baseline-main/worktree that inflated that run has since been removed from the clone);python3 scripts/validate-scope-globs.py .→scope_globs validation passed (all active changes conform).(exit 0); and the issue reproduction--archive-gate openspec/changes/archive/2026-09-05-amend-published-tip-unreadable-scenario --ratified-ref 87c15baa→scope_globs scope-retention gate passed (scope unchanged since ratification).(exit 0). Thepytest-suitegate on GitHub remains the skip-pin authority (EXACT 21).d9569096: ALL NINE required checks PASS (clearing-dispatch-gate,lane-line,merge-master-approval,openreposhape-pin,openspec-cli-pin,pytest-suite,release-tag-gate,signed-execution-chain-gate,wallet-validation).pytest-suiterun 34038244933, 22m47s —9734 passed, 21 skipped, 338 deselected, 9 warnings, 93 subtests passed, pinned asselected=9848 passed=9827 skipped=21 failures=0 errors=0: the EXACT skip pin of 21 is met again, with the named freshness verifier and the vector replay bothpassed. Copilot re-reviewedd9569096(review5125564734) and recommended approval with 0 new comments; both review threads are resolved and 0 remain unresolved.Review round 1 (adversarial pass →
84c77de4)Four fixes, all inside the declared scope, and six fixtures:
scope_retention_at_archivenow RESOLVESchange_dirbefore the change id is read (an unresolved relative spelling carried neither the directory's own name nor its parent's, socd <archived dir> && --archive-gate .read the id as'');_git_toplevelconverts a failedrev-parse --show-toplevelinto a namedScopeGlobsResolutionError; an unresolvable or non-commit--ratified-refis named as such rather than reported as an absent change; and the deferred sibling loader probes EVERY attribute the gate uses (change_id_of_dir,proposal_path_at_ref,SequencedAfterError) on BOTH thesys.modulescache-hit path and afterexec_module. Fixtures:test_the_archive_gate_RUNS_when_CHANGE_DIR_IS_DOT_from_inside_the_archived_dir,test_the_archive_gate_RUNS_on_a_RELATIVE_dated_dir_name_from_inside_archive,test_a_CHANGE_DIR_OUTSIDE_A_WORK_TREE_is_a_finding_not_a_CalledProcessError,test_an_UNRESOLVABLE_RATIFIED_REF_is_named_as_such_not_as_an_absent_change,test_a_ref_naming_a_NON_COMMIT_OBJECT_is_refused_as_an_unresolvable_ref,test_the_sibling_loader_REQUIRES_every_attribute_the_gate_uses.Review round 2 (
d9569096) — two Copilot threads on headd4112e65, one taken, one refusedproposal.mdreported a verdict instead of refusing to run (scripts/scope_globs.py:580).scope_retention_at_archiveread an absent current-side proposal as "no scope declared" (current = read_scope_globs(proposal) if proposal.is_file() else None) and compared on, so a ratified-absent change reported RETAINED and a ratified-present one reported a contested MUTATION — a removal nobody made, because the file that would hold the declaration is not there. Both are verdicts about a declaration the gate never read, and the CLI's own contract already said the other thing: every failure to READ the current front matter is a named finding with exit 2. It now raisesScopeGlobsResolutionErrornaming the change directory and the missing path, which_archive_gatealready catches and prints asscope_globs SCOPE-RETENTION gate CANNOT RUN:— exit 2, no traceback. Docstring and--archive-gateusage text updated to list the new arm. New fixturetest_a_MISSING_WORKING_TREE_PROPOSAL_is_a_CANNOT_RUN_finding_not_a_verdict, built the way the neighbouring archive-gate tests are (a ratified commit carrying the scope, then agit rmof the proposal in a later commit; the directory survives because it also carriestasks.md); it asserts the direct call raises the named error and the CLI exits 2 withCANNOT RUN, noTracebackon either stream, and nocontested.sys.modulescache check only verifiesproposal_path_at_ref" (scripts/scope_globs.py:160). The comment carriesoriginal_commit_id183753fa, the branch's first commit, where line 155 really did readif module is not None and hasattr(module, "proposal_path_at_ref"):.84c77de4— an ancestor of the reviewed headd4112e65— replaced it with the full-set probe now atscripts/scope_globs.py:157-160, re-probed afterexec_moduleat:186-192, pinned bytest_the_sibling_loader_REQUIRES_every_attribute_the_gate_uses. GitHub flags the threadisOutdated: true(originalLine155 →line160), and Copilot's OWN second review, taken atd4112e65(review5125162188), generated 0 new comments and recommended approval. No change made.Follow-on (out of scope, deliberately not taken here)
The sibling gate
sequenced_after.retention_at_archivereads a missing working-treeproposal.mdasABSENTand compares on —scripts/sequenced_after.py:740,current = read_declaration(proposal) if proposal.is_file() else ABSENT. That is now the ONE arm on which the two archive gates differ.scripts/sequenced_after.pyis outside this PR's declared scope (scripts/scope_globs.py,scripts/validate-scope-globs.py,tests/scope_globs/test_integrity.py), so the divergence is recorded rather than fixed: a comment at the raise site says so, and the alignment is owed as a separate change.No OpenSpec change — plain fix PR for a pre-existing implementation defect, per the #638 precedent scoped in #705. No sweep-ledger row: the ledger seeds rows for OpenSpec changes, and this PR adds none (#638 added none either). Files touched:
scripts/scope_globs.py,scripts/validate-scope-globs.py,tests/scope_globs/test_integrity.py— nothing outside the scope declared in #705.Closes #705
🤖 Generated with Claude Code
https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv