Repository navigation
Archive-gate parity, round 2: sequenced_after resolves CHANGE_DIR, names an unresolvable ref, and refuses outside a work tree; the stale scope-globs follow-on comment retired - #752
Conversation
…ope-globs has `scripts/sequenced_after.py::retention_at_archive` now refuses the three inputs `scripts/scope_globs.py::scope_retention_at_archive` has refused since #723: 1. CHANGE_DIR is RESOLVED to an absolute path before its change id is read, so a cwd-relative spelling (`.` from inside the archived directory, `<date>-<id>` from inside `archive/`) is read against the components it actually carries. Before: `.` read as the id `''`; `<date>-<id>` read as an id still carrying the date prefix — both refused a directory the gate can perfectly well check. 2. An unresolvable `--ratified-ref` is NAMED as such, by a `git rev-parse --verify --quiet <ref>^{commit}` probe run BEFORE the by-id lookup. Before: the lookup's own probes swallow git's exit status, so a typo or a deleted branch was reported in the wording of a change ABSENT at a good ref — the wrong repair. 3. A CHANGE_DIR outside any git work tree is a named CANNOT RUN finding with exit 2. Before: a `CalledProcessError` traceback out of `_git_toplevel`, exit 1 — the same class of operator error #705 filed against the sibling. `scripts/validate-sequenced-after.py` carries the matching usage text and, like `validate-scope-globs.py`, a `CalledProcessError` backstop beside its whole-error-class catch, so no git failure on this path can trace back. The stale "KNOWN DIVERGENCE FROM THE SIBLING GATE, deliberately not fixed here" comment in `scripts/scope_globs.py` is retired — false since #734. That edit is COMMENT-ONLY (no code line changes) but `scope_globs.py` is vendored byte-for-byte into codexFactory's merge gate, so it grows the re-vendor obligation (add-sequenced-after-substrate task 6.8). `tests/sequenced_after/test_gate_parity.py` runs BOTH CLIs over ONE set of git fixtures per arm and asserts identical exit codes, the shared refusal phrase and "CANNOT RUN" on every refusal — importing neither substrate, so the two are pinned through the surface an operator actually touches. Closes #749 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.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
|
Lane: openxfactory-1 (openXfactory-1) @codex review |
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral changes are narrowly scoped, mirror the established sibling-gate implementation, and are strongly pinned by both unit-level integrity tests and a CLI-level parity suite.
Pull request overview
This PR brings scripts/sequenced_after.py::retention_at_archive to parity with the sibling archive-freeze gate in scripts/scope_globs.py, ensuring both gates handle the same runnable/refusal inputs consistently and that any future divergence is caught by tests rather than operators.
Changes:
- Align
sequenced_after’s archive-gate behavior withscope_globsby (a) resolvingCHANGE_DIRbefore reading the change id, (b) naming unresolvable/non-commit--ratified-refinputs explicitly, and (c) converting “outside any git work tree” into a named refusal rather than a traceback. - Add/extend tests to pin both gates’ CLI behavior (exit codes + refusal phrases) over shared git fixtures.
- Retire the stale “known divergence” follow-on comment in
scripts/scope_globs.pyand updatevalidate-sequenced-after.py’s archive-gate contract text + backstop error handling.
File summaries
| File | Description |
|---|---|
| tests/sequenced_after/test_integrity.py | Adds fixtures asserting the sequenced_after archive gate runs/refuses correctly for the three newly-aligned arms. |
| tests/sequenced_after/test_gate_parity.py | New CLI-level parity suite that runs both gates over the same fixtures and asserts matching exit codes and refusal phrasing. |
| scripts/validate-sequenced-after.py | Updates archive-gate contract text and catches CalledProcessError as a last-resort “CANNOT RUN” backstop (matching scope-globs CLI). |
| scripts/sequenced_after.py | Implements the three parity arms: resolve CHANGE_DIR, _ref_names_a_commit probe, and _git_toplevel refusal instead of traceback. |
| scripts/scope_globs.py | Comment-only update to close the previously recorded divergence and point at the new parity test as the long-term guardrail. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Lane: openxfactory-1 (openXfactory-1) FROZEN at Provenance for the admin merge of #752 (plain fix; no OpenSpec change — the #638/#723/#734 precedent). Words: Brett Heap, 2026-09-07 ~12:4xZ, verbatim "lets work on these" naming the three divergent arms and the stale vendored comment (recorded + claimed on #749), then ~14:3xZ verbatim "merge them when green, then ratify 753" (recorded on #749). Three arms mirrored from the scope-globs gate into 🤖 Generated with Claude Code |
…mber (#757) Catch-up so this branch's `sequenced_after` row is validated by the tooling main now carries (#752's archive-gate parity round 2 rewrote `scripts/sequenced_after.py` and `scripts/validate-sequenced-after.py`). Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
…09-07 word, capture the records (#753) RATIFIED 2026-09-07 by Brett Heap (openxFactory operator authority), in session, verbatim: "merge them when green, then ratify 753". The first clause landed openxFactory #752 (`3a28face`) and #755 (`64aad02e`) and xFactory-Hermes-Install #72 (`06c9083d`); this is the second. BOTH VETO POINTS WERE PUT AND NEITHER WAS TAKEN. `design.md` D1 — option A (split the changelog arm on the fact the read already establishes, so a HELD tip with no readable changelog is GRADED with no declarations) against option B (keep the skip and give the held case a distinct reason class only) — is ratified AS DESIGNED, and A's stated cost is ratified with it: A changes which findings an in-scope repository receives, in the conservative direction, with the estate-wide consequence named as owed at `tasks.md` § 6.1 rather than claimed. `design.md` D2 — the retired skip's fact re-reported at `info` beside the grading rather than dropped — was carried separately so it could be vetoed on its own, and was not vetoed either. ONE CITATION LINE PER DOCUMENT, which is what `ratified-provenance` counts: `Ratified:` in `proposal.md`'s front matter, `Ratified by:` in `design.md` and `tasks.md`. `.openspec.yaml` gains `approved_by` + `approved_on` BESIDE the drafting provenance it was authored with — `kind`, `id` and `reason` unmoved, the addition-not-rewrite shape `add-drafted-proposal-origin` defined. The status flip and the approval pair move in ONE commit because the origin-retention gate resolves the ratifying commit as the FIRST commit declaring `Status: ratified`. THE WORD DOES NOT ARCHIVE. `code_surface` is non-empty, so under `release-realization` the archive is a separate act on merged-plus-green realization evidence and a separate word (§ 6.4, still unticked); #750 closes at archive, which is why the pull request says Refs and not Closes. § 6.1, § 6.2, § 6.5 and § 6.6 remain owed exactly as the word was given over them — including § 6.6's two recorded remedies for the late-`Skip` trace drop, NEITHER of which this word takes. Records: review/ratification-2026-09-07.md and review/verification-2026-09-07.md, every number in them re-derived on this tree at origin/main 64aad02. No ledger row moves: a row's derived keys read no lifecycle status. 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)
The two archive freeze gates read the SAME corpus over the SAME trees, and an
operator archiving a change runs BOTH. After 723 and 734 they still disagreed
about which inputs they can even be RUN on — three arms present in
scripts/scope_globs.py::scope_retention_at_archiveand absent fromscripts/sequenced_after.py::retention_at_archive. This mirrors those three,retires the stale follow-on comment 723 left behind, and pins the parity with a
test that runs both CLIs over one set of fixtures.
The three arms
1. CHANGE_DIR is resolved to an absolute path BEFORE its change id is read
The id is decided from the directory's own name and its PARENT's name (
archiveor not), so a cwd-relative spelling carries components the reading needs and the
path does not have.
Before —
cd openspec/changes/archive/2026-09-05-amend-published-tip-unreadable-scenario,--archive-gate .:and from inside
archive/,--archive-gate 2026-09-05-amend-published-tip-unreadable-scenario:Both are refusals of a directory the gate can perfectly well check.
After — both spellings simply run:
2. An unresolvable
--ratified-refis NAMED as suchA
git rev-parse --verify --quiet <ref>^{commit}probe runs BEFORE the by-idlookup. The lookup's own probes (
_blob_exists_at_ref,_archive_dir_names_at_ref)deliberately swallow git's exit status, so without the probe a typo or a deleted
branch is reported in the wording of a change that is ABSENT at a good ref —
sending the operator to look for a missing directory when the ref is what is
wrong.
Before (
--ratified-ref no-such-refon a real archived directory):After:
A ref naming a NON-COMMIT object (a blob sha) lands in the same named refusal.
3. A CHANGE_DIR outside any git work tree is a named CANNOT RUN finding
Before (a real proposal in a directory under
/tmp, in no repository):After:
scripts/validate-sequenced-after.pycarries the matching usage text, and — likevalidate-scope-globs.py— asubprocess.CalledProcessErrorbackstop beside itswhole-error-class catch. That backstop is the one addition beyond the three arms:
no git call on this path is expected to reach the caller unhandled any more (the
two that used to are exactly arms 2 and 3), and if one ever does it is reported
rather than traced. It is disclosed here rather than folded in silently.
The stale comment, and the vendoring cost
scripts/scope_globs.py~591-595 still said the sibling gate "deliberately"read a missing working-tree proposal as ABSENT and that aligning it was a
follow-on. That has been false since 734. The comment is retired and replaced
with the closed record (734 took that arm; this change takes the other three,
and the parity test now holds them together).
git diff scripts/scope_globs.pyis COMMENT-ONLY — no code line changes(verified by filtering the diff to non-comment
+/-lines: none). It is stillan edit to a file vendored byte-for-byte into codexFactory's merge gate
(
scripts/merge_master/scope_globs.py, pinned bytests/merge-master/test_vendored_scope_globs.py), so it grows the re-vendorobligation — add-sequenced-after-substrate task 6.8. A comment-only edit is
still a byte difference to a byte-for-byte pin; nothing here makes it free.
The parity test
tests/sequenced_after/test_gate_parity.py(new, 286 lines) builds ONE gitfixture per arm whose
proposal.mdcarries BOTH frozen fields, runs BOTH CLIsover it, and asserts they agree:
.from inside the archiveddir; relative
<date>-<id>from insidearchive/— both exit 0, both print"passed", neither traces back;
FAILED (contested), so the file does not pass with both gates broken;non-commit object; CHANGE_DIR outside any work tree — both exit 2, both print
"CANNOT RUN", and both use the same phrase for the fact (
does not name a commit,is not inside a git work tree,no proposal.md in the working tree).The phrase assertion is load-bearing and was added after measurement: with the
arm-2 fix reverted, the exit codes still MATCHED (both gates reached exit 2, one
by the wrong route), so an exit-code-only parity file would have passed while
the divergence stood. Feasible without cross-importing — the file imports
NEITHER substrate and drives both through their CLIs, which is the surface the
operator and the archival workflow actually touch; a test asserts that (by
parsing its own import statements, not by scanning its own source text).
Verification
Recorded verbatim, from a fresh clone at
fix/archive-gate-parity-round-2.Suite delta.
python3 -m pytest tests/sequenced_after tests/scope_globs -qd5a549e4):248 passed in 7.09s262 passed in 9.51s— +14 (5 fixtures intests/sequenced_after/test_integrity.py, 9 in the new parity file: 3 passingarms + 4 refusing arms + the mutation arm + the two-distinct-CLIs guard).
Negative control, arm 1 (
.resolve()reverted, fixtures kept):Negative control, arm 2 (the
_ref_names_a_commitguard removed, fixtures kept):(the parity failures are the SECOND run, after the shared-phrase assertion was
added — the first run of this control passed on exit codes alone, which is the
measurement that motivated the phrase.)
Negative control, arm 3 (
check=Truerestored in_git_toplevel, fixtures kept):(the parity failure there is the PHRASE assertion, not the exit code: the new
CalledProcessErrorbackstop catches the reverted crash and prints git's ownmessage under CANNOT RUN — the backstop works, and the phrase is what holds the
parity.)
House validator.
python3 scripts/validate-sequenced-after.py .Ledger.
python3 scripts/validate-sequenced-after.py . --ledger-diffThe 705 reproduction on this gate, across the rename, still passes.
python3 scripts/validate-sequenced-after.py . --archive-gate openspec/changes/archive/2026-09-05-amend-published-tip-unreadable-scenario --ratified-ref 87c15baadoc-health unchanged.
python3 scripts/doc-health.py --single-repo .identical on main (stashed) and on the branch; exit 0 both.
Full suite. The CI
pytest-suitecheck is the authority, and it is theskip pin:
pass, 23m52s.
Locally the whole run does not complete on this host:
python3 -m pytest -q -p no:randomlycollects 10492 and was cut at 86% by its own 50-minute cap (the boxwas running three other sessions' suites concurrently), and a second attempt was
abandoned at 29%. The single
Fthe truncated run showed was located and run onits own:
The environment-dependent family, named:
test_snapshot.py::test_find_validator_locates_pinned_checkoutasserts
snapshot.find_validator(REPO_ROOT) is not None— it needs a SIBLINGopenxFactory checkout reachable from the repo root, i.e. the
~/projects/xFactory/workspace layout. This work was done in a standalonescratchpad clone with no siblings, so it fails with
assert None is not None;its neighbour
test_minimal_snapshot_validates_against_pinned_validatorskips onthe same condition rather than asserting it. Nothing in this change is reachable
from
tests/ideation-dashboard/— the file touches no code it imports — and CI,which provides the layout, is green. The local skip count also differs from the
pinned 21 for the same reason (31 skips in that one directory alone), which is
why the CI check, not a local run, is the skip-pin authority.
Governance
No OpenSpec change — plain fix per the 638 precedent, on Brett Heap's word
2026-09-07 ("lets work on these").
Closes #749
🤖 Generated with Claude Code
https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb