Skip to content

Realize add-declared-former-id, slices 1-3: read the declared lineage, baseline by identity, fail closed on every history read - #1038

Merged
brettheap merged 16 commits into
mainfrom
realize/add-declared-former-id
Sep 14, 2026
Merged

brettheap merged 16 commits into
mainfrom
realize/add-declared-former-id

Conversation

@brettheap

@brettheap brettheap commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-1 (openXfactory-1)
Claim: #1003 (comment)

What this realizes

add-declared-former-id was ratified 2026-09-13T22:48Z by Brett Heap,
verbatim "ratify 1028 as encoded" — a multiple-choice ruling taking the
recommendation on all five decisions D1–D5, so the delta's wording stands
unchanged and nothing was substituted, restored or deleted. The record is
openspec/changes/add-declared-former-id/review/ratification-2026-09-13.md;
the packet landed as PR #1028 → merge 28ad27af (encode commit 2c75d82a).

code_surface: openxFactory is non-empty, so the Realization archive gate
holds the archive behind merged-plus-green evidence. This is the first of the
realization pull requests: slices 1–3 of design.md D7's six.

The three slices, and the scenarios each realizes

Slice 1 — the declaration and its reader (59232b37, +369/−2 script,
+353 tests; tasks.md §§ 2.1, 2.2, 2.3, 2.5, 2.6). CHANGE_ID_RE hoisted to
module scope, FormerIdError, former_id_problems (the six shape refusals),
declared_former_ids / declared_former_ids_of, load_packet_at,
append_only_problems, former_identity_claimants /
former_identity_ownership_problems, standing_former_id_problems. Over ADDED
A moved packet declares the identity it was ratified under:

  • A fork by copy declares nothing
  • A declared former id still stands in the tree
  • A draft is renamed
  • A later commit removes or reorders a declared former id
  • Two packets claim the same former identity

It includes two sweeps over this repository's own 47 active and 191 archived
packets.

Slice 2 — the archive gate (2a9cfbda, +394/−78 script, +343/−31 tests;
tasks.md §§ 3.1, 3.1a, 3.2, 3.3). _tree_rows (the ls-tree read that
separates ABSENT from UNREADABLE), identity_paths_at / proposal_path_at
(the two-candidate rule, a LIST, origin-retention-identity-ambiguous over
more than one), packet_yaml_of / packet_yaml_at, _identity_pathspecs,
declared_former_ids_in_tree, ratifying_baseline (ONE
--full-history --topo-order --reverse walk over the UNION of the identities'
pathspecs, EARLIEST wins, no dates compared), _refuse_an_undeclared_move,
ratifying_commit thinned to a wrapper, origin_retention_errors reading the
baseline under the baseline IDENTITY. Over MODIFIED Origin retention at
archive
:

  • A packet that declares a former identity reaches its archive gate
  • A mutation rides in the commit that renamed the packet
  • A declared identity resolves to two locations at one commit

and over ADDED A moved packet declares the identity it was ratified under:

  • A ratified packet is renamed and declares where it came from
  • A packet moves more than once

The MODIFIED requirement's three carried-over scenarios — A staged-origin
change archives
, An ad-hoc change without a support bundle archives, An
origin was mutated after ratification
— are verbatim from canon and stay green
on their existing fixtures.

Slice 3 — the fail-closed reads (this session, +171/−19 script, +334 tests;
tasks.md § 3.4). Over MODIFIED Origin retention at archive:

  • The history holding the baseline cannot be read

Slice 2 landed the probe and left its callers reading a None as "no row" —
its docstring said so and named this slice. This changes callers, not probes:
_unreadable_read_refusal (one refusal, origin-retention-read-unavailable,
CANNOT RUN, naming the git command that failed and the identity it was for, no
bypass flag), _rows_or_refuse, _text_at_a_present_path, _text_at, and the
four reads behind a baseline — the commit enumeration, the per-commit archive
listing, each identity's presence probe, each blob — now each fail closed in
identity_paths_at, ratifying_baseline and origin_retention_errors.

The defect it closes, measured against slice 2's tip 2a9cfbda rather than
argued.
One fixture packet, ratified under change-r, origin mutated
afterwards:

checkout origin_retention_errors
full clone the mutation, refused (exit 2)
--filter=blob:none, promisor cut ORIGIN RETENTION NOT COMPARABLE change-r: the packet at the ratifying commit 4dc042695739 declares no origin (pre-contract packet) → []

The same history, ARCHIVED GREEN over a mutated origin, because the
.openspec.yaml at the ratifying commit could not be read and git show's
silence was read as "declares no origin". design.md M1 measured on git 2.43.0
that git ls-tree prints the row and exits 0 in that checkout while git show
exits 128 — the same 128 a genuinely absent path answers with. Both fixtures
(--filter=blob:none for the unreadable blob, --filter=tree:0 --no-checkout
for the unreadable tree read and the unreadable git log enumeration) are
hermetic, need no network, skipTest where the git in hand ignores the filter,
and prove the probe really fails before anything is asserted about the code.
partial_checkout is lifted from PR #1024's retained branch 2bc60386, which
tasks.md § 3.4 names as a candidate to lift.

The #1027 fixture — asked, done, and why the second half is owed elsewhere

PR #1027 (d6e5969e, already on main) pinned the multi-hop gap as
test_an_unratifying_rename_chain_escapes_the_guard_a_stated_gap. The house
convention for closing such a pin is PR #999's, stated in 2dd54b8e's own
message: repurpose the fixture into a refusal and rename it. Slice 2 SPLIT
it, and flipped the DECLARED half:

  • test_a_declared_rename_chain_is_baselined_at_the_first_ratification — the
    same ratify r → rename+un-ratify r→s → rename s→t while draft → ratify t
    chain with every hop DECLARING: ratifying_commit now returns the FIRST
    ratification where the old fixture asserted the last, ratifying_baseline(…)[1] == "change-r", and the mutation is reported "under the declared former
    identity change-r"
    . That is the flip.
  • test_an_undeclared_rename_chain_is_the_landing_validators_to_refuse — the
    same history declaring nothing, same answer as before, renamed to say who owns
    the refusal.

The undeclared chain is NOT flipped to a refusal here, deliberately and on
three packet-grounded citations:
tasks.md § 3.2 ("LEAVE THE UNDECLARED
REFUSAL EXACTLY WHERE IT IS"
); the ADDED requirement An undeclared rename
arrival is refused at its landing
, which puts that refusal at the LANDING and
whose D3 option (b) — putting it in the archive gate — was considered and
rejected; and mechanically, with nothing declared nothing in history connects
change-t to change-r, so the path-limited git log for change-t never
visits the r→s commit. Flipping it inside ratifying_commit would need the
rename-lineage walk the commissioning ruling declined by name ("history-walking
archaeology that cannot carry the intent bit"
). The flip's second half is
owed to slice 4
, where that fixture gains its refusal from the landing
validator over the same tree and takes the house-convention name
test_an_undeclared_rename_chain_now_refuses_at_its_landing.
ratifying_commit's docstring already names the renamed fixture and says the
closure is at the landing.

Figures

measurement value
tests/proposal-support on main 130 passed, 74 subtests
… after slices 1–2 (2a9cfbda) 170 passed, 290 subtests
… after slice 3 (this branch) 176 passed, 290 subtests, exit 0
slice 3's six new tests run against 2a9cfbda 5 failed, 1 passed, 170 deselected
python3 scripts/proposal-support.py . verify proposal support verification ok, exit 0
python3 scripts/validate-pin-registrations.py . every in-tree path resolves; 2 pin registration(s) cohere, exit 0

The one slice-3 test that passes before AND after is
test_a_genuinely_absent_path_is_still_read_as_absent — the regression pin on
the other half of the requirement: a read that CAN be performed and finds
nothing must still answer "nothing", or the gate refuses over every packet that
ever moved. The sixth test,
test_an_unreadable_commit_enumeration_is_not_an_unratified_packet, is beyond
the five the slice brief names, because § 3.4's fourth clause commissions that
behaviour by hand.

OPENSPEC_TELEMETRY=0 openspec validate --all --strict reports the SAME two
pre-existing failures as origin/main (change/add-chain-attestation,
change/add-composed-view-authoring) and no third.

What is NOT in this pull request

  • No openspec/changes/ file is touched, and no README OpenSpec Records row
    — git diff --stat origin/main...HEAD -- openspec/ is empty. Rule 6's
    landing window therefore does not apply to this PR.
    The tasks.md ticks
    are slice 6's: a tick is a claim about what landed and cannot be written
    before the thing lands.
  • Slice 4 — the landing validator (tasks.md § 2.4 and § 4): the whole of
    ADDED An undeclared rename arrival is refused at its landing (ten
    scenarios, The pairing read cannot be performed and The ratification lookup
    cannot be performed
    among them), plus A former id is appended by a commit
    that moves nothing
    , which reads a commit range.
  • Slice 5 — the reference resolver (§ 5.0–5.2a): ADDED A packet reference
    resolves by identity, not by path
    , six scenarios, and its named consumer in
    scripts/validate-pin-registrations.py.
  • Slice 6 — the documents and the ticks (§ 5.3, § 5.4).
  • § 4.5, the required-check registration, which is an owner console act and
    no author's
    — adding the former-id-arrival-gate context to an opensoft
    organization ruleset targeting openxFactory / ~DEFAULT_BRANCH, and closing
    it on a live read of GET /orgs/opensoft/rulesets/<id> plus
    GET /repos/opensoft/openxFactory/rules/branches/main AND a canary pull
    request going red and BLOCKED — never on the merged workflow file. Whether
    § 4.5 means a new required context at all, or whether the validator may ride
    the already-required pytest-suite, is an open decision for Brett Heap.
  • The promotion (§ 7.1) and the closing of The #849 range guard follows one rename hop only: a rename chain (ratify → rename+un-ratify → rename while draft → ratify) is accepted (routed from #999 Copilot review) #1003 (§ 7.2) — separate acts on
    separate words. The #849 range guard follows one rename hop only: a rename chain (ratify → rename+un-ratify → rename while draft → ratify) is accepted (routed from #999 Copilot review) #1003 stays open.
  • scripts/sequenced_after.py's collapsing probes: the requirement forbids
    REUSING them for this read and does not ask for them to be repaired.

Landing is not this lane's act. This PR merges on Brett Heap's word.

Fix round 1

Nine findings across two reviewers and two pull requests, all nine TAKEN,
none refused. Four commits on top of 5859f053. Every claim was measured on a
fixture before it was taken, and every fix carries a test that FAILS against
the head it was raised on.

The four findings marked (via #1037) were raised on the stacked PR
#1037 against
scripts/proposal-support.py, which is this branch's slice 1–2 work — so they
are fixed here and #1037 inherits them on its next merge of this branch. All
four are replied to and resolved there.

# finding reviewer disposition commit
1 PRRT_kwDOTAvnrs6iElb0 :1541 — refuse when the undeclared-move probe is unreadable Codex P1 TAKEN da9297e0
2 PRRT_kwDOTAvnrs6iEma3 :1516 — the baseline walk's ratified_under_a_former_path treats an unreadable source blob as "not ratified" Copilot TAKEN da9297e0
3 PRRT_kwDOTAvnrs6iElb4 :1310 — preserve date-prefixed identities during archive lookup Codex P2 TAKEN b90fc7f6
4 PRRT_kwDOTAvnrs6iEmbV :554 — change_id_of strips YYYY-MM-DD- from every directory, live ones included Copilot TAKEN b90fc7f6
5 PRRT_kwDOTAvnrs6iEmbp :1311 — the resolver always reads archive/<date>-<id> as <id> Copilot TAKEN b90fc7f6
6 PRRT_kwDOTAvnrs6iEemp :554 — same as 4 (via #1037) Copilot TAKEN b90fc7f6
7 PRRT_kwDOTAvnrs6iEenD :614 — former_ids: [archive] passes CHANGE_ID_RE though active_change_dir reserves the literal (via #1037) Copilot TAKEN 30d40c1c
8 PRRT_kwDOTAvnrs6iGr_N :734 — is_dir()/iterdir() follow symlinks without a containment check (via #1037) Copilot TAKEN cce09fdd
9 PRRT_kwDOTAvnrs6iGr_s :1293 — the lineage lookup silently takes the first of two candidates (via #1037) Copilot TAKEN cce09fdd

da9297e0 — the undeclared-move probe's two reads fail closed

Slice 3 closed every read the baseline walk takes and left the refusal that
GUARDS the walk reading its own two silences flat. Measured end to end on git
2.43.0, on a fixture where change-r is ratified, its origin mutated, then
renamed to change-s by a commit that also rewrites one line of prose:

full clone partial clone at 5859f053
git log --follow … the pairing exit 128
ratifying_commit REFUSE origin-retention-path-moved the rename commit itself
origin_retention_errors raises, the archive stops [] — ORIGIN RETAINED change-s

The mutated origin archived GREEN: the #833 failure reached through a partial
clone instead of through a rename. _pairing_rows now separates "git paired
nothing" from "the read could not be performed" the way _tree_rows already
does, _pairing_or_refuse is the one door the second leaves by, and the source
packet's header at revision^ goes through _text_at so presence comes off
the tree first. On a real partial checkout the second read is unreachable — a
pairing computable without content is an EXACT one, whose source blob at the
parent is the same object as the destination blob at the commit — and the test
says so rather than pretending otherwise, composing two measured values the way
test_an_unreadable_archive_listing_refuses_cannot_run already does.

b90fc7f6 — an id that begins with a date is not the archive's prefix

The rule was already written down in this file: archive_directory_name states
the pinned CLI's own behaviour (an id already carrying YYYY-MM-DD- is
archived under that id UNCHANGED) and names_this_change states that the two
readings of such a directory name "are indistinguishable from the name". The
identity readers took one of them, unconditionally, and for LIVE directories
where there is no ambiguity at all. Measured at 5859f053:

change_id_of(openspec/changes/2026-08-04-add-dated)  -> 'add-dated'
identity_paths_at(root, HEAD, '2026-09-09-foo')      -> []   (it stands there)
declared_former_ids_in_tree(root, '2026-09-10-bar')  -> []   (it declares one)

Four readers fixed — change_id_of, the new _archive_dir_carries behind
identity_paths_at, _change_ids_of_proposal_path (now a list), and
declared_former_ids_in_tree via names_this_change. The third measurement is
the quietest and the worst: a declaring packet handed the UNDECLARED answer,
which is the shed-lineage failure arriving through the reader. Admitting both
readings also makes the ratified scenario A declared identity resolves to two
locations at one commit
reachable for a dated id, and it refuses there.

30d40c1c — archive is a lawful slug and an unlawful identity

former_id_problems("x", {"former_ids": ["archive"]}) returned [] while
active_change_dir refuses the literal and identity_paths_at answers [] —
a declared lineage the reader indexed and every resolution answers with
silence. RESERVED_CHANGE_ID is hoisted beside CHANGE_ID_RE, one spelling,
and former_id_problems gains a seventh arm.

cce09fdd — a lineage only from a packet this repository contains, and only one

A committed symlink is active_change_dir's own traversal reached from the
tree instead of from the caller; git carries one at mode 120000. With
openspec/changes/archive committed as a symlink outside the checkout the
sweep claimed 'stolen-identity' from an .openspec.yaml nobody here wrote,
and declared_former_ids_in_tree returned that outside packet's list as this
corpus's lineage. contained_dir now guards both readers. Separately, where an
identity holds a packet BOTH actively and in the archive, the lineage was the
first candidate's — chosen by the reader's ordering rather than by an author —
and now refuses origin-retention-identity-ambiguous naming both. Neither
refusal fires on the corpus: 47 active ids, 167 archived directories, no
overlap, and zero tracked symlinks anywhere in the repository.

Second bench round — eight more threads, all eight TAKEN

Posted on cce09fdd. Five of the eight are defects the first round created
or half-closed
, which is the reason a second round is bench and not ceremony.
Fixed in 018a65d3.

# finding reviewer disposition
10 PRRT_kwDOTAvnrs6iG9tt — _identity_pathspecs cannot reach the exact archive path Copilot TAKEN
11 PRRT_kwDOTAvnrs6iG9vA — the accept channel authorises itself over an unread ratification Copilot TAKEN
12 PRRT_kwDOTAvnrs6iG9vt — the sweep's archived self-claim Copilot TAKEN
13 PRRT_kwDOTAvnrs6iG9wN — ratifying_commit's retained paragraphs are now false Copilot TAKEN
14 PRRT_kwDOTAvnrs6iHNFa — a contained directory can carry an uncontained .openspec.yaml Copilot TAKEN
15 PRRT_kwDOTAvnrs6iHNGM — the gate's lineage bypasses the two-candidate rule Copilot TAKEN
16 PRRT_kwDOTAvnrs6iHS5E — the archive wrapper's collision heuristic suppresses a lineage Codex P2 TAKEN
17 PRRT_kwDOTAvnrs6iHS5I — same as 12, from the other side Codex P2 TAKEN

10 — round one taught _archive_dir_carries that archive/<id> is a
location a preserved dated id occupies and left the commit ENUMERATION on the
glob *-<identity>, which cannot match <identity>: ratifying_commit
returned None for a packet standing ratified at
openspec/changes/archive/2026-09-09-foo/proposal.md, while
identity_paths_at resolved it. The two halves of one resolution disagreeing.

11 — _origin_mapping(None) is None and _changed_keys(None, …) is [],
so an accept entry declaring changed_keys: [] compared EQUAL to a
measurement taken over a declaration that was never read: the acceptance
authorised and the baseline moved, on a checkout that could not read the
ratification. Both reads now go through _text_at.

12 / 17 — round one named this as a residue in a docstring; two reviewers
measured it. archive/2026-09-09-foo declaring former_ids: [2026-09-09-foo]
— a claim to be the move of itself — validated as foo and was indexed.
packet_identities_of returns both readings and the sweep refuses a
declaration naming either.

14 — round one guarded packet DIRECTORIES; load_packet opens the header
through is_file(), which follows a symlink. With .openspec.yaml committed
as a symlink (mode 120000) the sweep imported 'stolen-by-header'.

16 — names_this_change's other_change_ids arm answers a TRANSIENT
question and suppressed a legitimate match: with archived foo at
archive/2026-09-09-foo and an unrelated live 2026-09-09-foo,
declared_former_ids_in_tree(root, "foo") returned []. The repair is ONE
rule — declared_former_ids_in_tree now resolves with _archive_dir_carries
— and the live-ids reading moves to the arm it belongs on: a LIVE change has
not been archived, so the EXACT reading yields to a live id of that name and
the STRIPPED reading never does. Dropping it altogether was the first attempt
and this round's own test rejected it, as a lawful corpus then read as one
identity in two places.

13 and 15 are stated without overclaim. 13 is documentation only, no
test. For 15 the fixture built for it ALREADY refused at cce09fdd, through
proposal_path_at at the commit the walk visits — the committed tree happening
to agree with the working one; the fix is taken because the refusal should not
depend on that coincidence. The accept-channel test for 11 was VACUOUS when
written through origin_retention_errors (slice 3's baseline door raises on the
same read first) and now drives _accept_declaration_problems directly — found
by running it against the pre-fix head and watching it pass.

Third bench round — two threads, both TAKEN

Posted on 018a65d3. Both are defects the SECOND round created. Fixed in
e6ff63fa.

# finding reviewer disposition
18 PRRT_kwDOTAvnrs6iHw_y — the append-only parent read conflates absent with unreadable Copilot TAKEN
19 PRRT_kwDOTAvnrs6iHxAo — change_dir_names follows symlinks, so the live set walks around the containment guard Copilot TAKEN

19 — round two moved the live-ids reading onto _archive_dir_carries's
EXACT arm, where an entry in the live set does not merely add a name, it
SUPPRESSES one — and left the set read from change_dir_names, one line above
the containment guard that same round added. Measured at 018a65d3, with
openspec/changes/2026-09-09-foo an out-of-tree symlink and the packet
standing at archive/2026-09-09-foo: declared_former_ids_in_tree(root, "2026-09-09-foo") returned [] where without the link it returns
['old-foo'] — an empty lineage sending the gate through the UNDECLARED
baseline, reached by adding a link that resolves nowhere this repository owns.
contained_change_dir_names is the resolver's set; change_dir_names is left
alone, because the archive wrapper's reading of the operator's tree is a
different question and its answer is compared against names the pinned CLI
wrote.

18 — load_packet_at is the tree-side reader the append-only comparison
rests on, and it read through a bare git_show_text, whose None is a genuinely
absent path and any failed git read alike. Measured:
append_only_problems("change-t", [], ["a"]) is [] while
append_only_problems("change-t", ["a", "b"], ["a"]) refuses the removal — so
a declaration DELETED or REORDERED is accepted whenever the established list
could not be read, the shed-lineage failure with the CHECKOUT doing the
shedding. It now reads through _text_at. This reader has no consumer yet (the
landing validator is a later slice), which is exactly why the conflation
survived three rounds.

Fourth bench round — one thread, TAKEN

Posted on e6ff63fa; fixed in 7568c9f1.

# finding reviewer disposition
20 PRRT_kwDOTAvnrs6iIM9m — a present-but-unparseable declaration still reads as an empty one Copilot TAKEN

The third silence in the same family: round three taught load_packet_at to
tell ABSENT from UNREADABLE and left PRESENT-BUT-UNPARSEABLE answering None
beside them. Measured at e6ff63fa over a packet whose .openspec.yaml is
- not\n- a mapping, declared_former_ids_of returned [] and
load_packet_at returned None — the value a genuinely absent packet answers
with. Two fail-opens: ratifying_baseline gets the UNDECLARED answer for a
packet nobody could read, and append_only_problems gets an empty ESTABLISHED
list to accept a removal against.

Both parse arms now refuse, as FormerIdError — the class this file already
reserves for a declaration that cannot be read as one, which the ownership
sweep steps over by design and every gate caller propagates. load_packet
itself is unchanged: it is the general working-tree reader, and the guard
belongs to the reader that knows a broken declaration is not an empty one. The
four further locations the thread lists are not parse arms at this head; the
two that are, are both taken.

Fifth bench round — two threads, both TAKEN

Posted on 7568c9f1; fixed in ef022a83. Both are this fix round's own work.

# finding reviewer disposition
21 PRRT_kwDOTAvnrs6iIy3N — _pairing_rows turns a failed rev-parse into [] Copilot TAKEN
22 PRRT_kwDOTAvnrs6iIy43 — load_packet_at's summary line still promises the conflation Copilot TAKEN

21 — when _pairing_rows was split out of renamed_from, its docstring
argued that a revision resolving to nothing answers [] rather than None
because "a question about a commit that is not there is not a read that
failed". True of a MISSPELLED revision, false of the shape that matters: the
only caller passes a full hash out of this repository's own git log, so a
failing rev-parse on it means the object cannot be read — and [] reached
_pairing_or_refuse as a successful read with no pairing, the same fail-open
that commit closed two lines below. Both of the probe's git calls now leave by
one door; renamed_from, the tolerant door, still answers None for an
unresolvable spelling.

22 — the previous round taught load_packet_at's body to raise and left
its first line saying "None when absent or unparseable". A caller who reads
that line writes the conflation back by hand. The summary now reserves None for
a genuinely absent path and names both exceptions against the silence each
answers.

Sixth bench round — one thread, TAKEN

Posted on ef022a83; fixed in fac01b29.

# finding reviewer disposition
23 PRRT_kwDOTAvnrs6iJHKd — an archived directory's default identity is an unchecked strip Copilot TAKEN

The archive gate's replay reads an ARCHIVED directory, and its default
identity was the date strip — spelled twice before this fix round, once after,
and wrong either way for a preserved dated id. For archive/2026-09-09-foo the
stripped reading foo omits openspec/changes/2026-09-09-foo/ from the
baseline walk entirely, so the later ARCHIVE commit can become the baseline and
a mutation made before archiving passes — the #833 failure reached through the
identity rather than through a rename.

identity_of_packet_dir resolves it from HISTORY rather than from preference:
the two readings differ in exactly one fact, whether an ACTIVE packet by the
directory's FULL name ever existed, which is one path-limited git log. Where
it has no history the stripped reading is the only packet the name can be
about; where it does, both readings name a packet this repository really
carried and the resolver REFUSES, naming both and asking for an explicit id. A
git log that could not be performed refuses too. Measured over this corpus:
of 167 archived directories, ZERO have a full name that ever stood as
an active packet, and the archive wrapper — the only production caller — passes
change explicitly.

Seventh bench round — six SUPPRESSED findings, all six TAKEN

Copilot's review at 14:24Z opened no thread and listed six findings as
"suppressed comments". A freeze that counted threads would have recorded zero
unresolved and been true and useless, so they are taken here in 256fe07a.

# finding disposition
24 :1070 — standing_former_id_problems follows a symlink, so a link pointing outside can REJECT a lawful move TAKEN
25 :632 — with PyYAML unavailable, load_packet_at returns None for a path proved PRESENT TAKEN
26 :1538 — the exact archive arm admits archive/foo/, a directory the pinned archiver cannot produce TAKEN
27 :1963 — ratifying_baseline accepts the reserved archive as an identity TAKEN
28 :690 — verify keeps a private fourth copy of the date strip TAKEN
29 :724 — the identity-disambiguating git log is subject to history simplification TAKEN

24 is the mirror of the containment work earlier in this round: those
guards stop a foreign packet being BELIEVED, and this arm REFUSES on what it
finds, so following a link made it reject a lawful move over a packet this
repository does not contain. 25 is the "None only when absent" contract
broken by the import rather than by the tree. 26 narrows the exact arm to
the single shape it exists for — an identity that already carries a date.
27 is the reserved-segment arm active_change_dir and former_id_problems
both carry, missing from the walk. 28 is the fourth copy of the strip,
after three were removed earlier in this round: after the CLI archives
2026-08-04-add-dated under that name unchanged, a bare strip made
verify(root, "2026-08-04-add-dated") skip the archived packet altogether.
29 matters most, because the probe it corrects landed one commit earlier:
git's default simplification can omit the commit that created the full-name
active packet on a merged side branch, so an ambiguous archive name would read
as unambiguous and resolve to the wrong identity. --full-history now, the
same flag and the same reason ratifying_baseline gives for its own walk.

Validators at 256fe07a

validator result exit
python3 -m pytest tests/proposal-support -q 199 passed, 290 subtests (176 at 5859f053) 0
python3 -m pytest tests/doc-health tests/pin_registrations tests/openspec_cli_pin tests/sequenced_after tests/carve_manifest tests/notebooklm -q 2493 passed, 3 skipped, 30 subtests 0
python3 scripts/proposal-support.py . verify proposal support verification ok 0
python3 scripts/proposal-support.py . verify add-declared-former-id proposal support verification ok 0
python3 scripts/validate-pin-registrations.py . every in-tree path resolves 0
python3 scripts/doc-health.py --single-repo . byte-identical to the pre-fix-round run 0

Twenty-nine findings, twenty-nine taken, none refused. Twenty-three tests
added, every one failing against the head its finding was raised on.

(Correction to the round-4 and round-6 validator tables above: their
"2493 passed" row named tests/proposal-support in the command, and the run it
reports did not include that directory. The two figures are the ones in this
table, measured separately.)

refs #1003

🤖 Generated with Claude Code

Summary by Sourcery

Make origin-retention validation identity-aware by honoring declared former IDs and refusing to proceed when required history reads cannot be completed.

New Features:

  • Add support for reading and validating top-level former_ids declarations, including lineage shape, append-only history, standing identities, and ownership checks.
  • Resolve origin-retention baselines across a packet’s declared identity lineage, including archived locations and ambiguous identity placements.
  • Fail closed when history, tree, or blob reads required for baseline resolution are unavailable instead of treating unreadable data as absent or unratified.

Bug Fixes:

  • Prevent renamed or multi-hop packets from acquiring a later ratification baseline and bypassing origin-retention checks.
  • Preserve distinct handling for genuinely absent paths while refusing unreadable reads.

Enhancements:

  • Update origin-retention comparisons to read packet declarations under the identity and path used at ratification.
  • Retain the existing refusal behavior for undeclared moves while allowing explicitly declared moves to resolve to their earliest ratification.

Tests:

  • Add comprehensive coverage for former-id declaration validation, lineage resolution, identity ambiguity, archived packets, multi-hop renames, and append-only enforcement.
  • Add hermetic partial-checkout tests covering unreadable blob, tree, archive-listing, and commit-enumeration reads.

brettheap and others added 6 commits September 13, 2026 23:56
… ownership sweep

add-declared-former-id § 2 (realization slice 1). `former_ids:` is a
TOP-LEVEL sequence of change ids in a packet's own `.openspec.yaml`, a
SIBLING of `origin:` and never a member of it, ordered oldest first and
append-only across commits. This commit lands the READER and nothing that
consumes it: the archive gate still resolves its baseline exactly as it did,
and no existing answer moves.

scripts/proposal-support.py
  CHANGE_ID_RE hoisted above `active_change_dir` — the id grammar was spelled
  inline there and again in `ratifying_commit`, and this section needed a
  third copy. Three copies of the rule that decides how this estate ADDRESSES
  a packet is the defect this packet is about, in miniature.
  FormerIdError, former_id_problems, declared_former_ids,
  declared_former_ids_of — the six shape refusals § 2.1 names (nested inside
  `origin:`, a scalar where a sequence is required, an entry that is not a
  change id, an entry equal to the packet's own id, a duplicate, and every
  problem reported rather than the first). A malformed declaration RAISES
  rather than reading short: a reader that dropped a bad entry would hand the
  archive gate a shorter lineage than the author wrote.
  load_packet_at — the packet at a revision, for the one comparison that
  cannot be taken from a single tree.
  append_only_problems (§ 2.5) — the established list must stay a PREFIX,
  refused whether or not the commit moves anything. The attack it stops is a
  declaration deleted the day after a lawful move, in a commit no arrival
  check ever looks at.
  former_identity_claimants / former_identity_ownership_problems (§ 2.6) —
  one owner per identity, naming every claimant. Archived packets are read
  for their declarations, because a declaration travels with the packet into
  the archived directory the archive gate reads.
  standing_former_id_problems (§ 2.3) — a declared former id that still
  stands as a live directory is a COPY, refused naming both ids.

tests/proposal-support/test_proposal_support.py
  DeclaredFormerIdTests, 29 tests (214 subtests): the grammar and each
  refusal; § 2.2's sibling property pinned by comparing `origin_block_lines`
  with and without the declaration (`design.md` M3, pinned by a test rather
  than by a comment), and again with the declaration ABOVE the origin block;
  append-only over a real repository, deleted the day after the move; the
  ownership sweep including an archived claimant; and two corpus sweeps over
  this repository's own 47 active and 191 archived packets.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. Binding a newly added entry to the
move that commit performs (§ 2.4) and refusing an undeclared arrival (§ 4)
read a COMMIT RANGE this module never sees; they belong to the landing
validator. Resolving the baseline across the declared identities (§ 3) is the
next slice, and it is the first thing that changes an answer.

Refs #1003. Nothing is archived or promoted by this commit.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…8ad27a; #1019 followed)

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…nd refuse an identity that resolves twice

add-declared-former-id § 3 (realization slice 2), the first slice that CHANGES
AN ANSWER. Slice 1 landed the reader and consumed it nowhere; this one hands
the declared lineage to the archive gate, so a packet that DECLARES where it
came from is baselined at that identity's own ratification and the mutations
made in between stop being waved through.

scripts/proposal-support.py
  _tree_rows — `git ls-tree --name-only`, the ONE read that separates ABSENT
  from UNREADABLE (`design.md` M1), returning None on a non-zero exit and
  never an empty list. Its callers still treat None as "no row", which is
  today's behaviour and this slice's honest limit: turning that into the
  CANNOT RUN refusal is § 3.4, and this is the read that slice needs.
  identity_paths_at / proposal_path_at (§ 3.1, § 3.1a) — the two-candidate
  RULE `sequenced_after.proposal_path_at_ref` states, read the same way and
  NOT through that function's boolean probes, which the requirement forbids
  reusing by name. A LIST, because two locations for one id is an ambiguity to
  report; `proposal_path_at` refuses `origin-retention-identity-ambiguous`,
  CANNOT RUN, naming every candidate.
  ratifying_baseline (§ 3.1) — ONE walk, `--full-history --topo-order
  --reverse` over the UNION of every identity's pathspecs, so the first
  ratified blob it finds IS the earliest and no commit DATES are compared.
  Returns (commit, identity, path): the declaration at the baseline is read
  under the identity the packet was RATIFIED under, which after a lawful move
  is not the one it carries now.
  _refuse_an_undeclared_move (§ 3.2) — PR #846's refusal to the sentence,
  silent for exactly the move the packet DECLARED and for no other. A lineage
  that declares some OTHER id is still refused, and the finding now says which
  ids were declared.
  ratifying_commit — a thin wrapper keeping its name and its one return value;
  `former_ids` defaults to the lineage the packet declares in the working tree,
  so no caller changes. origin_retention_errors (§ 3.3) reads the baseline
  declaration at the baseline identity's own path and names that identity in
  its findings; THE COMPARISON ITSELF DOES NOT MOVE.

tests/proposal-support/test_proposal_support.py
  Twelve tests, all twelve failing against slice 1's script (measured: 12
  failed / 159 passed with this file over the unchanged module). Scenarios
  realized, by their titles in `specs/release-realization/spec.md`:
  - *A packet that declares a former identity reaches its archive gate* —
    test_a_declared_move_resolves_the_baseline_to_the_first_ratification,
    test_the_declaration_is_what_makes_the_difference (both arms in one
    fixture: undeclared REFUSES, declared RESOLVES),
    test_an_undeclared_source_is_still_refused_when_another_is_declared.
  - *A mutation rides in the commit that renamed the packet* —
    test_a_mutation_riding_in_the_declared_move_is_still_a_mutation, the
    laundering case, beside test_a_declared_move_with_no_mutation_retains_its_origin.
  - *A declared identity resolves to two locations at one commit* —
    test_an_identity_resolving_to_two_locations_refuses_cannot_run, with the
    duplicate planted BEFORE the ratification so the walk actually reaches it.
  - *A ratified packet is renamed and declares where it came from* and *A
    packet moves more than once* —
    test_a_declared_rename_chain_is_baselined_at_the_first_ratification, the
    #1003 chain with every hop declaring and the arriving list being the
    source's list with the source id appended.
  - The id-derived path, pinned either side: test_an_identity_resolves_to_its_archived_location,
    test_an_archive_directory_that_merely_ends_with_the_id_is_not_it,
    test_the_declared_lineage_is_read_from_an_archived_packet_too,
    test_packet_yaml_of_names_the_declaration_beside_the_proposal.

THE #1027 FIXTURE IS SPLIT, NOT FLIPPED, AND THE REASON IS THE PACKET'S OWN.
`test_an_unratifying_rename_chain_escapes_the_guard_a_stated_gap` pinned the
UNDECLARED #1003 chain's acceptance until this packet landed. Its DECLARED
half now flips —
test_a_declared_rename_chain_is_baselined_at_the_first_ratification asserts
the first ratification where the old fixture asserted the last. Its UNDECLARED
half keeps the same history and the same answer under the name
test_an_undeclared_rename_chain_is_the_landing_validators_to_refuse, because
nothing in that history connects change-t to change-r and the archive gate has
nothing to read: `tasks.md` § 3.2 says the undeclared refusal stays exactly
where it is, and the refusal that closes this shape is *An undeclared rename
arrival is refused at its landing*, the § 4 validator, which refuses the
r-to-s hop at its own landing so the history can never be created. That
fixture gains its refusal there, from the validator, over the same tree.
`ratifying_commit`'s docstring gap paragraph is updated in place and names it.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. § 3.4 (fail closed on every read
behind the baseline, and the scenario *The history holding the baseline cannot
be read*) is NOT taken: `_tree_rows` is the read it needs and the callers do
not yet refuse on it. § 2.4, § 4 and § 5 are untouched — they read a COMMIT
RANGE or a citation corpus this module never sees. Nothing under
`openspec/specs/` moves, no task box is ticked, nothing is archived or
promoted.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
origin/main moved to dd07374 (#1036, #1033, #888) after the slice-1/slice-2
bundle was cut at 2a9cfbd. Nothing in that range touches
scripts/proposal-support.py or tests/proposal-support/, so the merge is a
currency merge only.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
`add-declared-former-id` § 3.4 (realization slice 3), realizing the MODIFIED
*Origin retention at archive* scenario **The history holding the baseline
cannot be read**, and the paragraph of that requirement which commissions
it: "EVERY READ BEHIND THE BASELINE SHALL FAIL CLOSED, AND ABSENT SHALL BE
DISTINGUISHED FROM UNREADABLE. … the gate SHALL establish whether a path is
PRESENT at a commit from the tree, SHALL treat a read it could not perform as
a refusal — CANNOT RUN, naming the read that failed and the identity it was
for — and SHALL NOT report an unreadable history as an unratified one."

THE DEFECT, MEASURED RATHER THAN ARGUED. Slice 2 landed `_tree_rows`, the one
read that separates the two silences, and left its callers treating a None as
"no row" — its own docstring said so and named this slice. On a fixture packet
ratified under `change-r` whose origin is mutated afterwards, against the
parent commit `2a9cfbda`:

  full clone      origin_retention_errors -> the mutation, refused, exit 2
  partial clone   ORIGIN RETENTION NOT COMPARABLE change-r: the packet at the
                  ratifying commit 4dc042695739 declares no origin
                  (pre-contract packet); presence and shape are still gated
                  origin_retention_errors -> []

The same history, ARCHIVED GREEN over a mutated origin, because the
`.openspec.yaml` standing at the ratifying commit could not be read and
`git show`'s silence was being read as "declares no origin". That is not an
exotic checkout: it is `git clone --filter=blob:none` with the promisor
unreachable, and `design.md` M1 measured on git 2.43.0 that `git ls-tree`
prints the row and exits 0 there while `git show` exits 128 — the same 128 a
GENUINELY ABSENT path answers with.

WHAT CHANGED — callers, and not probes. `_tree_rows` and `git_show_text` are
untouched.

* `_unreadable_read_refusal` — one refusal, `origin-retention-read-unavailable`,
  CANNOT RUN, naming the git command that failed and the identity it was for,
  and routing the operator to `git fetch --refetch` or a full clone. No bypass
  flag (#690). Returned rather than raised, so the `raise` stands at the call
  site.
* `_rows_or_refuse` — the one door a `_tree_rows` None now leaves by.
* `_text_at_a_present_path` — the blob at a path the TREE has already said
  stands there, so a None is never "nothing is there".
* `_text_at` — presence off the tree FIRST, then content: absent still answers
  None, unreadable refuses.
* `identity_paths_at` — all three of its reads (the active probe, the archive
  listing, the archived probe) fail closed. An unreadable ARCHIVE LISTING was
  the quietest: an identity standing only in the archive resolved to nothing at
  all and the walk passed its ratification by.
* `ratifying_baseline` — the commit enumeration no longer returns None on a
  non-zero `git log` (that reported an unreadable history as an unratified
  packet, the sentence the requirement forbids by name); the per-commit archive
  listing refuses; and each identity's blob is read through
  `_text_at_a_present_path`, so a skipped commit can no longer hand the walk a
  LATER baseline.
* `origin_retention_errors` — the `.openspec.yaml` at the resolved baseline, and
  the re-read under an accepted disposition, both go through `_text_at`. The
  refusal is deliberately NOT caught here, on the same ground the moved-packet
  arm is not: there is no comparison left to report.

THE FIXTURES, PROVED BEFORE ANYTHING RESTS ON THEM. Two partial clones, both
hermetic and neither needing a network:

* `partial_checkout` — `--filter=blob:none` with `remote.origin.url` pointed at
  a path that does not exist. Every tree is local, so `ls-tree` still answers
  and the BLOB read fails. Lifted from PR #1024's retained branch `2bc60386`,
  which `tasks.md` § 3.4 names as a candidate; the fixture is the half of that
  branch the commissioning ruling leaves standing.
* `treeless_checkout` — `--filter=tree:0 --no-checkout`, same cut promisor. The
  trees are fetched lazily too, so `git ls-tree` AND the pathspec-limited
  `git log` exit 128.

Each helper `skipTest`s where the git in hand ignores the filter, asserts the
probe it rests on really does fail, and asserts the tree still lists the row —
a test whose "unreadable" checkout is merely empty asserts nothing.

TESTS — six, five of which fail against the parent, measured:

  python3 -m pytest tests/proposal-support -q -k '<the six>'   @ 2a9cfbd
  5 failed, 1 passed, 170 deselected

  test_an_unreadable_baseline_read_refuses_cannot_run                 FAILED
  test_an_unreadable_archive_listing_refuses_cannot_run               FAILED
  test_a_present_path_whose_blob_is_unavailable_is_not_read_as_absent FAILED
  test_the_refusal_names_the_read_and_the_identity_it_was_for         FAILED
  test_an_unreadable_commit_enumeration_is_not_an_unratified_packet   FAILED
  test_a_genuinely_absent_path_is_still_read_as_absent                passed

The sixth passes before and after BY DESIGN: it is the regression pin on the
other half of the requirement — a read that CAN be performed and finds nothing
must still answer "nothing", or the gate refuses over every packet that ever
moved. The enumeration test is the sixth beyond the five the brief names,
because § 3.4's fourth clause commissions that behaviour by hand and a
commissioned behaviour with no test is the defect this packet's own plan warns
about.

  python3 -m pytest tests/proposal-support -q
  before: 170 passed, 290 subtests      after: 176 passed, 290 subtests
  python3 scripts/proposal-support.py . verify   -> proposal support
                                                    verification ok, exit 0

WHAT THIS COMMIT DELIBERATELY DOES NOT DO

* § 2.4 — binding a new `former_ids:` entry to the commit that performs the
  move. It reads a COMMIT RANGE, which is D7.4's, and nothing here touches it.
* § 4 — the landing validator, its two statuses and its workflow. The ADDED
  requirement *An undeclared rename arrival is refused at its landing* keeps all
  ten of its scenarios, *The pairing read cannot be performed* and *The
  ratification lookup cannot be performed* among them: `renamed_from`'s
  `--follow` pairing is the read that fails there, it is the landing gate's to
  take, and this commit does not touch `renamed_from` or
  `ratified_under_a_former_path`.
* § 5 — the reference resolver and its named consumer.
* Any tick in `tasks.md`, any prose in `docs/document-lifecycle.md`, and any
  file under `openspec/changes/`. A tick is a claim about what landed and
  belongs to the slice that can make it (D7.6).
* `scripts/sequenced_after.py`'s collapsing probes. The requirement forbids
  REUSING them for this read and does not ask for them to be repaired; repairing
  them is a change that says so.
* `_accept_declaration_problems`'s two blob reads of a declaration an operator
  named by sha. Their presence half now refuses (they resolve through
  `packet_yaml_at`), and an unreadable blob there already fails closed as a
  finding — "names a `mutation_at` … at which {rel} declares no origin, so there
  is no declaration to accept" — so nothing is waved through; only the wording
  mis-describes the cause. Named here rather than left to be discovered.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 14, 2026 10:23

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

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Slices 1–3 add declared former-identity parsing and ownership validation, baseline origin-retention by the identity that actually ratified the packet, and fail-closed behavior for every history read so unreadable partial checkouts cannot appear unratified or archive green.

Sequence diagram for identity-based origin-retention baseline

sequenceDiagram
    participant Gate as ArchiveGate
    participant Reader as proposal_support
    participant Git as GitHistory
    participant Packet as PacketYaml

    Gate->>Reader: origin_retention_errors()
    Reader->>Reader: declared_former_ids_of()
    Reader->>Git: git log --full-history --topo-order --reverse
    Git-->>Reader: commits across current and former identities
    loop earliest candidate commit
        Reader->>Git: identity_paths_at()
        Git-->>Reader: active or archived proposal path
        Reader->>Git: git show commit:path
        Git-->>Reader: packet declaration
        Reader->>Packet: declares_ratified()
    end
    Reader->>Reader: ratifying_baseline()
    Reader->>Git: _text_at() under baseline identity
    Git-->>Reader: ratified origin declaration
    Reader-->>Gate: compare current origin with baseline
Loading

Flow diagram for fail-closed history reads

flowchart TD
    A[History read] --> B{Tree says path exists?}
    B -->|No rows| C[Absent: continue as genuinely absent]
    B -->|Rows found| D[Read blob with git show]
    D -->|Success| E[Parse declaration or content]
    D -->|Failure| F[Refuse: origin-retention-read-unavailable]
    A -->|git log failure| F
    B -->|git ls-tree failure| F
    F --> G[CANNOT RUN; no unratified or archive-green result]
Loading

File-Level Changes

Change Details Files
Introduces parsing and validation for top-level append-only former_ids declarations, plus repository-wide identity ownership checks.
  • Hoists the change-ID grammar and validates declaration shape, placement, duplicates, self-reference, and malformed entries.
  • Reads declarations from active, archived, and historical packet revisions.
  • Enforces append-only lineage and detects standing or multiply claimed identities.
scripts/proposal-support.py
tests/proposal-support/test_proposal_support.py
Resolves archive baselines by declared identity rather than current directory path.
  • Adds tree-based active/archive path resolution with explicit ambiguity refusal.
  • Walks the union of current and declared identity pathspecs once in topological order, selecting the earliest ratification without comparing dates.
  • Reads ratification and origin data under the identity/path that existed at the baseline, while preserving undeclared-move refusals.
scripts/proposal-support.py
tests/proposal-support/test_proposal_support.py
Makes every history and content read fail closed when the repository cannot distinguish unreadable data from absence.
  • Separates tree presence checks from blob reads and converts unavailable reads into origin-retention-read-unavailable CANNOT RUN errors.
  • Propagates failures through commit enumeration, archive listing, identity probes, and baseline blob reads.
  • Adds hermetic partial-clone tests covering unreadable blobs, trees, archive listings, and commit enumeration while retaining genuine-absence behavior.
scripts/proposal-support.py
tests/proposal-support/test_proposal_support.py
Updates origin-retention validation and regression coverage for declared moves and multi-hop identity histories.
  • Uses declared lineage when locating mutation and ratification packet YAML files.
  • Verifies declared moves retain the original baseline, still reject mutations, and select the first ratification across multiple declared identities.
  • Reworks the prior multi-hop fixture to distinguish the declared lawful path from the intentionally deferred undeclared landing refusal.
scripts/proposal-support.py
tests/proposal-support/test_proposal_support.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)
@codex review

Realization slices 1-3 of add-declared-former-id (ratified 2026-09-13T22:48Z, "ratify 1028 as encoded"; packet landed 28ad27af). Two files only — scripts/proposal-support.py and tests/proposal-support/test_proposal_support.py; no openspec/changes/ file is touched.

Where to look hardest:

  1. Slice 3 (5859f053) is the fail-closed half. design.md M1: in a --filter=blob:none clone with the promisor cut, git ls-tree prints the row and exits 0 while git show exits 128 — the same 128 a genuinely ABSENT path answers with. The question for review is whether EVERY read behind the baseline now separates the two: the commit enumeration, the per-commit archive listing, each identity presence probe, each blob. If one is still collapsed, name it.
  2. The other half must not move. test_a_genuinely_absent_path_is_still_read_as_absent passes before AND after by design — a gate that refuses over absence refuses over every packet that ever moved.
  3. The fixtures. partial_checkout (blob:none) and treeless_checkout (tree:0 --no-checkout) each skipTest where the git in hand ignores the filter and assert the probe really fails before anything rests on it. A fixture that is merely empty asserts nothing — say so if either is.
  4. _refuse_an_undeclared_move ordering. The new blob refusal fires before the undeclared-move refusal in the same loop iteration. Check that is the right precedence: CANNOT RUN over a read that could not be performed should outrank a refusal derived from reads that did.
  5. Slices 1-2 carry the declaration reader and the baseline resolution. Four of slice 1 readers (former_id_problems, append_only_problems, standing_former_id_problems, former_identity_ownership_problems) have NO caller outside their tests — that is known, named in the plan, and D7.4 is their consumer. Flag it if you think it should not ship that way; do not flag it as a discovery.

Measured: the six new slice-3 tests against the parent 2a9cfbda — 5 failed, 1 passed (the regression pin). tests/proposal-support 170 -> 176 passed, 290 subtests. openspec validate --all --strict has the same 2 pre-existing failures as origin/main and no third.

refs #1003

@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: 5859f053b9

ℹ️ 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/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved

Copilot AI 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.

🟡 Changes recommended

Unresolved findings include a critical fail-closed baseline-read issue and multiple identity-resolution validation gaps.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Implements slices 1–3 of declared former-ID support, identity-aware origin-retention validation, and fail-closed Git history reads.

Changes:

  • Adds former-ID parsing, lineage validation, and archived identity resolution.
  • Establishes baselines across declared identities.
  • Refuses unavailable history, tree, and blob reads.
  • Adds extensive rename, ambiguity, and partial-checkout tests.
File summaries
File Summary Findings
scripts/proposal-support.py Implements former-ID lineage and fail-closed baseline resolution. 1 critical and 5 moderate unresolved findings involving unreadable predecessor blobs, dated IDs, reserved names, and declaration timing.
tests/proposal-support/test_proposal_support.py Adds lineage, ambiguity, rename, and partial-checkout coverage. No final comments.
Review details

Suppressed comments (3)

scripts/proposal-support.py:1465

  • These lines trust the former_ids list from the current worktree, but this branch has no check that each entry was introduced in the commit that performed the move or remained append-only afterward. A ratified packet can therefore be renamed without a declaration and have former_ids: [old-id] added in a later commit; this resolver will accept the old baseline and bypass the existing undeclared-move refusal. Keep such moves refused until the landing/history check is wired into this path, or call that validator before admitting the declared lineage.
    if former_ids is None:
        former_ids = declared_former_ids_in_tree(root, change)
    declared = list(former_ids)

scripts/proposal-support.py:618

  • active_change_dir reserves the archive directory name, but this new reader validates former IDs only with CHANGE_ID_RE, so former_ids: [archive] is accepted as a packet identity. Its derived path collides with openspec/changes/archive/, and the baseline walk can then inspect the archive root instead of a packet. Apply the same reserved-name rejection used for active change IDs here.
        if not CHANGE_ID_RE.fullmatch(entry):
            problems.append(
                f"{change}: {where} names {entry!r}, which is not a change "
                f"id by the grammar this estate resolves a packet with "
                f"(`{CHANGE_ID_RE.pattern}`). An entry names an ID and never "

scripts/proposal-support.py:1397

  • The same date-prefixed-ID rule is missed when loading the current lineage: change_id_of strips YYYY-MM-DD- from every archive-shaped name, so an archived packet whose actual ID is 2026-08-04-add-dated is treated as add-dated and its former_ids are not read by declared_former_ids_in_tree. Check an archive directory whose name exactly equals the requested identity before using the normalized archive-ID match.
    if archive.is_dir():
        candidates += [d for d in sorted(archive.iterdir())
                       if d.is_dir() and change_id_of(d) == change]
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
brettheap added a commit that referenced this pull request Sep 14, 2026
Copilot review, PR #1037, `scripts/packet_reference.py:336`: the archive
directory scan uses `is_dir()`, which follows symlinks, so a symlinked
archive packet pointing outside `root` was indexed and read through the
link while `check_citations` containment-checks only the CITED SPELLING —
a path that never itself crosses the link, since the link sits at the
ARCHIVE LOCATION the identity resolves TO, a path this module's own
directory scan builds and the citing record never typed.

THE DEFECT, MEASURED ON THIS TREE BEFORE THIS COMMIT AND NOT ASSUMED. A
fixture archive directory `2026-09-10-add-a-linked-one` symlinked to a
directory outside `root`, carrying its own `.openspec.yaml` and a
`proposal.md` reading "outside content, not part of the checkout": before
this commit, `PacketIndex(root).identities()` included `add-a-linked-one`,
`Claim.carries("proposal.md")` answered `True`, and
`resolve(root, "openspec/changes/add-a-linked-one/proposal.md")` reported
RESOLVED — and reading the corpus's own spelling of the resolved path
(`root / resolution.resolved_rel`) returned the outside bytes verbatim.
After: the directory contributes no claim, `identities()` omits it, and the
same citation resolves DANGLING at the IDENTITY half.

THE CONTAINMENT RULE CHOSEN, AND WHY, NAMED PER THE REVIEW'S OWN
ALTERNATIVES. `resolve_in_tree` in `scripts/validate-pin-registrations.py`
— which this module's own docstring already credits with "a reference that
walks out of the tree is the caller's containment question and never this
reader's" — resolves fully (`.resolve()`, following every symlink) and
checks `is_relative_to(root)`; it does NOT refuse a symlink that stays
inside the tree. `_contained`/`_contained_dir` mirror that idiom exactly
rather than the blanket `is_dir(follow_symlinks=False)` alternative, which
would also exclude a symlink that never leaves `root` and has no reason to.
THE DISPOSITION CHOSEN IS SKIP, NOT REFUSE: a directory that fails
containment CONTRIBUTES NO CLAIM, the same posture `PacketIndex._build`
already holds for a malformed `former_ids:` declaration — "a resolver that
raised here would turn one packet's malformed declaration into a refusal
of every citation in the corpus" — true in the same words of one hostile
symlink, and this module's ratified requirement has no CANNOT-RUN outcome
for `resolve` to raise into; DANGLING at the identity half is the existing,
correct answer for an id nothing legitimately claims.

EVERY OTHER `is_dir()`/`exists()`/`iterdir()` ON A WORKING-TREE PATH IN THIS
MODULE IS HARDENED THE SAME WAY, GREPPED RATHER THAN GUESSED, in one
commit:
* `PacketIndex._build`'s `changes.is_dir()` guard and its `live`/`archived`
  directory-scan comprehensions (the archive one is line 336; the LIVE one
  beside it follows the identical shape and gets an identical fixture,
  `test_a_symlinked_live_packet_pointing_outside_root_is_not_indexed`).
* The `.openspec.yaml` marker check inside `_build`: a REAL, contained
  packet directory whose marker file is itself a symlink escaping `root`
  no longer has its `former_ids:` read.
* `Claim.carries`, now taking `root` (its one call site, in `resolve`,
  already has it): a remainder joined onto an already-contained `self.path`
  can still name a symlink escaping `root` from inside an otherwise sound
  packet, and is refused the same way — reported DANGLING at the FILE half,
  the packet's own identity having resolved soundly.
* `resolve`'s own `not candidates` fallback (`Path(root) / claimed`,
  formerly a bare `.exists()`): a claimed path free of `.`/`..` can still
  name a symlink segment, and is no longer read as "present" through one.

MEASURED. `tests/packet_reference tests/pin_registrations`: 88 passed on
`34473ecd` before this commit; the four new tests fail against that same
tree (asserted directly, by running them against `34473ecd`'s own
`packet_reference.py`); 92 passed after. `tests/proposal-support`
untouched, 170 passed / 290 subtests, unchanged from before this commit —
this commit edits no file that suite exercises.
`python3 scripts/validate-pin-registrations.py .` exits 0, counts line
unchanged word for word: "6 disposition(s) carry 40 citation(s) naming 36
referent(s) — 17 name a path in this tree, 0 a URL, 7 a forge reference, 12
a path qualified to another repository; 4 citation(s) name no machine
referent; … every in-tree path resolves" — the live corpus carries no
symlinked packet, so this fix moves no figure on it.
`python3 -m pyflakes scripts/packet_reference.py` exits 0.
`python3 scripts/doc-health.py --single-repo .` exits 0, no ERROR-severity
finding.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. No edit to
`scripts/proposal-support.py`, held by the sibling PR #1038 fixing two
other threads on this same review. No new `Resolution` status and no new
printed finding channel: `PacketIndex` is a library with no findings list,
and the ratified requirement's outcome space (RESOLVED / DANGLING /
AMBIGUOUS / NOT_A_PACKET_REFERENCE) already has a correct answer for a
claim that must not stand. No change to any `openspec/changes/` file, so
Rule 6's landing window does not apply.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap and others added 3 commits September 14, 2026 12:23
Fix round 1 on PR #1038, taking Codex P1 `PRRT_kwDOTAvnrs6iElb0` and Copilot
`PRRT_kwDOTAvnrs6iEma3` — the same defect from two sides. Slice 3 closed every
read the baseline walk takes and left the refusal that guards the walk reading
its own two silences flat, so the gate still switched itself off on exactly the
checkout where nothing can be proved.

THE DEFECT, MEASURED END TO END on git 2.43.0. Fixture: `change-r` ratified,
its origin MUTATED afterwards, then renamed to `change-s` by a commit that also
rewrites one line of its prose — so the pairing is INEXACT and the destination
blob at the rename commit is the one HEAD carries while the source blob at that
commit's parent is not. Against this branch's head `5859f053`:

  full clone     ratifying_commit      -> REFUSE origin-retention-path-moved
                 origin_retention_errors -> raises, the archive stops
  partial clone  git log --follow ...  -> exit 128, `fatal: could not fetch
                                          … from promisor remote`
                 renamed_from          -> None
                 ratifying_commit      -> THE RENAME COMMIT ITSELF
                 origin_retention_errors -> []
                 ORIGIN RETAINED change-s (declaration unchanged since the
                 ratifying commit …)

The mutated origin archives GREEN. The rename commit became the baseline, so
the gate compared the packet against the declaration standing AFTER the
mutation — the #833 failure reached through a partial clone instead of through
a rename, and the exact sentence § 3.4 forbids: an unreadable history read as
an innocent one.

WHY THE PAIRING READ FAILS THERE, and it is not a quirk. Rename pairing below
an exact match is computed FROM CONTENT (`design.md` M2), so a checkout that
cannot read content cannot pair — and the hop it loses is the dangerous one by
construction, because an un-ratifying or origin-mutating rename is a rename
that also EDITS.

WHAT CHANGED — the two doors, and no probe.

* `_pairing_rows` — the `git log --follow` probe, split out of `renamed_from`
  the way `_tree_rows` already stands apart from `_rows_or_refuse`: `[]` when
  git pairs `rel` with nothing, None when the read could not be performed. A
  revision that resolves to nothing stays `[]` and not None, because a question
  about a commit that is not there is not a read that failed.
* `_former_path_in` — `kinds` applied over those records, so both doors read
  one set of rows.
* `renamed_from` — unchanged contract, kept for the readers that are not a
  gate.
* `_pairing_or_refuse` — the one door that None leaves by, raising
  `origin-retention-read-unavailable`, CANNOT RUN, naming the git command and
  the identity it was for. No bypass flag (#690).
* `ratified_under_a_former_path` — BOTH of its reads now fail closed. The
  pairing goes through `_pairing_or_refuse`; the source packet's header at
  `revision^` goes through `_text_at` instead of a raw `git_show_text`, so
  presence comes off the TREE first and a genuinely absent predecessor still
  answers None while an unreadable one refuses. It takes an `identity` so the
  refusal is never unattributed, defaulting to the id `rel` addresses.
* `_refuse_an_undeclared_move` — passes the change id as that identity, and its
  docstring now states the line: the refusal fires on a move it could see, and
  CANNOT RUN on a move it could not look for.

THE SECOND READ IS UNREACHABLE ON A REAL PARTIAL CLONE, and the test says so
rather than pretending otherwise: a pairing git can still compute without
content is an EXACT one, whose source blob at the parent is the SAME OBJECT as
the destination blob at the commit, so either both read or the destination read
fails first. Its test therefore composes two MEASURED values — the pairing the
full clone reports, and the `_tree_rows`-says-present / `git_show_text`-says-
None pair the partial clone is asserted to produce in the test itself — which
is the technique `test_an_unreadable_archive_listing_refuses_cannot_run`
already uses to pin WHICH CALLER carries a refusal. The read is closed because
the requirement says every read behind the baseline is closed, not because a
route to it was found.

Three tests, all three failing against `5859f053`:
`test_an_unreadable_move_probe_refuses_rather_than_concluding_no_move`
(AssertionError: OriginRetentionError not raised — the defect itself),
`test_the_move_probes_source_header_read_refuses_where_it_stands`, and
`test_a_predecessor_absent_at_the_parent_is_still_no_move`, which guards the
change from becoming a fail-ALWAYS one.

tests/proposal-support: 176 passed before, 179 after, 290 subtests either way.
`proposal-support.py . verify` -> `proposal support verification ok`, exit 0.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Fix round 1 on PR #1038, taking Codex P2 `PRRT_kwDOTAvnrs6iElb4` and Copilot
`PRRT_kwDOTAvnrs6iEmbV` / `PRRT_kwDOTAvnrs6iEmbp` — and Copilot
`PRRT_kwDOTAvnrs6iEemp` on the stacked PR #1037, which reads the same lines
because slices 1–2 are this branch's.

THE RULE WAS ALREADY WRITTEN DOWN IN THIS FILE, and the identity readers took
only half of it. `archive_directory_name` states the pinned CLI's own
behaviour, copied from `@fission-ai/[email protected]` rather than approximated:
a change whose id ALREADY carries a `YYYY-MM-DD-` prefix is archived under that
id UNCHANGED, because "re-prefixing would stutter the name, and when the
archive runs on a later day the folder would sort under a day on which the
change did not happen". `names_this_change` then says what follows: a directory
called `2026-08-04-foo` is the wrong-day archive of `foo` AND the archive of a
change whose id IS `2026-08-04-foo`, and "the two readings are
indistinguishable from the name". Neither reader admitted the second reading,
and one of them applied the strip where there is no ambiguity at all.

MEASURED against this branch's head `5859f053`:

  change_id_of(openspec/changes/2026-08-04-add-dated)      -> 'add-dated'
  identity_paths_at(root, HEAD, '2026-09-09-foo')          -> []
      (with openspec/changes/archive/2026-09-09-foo/proposal.md standing)
  proposal_path_at(root, HEAD, '2026-09-09-foo')           -> None
  declared_former_ids_in_tree(root, '2026-09-10-bar')      -> []
      (with that archived packet declaring former_ids: [old-bar])

The first renames a live packet: `CHANGE_ID_RE` admits a leading date,
`active_change_dir` resolves such an id verbatim, and the corpus's own pinned-
CLI fixture is `2026-08-04-add-dated`. `former_identity_claimants` passes every
LIVE directory through `change_id_of`, so that packet's `former_ids:` was
validated and attributed as `add-dated`'s — the "an entry may not name the
packet's OWN id" arm asked about a packet that does not exist, and missed the
self-claim that was written.

The second and third are worse, because their answer is a SILENCE the walk acts
on: an identity reported ABSENT at every commit it occupies, and a declaring
packet handed the UNDECLARED answer — the shed-lineage failure this mechanism
exists to stop, arriving through the reader rather than through a move.

WHAT CHANGED.

* `change_id_of` — strips only for a directory UNDER `archive/`. An active
  directory's name IS its id. The archived half's residual ambiguity is stated
  rather than pretended away, and the docstring names the two helpers that do
  settle it.
* `_archive_dir_carries` — the archive-row test, both readings: the exact
  identity name first, then the dated interpretation. Admitting both is what
  the requirement asks for — the identity resolution "SHALL NOT infer an
  identity from rename detection, from similarity between two packets, or from
  any walk over a lineage", and a directory name is none of those.
* `identity_paths_at` — uses it, so a preserved date-prefixed id resolves to
  the directory it occupies. Where ONE identity matches TWO directories that
  way, `proposal_path_at` refuses `origin-retention-identity-ambiguous` naming
  both, which is the ratified scenario *A declared identity resolves to two
  locations at one commit* — reachable for a dated id only now that the exact
  reading exists.
* `_change_ids_of_proposal_path` (was `_change_id_of_proposal_path`) — a LIST,
  the directory's own name first. `_refuse_an_undeclared_move` tests the
  DECLARED lineage against all of them, so a lawful move out of a preserved
  dated archive id is recognised instead of taking the undeclared refusal;
  `_first_change_id_of_proposal_path` serves the callers that want one string.
* `declared_former_ids_in_tree` — chooses its archived candidate with
  `names_this_change`, the reading this file already settled for the archive
  wrapper, which also takes the ACTIVE ids into account the way that helper's
  own docstring requires.
* `former_identity_claimants` — one residue named rather than left to be
  discovered: its ARCHIVED half still reads the commoner interpretation, so a
  packet archived under a preserved dated id that declares its OWN id would
  escape the self-claim arm. The estate has no change of that shape today, the
  live half is now exact, and settling the archived half needs the active-ids
  reading a sweep over departed packets cannot take.

Four tests, all four failing against `5859f053` on behaviour rather than on a
missing symbol:

  test_an_active_id_that_begins_with_a_date_keeps_it
      AssertionError: 'add-dated' != '2026-08-04-add-dated'
  test_a_preserved_date_prefixed_archive_id_resolves_to_its_directory
      AssertionError: Lists differ: [] != ['openspec/changes/archive/…']
  test_an_archived_packet_under_a_preserved_dated_id_declares_lineage
      AssertionError: Lists differ: [] != ['old-bar']
  test_an_identity_matching_two_archive_directories_still_refuses
      AssertionError: 1 != 2

tests/proposal-support: 179 passed before, 183 after, 290 subtests either way.
`proposal-support.py . verify` -> `proposal support verification ok`, exit 0.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Fix round 1 on PR #1038, taking Copilot `PRRT_kwDOTAvnrs6iEenD` — raised on the
stacked PR #1037 because `former_id_problems` is slice 1's reader and reaches
that review through this branch. The fix belongs here, where the reader lives.

MEASURED against this branch's head `5859f053`:

  former_id_problems("x", {"former_ids": ["archive"]})  -> []
  active_change_dir(root, "archive")                    -> SupportError
  identity_paths_at(root, HEAD, "archive")              -> []

`archive` matches `CHANGE_ID_RE` like any other slug, so the grammar arm cannot
refuse it and nothing else did. A packet could therefore publish `former_ids:
[archive]`, and the declaration would be accepted, indexed by
`former_identity_claimants`, and carried into `ratifying_baseline` as an
identity to resolve — where every resolution answers silence, because
`openspec/changes/archive/` is the archive ROOT and never a packet. A declared
lineage that resolves to nothing is exactly the shape the reader exists to
refuse: `declared_former_ids` raises rather than returning the entries it could
read, precisely so the walk is never handed a lineage its author did not write.

WHAT CHANGED.

* `RESERVED_CHANGE_ID` — hoisted beside `CHANGE_ID_RE`, for the reason that
  pattern was hoisted: the declaration and the walk that consumes it cannot be
  allowed to disagree about what a change id is. `active_change_dir` now reads
  it instead of spelling the literal a second time.
* `former_id_problems` — a seventh arm, refusing an entry that names it, saying
  why the grammar above cannot: it is a lawful slug and an unlawful identity.

One test, failing against `5859f053` with `AssertionError: 0 != 1` — the entry
accepted where a refusal is required:
`test_an_entry_naming_the_reserved_archive_segment_refuses`.

tests/proposal-support: 183 passed before, 184 after, 290 subtests either way.
`proposal-support.py . verify` -> `proposal support verification ok`, exit 0.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>

Copilot AI 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.

🟡 Changes recommended

Unresolved critical and moderate review findings affect archive resolution and fail-closed validation.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

scripts/proposal-support.py:2634

  • origin_retention_errors still computes change above with a regex that strips a leading date from every directory name. For an active packet whose id is 2026-08-04-add-dated, these new calls receive add-dated, so the active path is omitted from the baseline pathspec and the packet can be reported as unratified (and a self-claim is validated against the wrong id). Derive the default with change_id_of(directory) so active names remain verbatim.
    lineage = declared_former_ids_of(directory, change)
    identities = [change] + list(reversed(lineage))
    baseline = ratifying_baseline(root, change, former_ids=lineage)

scripts/proposal-support.py:803

  • former_identity_claimants registers archived packets' former_ids but not their own preserved identity. Because archive relocation preserves the id and identity_paths_at resolves archived locations, an archived archive/<date>-change-r plus a live packet declaring former_ids: [change-r] is treated as one owner and can bind the new packet's baseline to the unrelated archived packet. Include archived current identities, or explicitly refuse this collision, in the exactly-one-owner check.
    for directory in live + archived:
        change = change_id_of(directory)
        try:
            ids = declared_former_ids_of(directory, change)
        except FormerIdError:

scripts/proposal-support.py:712

  • For an archived packet whose ID itself begins with a date, change_id_of strips the archive prefix and this default validates the packet as the wrong identity. Thus declared_former_ids_of(archive/2026-09-10-bar) treats 2026-09-10-bar as a former ID rather than the packet's own ID, allowing the self-claim shape refusal to be missed. Resolve the archive directory with the exact-vs-stripped identity rules (or require the caller to provide the identity) before validating the declaration.
    change = change or change_id_of(directory)
    return declared_former_ids(change, load_packet(directory))
  • Files reviewed: 2/2 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
Fix round 1 on PR #1038, taking Copilot `PRRT_kwDOTAvnrs6iGr_N` and
`PRRT_kwDOTAvnrs6iGr_s` — raised on the stacked PR #1037 against
`scripts/proposal-support.py`, which is this branch's slice 1–2 work, so the
fix belongs here. Both land on the two readers that hand `ratifying_baseline`
its lineage.

(1) A SYMLINK IS `active_change_dir`'S TRAVERSAL REACHED FROM THE TREE.

That function already refuses a change NAME with path syntax in it — "anything
with path syntax would let a caller-supplied name traverse outside
openspec/changes/" — and a committed symlink is the same traversal arriving
through a pull request instead of through a caller. Git tracks one as an
ordinary object (mode `120000`), and `is_dir()`/`iterdir()` both follow it
silently.

MEASURED with `openspec/changes/archive` committed as a symlink to a directory
outside the checkout:

  git ls-files -s -> 120000 … openspec/changes/archive
  former_identity_claimants        -> claims 'stolen-identity', attributed to
                                      `openspec/changes/archive/2026-09-09-forged`
  declared_former_ids_in_tree(root, '2026-09-09-forged') -> ['stolen-identity']

An `.openspec.yaml` nobody in this repository wrote, read as this corpus's
lineage and carried to the archive gate. `contained_dir` now guards the
`changes` root, the `archive` root and every candidate child in both readers.
It RESOLVES before it compares, so a link chain cannot walk out in more than
one hop, and it resolves `root` too so a checkout reached through a symlinked
parent is not refused as foreign. It answers a BOOLEAN and not the resolved
path, deliberately: `change_id_of` reads a packet's identity off the path that
was WALKED (it asks whether the parent is `archive/`), and handing it a
resolved spelling would rename a packet reached through an in-repository link.

The live corpus tracks ZERO symlinks anywhere — `git ls-files -s | grep
^120000` is empty — so this refuses nothing that stands today. It is the
surface being closed, not a finding being repaired.

(2) TWO PLACES FOR ONE ID IS AN AMBIGUITY TO REPORT, IN THE WORKING TREE TOO.

`declared_former_ids_in_tree` returned the FIRST candidate holding a packet.
Where an identity stands both actively and in the archive, the two
`.openspec.yaml` files may declare different lineages, so the lineage the walk
resolved was chosen by this reader's ordering rather than by an author — which
is the line `proposal_path_at` already draws one layer down, and the ground
`archived_change_dirs` gives for returning a LIST.

MEASURED before the change: with `openspec/changes/change-x/` declaring
`[from-the-active-copy]` and `openspec/changes/archive/2026-09-09-change-x/`
declaring `[from-the-archived-copy]`, it returned `['from-the-active-copy']`
silently. `ratifying_baseline` happened to refuse afterwards, because both
locations also stand at the commit it visits first — but that is the COMMITTED
tree agreeing with the working one, which a reader of the WORKING tree may not
assume. It now refuses `origin-retention-identity-ambiguous`, CANNOT RUN,
naming both locations and the usual cause (an archived packet whose active
directory was left standing). One location is still an answer, not a refusal.

Neither refusal fires on the corpus: 47 active ids, 167 archived directories,
no active id matching an archive directory under `names_this_change`, and no
id matched by two archive directories.

Two tests, both failing against `30d40c1c`:
`test_a_symlinked_archive_cannot_import_an_identity_from_outside`
(`AssertionError: 'stolen-identity' unexpectedly found in …`) and
`test_an_identity_holding_a_packet_in_two_places_refuses_the_lineage`
(`AssertionError: OriginRetentionError not raised`). The first also asserts
that the packets this repository DOES contain are still swept, so the guard is
containment and not a switched-off sweep.

tests/proposal-support: 184 passed before, 186 after, 290 subtests either way.
tests/pin_registrations + openspec_cli_pin + sequenced_after + carve_manifest +
notebooklm: 751 passed, 3 skipped. `proposal-support.py . verify` exit 0;
`validate-pin-registrations.py .` exit 0; `doc-health.py --single-repo .`
byte-identical to the pre-fix-round run.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 12:43
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)
@codex review

Fix round 1 on da9297e0, b90fc7f6, 30d40c1c and cce09fdd (head cce09fdd): all five threads on this PR taken, plus the four shared findings raised on #1037 against this branch's scripts/proposal-support.py.

Copilot AI 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.

🟡 Changes recommended

Four unresolved findings remain in scripts/proposal-support.py, including two critical issues.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/proposal-support.py:2706

  • origin_retention_errors now uses the default change to resolve the declared lineage and baseline, but the default is still derived by unconditionally stripping a date prefix from directory.name. For an active packet whose actual id is 2026-09-10-bar, this becomes bar, so the new lineage/baseline read searches the wrong identity and can report the packet as unratified. Preserve active date-prefixed ids when deriving this default, for example by using change_id_of(directory).

scripts/proposal-support.py:1597

  • The union walk never enumerates the exact archive path for a date-prefixed identity. _archive_dir_carries treats archive/2026-09-09-foo as carrying both foo and 2026-09-09-foo, but this pathspec only matches archive/*-2026-09-09-foo; an archived-only/date-prefixed packet can therefore be resolved by identity_paths_at yet omitted from ratifying_baseline. Include the exact archive candidate in the pathspecs for date-prefixed identities.
    return [f"openspec/changes/{identity}/proposal.md",
            f":(glob){_ARCHIVE_ROOT}*-{identity}/proposal.md"]
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread scripts/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved

@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: cce09fdd7e

ℹ️ 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/proposal-support.py Resolved
Comment thread scripts/proposal-support.py Resolved
brettheap pushed a commit that referenced this pull request Sep 14, 2026
…hat is not a move, a manifest that does not parse

TAKEN from Copilot's review of PR #1039. Three of its six threads name real
defects in this slice's own files; each is fixed here with a test measured
failing against the parent commit `6dfb32d4`, and the other three are refused
below with reasons rather than left unanswered.

1. THE ARCHIVE DATE MEANS THE ARCHIVE AND NOTHING ELSE. `change_id_of_dir`
stripped a `YYYY-MM-DD-` prefix from any packet directory. `CHANGE_ID_RE` admits
an ACTIVE id that merely begins that way — `2026-09-14-example` is a legal
change id — so the gate derived `example` as the source identity, `ever_ratified`
walked pathspecs no packet has ever occupied, answered "never ratified", and the
undeclared rename PASSED; the archive exception, which compares two ids, would
also have stopped recognizing that packet's own relocation. The strip now
happens only under the archive root.
MEASURED on the parent: `change_id_of_dir("openspec/changes/2026-09-14-example")`
returns `'example'`, and `test_a_live_packet_id_that_begins_with_a_date_keeps_its_whole_id`
fails there with `AssertionError: 'example' != '2026-09-14-example'`.

2. A FILE THAT CROSSES TWO STANDING PACKETS IS NOT A PACKET MOVING. `moves_at`
read every file-level `R` whose two sides sat in different packet directories as
a packet-directory move, so one `design.md` relocated from a ratified packet into
another packet that also stands read as an ARRIVAL from a ratified identity —
and the gate refused an ordinary edit that no declaration could repair, because
nothing moved. `relocations_at` now qualifies each pairing against the tree: the
source must have been present at the parent and be gone here, the destination
absent at the parent and present here. THIS IS NOT PAIRING FROM THE TREE, which
`design.md` D3 declined by name — the pairing is still git's and only git's, and
the tree is asked one further question about a pairing git has already made. A
source that still stands is the COPY shape the requirement says declares nothing;
a destination that already stood is not a packet being BROUGHT IN.
MEASURED on the parent over that fixture: one `former-id-undeclared` naming
`openspec/changes/change-s/` as brought in from `openspec/changes/change-r/` —
a FALSE refusal. On this commit: no finding.

3. AN UNREADABLE MANIFEST IS NOT A PACKET THAT DECLARES NOTHING.
`proposal_support.load_packet` answers None for THREE states — absent,
unparseable YAML, and a top-level that is not a mapping — and only the first is
an answer. The corpus arm handed all three to `former_id_problems` as a packet
with no declaration, so a malformed `.openspec.yaml` was swallowed by the parser
that could not reach it and the whole-tree sweep reported a clean corpus: the
exact vacuous read this gate's PyYAML guard exists to refuse, arriving one file
at a time instead of all at once. The commit-range arm always drew the
distinction (`declared_at` raises rather than returning `[]`); the corpus arm now
draws it too, and a packet with NO manifest is still simply silent.
MEASURED on the parent: `corpus_problems` returns `[]` over a tree carrying an
unparseable manifest.

REFUSED, WITH REASONS, AND WRITTEN INTO THE MODULE SO THEY ARE NOT REDISCOVERED
AS SURPRISES — a new `WHAT THIS READER DOES NOT JUDGE` section names the first
two:

* *A successful diff with no rename pairs is silently treated as no move.* True,
  and it is the similarity THRESHOLD rather than the limit: `-l0` lifts the
  limit, but a relocation whose every file is also rewritten below the threshold
  lands as plain D and A rows. The fail-closed arm does not reach it and is not
  meant to — that arm exists for a pairing read the checkout CANNOT PERFORM, and
  here the read was performed and answered. Pairing from the TREE instead is what
  `design.md` D3 declined by name, because a commit that withdraws one packet and
  creates an unrelated other has exactly that tree shape and refusing it refuses
  a lawful landing. Closing it is a threshold ruling and a new refusal class on a
  gate with no bypass flag: it belongs to a change that says so, in the shape
  `tasks.md` § 6.4 uses.
* *A conflict-resolution merge can introduce a move relative to both parents.*
  True. Judging it needs a COMBINED diff (`git diff-tree -c`), whose rename
  reporting is not the `-M` pairing every refusal here rests on — a different
  read and a different ruling from D3's *one commit, never a chain*. Named in the
  module, not taken here.
* *`change_id_of` in `scripts/proposal-support.py` strips the same prefix
  unconditionally.* True, and it is the same defect as (1) in a file this author
  may not edit: it belongs to PR #1038, whose fix round is already repairing
  `change_id_of`'s date-prefix stripping. This module IMPORTS that function
  through `corpus_problems` and therefore INHERITS the #1038 fix rather than
  forking a copy of it.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. It does not touch
`scripts/proposal-support.py`, `tests/proposal-support/`, `openspec/changes/` or
any task box. It adds no status token and no flag: (1) and (2) narrow what is
refused and (3) reports under the declaration requirement's existing name. It
does not lower the rename threshold, which would pair a withdrawal with an
unrelated creation and refuse a lawful landing to catch an evasion.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…osed

Fix round 1, second bench round on PR #1038 — eight threads, all eight taken.
Five of them are defects the FIRST round created or half-closed, which is the
reason a second round is bench and not ceremony.

**A — `_identity_pathspecs` could not reach the exact archive path**
(`PRRT_kwDOTAvnrs6iG9tt`). Round one taught `_archive_dir_carries` that
`archive/<id>` is a location a preserved dated id occupies, and left the
COMMIT ENUMERATION on the glob `*-<identity>`, which does not match
`<identity>`. Measured: `ratifying_commit` returned None for a packet standing
ratified at `openspec/changes/archive/2026-09-09-foo/proposal.md` — the walk
enumerated no commit for it and reported it as never ratified, while
`identity_paths_at` resolved it perfectly well. The two halves of one
resolution disagreeing about where an id can stand. The exact archive path is
now its own pathspec.

**B — the accept channel authorised itself over an unread declaration**
(`PRRT_kwDOTAvnrs6iG9vA`). Slice 3's own message said this read's flat answer
merely mis-described its cause. It does more: `_origin_mapping(None)` is None
and `_changed_keys(None, …)` is `[]` by its own advisory contract, so an
`accept` entry declaring `changed_keys: []` compares EQUAL to a measurement
taken over a declaration that was never read — the acceptance authorised, and
the baseline moved to the accepted mutation, on a checkout that could not read
the ratification at all. Both of `_accept_declaration_problems`'s blob reads
now go through `_text_at`.

**C — the archived self-claim, no longer a named residue**
(`PRRT_kwDOTAvnrs6iG9vt`, Codex P2 `PRRT_kwDOTAvnrs6iHS5I`). Round one named
this in a docstring and left it; two reviewers then measured it, so it is
closed. Measured: `archive/2026-09-09-foo` declaring `former_ids:
[2026-09-09-foo]` — a claim to be the move of ITSELF — was validated as `foo`,
passed every arm, and the sweep indexed the self-claim as a legitimate lineage.
`packet_identities_of` returns every id such a directory can carry and the
sweep refuses a declaration naming any of them, which is the arm
`former_id_problems` cannot reach because it is asked about one id at a time.

**D — `ratifying_commit`'s retained paragraphs were false**
(`PRRT_kwDOTAvnrs6iG9wN`). Its new first paragraph says the resolution is
`ratifying_baseline`'s while three retained ones still described a one-path
walk, an ACTIVE-only read, and a corpus in which "no former-id declaration
exists". All three restated. Documentation only; no test.

**E — a contained directory can carry an uncontained header**
(`PRRT_kwDOTAvnrs6iHNFa`). Round one containment-checked packet DIRECTORIES.
`load_packet` opens `.openspec.yaml` through `is_file()`, which follows a
symlink exactly as `is_dir()` does. Measured, with the header committed as a
symlink (`git ls-files -s` → mode `120000`): the sweep claimed
`'stolen-by-header'` and `declared_former_ids_in_tree` returned
`['stolen-by-header']`. `contained_file` now guards it in both lineage
readers.

**F — the gate's lineage skipped the two-candidate rule**
(`PRRT_kwDOTAvnrs6iHNGM`). `origin_retention_errors` read the declaration
straight off the directory it was handed and passed it on as `former_ids=`,
bypassing `declared_former_ids_in_tree`'s ambiguity refusal. It now resolves
through that reader. Stated plainly: the fixture built for this ALREADY
refused at `cce09fdd`, through `proposal_path_at` at the commit the walk
visits — the committed tree happening to agree with the working one. What
changes is that the refusal no longer depends on that coincidence. The same
commit stops `origin_retention_errors` deriving its change id with a fourth
hand-rolled copy of the date strip, which renamed an active dated id.

**G — the archive wrapper's collision heuristic is not a resolution rule**
(Codex P2 `PRRT_kwDOTAvnrs6iHS5E`). Round one resolved archived candidates
with `names_this_change`, whose `other_change_ids` arm answers a TRANSIENT
question — "is this new directory mine or a sibling lane's", read before the
child ran. Measured: with archived `foo` at `archive/2026-09-09-foo` and an
unrelated ACTIVE packet whose valid id is `2026-09-09-foo`,
`declared_former_ids_in_tree(root, "foo")` returned `[]` although the archived
packet declares `['old-foo']`.

The repair is one rule rather than two. `declared_former_ids_in_tree` now uses
`_archive_dir_carries`, the same rule `identity_paths_at` resolves a location
with, so the two halves cannot disagree. The live-ids guard MOVES to the arm it
belongs on: a change that is LIVE has not been archived, so an archive
directory spelled exactly like a live id cannot be that packet's archive — the
EXACT reading yields, the STRIPPED reading never does. That ordering is what
this round's own test found: written the naive way, a lawful corpus carrying
both `openspec/changes/2026-09-09-foo/` and `archive/2026-09-09-foo/` read as
one identity in two places and refused. `live_ids` is empty for a read at a
ref, deliberately — which ids were active at some commit is another tree read
per commit, and admitting both readings there is what the ratified ambiguity
scenario expects.

Six tests, every one failing against `cce09fdd` on behaviour:

  test_a_preserved_dated_archive_id_is_enumerated_by_the_walk
      AssertionError: 'openspec/changes/archive/2026-09-09-foo/proposal.md'
      not found in [...]
  test_an_unreadable_ratification_blob_cannot_authorise_an_acceptance
      AssertionError: OriginRetentionError not raised
  test_an_archived_self_claim_under_either_reading_is_not_indexed
      AttributeError: no attribute 'packet_identities_of'
  test_a_symlinked_packet_header_cannot_import_a_lineage
      AssertionError: 'stolen-by-header' unexpectedly found in {...}
  test_an_unrelated_live_dated_id_does_not_hide_an_archived_lineage
      AssertionError: Lists differ: [] != ['old-foo']
  test_the_gate_resolves_its_lineage_through_the_tree_resolver
      AssertionError: OriginRetentionError not raised

The accept-channel test drives `_accept_declaration_problems` directly rather
than through `origin_retention_errors`: written through the gate it was
VACUOUS, because slice 3's baseline door raises on the same (revision, path)
before the accept channel reads it. Found by running it against `cce09fdd` and
watching it pass.

tests/proposal-support: 186 passed before, 192 after, 290 subtests either way.
tests/pin_registrations + openspec_cli_pin + sequenced_after + carve_manifest +
notebooklm: 751 passed, 3 skipped. `proposal-support.py . verify` exit 0;
`validate-pin-registrations.py .` exit 0; `doc-health.py --single-repo .`
byte-identical to the pre-fix-round run.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap pushed a commit that referenced this pull request Sep 14, 2026
…sh out of the gate

TAKEN from Copilot's fourth round on PR #1039, and it closes the last way this
slice could leave the corpus arm with an exit code its own contract does not
name. Two states got past the presence check added in `1c4d0131`:

* A `.openspec.yaml` carrying bytes that are NOT UTF-8. `proposal_support.
  load_packet` decodes before it parses and catches only `YAMLError`, so that
  file comes out of it as a raised `UnicodeDecodeError` rather than as None —
  a traceback where the two documented exits are 1 (`former-id-undeclared` and
  the declaration refusals) and 2 (`former-id-arrival-unreadable`).
* A `.openspec.yaml` that is PRESENT and is not a regular file. `is_file()`
  reads that as absent, which is the silence this whole arm exists to refuse.

Both are now refusals naming the packet: the read is wrapped, the presence test
is `exists()` rather than `is_file()`, and the message names "a path that is not
a regular file" beside the other two shapes.

AND THE OWNERSHIP SWEEP'S OWN RE-READ IS CAUGHT TOO. `former_identity_ownership_
problems` re-reads every manifest itself, in `scripts/proposal-support.py` —
a module this slice imports and does not edit — so the same unreadable file
reaches `load_packet` a second time and raises there as well. The call is
wrapped and the failure reported as a refusal that says which question went
unanswered ("whether every declared former identity has EXACTLY ONE OWNER was
not established"), with the offending packet already named by the loop above.
Fixing the shared reader is #1038's to do if it is done at all; converting a
foreign reader's crash into this gate's own named refusal is this module's.

MEASURED against the parent commit `ff7fcb7c`:
`test_a_manifest_that_cannot_be_read_at_all_is_refused_not_skipped` fails there
with `UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 16`
raised out of the reader — which is the finding, exactly. On this commit: 41
passed with no `GITHUB_EVENT_NAME` and 41 with `GITHUB_EVENT_NAME=pull_request`,
and the live corpus still exits 0 over 47 active and 167 archived packets.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. It catches `UnicodeDecodeError` and
`OSError` and nothing wider: a bare `except Exception` around a foreign reader
would turn a defect in this gate into a finding about somebody's packet. It does
not edit `scripts/proposal-support.py`. It adds no status token — these are
declaration refusals, reported under the requirement that names none, at exit 1.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 14:03
Fix round 1, fifth bench round on PR #1038 — two threads, both taken. Copilot
`PRRT_kwDOTAvnrs6iIy3N` and `PRRT_kwDOTAvnrs6iIy43`, and both are this fix
round's own work.

**THE `rev-parse` ARM WAS THE ONE `[]` THIS ROUND ARGUED FOR, AND THE ARGUMENT
WAS WRONG** (`PRRT_kwDOTAvnrs6iIy3N`). When `_pairing_rows` was split out of
`renamed_from`, its docstring reasoned that a revision resolving to nothing
answers `[]` rather than None because "a question about a commit that is not
there is not a read that failed". That is true of a MISSPELLED revision and
false of the one shape that matters: the only caller passes a full hash
straight out of THIS repository's own `git log --format=%H`, so a `rev-parse
--verify <that hash>^{commit}` that fails means the object cannot be read —
and `[]` reached `_pairing_or_refuse` as a successful read with no pairing,
which is the same fail-open the round opened by closing the `git log` arm two
lines below.

`_pairing_rows` now returns None there, so both of its git calls leave by the
same door. `renamed_from`, the TOLERANT door, still answers None for a revision
that resolves to nothing — which is what
`test_the_guard_reads_any_spelling_of_the_candidate_commit` pins, and it is
unchanged.

**AND `load_packet_at`'S SUMMARY LINE STILL PROMISED THE CONFLATION**
(`PRRT_kwDOTAvnrs6iIy43`). The previous round taught the body to raise for a
present-but-unreadable blob and for one that does not parse, and left the first
line saying "None when absent or unparseable". A caller who reads that line
writes the conflation back by hand, which is the whole failure mode this slice
exists to remove. The summary now says None is for a genuinely ABSENT path
only, and names both exceptions and which silence each answers.

One test, failing against `7568c9f1` with `AssertionError: [] is not None`:
`test_an_unresolvable_candidate_commit_refuses_at_the_gate_door`. It asserts
all three doors at once — the probe answers None, the tolerant reader still
answers None, and the gate's door refuses `origin-retention-read-unavailable`
naming the identity.

tests/proposal-support: 195 passed before, 196 after, 290 subtests either way.
`proposal-support.py . verify` exit 0; `validate-pin-registrations.py .` exit
0; `doc-health.py --single-repo .` byte-identical to the pre-fix-round run.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>

Copilot AI 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.

🟡 Changes recommended

Three unresolved findings remain, including one critical issue.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

scripts/proposal-support.py:1019

  • This reader still follows an out-of-tree symlink with .is_dir(). A openspec/changes/<id> symlink to an external directory would make a valid move look like a copied packet and cause a false refusal, while the other lineage readers already reject uncontained paths via contained_dir; use the same containment check here.
        if standing.is_dir():

scripts/proposal-support.py:1912

  • archive is a valid CHANGE_ID_RE match but is the reserved archive-root segment (active_change_dir rejects it at lines 355–359). This direct baseline API only checks the regex, so a caller can make the resolver treat openspec/changes/archive/ as a packet identity (and a tree containing archive/proposal.md could be baselined). Apply the same reserved-segment check here so all identity readers reject this non-packet id consistently.
    if not CHANGE_ID_RE.fullmatch(change):
        raise SupportError(f"invalid change name: {change}")
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/proposal-support.py Resolved
brettheap pushed a commit that referenced this pull request Sep 14, 2026
…ymlink

TAKEN from Copilot's fifth round on PR #1039 — two threads, one rule, one
commit. The corpus arm walked the working tree with `iterdir()` and `is_dir()`,
and both FOLLOW symlinks:

* a symlink standing where a packet directory would be was read as a packet,
  and its target's `.openspec.yaml` adjudicated — a tree no commit carries, and
  possibly outside the checkout entirely;
* `Path.exists()` follows links too, so a DANGLING `.openspec.yaml` symlink read
  as an absent manifest and the packet passed as one that declares nothing —
  the silence the presence check added in `1c4d0131` exists to refuse.

THE RULE IS THE OTHER ARMS' OWN. Git stores a symlink as a BLOB whose content is
a path, so `git ls-tree` — the read the commit-range arm and both fail-closed
arms rest on — reports no tree at that path and sees no packet there. An arm
that reads through the link adjudicates something the rest of this gate cannot
see. So a symlink where an active packet, the archive root, or an archived
packet would be is REPORTED and not walked; a symlinked manifest is reported and
never opened; and `is_symlink()` is asked FIRST, so a dangling link is caught by
the same branch rather than by a presence test that cannot see it.

AND THE OWNERSHIP SWEEP IS NOT RUN OVER A TREE THIS ARM HAS ALREADY REFUSED.
`former_identity_ownership_problems` walks the working tree itself, in
`scripts/proposal-support.py` — imported here, not edited — and its walk follows
the same link. MEASURED in the test: with a symlinked packet in place,
`former_identity_claimants(root)` claims `change-from-outside`, an identity
declared by a file no commit in that repository carries. Letting that decide
whether an identity has EXACTLY ONE OWNER is worse than not answering, and the
run is already refusing, so the sweep is skipped and the unanswered question is
named.

MEASURED against the parent commit `d053b38e`:
`test_a_symlink_is_refused_and_is_never_read_through` fails there with
`AssertionError: 0 != 2 : []` — the parent reports NO problem at all for a
symlinked packet directory, because it read the outside manifest, found it well
formed, and called the corpus clean. On this commit: 42 passed with no
`GITHUB_EVENT_NAME` and 42 with `GITHUB_EVENT_NAME=pull_request`;
`tests/proposal-support` unchanged at 170 passed, 290 subtests; the live corpus
still exits 0 over 47 active and 167 archived packets, and carries no symlink
under `openspec/changes/` (`find -type l` and `git ls-files -s` both report
none), so nothing in this repository changes verdict.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. It does not enumerate the corpus from
git tree entries instead of the working tree, which is the wider fix Copilot
also offered: the corpus arm is defined over the tree this gate was GIVEN — that
is what lets `proposal-support.py verify` and this validator read the same
working copy an author is editing — and changing that is a different reading of
§ 2.6 than the one slices 1 and 2 landed. Refusing what cannot be seen is the
part that belongs to this slice. It does not edit `scripts/proposal-support.py`,
whose own walk still follows links; that is named here and left to #1038.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Fix round 1, sixth bench round on PR #1038 — one thread, taken. Copilot
`PRRT_kwDOTAvnrs6iJHKd`, on `origin_retention_errors`'s default identity.

THE REPLAY READS AN ARCHIVED DIRECTORY, and its default was an unchecked strip.
That line was `re.sub(r"^\d{4}-\d{2}-\d{2}-", "", directory.name)` before this
fix round and `change_id_of(directory)` after it, which is the same reading
spelled once instead of twice — and for `archive/2026-09-09-foo` the stripped
reading `foo` omits `openspec/changes/2026-09-09-foo/` from the baseline walk
ENTIRELY. The later ARCHIVE commit can then become the baseline and a mutation
made before archiving passes, which is the #833 failure reached through the
identity rather than through a rename.

HISTORY SETTLES IT, AND ONLY HISTORY. The two readings of a dated archive name
differ in exactly one fact: whether an ACTIVE packet by the directory's FULL
name ever existed. That is one path-limited `git log`, and it is a fact rather
than a preference — which is the whole difference between resolving an identity
and choosing one.

`identity_of_packet_dir` is that resolution. An ACTIVE directory's name IS its
id. An archived directory whose name carries no date prefix is its id. A dated
archived directory resolves to the stripped id where
`openspec/changes/<full name>/proposal.md` has NO history, and otherwise
REFUSES `origin-retention-identity-ambiguous`, naming both candidates and the
repair: pass the id. A `git log` that could not be performed refuses too, and
says which of the two it was.

MEASURED over this corpus: of **167** archived directories, **ZERO** have a
full name that ever stood as an active packet, so this refuses nothing that
stands today — and the archive wrapper, the only production caller, passes
`change` explicitly and never reaches it.

One test, failing against `ef022a83` with `AttributeError: no attribute
'identity_of_packet_dir'`:
`test_an_archived_dated_directory_does_not_guess_its_own_identity`. It asserts
all four arms — an unambiguous archived name, an ACTIVE dated name resolving to
itself, and the refusal where both readings name a packet this repository
really carried.

tests/proposal-support: 196 passed before, 197 after, 290 subtests either way.
`proposal-support.py . verify` exit 0; `validate-pin-registrations.py .` exit
0; `doc-health.py --single-repo .` byte-identical to the pre-fix-round run.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 14:17
brettheap pushed a commit that referenced this pull request Sep 14, 2026
…alked

TAKEN from Copilot's sixth round on PR #1039, and it is the rule `e4fab682` took
one level up. `Path.is_dir()` and `iterdir()` both follow links, so a symlinked
`openspec/` or `openspec/changes/` moved the WHOLE corpus somewhere no commit
carries: every per-packet check would then have read files the commit-range arm
cannot see, while never seeing a symlink itself, because by then the walk is
already on the other side of the link.

Both ancestors are now tested with `is_symlink()` BEFORE `is_dir()` is asked,
and a symlink there ends the corpus arm with one refusal that says what was not
answered — "no declaration, no standing id and no ownership question was
answered over this tree" — rather than reporting findings from down there.

MEASURED against the parent commit `e4fab682`:
`test_a_symlinked_corpus_root_is_refused_before_anything_is_walked` fails there
on both subtests, `openspec` and `openspec/changes` alike. On this commit: 43
passed with no `GITHUB_EVENT_NAME` and 43 with `GITHUB_EVENT_NAME=pull_request`.
The live corpus is unaffected — neither path is a link, and the sweep still
exits 0 over 47 active and 167 archived packets.

WHAT THIS COMMIT DELIBERATELY DOES NOT DO. It still reads the corpus from the
WORKING TREE rather than from git tree entries: the corpus arm is defined over
the tree this gate was given, which is what lets it read the working copy an
author is editing, and changing that is a different reading of § 2.6 than slices
1 and 2 landed. It does not edit `scripts/proposal-support.py`, whose own corpus
walk still follows links — named here and left to #1038.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>

Copilot AI 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.

🔵 Needs a closer look

Six unresolved moderate findings remain in scripts/proposal-support.py.

Review details

Suppressed comments (6)

scripts/proposal-support.py:1070

  • standing_former_id_problems treats any symlink that resolves to a directory as a standing packet, even when the target is outside the repository. A tracked openspec/changes/<id> symlink is a non-directory entry in Git, so this can reject a valid move based on a packet the repository does not contain. Use the same containment-aware directory check as the other tree readers.
        if standing.is_dir():

scripts/proposal-support.py:632

  • When PyYAML is unavailable, yaml is None and this branch returns None even if _text_at proved that the historical .openspec.yaml path is present. That violates the function's documented “None only when absent” contract and lets append-only callers treat a declaration they could not parse as an empty/absent one; handle the missing parser as an error, as _load_origin_dispositions does, instead of returning None.
    if text is None or yaml is None:

scripts/proposal-support.py:1538

  • The exact archive arm accepts any directory whose name equals the identity, including openspec/changes/archive/foo/. That is not a directory the pinned archiver can produce—archive_directory_name only emits a date-prefixed directory for foo—so a malformed or stray archive entry can be treated as a valid baseline location. Restrict the exact arm to date-prefixed names while retaining exact matches for already date-prefixed identities.
    if name != identity:
        return False

scripts/proposal-support.py:1963

  • This guard checks only CHANGE_ID_RE, so the reserved archive segment is accepted as the current identity even though active_change_dir and former_id_problems explicitly reject it. A caller (or malformed tree) can therefore make the baseline walk treat openspec/changes/archive/proposal.md as an active packet, contradicting the reserved-identity contract. Reject RESERVED_CHANGE_ID here before constructing the pathspecs.
    if not CHANGE_ID_RE.fullmatch(change):
        raise SupportError(f"invalid change name: {change}")

scripts/proposal-support.py:690

  • This helper now preserves date-prefixed active IDs, but the archive-specific verify path still independently strips every archive directory prefix (verify line 3720). After the pinned CLI archives 2026-08-04-add-dated under that unchanged name, verify(root, "2026-08-04-add-dated") derives add-dated and skips the archived packet entirely. Reuse the identity-aware archive naming rule in that filter and cover targeted verification of a preserved date-prefixed archive.
    if directory.parent.name != RESERVED_CHANGE_ID:
        return directory.name
    return _ARCHIVE_DATE_RE.sub("", directory.name, count=1)

scripts/proposal-support.py:724

  • This path-limited git log uses Git's default history simplification, so it can omit a commit that created the full-name active packet on a merged side branch. In that case stdout is empty and an archived YYYY-MM-DD-id directory is incorrectly treated as unambiguous (stripped), allowing identity resolution to use the wrong baseline; use --full-history here as ratifying_baseline() already does, and cover a merged-history case.
        ["git", "-C", str(root.resolve()), "log", "--format=%H", "-1", "--",
         f"openspec/changes/{full}/proposal.md"],
        capture_output=True, text=True, check=False,
  • Files reviewed: 1/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Fix round 1, seventh bench round on PR #1038. Copilot's review at 14:24Z opened
NO thread and listed six findings as "suppressed comments" — so a freeze that
counted threads would have recorded zero unresolved and been true and useless.
All six are real, all six are on this branch's own code, and all six are taken.

**(1) `standing_former_id_problems` followed a symlink** (:1070). The
containment guards added earlier in this round stop a foreign packet being
BELIEVED; this arm REFUSES on what it finds, so following a link made it reject
a LAWFUL move over a packet this repository does not contain. Now
`contained_dir`, and a real standing packet is still refused.

**(2) A missing YAML parser is not an absent declaration** (:632).
`load_packet_at` returned None when `yaml is None` even for a path `_text_at`
had just proved PRESENT — the documented "None only when absent" contract
broken by the import rather than by the tree, and an empty established list
handed to the append-only rule. It now refuses and says to install PyYAML; a
genuinely absent path is still None, parser or no parser.

**(3) The exact archive arm admitted a directory the archiver cannot produce**
(:1538). `_archive_dir_carries` accepted any archive directory whose name
equals the identity, `archive/foo/` included — but `archive_directory_name`
emits `<date>-<id>` for every id that does not already carry a date, so that
directory is not one the pinned CLI can write. The exact arm is now restricted
to an identity that is itself dated, which is the single shape it exists for.

**(4) The reserved segment was a change id the walk would resolve** (:1963).
`ratifying_baseline` checked only `CHANGE_ID_RE`, which `archive` satisfies —
so a caller, or a malformed tree, could make the walk resolve
`openspec/changes/archive/proposal.md` as an active packet, contradicting the
arm `active_change_dir` and `former_id_problems` both carry. Refused by name.

**(5) `verify` kept a private copy of the date strip** (:690, at verify's
archive filter). This round removed three copies of that `re.sub` and missed
the fourth: after the pinned CLI archives `2026-08-04-add-dated` under that
name unchanged, a bare strip derives `add-dated` and
`verify(root, "2026-08-04-add-dated")` skips the archived packet altogether.
It now filters with `names_this_change`, which reads both spellings and lets
the ACTIVE ids settle the ambiguous one.

**(6) The disambiguating probe was subject to history simplification** (:724).
The `git log` that settles which of an archived directory's two identities it
carries — landed one commit ago — used git's default simplification, which can
omit the commit that created the full-name active packet on a merged side
branch. An ambiguous name would then read as unambiguous and resolve to the
wrong identity. `--full-history` now, the same flag and the same reason
`ratifying_baseline` gives for its own walk.

Two tests, both failing against `fac01b29`:
`test_the_six_suppressed_findings_of_the_last_copilot_round` (`Lists differ:
["change-t: declares former id 'change-r'…"] != []`) carries (1), (3) and (4)
as its own assertions, and `test_a_missing_yaml_parser_is_not_an_absent_
declaration` (`AssertionError: FormerIdError not raised`) carries (2). (5) and
(6) are covered by the existing archive-verification and identity tests, and
(5) is additionally proved by `proposal-support.py . verify
add-declared-former-id` exiting 0 against the live corpus.

tests/proposal-support: 197 passed before, 199 after, 290 subtests either way.
tests/doc-health + pin_registrations + openspec_cli_pin + sequenced_after +
carve_manifest + notebooklm: 2493 passed, 3 skipped, 30 subtests.
`proposal-support.py . verify` exit 0, and `verify add-declared-former-id`
exit 0; `validate-pin-registrations.py .` exit 0; `doc-health.py --single-repo
.` byte-identical to the pre-fix-round run.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 14:45

Copilot AI 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.

Copilot wasn't able to review any files in this pull request.

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FREEZE — fix round 1 complete

Head 256fe07af1730f9db3b439ac176b3cb850e2903b. Nine commits on top of
5859f053, seven bench rounds, 29 findings across two reviewers and two
pull requests — 29 TAKEN, 0 REFUSED
, 23 tests added, every one of them
failing against the head its finding was raised on.

Review threads — 20 total, 0 unresolved

gh api graphql … pullRequest(number:1038){ reviewThreads } →
  {"total": 20, "unresolved": 0}

Every thread carries a reply naming the commit that took it and the
measurement it was taken on. The four raised against this branch's
scripts/proposal-support.py on the stacked PR #1037 are fixed here and
replied to and resolved there; #1037 now shows 0 unresolved threads.

Reviewer outcomes, verbatim

  • Codex, requested once on cce09fdd, replied 2026-09-14T12:53Z with two
    P2 findings — "Keep undated archive identities visible beside dated live
    IDs"
    and "Preserve the actual ID when validating preserved-date
    archives"
    . Both TAKEN (018a65d3), both resolved. Codex's earlier round on
    5859f053 was one P1 and one P2, both TAKEN (da9297e0, b90fc7f6).
  • Copilot, on 7568c9f1: "🟡 Changes recommended — Three unresolved
    findings remain, including one critical issue."
    → all taken.
  • Copilot, on fac01b29: "🔵 Needs a closer look — Six unresolved
    moderate findings remain in scripts/proposal-support.py."
    Those six opened
    no thread — they were listed as "Suppressed comments (6)" — so a freeze
    counting threads would have read zero and been true and useless. All six are
    taken in 256fe07a and itemised in the body's seventh-round section.
  • Copilot, on the final head 256fe07a at 14:46Z: "Copilot wasn't able to
    review any files in this pull request."
    Recorded as it stands: that head has
    had no Copilot finding, and no Copilot pass either.
  • Sourcery: SKIPPED.

Check rollup at 256fe07a

check result
lane-line SUCCESS
openspec-cli-pin SUCCESS
pytest-suite SUCCESS
release-tag-gate SUCCESS
signed-execution-chain-gate SUCCESS
wallet-validation SUCCESS
clearing-dispatch-gate SUCCESS
merge-master-approval SUCCESS
openreposhape-pin SUCCESS
SonarCloud Code Analysis SUCCESS
Sourcery review SKIPPED

All six required checks green. mergeable: MERGEABLE.
closingIssuesReferences: [] — this pull request closes nothing by
keyword; #1003 is referenced and stays open, and the archive and the promotion
are separate acts.

Local validators at 256fe07a

validator result exit
python3 -m pytest tests/proposal-support -q 199 passed, 290 subtests (176 at 5859f053) 0
python3 -m pytest tests/doc-health tests/pin_registrations tests/openspec_cli_pin tests/sequenced_after tests/carve_manifest tests/notebooklm -q 2493 passed, 3 skipped, 30 subtests 0
python3 scripts/proposal-support.py . verify proposal support verification ok 0
python3 scripts/proposal-support.py . verify add-declared-former-id proposal support verification ok 0
python3 scripts/validate-pin-registrations.py . every in-tree path resolves 0
python3 scripts/doc-health.py --single-repo . byte-identical to the pre-fix-round run 0

What the round is about, in one line each

Nine commits, and the shape they share: every silence a gate reads is now two
facts, not one.

  • da9297e0 — the undeclared-move probe's pairing and its source header both
    fail closed. Measured: in a --filter=blob:none clone the pairing read exits
    128, and the walk took the RENAME COMMIT as the baseline while
    origin_retention_errors printed ORIGIN RETAINED over a mutated origin.
  • b90fc7f6 — an id that begins with a date is not the archive's prefix.
  • 30d40c1c — archive is a lawful slug and an unlawful identity.
  • cce09fdd — a lineage only from a packet this repository contains, and only
    one of them.
  • 018a65d3 — one rule for where an identity can stand; five of that round's
    eight findings were defects the previous round created.
  • e6ff63fa — the two sets the containment guard left open.
  • 7568c9f1 — a header that stands and does not parse is not an empty lineage.
  • ef022a83 — an unresolvable candidate commit is a read that failed (this
    round's own [], argued for and wrong).
  • fac01b29 — an archived directory does not guess which of its two ids it
    carries; history settles it, measured 0 of 167 ambiguous in this corpus.
  • 256fe07a — the six findings Copilot suppressed rather than posted.

Landing is the orchestrator's act on Brett Heap's word. This lane does not
merge, and has posted no LANDING.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

WORD 2026-09-14T21:09Z — Brett Heap, verbatim "land 1038 when green" (given first-hand in lane openxfactory-1's window). The landing word for this realization PR (slices 1–3 of add-declared-former-id, ratified 2026-09-13T22:48Z, landed as a packet at 28ad27af). It is FROZEN at 256fe07a (issuecomment-5666125262) with the six required checks SUCCESS and 0 unresolved threads; guard PASS; landing follows now as an admin merge commit. refs #1003 only.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

LANDING — lane openxfactory-1, session ea50c958-b384-4f43-b073-0540ec00231a@Eagle, 2026-09-14T21:09:24Z, PR #1038 into opensoft/openxFactory main

Guard at 2026-09-14T21:09:28Z on head 256fe07af1730f9db3b439ac176b3cb850e2903b: six required checks SUCCESS (lane-line, openspec-cli-pin, pytest-suite, release-tag-gate, signed-execution-chain-gate, wallet-validation); closingIssuesReferences = []; 0 unresolved threads; main's newest decided pytest-suite = success; no other-lane open LANDING into opensoft/openxFactory main (who --landing). mergeStateStatus BLOCKED = the code-owner-review ruleset that never clears on the author's own account; admin merge on Brett Heap's recorded word (REALIZATION slices 1-3 of add-declared-former-id (ratified 22:48Z, packet landed 28ad27a): declared-lineage reader, identity-based baseline, fail-closed reads; 29/29 review findings taken, tests 176 to 199; Brett Heap word 2026-09-14T21:09Z verbatim "land 1038 when green"; FREEZE issuecomment-5666125262). Merge = merge commit.

@brettheap
brettheap merged commit 701c8fd into main Sep 14, 2026
12 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

LANDED — lane openxfactory-1, session ea50c958-b384-4f43-b073-0540ec00231a@Eagle, 2026-09-14T21:09:36Z, PR #1038 into opensoft/openxFactory main → 701c8fd

brettheap added a commit that referenced this pull request Sep 14, 2026
…tation call sites

main 701c8fd (landed from PR #1038's fix round) narrowed change_id_of to
strip the archive date prefix only where directory.parent.name is
literally "archive" (RESERVED_CHANGE_ID) — fixing the defect Copilot
raised against both PR #1038 and this PR (#1037): the old, unconditional
strip mis-read an ACTIVE directory whose own id merely looks dated (this
corpus's own `2026-08-04-add-dated`), stripping a slice of its real id.

Both of this file's own call sites, and this suite's own corpus-sweep
helper, called change_id_of on a bare leaf name read out of a citation
string — Path(parts[3]) here, Path(n) in the test — with no real parent
at all. Under the new contract that bare Path answers "not archived" and
change_id_of hands the dated spelling back unchanged, so a citation to
the archive's old date (or the test's own reconstruction of one) no
longer matches the claim PacketIndex._build recorded under the stripped
id, and two references that used to resolve now dangle:

  * test_an_archived_spelling_resolves_by_id_when_the_archive_date_moves
  * test_every_packet_in_this_corpus_resolves_to_exactly_itself

Both call sites now prefix the leaf with the segment the citation was
already read from (ARCHIVE_SEGMENT / "archive"), matching the contract
PacketIndex._build already satisfies by passing a real directory whose
parent truly is named archive. Both listed tests pass again; the full
suite (tests/packet_reference tests/pin_registrations
tests/proposal-support) is 291 passed, 290 subtests passed.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 14, 2026
…er than leave it stale

test_a_symlink_is_refused_and_is_never_read_through asserted, as evidence
for why this arm skips the ownership sweep on a symlink problem, that
`support.former_identity_claimants(root)` still reads through the very
link this arm had just refused — MEASURED at this branch's own head, and
true there. It is no longer true against main: PR #1038 landed at
`701c8fde` with the same containment guard (`contained_dir`/
`contained_file`) this arm carries, added to `former_identity_claimants`
itself and therefore to `former_identity_ownership_problems`, which calls
it. Re-measured post-merge: `former_identity_claimants(root)` on the
test's own fixture now answers `{'change-a': [...]}`, never
`change-from-outside`, so the assertion FAILED — not this arm's own
behaviour drifting, a downstream fact this test cited going stale.

The test now measures the current fact instead of the retired one. The
skip itself is UNCHANGED and is kept on a narrower, still-true ground:
this arm does not review `proposal-support.py`'s changes, so a refusal it
has already reached should not start depending on staying in step with a
containment guard a module it does not own happens to carry today.

The module's two docstrings that named `tasks.md` § 3.4 as the still-
future trigger for deleting `_identity_paths_at` are corrected the same
way: § 3.4 HAS landed, but the swap it was waiting for is still not
mechanical, and for a reason neither docstring anticipated. Main's
`identity_paths_at` now fails closed through `_rows_or_refuse`, but that
raises `OriginRetentionError` (a `SupportError`/`ValueError`, built for
the archive gate's own four conditions) and never this module's
`ArrivalCannotRun` (a `RuntimeError` this module owns so
`validate-former-id-arrival.py` can catch exactly one exception for exit
2). Calling the shared reader directly here would let an unreadable read
escape `except fia.ArrivalCannotRun` as an uncaught `OriginRetentionError`
— the same "crash instead of refuse" shape this slice's own review round
closed for `load_packet` (`d053b38e`), not a defect being introduced but
one being correctly left unintroduced. `_identity_paths_at` stays; the
swap is named as owed to whichever slice adds the adapter, not taken here.

No behaviour of this gate changes. `python3 -m pytest tests/former_id_arrival
-q` and the same with `GITHUB_EVENT_NAME=pull_request` both report 43
passed, 4 subtests passed — identical to this branch's pre-merge count.

Lane: openxfactory-1

Co-Authored-By: Claude Sonnet 5 <[email protected]>
brettheap added a commit that referenced this pull request Sep 14, 2026
… opened

Un-drafting this PR triggered a seventh Copilot review and its first Codex
review, over the diff the merge-from-main left. Six findings, all TAKEN:

* The workflow's own anti-vacuity assertion required the corpus sweep's
  ACTIVE count to be nonzero, so a corpus that has archived every packet
  it ever held (`0 active and N archived` — a valid live state) would fail
  a required check that actually read something. Now refuses only the one
  shape that cannot be a real corpus: `0 active and 0 archived`.

* `former_id_problems` is asked about ONE identity, and the corpus arm
  hands it only the commoner (stripped) reading of an archived directory.
  A self-claim written under a DATED archive directory's OTHER (exact)
  reading — `archive/2026-09-09-foo` declaring `former_ids:
  [2026-09-09-foo]` — named an id neither `former_id_problems` compared
  against nor the ownership sweep's self-claim skip caught (it skips under
  the SAME other reading): the exact shape `packet_identities_of`'s own
  docstring already names as a measured historical defect (`cce09fdd`),
  closed there and, until now, not here. Measured against the parent:
  `corpus_problems` returned `[]`; now one refusal, naming the reading.

* `declared_at` reads history through `support.git_show_text`, which
  decodes with `errors="replace"` and never raises — unlike `load_packet`,
  which decodes a manifest ON DISK strictly and only catches `YAMLError`,
  so the corpus arm refuses non-UTF-8 bytes as "could not be read at all".
  The range arm had no equivalent: a `�` a legitimate `.openspec.yaml`
  has no reason to carry now refuses as CANNOT RUN instead of parsing a
  lossy decode as a document the corpus arm would have refused outright.

* The CLI's own ratification-gap count read as a sentence fragment ("N of
  a packet no identity of which has ever declared `Status: ratified`"),
  naming neither what N counts nor what "a packet" refers to. Reworded to
  name the count directly: "N packet-directory move(s) whose source
  identity has never declared `Status: ratified`."

* `_identity_paths_at`'s archive loop asked only the STRIPPED reading of a
  dated identity (`ARCHIVE_DIR_RE.match(name).group("id") == identity`),
  though the module docstring already claimed "the two-candidate rule...
  is reused" — it was not. `archive/2026-09-09-foo` is the archived `foo`
  AND the archived `2026-09-09-foo` (`support._archive_dir_carries`'s own
  docstring names why, from PR #1038's identical fix to the shared
  reader), and asking only the first meant a ratification recorded for the
  EXACT reading — including one recorded while already archived, which
  this gate does not assume can't happen — resolved to "never ratified".
  Fixed by calling `support._archive_dir_carries` itself, the predicate
  PR #1038 already built and tested for this exact ambiguity, rather than
  re-deriving a narrower version of it a second time. (Copilot, PR #1039.)

* The archive-relocation exception in `judge_commit` compared
  `change_id_of_dir`'s STRIPPED reading of the destination against the
  source's own UNSTRIPPED id, so a RATIFIED packet whose own id already
  carries a date — archived UNCHANGED, per `archive_directory_name`'s own
  rule — compared `example` against `2026-09-14-example`, never matched,
  and had its perfectly ordinary archival refused as an undeclared rename:
  the false-refusal shape a required gate with no bypass flag must never
  take. Fixed the same way, by asking `support._archive_dir_carries`
  whether the destination's bare name carries the source's id, under
  either reading. Measured against the parent: refused; on this head,
  excepted. (Codex P2 and Copilot, PR #1039.)

Four new tests, each measured against the parent to fail there and pass
here: `test_an_archived_self_claim_under_its_OTHER_reading_is_refused`,
`test_a_historical_manifest_with_invalid_utf8_is_refused_not_garbled`,
`test_a_dated_identitys_own_archival_is_excepted_too`, and
`test_ever_ratified_finds_the_EXACT_reading_of_a_dated_archived_id` (the
last calls `_identity_paths_at` directly, at a revision where the
identity stands ONLY in the archive, so the assertion is not masked by an
earlier commit's unaffected active-path reading).

`python3 -m pytest tests/former_id_arrival -q` and the same with
`GITHUB_EVENT_NAME=pull_request` both report 47 passed, 4 subtests
passed. `python3 -m pyflakes scripts/former_id_arrival.py
scripts/validate-former-id-arrival.py` is silent. The live corpus sweep
is unchanged (47 active, 167 archived, 0 problems): no packet in it
carries a dated id under either shape this round touches.

Lane: openxfactory-1

Co-Authored-By: Claude Sonnet 5 <[email protected]>
brettheap added a commit that referenced this pull request Sep 15, 2026
…ince amended

Brett Heap ruled it, 2026-09-15T19:0xZ, by multiple choice in this lane's
window, verbatim "Amend the row in #1041"
(#1003 (comment)).
Two claims in the `add-declared-former-id` OpenSpec Records row had been
overtaken by the packet's own realization and are corrected where they stand,
in the grammar the block already uses for a row amended by its own realization
(`add-consent-custody-rederivation-record`, README:1564 — the superseded text
is kept in place and dated rather than deleted).

1. The row quoted `docs/document-lifecycle.md`'s "Renaming a ratified change is
   therefore blocked until a change declares a FORMER ID (issue #833, a
   successor packet)" IN THE PRESENT TENSE, as what canon says. Slice 6 amends
   that sentence. The quote is kept and re-tensed — THEN STATED, "quoted here
   as the text that stood, not as the text that stands" — with a pointer to the
   amendment at the foot of the row.
2. The row said "`tasks.md` § 1 is ticked and §§ 2-7 stay open". That was true
   of the ratification and is false of the realization. It is re-tensed to the
   ratification it describes, and the amendment records what is true now:
   ratified 2026-09-13; realization slices 1-5 LANDED — PR #1038 → `701c8fde`,
   PR #1037 → `8f393758`, PR #1039 → `92d519b0` — and slice 6 is this pull
   request; § 4.5 (his operator act, re-measured live at 2026-09-15T19:41Z and
   still named by no branch ruleset) and § 7 (the archive and the promotion
   into `openspec/specs/release-realization/spec.md`) OUTSTANDING, the archive
   ruled admissible with § 4.5 open as a disposition plus a carry-forward
   issue. Thirty-one of thirty-nine boxes ticked, eight open.

No other row moves and no numeral elsewhere in the block moves: this amendment
neither archives nor un-archives anything, so the Active and Archived
enumerations are exactly as `8944758c` left them.

Refs #1003.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 16, 2026
Archive add-declared-former-id on its merged-plus-green realization evidence (#1038 → 701c8fd, #1037 → 8f39375, #1039 → 92d519b, #1041 → 79ac94b)
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.

2 participants