Skip to content

proposal-support and the ledger seeder own the UTC clock: TZ=UTC for the pinned CLI, the archived directory name asserted, moved_on taken from the directory, and a validator arm for drift - #797

Merged
brettheap merged 11 commits into
mainfrom
fix/archive-date-owns-the-utc-clock
Sep 8, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-1 (openXfactory-1)

proposal-support.py archive and validate-sequenced-after.py --seed-ledger
both took a DATE, and both took it from the machine's LOCAL clock — while the
pinned OpenSpec CLI, which is what actually names
openspec/changes/archive/<YYYY-MM-DD>-<change>/, took it from ITS local clock
and accepts no date option at all. Nothing compared the three. Archiving #780's
packet at 23:35 local / 03:35 UTC produced a 2026-09-07- directory on a UTC
2026-09-08 archive; the author reverted whole and re-ran under TZ=UTC so the
serializer itself named it right. Every other date in this estate — the lane
rows, the records, the ratification lines — is UTC.

The three measured facts (issue #790)

  1. --date never reached the CLI. archive --date defaulted to
    date.today().isoformat() and flowed ONLY into the support bundle's
    packaged_at (package()). The child was
    [executable, 'archive', change] with env=pin_verifier().validation_environment()
    — no timezone in it — and pinned @fission-ai/[email protected]'s archive
    takes --yes --skip-specs --no-validate --json --store and nothing else. The
    directory name was the CLI's local clock, full stop.
  2. The seeder read the same local clock. --seed-ledger defaulted
    moved_on to datetime.date.today().
  3. Nothing compared them. No validator read an archived directory's date
    prefix (sequenced_after.ARCHIVE_DIR) against the ledger row's moved_on.

Proven again here on the REAL pinned CLI, in a throwaway repo, at a wall time
where the two dates differ (UTC 2026-09-08, Pacific/Kiritimati 2026-09-09)
— see Verification, demos 1 and 2: bare CLI under Kiritimati →
2026-09-09-demo-clock; bare CLI under UTC → 2026-09-08-demo-clock.

The four arms

(a) The archive date is derived ONCE, in UTC, and the child is handed TZ=UTC

utc_today() (datetime.now(timezone.utc).date().isoformat(), not the
deprecated naive utcnow()) is the one clock this script stamps from.
transition --date, package --date and the archive's date all default to it,
and each says so in --help. archive_environment() MERGES TZ=UTC into
pin_verifier().validation_environment() — never substitutes for it, so
OPENSPEC_TELEMETRY=0 still settles both halves — and SETS TZ rather than
setdefault-ing it, because the operator's ambient timezone is precisely the
input that produced the defect.

Before (TZ=Pacific/Kiritimati, UTC 2026-09-08): Change 'demo-clock' archived as '2026-09-09-demo-clock'.
After (same TZ, through the wrapper): Change 'demo-clock' archived as '2026-09-08-demo-clock'.

--date on archive now defaults to None and resolves in main, so "the
operator named a date" stays distinguishable from "the operator named nothing".
An explicit --date that is not today in UTC is REFUSED before the CLI runs
— the CLI could not honour it at any price, and stamping it on the bundle beside
a differently-named directory is the split this issue is about:

$ TZ=Pacific/Kiritimati proposal-support.py <root> archive demo-clock --yes --date 2026-09-09
REFUSE archive-date-not-utc-today: --date '2026-09-09' is not today in UTC ('2026-09-08'). The pinned OpenSpec CLI has no date option — it names openspec/changes/archive/<date>-<change> from its own clock, which this wrapper fixes to UTC — so an archive cannot be stamped with any other day: the bundle's `packaged_at` would state one date and the directory beside it another. Re-run without --date, or pass '2026-09-08'.
exit=2

Nothing moved: the change was still at openspec/changes/demo-clock/ and no
archive directory was created (the refusal precedes the pin resolution).

(b) The tree the CLI left is INSPECTED, on every exit status, and a wrong day is reverted

TZ is an ask of a process this repository does not own; whether the child
honoured it is a FACT, and the fact is now checked. archive_change records the
names under openspec/changes/archive/ and the cleanliness of
openspec/specs/ BEFORE the child runs, and afterwards
assert_archived_directory_date reads what actually appeared.

Before: whatever the CLI named was committed.
After, against a CLI that ignores the handed TZ (a shim forcing
Pacific/Kiritimati, wrapper run under TZ=UTC, over a repository whose
openspec/specs/ is tracked and carries an untracked stray beside it):

REFUSE archive-date-mismatch: the pinned CLI named the archive directory '2026-09-09-demo-clock' but the archive date is '2026-09-08' — the CLI's clock is not UTC, or a future CLI ignored the TZ this wrapper hands it, or the change was archived by something other than this wrapper — this run cannot tell which, and does not guess; nothing committed.
  reverted: the change directory was moved back to openspec/changes/demo-clock/.
  reverted: the CLI's edits under openspec/specs/ (`git checkout -- openspec/specs`). Files it ADDED there are untracked and are left in place rather than deleted.
  The archive is REFUSED rather than committed under a name that states a day it did not happen on. Re-run once the CLI names '2026-09-08-demo-clock'; this wrapper already hands it TZ=UTC.
exit=2

ArchiveDateRefusal is one of a THIRD exit-2 family beside OriginRetentionError
and PinnedCliRefusal, in their shape and for their stated reason: none of the
three is the "fix the packet and retry" shape exit 1 means, and which one it was
is in the message rather than in the number. The fix round added a base,
ArchiveRefusal, and a sibling — see below.

The refusal is honest about what it did NOT do — a supporting-docs bundle
written before the child ran is left in place and SAID SO, and
git checkout -- openspec/specs runs only when openspec/specs/ was free of
uncommitted TRACKED changes before the run
, which is read beforehand precisely
so a revert can never discard the operator's own work:

  NOT reverted: openspec/specs/ carried uncommitted changes to TRACKED files BEFORE this archive, so the CLI's spec edits were left alone — reverting them would have discarded work this wrapper did not make. Undo them by hand.

(outside a work tree, NOT reverted: openspec/specs/ could not be read through git (no work tree) …; and where git tracks nothing under openspec/specs/ at
all, nothing to revert under openspec/specs/: git tracks no file there, so anything the CLI wrote is an untracked addition, left in place rather than deleted — which is not a failed revert and is no longer reported as one).

The six outcomes this inspection distinguishes, and the two it will not touch,
are the fix round's subject: see "Fix round" below, which is where the
check=True that used to skip all of this is dealt with.

(c) The seeder: UTC by default, and the FLIP takes its directory's date

--moved-on defaults to today in UTC. A row FLIPPING active -> archived
takes moved_on from archive/<YYYY-MM-DD>-<id>'s prefix — render_ledger
gains an archive_dates argument, sequenced_after.archive_dates(repo_root)
supplies it, and sequenced_after.flips_to_archived() is the one place that
decides which rows it applies to.

Before: add-a, flipping to archived at 2026-08-14, re-seeded on
2026-09-03 → moved_on: 2026-09-03.
After: moved_on: 2026-08-14 — at the flip the row's move and the archive
are the same act, because the archiving change seeds its own row.

NARROWED ON REVIEW, and this is the substantive change Codex earned. My
first cut applied the archive date to EVERY moved archived row.
openspec/specs/release-realization/spec.md's per-subject-row requirement says
a row records "the pull request that last moved it AND THE DATE" — the date of
THAT move. A September pull request that flips an already-archived row from sole
to co-modifier moved it in September; writing the August archive date beside a
September moved_by would have made the provenance pair state two different
moves. A row CREATED for a change that was already archived is likewise not a
flip: its move is its creation, today. Both now keep the run's date.

An explicit --moved-on that a FLIPPING row's directory contradicts is REFUSED
rather than silently overridden — a caller who typed a date and got a different
one written was told their flag was honoured when it was not:

--seed-ledger refused: --moved-on '2026-09-08' disagrees with the archived directory of 1 row(s) this re-seed FLIPS to archived: add-old (2026-08-01). At the flip the row's move and the archive are the same act, so its moved_on IS the date its archive/<YYYY-MM-DD>-<id> directory carries and a re-seed cannot stamp another day on it. Drop --moved-on (a flipping row then takes its directory's date and every other row takes today in UTC), or pass the date those directories carry
exit=2

And a flipping row whose directory is dated AFTER today in UTC is refused before
it is stamped — that directory was named by a clock running ahead of UTC, and
stamping its date would write the contradiction arm (d) gates on. A refused
re-seed writes nothing; an UNMOVED row is still never restamped.

(d) A validator arm for the drift, on the plain run — and it GATES

validate-sequenced-after.py . (the invocation CI already makes) now fails
(exit 1) on the one direction that is a contradiction under any reading of the
provenance pair: an archived row whose moved_on PREDATES the directory it
describes.
The row says archived and claims a move older than the archive
that made it archived. It is also exactly the shape a CLI clock running AHEAD of
UTC produces — under Pacific/Kiritimati the pinned CLI names tomorrow's
directory for today's archive.

The (d) live-corpus result, measured before the arm was made a gate
(144 archived rows, 144 with an unambiguous directory, a row, and a row that
says archived):

reading findings
moved_on EARLIER than the directory's date (the shipped gate) 0
moved_on LATER 124
moved_on EQUAL 20

So the gate ships GREEN and as an ERROR — which is what the issue asked for and
what a warning class would not have delivered. Equality is NOT required, and
that is the second correction Codex earned: 124 of the 144 rows carry a date
LATER than their directory, every one of them a legitimate later move under the
requirement quoted above, and requiring equality would have reported a correct
ledger as stale on the required pytest-suite check. The equality reading the
issue proposed is KEPT rather than dropped, behind --strict-archive-dates
(which reports all 124 on this corpus and exits 1), and named there as the
stronger reading.

Stated plainly rather than left to be found: neither ledger reading catches a
clock running BEHIND UTC — #780's own direction
— because a later moved_on
is indistinguishable from a legitimate later move. That direction is caught
where it happens, by arm (b)'s assertion on the directory name at archive time,
and it is why (b) exists rather than (d) alone.

sequenced_after.archive_date_problems(repo_root, ledger, require_equal=…)
reads only directory names and active_change_dirs — no classify_corpus — so
the plain run stays at ~0.25s. It is kept OUT of ledger_problems deliberately:
that function is what --ledger-diff gates on AND what render_ledger re-runs
over its own output, so a finding added there would make the seeder refuse to
write the file that repairs the drift. A missing or unreadable ledger is NOT
this arm's finding — --ledger-diff owns that class and answers it with exit 2,
a status the plain run does not have and must not invent — so the arm says
archive-date arm NOT RUN: … and the verdict is unchanged. A row whose
moved_on is not a readable date is left to --ledger-diff too, so one defect
is reported once.

An independent measurement this PR does NOT ship, offered because Codex
asked for archive-directory dating to be validated independently of the ledger:
comparing each directory's date prefix to the UTC date of the OLDEST commit that
added it gives 132 of 144 equal, 12 not. (An earlier draft of this paragraph
said "131 of 143 ... eleven of the twelve ... the twelfth PAIR", which does not
add up — eleven plus a pair is thirteen. The derivation below is the corrected
one, re-run at this PR's head.) The twelve split cleanly:

  • TEN dated exactly ONE DAY EARLIER than their adding commit — Archive publish-openspec-cli-pin-as-contract-member: the pin's registration promoted into neutral-product-pin canon (#754) #780's own
    shape, on ten archives nobody noticed:
    2026-08-04-add-ideation-cross-reference-readiness,
    2026-08-04-add-possibles-derivation-lane,
    2026-08-04-adopt-neutral-utility-pack,
    2026-08-04-implement-avatar-client-lab,
    2026-08-06-add-opendox-project-header,
    2026-08-06-add-project-scoped-selection,
    2026-08-06-add-proposal-origin-contract,
    2026-08-09-qualify-avatar-brokered-call-feasibility,
    2026-08-25-add-dispatch-credential-contract,
    2026-09-04-add-chain-anchoring.
  • TWO six days apart: 2026-06-26-enable-live-openxfactory and
    2026-06-26-migrate-canonical-policy-to-openxfactory, the repository's
    initial import.

That arm would catch the behind-clock direction estate-wide, costs 144 git log
calls, and has 12 pre-existing findings — so it is a named successor, not a line
in this PR.

Fix round (two-lens adversarial review)

Two adversarial lenses were run over this branch against the REAL pinned CLI
(@fission-ai/[email protected], dist/core/archive.js read directly) and against
shims standing in for the failures the real CLI cannot be made to produce on
demand. One MAJOR finding and six smaller ones were taken; every one of them is a
case where the wrapper either MISSED a defect entirely or refused something
CORRECT.

MAJOR — check=True skipped the entire inspection

subprocess.run(command, cwd=root, check=True, env=…) raised
CalledProcessError at the exact point assert_archived_directory_date would
have run. The pinned CLI has THREE documented failure paths that occur AFTER the
move, each ending with the archive standing:

path dist/core/archive.js what it says
MoveDestinationRetainedError :449 "The complete destination was retained for recovery."
RetirementBackupsRetainedError :852 "The change remains archived and each listed backup was retained for recovery."
rollback-failure rethrow :1605-1617 reports that the ROLLBACK itself failed

…plus a SIGINT part-way through moveDirectory, which copies and only then
removes the source, leaving the change in TWO places. Every one of those left a
directory nothing named and nothing date-checked, at exit 1, with no revert.

Measured on the pre-fix head 652a8116, real packet, shim CLI:

--- CONTROL: a CLI that archives on the WRONG DAY and then exits 1
exit=1
Command '[…/openspec', 'archive', 'demo-clock', '--yes']' returned non-zero exit status 1.
[tree] changes: archive | archive: 2026-09-09-demo-clock      <- THE WRONG-DAY DIRECTORY, LEFT ON DISK

--- CONTROL: a CLI that half-copies and then dies by SIGINT
exit=1
[tree] changes: archive demo-clock | archive: 2026-09-08-demo-clock   <- BOTH COPIES, unnamed

The child now runs with check=False and its status is an INPUT to the
inspection. Six outcomes, each named on its own terms:

child tree outcome
0 <date>-<change>/, active path gone ok, silently
any a directory naming this change AND the active path still there archive-split, exit 2, NOTHING touched
non-zero nothing new, active path still there the child's own CalledProcessError, exit 1, tree untouched
non-zero <date>-<change>/, active path gone archive-cli-failed, exit 2, NOTHING reverted
any a directory naming this change on ANOTHER day archive-date-mismatch, exit 2, REVERTED
any no directory naming this change archive-date-mismatch, exit 2

The third row matters as much as the rest: a CLI that refused for its own good
reason (incomplete tasks, a destination that exists, its own validation) and
moved NOTHING leaves the tree exactly as the operator handed it over, which is
the fix-and-retry shape exit 1 has always meant here — so the child's own
CalledProcessError is re-raised rather than renamed after a date nothing wrote.

ArchiveRefusal is a new base; ArchiveDateRefusal keeps its meaning and
ArchiveTreeRefusal carries the two tree-shape refusals, which are NOT date
findings — the name on disk may be exactly right. main catches the BASE, so a
subclass cannot diverge in status by being forgotten there. Neither tree arm
reverts
, and the reason is the CLI's own comment on the move it interrupted.

The two new refusals, verbatim, on the real CLI + shim (nothing real
archived; a throwaway demo-clock packet in a temp repo):

--- a CLI that ARCHIVES CORRECTLY and THEN EXITS 1
exit=2
REFUSE archive-cli-failed: the pinned CLI exited 1 AFTER archiving 'demo-clock' — <root>/openspec/changes/archive/2026-09-08-demo-clock is on disk under the name this archive date asks for and the active path is gone. THE DATE IS NOT IN QUESTION.
  NOT reverted, deliberately: every post-move failure this CLI documents ends with the change still archived — a staged source it could not remove, a retirement backup it could not delete, a rollback that itself failed — so this directory is the complete copy and moving it back would destroy it.
  Read the child's own output above: it names the paths it retained. Finish what it could not, then commit the archive; nothing about the naming needs re-running.
[tree] archive: 2026-09-08-demo-clock          <- kept, as the CLI says it should be
--- a CLI that HALF-COPIES and then DIES BY SIGINT
exit=2
REFUSE archive-split: the pinned CLI left 'demo-clock' in TWO places, so the archive is neither done nor undone (the child exited -2).
  active:   <root>/openspec/changes/demo-clock
  archived: <root>/openspec/changes/archive/2026-09-08-demo-clock
  NOTHING was moved and NOTHING was reverted: which of the two copies is complete cannot be read off the tree, and the pinned CLI's own move says why guessing is wrong — 'the destination is now the only complete copy, so never erase it while trying to make this failed move look atomic'. Compare the two by hand, keep exactly one, and re-run.
--- a CLI that archives on the WRONG DAY and THEN EXITS 1
exit=2
REFUSE archive-date-mismatch: … this run cannot tell which, and does not guess; nothing committed.
  The child also exited 1; its own output is above.
  reverted: the change directory was moved back to openspec/changes/demo-clock/.

MINOR — a sibling lane's directory refused a CORRECT archive

created == [want] asked whether the directory this run produced was the ONLY
thing that appeared, not whether it appeared. In a shared checkout a second lane
archiving between the before- and after-readings made a correct archive exit 2,
and the refusal's remedy said "move THEM back by hand" over a list containing
ANOTHER change's directory. Now want in created; extra directories are named
as facts and never as something to undo:

NOTE: 2026-09-08-change-from-another-lane also appeared under openspec/changes/archive/ while this archive ran; they name other changes (a concurrent archive in a shared checkout) and are left exactly as found.
exit=0

and on the refusing side, where the wrong-day copy of THIS change is reverted and
the sibling is not:

  LEFT ALONE: 2026-09-07-change-from-another-lane appeared under openspec/changes/archive/ during this run but name OTHER changes — a concurrent archive in a shared checkout — and this refusal does not touch them or ask you to.

MINOR — an untracked file disabled the revert of TRACKED spec edits

specs_are_clean ran git status --porcelain -- openspec/specs INCLUDING
untracked files. git checkout -- openspec/specs restores tracked paths from the
index and cannot touch an untracked file — so a stray note under
openspec/specs/ disabled the revert of edits the revert was written for, and
the message then blamed the operator for uncommitted work they had not done.
--untracked-files=no.

Both halves observed on the real CLI, same packet, same shim, one repository
whose openspec/specs/demo-capability/spec.md is committed and carries an
untracked scratch-note.md beside it:

pre-fix 652a8116:  NOT reverted: openspec/specs/ carried uncommitted changes BEFORE this archive …
                   [spec.md after] "The demonstration SHALL record the date its archive directory carries, in UTC."
                                    ^ THE CLI'S EDIT, STILL IN THE TREE

this head:         reverted: the CLI's edits under openspec/specs/ (`git checkout -- openspec/specs`) …
                   [spec.md after] "The demonstration SHALL record the date its archive directory carries."
                   [stray] scratch-note.md   <- untouched, as it must be

MINOR — the refusal asserted "the CLI's clock is not UTC" in cases it cannot know

Three of them, and the third was the worst kind of bug: it refused AND REVERTED a
CORRECT archive.

  • A run crossing midnight UTC. today is taken once, before the child. A run
    that begins at 23:59:59 UTC and returns after midnight sees a directory dated
    the next day from a perfectly UTC clock. The day is now RE-READ after the child
    and the crossing is named: "THIS RUN CROSSED MIDNIGHT UTC — the archive date
    was taken as '2026-09-07' before the CLI ran and it is now '2026-09-08', which
    is the day the directory carries. The CLI's clock is not in question; the
    bundle's packaged_at would simply state the earlier day. Re-run and the two
    will agree"
    . It is still refused — one archive, one date — but not on a false
    charge.
  • Two directories. "more than one directory appeared during this run, so
    which one this archive produced cannot be read off the tree"
    .
  • A change id that already carries a YYYY-MM-DD- prefix. The pinned CLI
    DELIBERATELY does not re-prefix such an id (ARCHIVE_DATE_PREFIX_PATTERN at
    archive.js:27, tested at :1124; upstream Ratify private connectivity production qualification and rollout gates #1309: "re-prefixing would stutter
    the name"). The wrapper always prepended today, so its expectation was one the
    CLI will never satisfy — it refused a correct archive and MOVED IT BACK.
    archive_directory_name() now computes the expectation the way the CLI
    computes it, and says out loud the consequence it does not repair: for such an
    id the directory carries the date in the id and the bundle beside it carries
    today.

The remaining diagnosis is a list of possibilities rather than an accusation:
"the CLI's clock is not UTC, or a future CLI ignored the TZ this wrapper hands
it, or the change was archived by something other than this wrapper — this run
cannot tell which, and does not guess"
.

MINOR — _utc_today() had no test that could fail on a UTC runner

Every test of the seeder's default date read the host's own clock, so on the UTC
runner CI uses the mutation _utc_today -> date.today passed the entire suite.
The clock is now FROZEN in a child process at 23:35 UTC — the hour #780's archive
actually ran at — with TZ=Pacific/Kiritimati set and time.tzset() called, an
instant at which the machine's local day is 2026-09-09 and UTC's is
2026-09-08. The anti-vacuity assertion (the local day really is tomorrow) ships
with it.

MINOR — the (d) gate named one fact twice

The archive-date arm read every archived-on-disk id with a row, whatever the row
said. A STALE active row for a disk-archived id was therefore reported as an
"archive-date contradiction" — a finding whose own words are "an archived row
cannot record a move that predates the archive that made it archived"
, about a
row that claims nothing of the kind. It is --ledger-diff's stale-row class and
its repair is a re-seed. if row.get("state") != STATE_ARCHIVED: continue.

MINOR — the documentation overclaimed

docs/document-lifecycle.md said the wrapper "refuses and reverts the move". The
refusal is unconditional; the revert is not — it needs exactly one new directory
naming this change, a free active path, and openspec/specs/ free of
uncommitted TRACKED changes. Reworded within the same paragraph, and the two
non-reverting tree refusals named.

Notes taken

  • --date '' was silently defaulted. stamp = args.date or today replaced an
    empty string the operator TYPED with today — a flag reported as honoured when
    nothing read it. stamp = today if args.date is None else args.date, so it now
    takes the same refusal every other unhonourable date takes, before the pin is
    resolved and before anything moves:
    REFUSE archive-date-not-utc-today: --date '' is not today in UTC ('2026-09-08'). …
  • git checkout -- openspec/specs exits 1 where nothing is tracked ("pathspec
    … did not match any file(s) known to git"), and that was printed as a FAILED
    revert with "STILL IN THE TREE … Undo them by hand", sending an operator after
    tracked edits that cannot exist. Guarded: "nothing to revert under
    openspec/specs/: git tracks no file there, so anything the CLI wrote is an
    untracked addition, left in place rather than deleted."
  • The comment on the merged environment was wrong. It said the merge exists
    "so this process does not archive under one environment having validated under
    another", which stopped being true the moment TZ=UTC was added — the archive
    child now runs under an environment the validation child did not. Reworded.
  • The flip branch can overwrite a later moved_on when a re-seed flips a row
    on a later day. Behaviour UNCHANGED — at a flip the row's move and the archive
    are the same act, which is the whole of arm (c) — and the rule is now stated in
    the code comment rather than left to be discovered.
  • LEDGER_HEADER gained lines the committed ledger does not carry. No
    re-seed was run here on purpose: the header refreshes at the next real seed,
    and re-seeding 185 rows to pick up a header comment would put a 185-row diff in
    a PR about a date.

Copilot round 3 — taken as clarity, premise corrected

Copilot read moved_on=moved_on or today in the seeder and reported the archive
half's defect there: --moved-on '' silently replaced by today. The premise is
wrong, and the record says so rather than claiming a fix it did not make.
That
value cannot reach the or: main refuses it (--moved-on must be an ISO date (YYYY-MM-DD), not '') and sequenced_after.render_ledger refuses it AGAIN,
running is_moved_on over the value before it writes a line. Measured — with
either guard neutered the other still refuses, so both mutations SURVIVE the
suite
, which is what identified the branch as dead rather than live. The
archive-side args.date or today it is compared to WAS live and did stamp today
over an empty string.

Taken anyway: today if moved_on is None else moved_on, because a predicate that
is correct by accident is not one that says what it means; and the empty-string
case joins the seeder's bad-provenance table, because nothing PINNED the double
guard — a later edit to either could have let a value through to a default that
overwrites it.

One more doc precision (36eb8ee5)

"A directory carrying any other day is REFUSED unconditionally" is true of the
ordinary case and misleading about the one this round fixed: a date-prefixed
change id is archived under that id UNCHANGED, and the wrapper now expects
exactly that. The paragraph names the CLI's own naming rule instead. Same hunk,
no new claim.

Codex round 2 — two shared-checkout P1s taken, the flip reading refused

All three findings are about the case this repository actually runs in: two
lanes archiving at once in one checkout.

  • P1, proposal-support.py: the no-move guard asked a GLOBAL question.
    if returncode != 0 and not created and active.exists() re-raises the child's
    own CalledProcessError when it failed having moved nothing — but created is
    EVERY new directory under archive/, so a sibling lane's archive landing
    between the two readings made the condition false for a child that had touched
    nothing. The run then fell through to the mismatch path, quoted the SIBLING's
    directory as "the name the pinned CLI gave this change", and ran
    git checkout -- openspec/specs over a cleanliness reading taken before
    EITHER child — erasing the concurrent archive's canonical spec edits. Every
    question the inspection asks is now asked about mine: the guard, the name in
    the refusal, the diagnosis, and the "child also exited" line. And a run that
    produced no directory of its own now reverts NOTHING and says why:
    "NOT reverted: this run produced no archive directory of its own, so it has
    no spec edits of its own to undo — and in a shared checkout git checkout -- openspec/specs would discard another lane's."
    The test's fake makes the
    sibling write a COMMITTED spec and asserts that edit survives.
  • P2, names_this_change: 2026-08-04-foo is a change id, not a prefix.
    It is both a wrong-day archive of foo and the archive of a change whose id
    IS 2026-08-04-foo — the shape archive_directory_name was just taught to
    support. Indistinguishable FROM THE NAME, so the name no longer decides: the
    ACTIVE change ids are read BEFORE the child and a directory whose name was a
    change id when the run started belongs to that change. The reading must be
    taken beforehand, which is its own small finding — a concurrent lane removes
    its own active directory as it archives, so asked afterwards the question
    answers "no such change" for exactly the directory it was asked about. Shipped
    with an anti-vacuity control proving a real wrong-day copy is still reverted.
  • P1, sequenced_after.py, the delayed flip: REFUSED, with the reason written
    into the code beside the branch.
    Codex is right that flips_to_archived
    reads only the previous row state and cannot tell "the archiving change seeded
    its own row" from "a later repair is seeding it now", and right that a delayed
    repair's row therefore states its pull request beside the ORIGINAL archive's
    day, with no way to record its own. That is the reading arm (c) adopted, not an
    oversight: moved_on is the date the ROW MOVED, and the move a flip records is
    "became archived" — which happened on the day the directory carries, whoever
    wrote the row down afterwards. The alternative is defensible and would still
    pass the archive-date arm (a later moved_on is permitted; 124 of 144 rows
    carry one). But choosing between them re-reads release-realization's
    per-subject-row requirement and changes what EVERY future flipped row means —
    a governed reading, not an implementation detail to settle in a fix round at
    freeze. Named as a successor, in the code and here.

+4 tests (371 → 375) and four more mutations, all four failing: the guard
reading created again; a nothing-produced run reverting specs anyway; the
dated-sibling disambiguation dropped; the active ids read after the child rather
than before.

Copilot round 4 — two claims THIS pull request makes that are not true

Prose only, and taken because they are the defect class this branch is about — a
sentence that states more than the code delivers.

  • docs/document-lifecycle.md claimed "the bundle's packaged_at and the
    directory name are one date" UNCONDITIONALLY, two sentences after naming the
    exception itself. The paragraph now carries the exception on the claim.
  • archive_dates()'s docstring said the directory date "is what moved_on
    records for an archived row" — a promise of equality this estate does not keep
    and the (d) arm was narrowed to avoid requiring. Corrected, with the number
    (124 of 144 archived rows legitimately carry a LATER date), so the next reader
    cannot infer the rule the arm exists without.

Refused and named as a successor: refusing to archive a change id that
already carries a date prefix. The observation behind it is real and measured —
sequenced_after.ARCHIVE_DIR is ^(?P<date>\d{4}-\d{2}-\d{2})-(?P<id>.+)$, so
archive/2026-08-04-foo parses as id foo, and a change whose id genuinely IS
2026-08-04-foo is recovered under the wrong id by every reader downstream of
the archive. But that ambiguity belongs to ARCHIVE_DIR and to the pinned CLI's
own #1309 behaviour, neither of which this branch introduced, and refusing an id
shape the PINNED CLI supports changes what the estate accepts. The estate has no
such id today. What this branch does is stop the wrapper being WRONG about them.

Not changed, and why

Tests

+45 tests (330 → 375 across the three suites), 20 of them from the fix round
and its bot rounds below. The first pass added 25:

  • tests/proposal-support/test_pinned_openspec_cli.py (+10): the local and UTC
    dates REALLY differ at the mocked instant (anti-vacuity for everything below);
    the --date defaults are the UTC date under a mocked clock and a non-UTC
    ambient TZ; the child's environment carries TZ=UTC over an ambient
    TZ=Pacific/Niue with OPENSPEC_TELEMETRY=0 intact and the ambient value
    still in os.environ (so the assertion cannot pass for the wrong reason);
    a wrong-day directory is refused, reverted and the tree restored; the spec
    revert over a clean tree and the NAMED refusal to touch a dirty one; a CLI
    that archived nothing; exit 2 with no traceback through main; the explicit
    --date refusal running nothing but the origin gate's own git; --help
    carries the rule.
  • tests/sequenced_after/test_sweep.py (+15): a row FLIPPING active→archived
    takes the archive's date while a NEW row for an already-archived change and
    every active row take the run's UTC date; the explicit---moved-on refusal at
    a flip, with the agreeing case accepted as its anti-vacuity control; the
    ahead-clock refusal (a flip whose directory is dated after today in UTC); an
    unmoved row is not restamped; the plain run GATES on a moved_on that
    predates its directory and is silent on a LATER one; an unreadable moved_on
    is left to --ledger-diff; --strict-archive-dates asks for the stronger
    reading, and is refused outside the plain run; a missing/unreadable ledger
    does not become a verdict; an id in both corpora and an id with two archive
    directories are NOT date-checked (those are resolve's ambiguity findings,
    not a provenance repair).

Two existing fixtures moved, disclosed rather than folded in. The recorded
double in test_pinned_openspec_cli.py now PERFORMS the archive move (a fake
that records the argv and moves nothing is a CLI that archived nothing, and
every test there would refuse on that rather than on the argv it exists to
watch); and the archive-date literals in the two test_archive_wrapper_* tests
became support.utc_today(), read ONCE into a local (a literal date is a
fixture asserting the CLI archived on a day it did not). A third edit — dropping
a --moved-on from test_the_SEED_LEDGER_cli_writes_a_ledger_the_diff_then_ACCEPTS
— was UNDONE when arm (c) was narrowed to the flip. That test is NOT
byte-identical to main, and an earlier draft of this paragraph said it was
: the
--moved-on it lost was restored, and it gained a comment recording why its
add-old row is not a flip AND one assertion pinning the consequence
(rows["add-old"]["moved_on"] == "2026-09-03", the run's date rather than the
archive's). A comment alone would have left the narrowing unpinned.

test_archive_wrapper_preserves_bundle additionally now asserts the bundle's
packaged_at equals the archive directory's own date prefix: one date, two
places, and they agree.

The fix round added 16 — 13 in tests/proposal-support/ and 3 in
tests/sequenced_after/: a failed child that left a wrong-day directory is still
date-checked and still reverted (with its status reported); a failed child that
left the RIGHT-day directory keeps it and is NOT called a date finding; a
half-moved change names both paths and touches neither; a child that failed
having moved nothing is still exit 1; a concurrent sibling directory does not
refuse a correct archive, and does not appear in a remedy when one IS refused;
archive_directory_name computes the pinned CLI's own rule (three cases,
including a non-date 2026-8-4- that IS prefixed) and a date-prefixed id is
archived, not falsely reverted; a midnight-crossing run is not blamed on the
clock; two directories are not blamed on the clock; an untracked file does not
disable the revert; untracked-only specs are not reported as a failed revert;
--date '' is refused; a stale active row is left to --ledger-diff; the
seeder's default date is UTC under a frozen clock at TZ=Pacific/Kiritimati, and
end-to-end through the CLI under the same zone.

The doubles were made to honour check. A fake subprocess.run that
returned a non-zero CompletedProcess regardless of check=True would let every
assertion above pass against a wrapper that still ran the child with it — which
is exactly the defect. _answer() raises CalledProcessError where the real
function does, and the check=True mutation then fails (M2 below); without that
change it SURVIVED.

The mutation table. Every arm carries one; all thirteen fail at least one
test, and each row names the first test that catches it.

# mutation verdict first test to fail
M1 the child's status is discarded again (returncode=0) FAILS test_a_FAILED_CHILD_that_left_a_WRONG_DAY_directory_is_STILL_reverted
M2 check=True restored, so the inspection is skipped FAILS test_a_FAILED_CHILD_that_left_a_WRONG_DAY_directory_is_STILL_reverted
M3 the split is not detected FAILS test_a_HALF_MOVED_change_is_REFUSED_with_BOTH_paths_named_and_NOTHING_touched
M4 a retained archive is reverted instead of kept FAILS test_a_FAILED_CHILD_that_left_the_RIGHT_DAY_directory_KEEPS_it
M5 created == [want] (a sibling refuses a correct archive) FAILS test_a_CONCURRENT_SIBLING_DIRECTORY_does_NOT_refuse_a_CORRECT_archive
M6 the remedy names another change's directory again FAILS test_a_CONCURRENT_SIBLING_DIRECTORY_does_NOT_refuse_a_CORRECT_archive
M7 untracked files count as dirty again FAILS test_an_UNTRACKED_FILE_under_specs_does_NOT_DISABLE_the_revert
M8 the midnight-crossing diagnosis is never reached FAILS test_a_RUN_THAT_CROSSED_MIDNIGHT_UTC_is_NOT_blamed_on_the_CLIs_CLOCK
M9 the expected name always re-prefixes FAILS test_the_EXPECTED_NAME_IS_COMPUTED_THE_WAY_THE_PINNED_CLI_COMPUTES_IT
M10 the untracked-only specs guard is dropped FAILS test_UNTRACKED_ONLY_SPECS_are_NOT_reported_as_a_FAILED_revert
M11 --date '' is silently defaulted again FAILS test_an_EMPTY_DATE_IS_A_VALUE_THE_OPERATOR_TYPED_and_is_REFUSED
M12 the (d) gate ignores the row's state again FAILS test_a_STALE_ACTIVE_ROW_for_an_ARCHIVED_id_is_the_LEDGER_DIFFS_finding
M13 _utc_today -> date.today FAILS test_the_SEEDERS_DEFAULT_DATE_IS_UTC_AND_NOT_THE_LOCAL_DAY
M16 the no-move guard reads created again FAILS test_a_SIBLINGS_DIRECTORY_does_not_MASK_this_childs_ORDINARY_FAILURE
M17 a nothing-produced run reverts specs anyway FAILS test_the_REFUSAL_NEVER_REVERTS_SPECS_when_THIS_run_produced_NOTHING
M18 the dated-sibling disambiguation is dropped FAILS test_a_DATE_PREFIXED_SIBLING_ID_is_NOT_read_as_THIS_CHANGES_wrong_day_copy
M19 the active ids are read AFTER the child FAILS test_a_DATE_PREFIXED_SIBLING_ID_is_NOT_read_as_THIS_CHANGES_wrong_day_copy

Two more were run for Copilot round 3 and both SURVIVED, which is the finding:
M14 (drop main's --moved-on ISO guard) and M15 (restore moved_on or today)
each leave the other guard standing, so an empty --moved-on is still refused.
That is what identified the branch as unreachable rather than defective; the
predicate was changed for clarity and the case pinned so a future edit to either
guard cannot quietly open it.

Verification

$ python3 -m pytest tests/proposal-support tests/sequenced_after tests/scope_globs -q
375 passed, 2 subtests passed          # main at 3504287a: 330 passed, 2 subtests passed
    tests/proposal-support   95  (main 68)
    tests/sequenced_after   195  (main 177)
    tests/scope_globs        85  (main 85, untouched)
$ python3 scripts/validate-sequenced-after.py .
sequenced_after validation passed (41 active changes, 8 declaring the field).
archive-date agreement passed (no archived row's moved_on predates its directory).
exit=0

$ python3 scripts/validate-sequenced-after.py . --strict-archive-dates
archive-date agreement FAILED (124 finding(s)):
  - archive-date drift: add-binding-consumer-identity: the archived directory is dated '2026-08-31' and the row's moved_on is '2026-09-03'; --strict-archive-dates asks for the stronger reading in which an archived row's moved_on IS its archive date
  … 123 more, every one a legitimate later move
exit=1

$ python3 scripts/validate-sequenced-after.py . --ledger-diff | tail -1
per-change sweep ledger consistent with the corpus (185 rows).
exit=0

$ python3 scripts/proposal-support.py . verify add-per-change-sweep-ledger
proposal support verification ok
exit=0

The dry demonstration — a throwaway demo-clock packet in a temp repo, the
REAL pinned CLI from the verifier's own cache, at UTC 2026-09-08 /
Pacific/Kiritimati 2026-09-09 (re-run at this head; demos 7-10 are the fix
round's). Nothing real was archived.

--- 1. the BARE pinned CLI under TZ=Pacific/Kiritimati
Change 'demo-clock' archived as '2026-09-09-demo-clock'.        <- THE DEFECT, on the real CLI

--- 2. the BARE pinned CLI under TZ=UTC
Change 'demo-clock' archived as '2026-09-08-demo-clock'.

--- 3. the WRAPPER under TZ=Pacific/Kiritimati (--path-mode)
Change 'demo-clock' archived as '2026-09-08-demo-clock'.        <- arm (a): TZ=UTC injected
exit=0

--- 4. the WRAPPER with --date 2026-09-09 under TZ=Pacific/Kiritimati
REFUSE archive-date-not-utc-today: --date '2026-09-09' is not today in UTC ('2026-09-08'). … Re-run without --date, or pass '2026-09-08'.
exit=2   (openspec/changes/demo-clock still active, no archive directory created)

--- 4b. the WRAPPER with --date '' (NEW: an empty string the operator typed)
REFUSE archive-date-not-utc-today: --date '' is not today in UTC ('2026-09-08'). …
exit=2   (nothing moved)
   CONTROL on 652a8116: exit=0, "Change 'demo-clock' archived as '2026-09-08-demo-clock'."
   — the typed value was discarded and the archive ran, silently.

--- 5. the WRAPPER under TZ=UTC (control)
2026-09-08-demo-clock
exit=0

--- 6. a CLI that IGNORES the handed TZ (shim forcing Pacific/Kiritimati; wrapper under TZ=UTC)
REFUSE archive-date-mismatch: the pinned CLI named the archive directory '2026-09-09-demo-clock' but the archive date is '2026-09-08' — the CLI's clock is not UTC, or a future CLI ignored the TZ this wrapper hands it, or the change was archived by something other than this wrapper — this run cannot tell which, and does not guess; nothing committed.
  reverted: the change directory was moved back to openspec/changes/demo-clock/.
  nothing to revert under openspec/specs/: git tracks no file there, so anything the CLI wrote is an untracked addition, left in place rather than deleted.
exit=2
[tree after] openspec/changes/{archive,demo-clock}; archive/ empty; git status shows only
             `?? openspec/specs/`, exactly what the message says is left

--- 6b. the same shim over a TRACKED openspec/specs/ with an UNTRACKED stray beside it
  reverted: the CLI's edits under openspec/specs/ (`git checkout -- openspec/specs`). …
exit=2   [spec.md restored; scratch-note.md untouched]
   CONTROL on the pre-fix head 652a8116: "NOT reverted: openspec/specs/ carried uncommitted
   changes BEFORE this archive …" and the CLI's edit SURVIVED in the tree.

--- 7. NEW: a CLI that ARCHIVES CORRECTLY and THEN EXITS 1
REFUSE archive-cli-failed: the pinned CLI exited 1 AFTER archiving 'demo-clock' — …/archive/2026-09-08-demo-clock is on disk under the name this archive date asks for and the active path is gone. THE DATE IS NOT IN QUESTION.
  NOT reverted, deliberately: …
exit=2   [archive/2026-09-08-demo-clock KEPT]
   CONTROL on 652a8116: exit=1, "Command … returned non-zero exit status 1", directory unnamed.

--- 8. NEW: a CLI that HALF-COPIES and then DIES BY SIGINT
REFUSE archive-split: the pinned CLI left 'demo-clock' in TWO places, so the archive is neither done nor undone (the child exited -2).
  active:   …/openspec/changes/demo-clock
  archived: …/openspec/changes/archive/2026-09-08-demo-clock
  NOTHING was moved and NOTHING was reverted: …
exit=2   [both copies exactly where the child left them]
   CONTROL on 652a8116: exit=1, a bare CalledProcessError, both copies unnamed.

--- 9. NEW: a CLI that archives on the WRONG DAY and THEN EXITS 1
REFUSE archive-date-mismatch: … nothing committed.
  The child also exited 1; its own output is above.
  reverted: the change directory was moved back to openspec/changes/demo-clock/.
exit=2
   CONTROL on 652a8116: exit=1, "Command … returned non-zero exit status 1",
   and archive/2026-09-09-demo-clock LEFT ON DISK with the active path gone.

--- 10. NEW: a SIBLING lane's directory appears beside a CORRECT archive
NOTE: 2026-09-08-change-from-another-lane also appeared under openspec/changes/archive/ while this archive ran; they name other changes (a concurrent archive in a shared checkout) and are left exactly as found.
exit=0   [both directories present; the archive is ACCEPTED]
   Pre-fix this exited 2 and told the operator to move BOTH back.
$ python3 scripts/doc-health.py --single-repo .
Findings: 10 critical, 9 error, 55 warning, 16 info. New regressions vs previous report: 0.

Diffed line by line against the same command run on this branch's merge commit
with the fix round removed: the finding set is byte-identical; the only two
lines that move are the corpus word counts (342417 → 342524 canon words,
standard | 6 | 15658 → 15765). Those 107 words are the documentation edit —
which is +20 / −1 lines, not "one line": a single paragraph in
docs/document-lifecycle.md, three sentences of it replaced across this round's
bot passes because
the old wording said the wrapper "refuses and reverts the move" when the refusal
is unconditional and the revert is not, and because "any other day is refused"
implied it refuses the date-prefixed ids the pinned CLI supports.

CI's pytest-suite at 652a8116 — the pre-fix-round head, and green:

selected=10379 passed=10358 skipped=21 failures=0 errors=0
freshness verifier: passed    vector replay: passed

CI at the frozen head fcb9e35c — all NINE checks SUCCESS, pytest-suite
22m55s:

selected=10427 passed=10406 skipped=21 failures=0 errors=0

(the skip-pin's 21, exactly; 10295 passed, 21 skipped on the suite's own line
before the deselected span is folded in). The eight gates beside it —
lane-line, clearing-dispatch-gate, merge-master-approval,
openreposhape-pin, openspec-cli-pin, release-tag-gate,
signed-execution-chain-gate, wallet-validation — all pass.

The full suite locally, in the fresh clone this branch was authored in:

$ GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 python3 -m pytest tests/ -q -m "not postgres"
96 failed, 10015 passed, 110 skipped, 338 deselected, 50 errors, 87 subtests passed  (32m08s)

The environment-dependent family, named: the UNINITIALIZED SUBMODULES of a
fresh clone.
94 of the 96 failures and all 50 errors are
tests/trust-anchor/, tests/openxwallet_pin/ and tests/clearing/, every one
tracing to the pinned openXwallet reader is not at <root>/openXwallet/scripts/validate-openxwallet.py. Run 'git submodule update --init openXwallet'; the remaining two
(test_chain_reader.py::test_a_carried_block_the_shipped_shape_rejects_is_refused
and test_snapshot.py::test_find_validator_locates_pinned_checkout) want the
pinned decision core checked out beside the repository. Run on main at
e8021fed in a worktree of the same clone, those same suites give the SAME
numbers
— tests/trust-anchor tests/openxwallet_pin tests/clearing → 93 failed, 195 passed, 50 errors on both — and so does the whole of the rest of
the span the two stragglers sit in: tests/doc-health tests/signed_execution_chain tests/ideation-dashboard → 2 failed, 6856 passed, 31 skipped on main and
2 failed, 6856 passed, 31 skipped on this branch, the same two failures by
name. Nothing in this branch contributes to any of them. CI initializes the
submodule before the suite, which is why it sees skipped=21 and no failures at
all.

The suites adjacent to the changed files, at the fix-round head — every
suite that reads proposal-support.py, the pin, or the doc-health catalog:

$ python3 -m pytest tests/doc-health tests/openspec_cli_pin tests/notebooklm -q
1913 passed, 7 warnings, 37 subtests passed in 343.16s

Not taken

  • An upstream --date flag. The pin is content-addressed at 1.12.0; a
    bump is a governed contract act (Bump the OpenSpec CLI pin to 1.12.0 with two cited dispositions #677), not a line in this PR.
  • A doc-only "run archives under UTC" rule. The estate already had that
    convention everywhere else; what it lacked was a mechanism, and a rule with no
    mechanism is what produced Archive publish-openspec-cli-pin-as-contract-member: the pin's registration promoted into neutral-product-pin canon (#754) #780's directory.
  • Re-seeding the 124 rows whose moved_on is later than their directory.
    They are not defects — see arm (d) — and a seeder that rewrote them would make
    every re-seed a 124-row diff.
  • The delayed-flip reading (Codex round 2's third finding): whether a repair
    re-seed that flips a long-archived row should stamp the repair's own day rather
    than the archive's. Refused here as a governed reading of
    release-realization, named in the code, and left as a successor.
  • The archive-directory-versus-adding-commit arm. Measured (12 of 144
    disagree, 10 of them by exactly one day in Archive publish-openspec-cli-pin-as-contract-member: the pin's registration promoted into neutral-product-pin canon (#754) #780's own direction, the other two
    the initial import) and named as the successor; it is the arm that would catch a behind-UTC clock estate-wide,
    and it is not a line in this PR.
  • A re-seed of the ledger. LEDGER_HEADER gained comment lines the committed
    file does not carry; they land at the next real seed. Re-seeding 185 rows to
    pick up a header comment would put a 185-row diff in a PR about a date.
  • Nothing under openspec/ is touched: no change directory, no archive, no
    spec. git diff --name-only origin/main...HEAD is exactly seven paths — the
    three scripts, three test files and the one doc — and grep '^openspec/'
    over it is empty.

No OpenSpec change. This is a plain implementation repair rather than a
governance act — the precedent is the change-free remediation PR #638, and #723
and #752 after it — on Brett Heap's word 2026-09-08 ("do it"), after this lane's
assessment of #780's archive.

Closes #790

🤖 Generated with Claude Code

https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb

brettheap and others added 2 commits September 8, 2026 08:46
`proposal-support.py archive` and `validate-sequenced-after.py --seed-ledger`
both took their date from the machine's LOCAL clock, while the pinned OpenSpec
CLI — which is what actually names `openspec/changes/archive/<date>-<change>/`
and accepts no date option — took it from ITS local clock, and nothing compared
the three. A 23:35-local archive produced a `2026-09-07-` directory on a UTC
2026-09-08 day (issue #790, PR #780's packet).

Four arms:

(a) The archive date is derived ONCE as today in UTC (`utc_today()`), it is what
    `--date` defaults to for `transition`, `package` and `archive`, and the CLI
    child is handed `TZ=UTC` MERGED into `validation_environment()` (never
    substituted for it, and SET rather than defaulted, because the operator's
    ambient TZ is the input that produced the defect). An explicit `--date` that
    is not today in UTC is refused before the CLI runs, since the CLI could not
    honour it.

(b) After the CLI returns, the directory it created is asserted to be exactly
    `<date>-<change>`; anything else — a wrong day, no directory at all, more
    than one — is a named `ArchiveDateRefusal` (exit 2, a third refusal beside
    OriginRetentionError and PinnedCliRefusal) that reverts the move, reverts
    the CLI's spec edits ONLY when `openspec/specs/` was clean before the run,
    and says what it did not revert.

(c) `--seed-ledger`'s `--moved-on` defaults to today in UTC, a moved archived
    row takes `moved_on` from its directory's date prefix (they are one fact),
    and an explicit `--moved-on` that such a directory contradicts is refused
    rather than silently overridden. An unmoved row is still never restamped.

(d) The plain `validate-sequenced-after.py .` run reports every archived row
    whose `moved_on` is not its directory's date. It ships as a WARNING class:
    124 of the 143 archived rows already disagree, because `moved_on` has until
    now meant "the date this row was last re-seeded". `--strict-archive-dates`
    gates on the same findings, and is what the repair proves itself with. This
    commit does not re-seed those rows.

+22 tests. Three existing fixtures moved and disclosed in the pull request: the
`recorded` CLI double now performs the archive move, two archive-date literals
became `utc_today()`, and one seeder test dropped a `--moved-on` that arm (c)
now refuses (gaining a stronger, clock-independent assertion in its place).

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI lite review requested due to automatic review settings September 8, 2026 12:48

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

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

@codex review

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

There are confirmed test/doc reliability issues in the changed hunks (midnight-UTC flake risk from repeated utc_today() calls in tests, and a broken multiline inline-code span in docs) that should be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes a real UTC/local-time mismatch across the archive workflow by standardizing date stamping to UTC, forcing the pinned OpenSpec CLI to run under TZ=UTC, asserting the archived directory’s <YYYY-MM-DD>-<id> name, and wiring a new validator arm to detect (and optionally gate) archive-date drift between archived directories and per-change sweep ledger rows.

Changes:

  • Add a single UTC “today” clock (utc_today() / _utc_today()) and apply it to proposal-support archive packaging + sequenced-after seeding defaults.
  • Force the pinned OpenSpec CLI archive subprocess to run with TZ=UTC, then assert the directory name matches the expected UTC date and refuse/revert on mismatch.
  • Extend the per-change sweep tooling to (a) derive archived moved_on from the archive directory prefix when rows move, and (b) report archive-date drift on plain validation runs with an optional strict gating flag.
File summaries
File Description
scripts/proposal-support.py Introduces UTC date source, injects TZ=UTC for pinned CLI archive, and asserts/refuses mismatched archive directory dates.
scripts/sequenced_after.py Adds archive-date extraction and a drift detector; updates ledger rendering to use archive directory dates for moved archived rows.
scripts/validate-sequenced-after.py Switches seed defaults to UTC, adds strict archive-date gating option, and prints archive-date agreement warnings on plain runs.
tests/proposal-support/test_pinned_openspec_cli.py Adds/updates tests for TZ injection, refusal/revert behavior, and date-rule help text.
tests/proposal-support/test_proposal_support.py Updates archive wrapper tests to use UTC-derived dates and assert packaged_at aligns with directory naming.
tests/sequenced_after/test_sweep.py Adds tests covering archive-date ↔ moved_on agreement and the new strict/warn behaviors.
docs/document-lifecycle.md Documents UTC archive-date behavior and the new refusal semantics.
Review details
  • Files reviewed: 7/7 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 tests/sequenced_after/test_sweep.py Resolved
Comment thread docs/document-lifecycle.md 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: 4b7fb4dcad

ℹ️ 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/sequenced_after.py Resolved
Comment thread scripts/sequenced_after.py Resolved
Comment thread scripts/proposal-support.py Resolved
- `test_archive_wrapper_preserves_bundle` and its bundleless sibling read
  `utc_today()` ONCE into a local and assert against it, rather than calling it
  again for `packaged_at` and for the directory prefix: a run crossing midnight
  UTC between the archive and the assertions would have compared two different
  days and failed for the calendar. The wrapper derives the date once for the
  same reason, so the fixture now states the same property it does.
- `test_the_SEEDER_takes_an_ARCHIVED_rows_moved_on_FROM_ITS_DIRECTORY` brackets
  the seeder's child process with a before/after UTC reading and asserts the
  active row's `moved_on` is one of the two, plus an anti-vacuity assertion that
  it differs from the archived row's. The claim under test is "the active row
  took a UTC date from the run", which the bracket states without inviting a
  nightly flake.
- `docs/document-lifecycle.md`: the `proposal-support.py archive` code span no
  longer straddles a line break, and the paragraph is rewrapped inside the
  corpus's column width. (CommonMark does convert a line ending inside a code
  span to a space, so the previous text rendered; keeping the span whole costs
  nothing and removes the question.)

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 12:54

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

The new archive-date refusal messaging in scripts/proposal-support.py can misattribute mismatch causes (e.g., “no new directory” / multiple dirs) to “clock not UTC,” which would mislead operators during a refusal.

Review details

Suppressed comments (2)

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

scripts/proposal-support.py:1772

  • The refusal message unconditionally claims the CLI’s clock is not UTC, but this branch also handles cases where the CLI created no archive directory (or multiple). That wording will be misleading in those scenarios; make the message describe the actual mismatch (expected vs observed) without asserting a specific cause.

This issue also appears on line 1817 of the same file.

scripts/proposal-support.py:1821

  • This guidance line assumes any mismatch means the child ignored TZ=UTC, but mismatches also include "" or multiple directories, where the cause isn’t necessarily timezone-related. Make the remediation text accurate for all mismatch cases, and treat TZ-ignoring as only one possible cause.
    lines.append(
        f"  The archive is REFUSED rather than committed under a name that "
        f"states a day it did not happen on. Re-run once the CLI names "
        f"'{want}'; this wrapper already hands it TZ=UTC, so a mismatch means "
        f"the child ignored it.")
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…permits

Codex cited `openspec/specs/release-realization/spec.md`'s per-subject-row
requirement — "a row SHALL record, as provenance, the pull request that last
moved it AND THE DATE" — against both ledger arms, and it is right on both.

(c) The archive date is now taken ONLY at the FLIP (`flips_to_archived`: the
    row had a predecessor whose state was `active` and now reads `archived`).
    At that one moment the row's move and the archive are the same act, because
    the archiving change seeds its own row. Every other archived row keeps the
    run's date: a September pull request that flips an already-archived row
    from sole to co-modifier moved it in September, and writing the August
    archive date beside a September `moved_by` would make the pair state two
    different moves. A row CREATED for a change that was already archived is
    likewise not a flip — its move is its creation. This also restores
    `test_the_SEED_LEDGER_cli_writes_a_ledger_the_diff_then_ACCEPTS` to its
    pre-existing form: one of the three fixture edits is no longer needed.

(d) The plain run now GATES (exit 1) on the one direction that is a
    contradiction under any reading: an archived row whose `moved_on` PREDATES
    the directory it describes claims a move older than the archive that made
    it archived. Measured across the live corpus before it was made a gate —
    143 archived rows, 0 findings, versus 124 for the equality reading — so it
    ships as an error rather than as a warning, which is what the issue asked
    for and what the previous commit could not deliver. The equality reading
    the issue proposed is KEPT behind `--strict-archive-dates` rather than
    dropped, and named there as the stronger reading 124 legitimate rows do not
    satisfy.

    Neither reading catches a clock running BEHIND UTC — #780's own direction —
    because a later `moved_on` is indistinguishable from a legitimate later
    move. That direction is caught where it happens, by the archive wrapper's
    assertion on the directory name. Stated in the docstring rather than left
    to be discovered.

    `--seed-ledger` gains the matching refusal: a flipping row whose directory
    is dated AFTER today in UTC is refused before it is stamped, since that
    directory was named by a clock running ahead of UTC and stamping its date
    would write the contradiction the validator gates on.

Also taken, Codex P2: the spec rollback in `assert_archived_directory_date`
reads `git checkout -- openspec/specs`'s return code. A discarded status let the
refusal claim a revert that had not happened — an index lock taken between the
cleanliness read and the revert is enough — and the operator would have left the
CLI's spec edits in a tree they were told was clean. A failed revert is now
named, with git's own output, as NOT reverted.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 13:03
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Round 2 requested at 543d418f. All six round-1 findings TAKEN — three from Copilot (midnight-straddling clock reads in two fixtures; the split inline code span) in 948c6664, three from Codex (the release-realization provenance definition against arms (c) and (d); the unchecked git checkout status) in 543d418f. The two Codex findings changed the design, not just the wording:

  • (c) narrowed to the FLIP. The archive date is stamped only when a row moves from active to archived — where the row's move and the archive are the same act. An already-archived row moved later by another change, and a new row for a change that was already archived, both keep the run's UTC date, because release-realization defines moved_on as the date THAT move happened.
  • (d) gates on the contradiction, not on equality. The plain run now exits 1 when an archived row's moved_on PREDATES its directory — impossible under any reading, and the shape an ahead-of-UTC clock produces. Measured across the live corpus before it was made a gate: 0 findings for that direction, against 124 for the equality reading (which is now opt-in behind --strict-archive-dates). So the arm ships as an ERROR rather than the WARNING the first cut needed.

@codex review

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

There is a confirmed risk of flaky tests in tests/proposal-support/test_pinned_openspec_cli.py due to multiple utc_today() reads that can straddle midnight UTC, and the --moved-on help text in validate-sequenced-after.py is now inconsistent with the UTC default behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread scripts/validate-sequenced-after.py Resolved
… in --help

- `tests/proposal-support/test_pinned_openspec_cli.py`: the `recorded` fixture
  freezes `support.utc_today()` once, on the module both the test and the double
  read it from. The fixture named the archive directory from one reading and the
  test passed `--date` from another, so a run straddling midnight UTC would have
  made the wrapper CORRECTLY refuse `archive-date-mismatch` — a green assertion
  turned into a nightly flake by the calendar rather than by the code.
- `scripts/validate-sequenced-after.py`: `--moved-on`'s argparse help said
  "default: today" while the code had moved to today in UTC. It now says so, and
  names the flip rule and the refusal beside it. `--help` is where an operator
  meets this rule.
- Also, unflagged and beside them: `_seed_ledger_inner` reads today in UTC ONCE
  and reuses it for both the ahead-clock refusal and the stamp. Two readings
  straddling midnight would have refused against one date and written another.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 13:09
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 543d418fe1

ℹ️ 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".

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

It changes critical archiving/ledger-seeding and CI-gating behavior (including new refusal/revert paths), so a final human review should validate the operational implications end-to-end.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FROZEN at 652a8116. All nine checks SUCCESS — pytest-suite 20m42s, selected=10379 passed=10358 skipped=21 failures=0 errors=0 (the skip-pin's 21, exactly). closingIssuesReferences = [790]. No openspec/ path in the diff, so no Rule 6 window is open. Eight review threads, all resolved: Copilot 3 + 2, Codex 3, every one taken.

Bench summary:

  • Copilot round 1 (3): two fixtures read utc_today() more than once and would flake across midnight UTC; a code span straddled a line break. All three taken in 948c6664.
  • Codex round 1 (3): the release-realization per-subject-row requirement against arms (c) and (d), and an unchecked git checkout status. All three taken in 543d418f — and the first two changed the design, not the wording: (c) is now the FLIP only, and (d) gates on the contradiction (moved_on PREDATING its directory, 0 on the live corpus) rather than on equality (124, every one a legitimate later move, now opt-in behind --strict-archive-dates).
  • Copilot round 2 (2): the recorded fixture's clock, and --moved-on's help still saying "today". Both taken in 652a8116.
  • Sourcery is the usual upsell stub — ABSENCE, not a review.

Not merged, not approved, no LANDING posted — this lane does not merge it.

TWO ADVERSARIAL LENSES, RUN AGAINST THE REAL PINNED CLI. The major finding:
`subprocess.run(command, …, check=True)` raised `CalledProcessError` BEFORE
`assert_archived_directory_date` could run, and pinned
`@fission-ai/[email protected]` has three documented failure paths that occur
AFTER the move, each ending with the archive standing —
`MoveDestinationRetainedError` (`dist/core/archive.js:449`),
`RetirementBackupsRetainedError` (`:852`) and the rollback-failure rethrow
(`:1605-1617`) — plus the SIGINT that leaves a half-copied split. Every one of
them left a directory nothing named and nothing date-checked, exit 1, no
revert; the operator was told only that a subprocess had failed. Proven on the
pre-fix head with a shim: wrong-day directory `2026-09-09-demo-clock` LEFT ON
DISK, active path gone, message "Command … returned non-zero exit status 1".

The child now runs with `check=False` and its status is an INPUT to the
inspection. Six outcomes, each named on its own terms:

  0        + `<date>-<change>/`, active gone  -> ok
  any      + a dir naming this change AND the active path still there
                                              -> REFUSE archive-split (2), nothing touched
  non-zero + nothing new, active still there  -> the child's own CalledProcessError (1)
  non-zero + `<date>-<change>/`, active gone  -> REFUSE archive-cli-failed (2), NOTHING reverted
  any      + a dir naming this change, other day -> REFUSE archive-date-mismatch (2), REVERTED
  any      + no dir naming this change        -> REFUSE archive-date-mismatch (2)

`ArchiveRefusal` is the new base; `ArchiveDateRefusal` keeps its meaning and
`ArchiveTreeRefusal` carries the two tree-shape refusals, which are NOT date
findings — the name on disk may be exactly right. Neither tree arm reverts: the
CLI's own move says why ("the destination is now the only complete copy, so
never erase it while trying to make this failed move look atomic").

Five smaller corrections, each one a case where the wrapper refused something
CORRECT or blamed something it could not know:

- `created == [want]` refused a correct archive when a sibling lane's directory
  landed beside it in a shared checkout, and its remedy told the operator to
  move BOTH back — one of them another change's. Now `want in created`, with
  the unexpected ones named as left alone and never as something to undo.
- `specs_are_clean` read `git status --porcelain` INCLUDING untracked files, so
  a stray note under `openspec/specs/` disabled the revert of the CLI's TRACKED
  spec edits — which `git checkout --` could never have harmed — and blamed the
  operator for uncommitted work they had not done. Now `--untracked-files=no`.
  Observed on the real CLI: pre-fix, the CLI's edit SURVIVED in the tree.
- The refusal asserted "the CLI's clock is not UTC" in three cases it cannot
  know: a run crossing midnight UTC (the day is now RE-READ after the child and
  the crossing named), two directories (never blamed on a clock), and a change
  id that already carries a `YYYY-MM-DD-` prefix — which the pinned CLI
  deliberately does not re-prefix (`archive.js:27`, upstream #1309), so the
  wrapper falsely refused AND REVERTED a correct archive. `want` is now computed
  the way the CLI computes it.
- `git checkout -- openspec/specs` exits 1 "pathspec did not match" where git
  tracks nothing there; that was printed as a FAILED revert with "undo them by
  hand", sending an operator after tracked edits that cannot exist.
- The (d) gate ignored the row's `state`, so a STALE `active` row for a
  disk-archived id was reported as an "archive-date contradiction" instead of by
  `--ledger-diff`'s stale-row class — one fact named twice, in two vocabularies
  with two different repairs.

And two notes taken: `--date ''` was silently defaulted by `args.date or today`
(a flag reported as honoured when nothing read it — now refused like any other
unhonourable date), and the comment claiming the merged environment exists "so
this process does not archive under one environment having validated under
another" stopped being true when `TZ` was added.

`validate-sequenced-after.py::_utc_today` had no test that could fail on a UTC
runner: the mutation `_utc_today -> date.today` passed the whole suite. It is
now frozen in a child process at 23:35 UTC under `Pacific/Kiritimati`, where the
two days are two days.

+41 tests (330 -> 371 across the three suites). Every arm carries a mutation
that fails at least one test; thirteen were run and all thirteen fail.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 14:48

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

It changes core archive/seeding/gating behavior with non-trivial filesystem and git side effects, so it warrants final human review despite strong test coverage.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 15:01

@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: 081a996294

ℹ️ 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/sequenced_after.py Resolved
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.

🔵 Needs a closer look

A few newly introduced docstrings/error messages are misleading in edge cases (e.g., implying the CLI “named” multiple/sibling directories and instructing “move them back by hand” in an ambiguous multi-directory scenario).

Review details

Suppressed comments (3)

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

scripts/proposal-support.py:2014

  • When more than one directory appears (or none appears), the refusal header says “the pinned CLI named the archive directory ''” / “A, B”, which isn’t strictly true (a sibling lane may have created one of the directories, or the child may have created none). Rewording this to “this run observed … under openspec/changes/archive/” keeps the message accurate while still reporting the on-disk facts.
    scripts/proposal-support.py:2034
  • In the multiple-“mine” directory case, the refusal message ends with “move them back by hand”, but this situation is explicitly described as ambiguous (the wrapper can’t know which directory is the correct one). Instructing an operator to move directories back suggests an atomic undo that may be unsafe; the message should instead direct the operator to compare/resolve the duplicates and keep exactly one copy.
    scripts/sequenced_after.py:383
  • The archive_dates docstring says an archived row’s moved_on records “the day the change entered canon”, but this PR explicitly allows (and tests) archived rows to carry a later moved_on when they were moved by a later change. This comment is misleading and can confuse readers about what the validator arm is checking.
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…refused with its reason

TWO P1s AND A P2, all three about a SHARED CHECKOUT — the case this repository
actually runs in — and two of them were mine to fix.

P1 (`proposal-support.py`): the no-move guard asked a GLOBAL question. `if
returncode != 0 and not created and active.exists()` re-raises the child's own
`CalledProcessError` when it failed having moved nothing — but `created` is every
new directory under `archive/`, so a sibling lane's archive landing between the
two readings made the condition false for a child that had touched NOTHING. The
run then fell through to the mismatch path, quoted the sibling's directory as
"the name the pinned CLI gave this change", and ran `git checkout --
openspec/specs` over a cleanliness reading taken before EITHER child — erasing
the concurrent archive's canonical spec edits. Every question the inspection asks
is now asked about `mine`: the guard, the name in the refusal, the diagnosis, and
the "child also exited" line. And a run that produced no directory of its own now
reverts NOTHING and says why — it has no spec edit of its own to undo, and in a
shared checkout the revert cannot tell whose edits it is discarding.

P2 (`names_this_change`): `2026-08-04-foo` is both a wrong-day archive of `foo`
and the archive of a change whose id IS `2026-08-04-foo` — the shape
`archive_directory_name` was just taught to support. The two readings are
indistinguishable FROM THE NAME, so the name no longer decides: the ACTIVE change
ids are READ BEFORE THE CHILD (a concurrent lane removes its own active directory
as it goes, so asked afterwards the question answers "no such change" for exactly
the directory it was asked about) and a new archive directory whose name was a
change id when the run started belongs to that change. With a control test
proving a real wrong-day copy is still reverted, so the precision was not bought
by disabling the arm.

P1 (`sequenced_after.py`, the delayed flip): REFUSED, with the reason written
into the code beside the branch. Codex is right that `flips_to_archived` cannot
tell "the archiving change seeded its own row" from "a later repair is seeding
it", and right that a delayed repair's row therefore states its pull request
beside the original archive's day. That is the reading arm (c) adopted: `moved_on`
is the date the ROW MOVED, and the move a flip records is the archive — which
happened when the directory says it did, whoever wrote the row down afterwards.
The alternative is defensible and would still pass the validator's archive-date
arm, but choosing between them re-reads `release-realization`'s per-subject-row
requirement and changes what every future flipped row means. That is not an
implementation detail to settle in a fix round at freeze; it is named in the code
and in the pull request as a successor.

+4 tests (371 -> 375). Four more mutations, all four failing: the guard reading
`created` again, a nothing-produced run reverting specs anyway, the dated-sibling
disambiguation dropped, and the active ids read after the child instead of before.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 15:09

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

The archive wrapper’s handling of date-prefixed change ids can conflict with repo-wide archive directory parsing conventions, and related docs/docstrings currently overclaim “one date” semantics without qualifying the exception.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread scripts/proposal-support.py Resolved
Comment thread docs/document-lifecycle.md Resolved
Comment thread scripts/sequenced_after.py Resolved
Prose only — no behaviour, no test, no new surface — and taken because they are
exactly the defect class this whole branch is about: a sentence that states more
than the code delivers.

1. `docs/document-lifecycle.md` said "the bundle's `packaged_at` and the
   directory name are one date" UNCONDITIONALLY, two sentences after naming the
   exception itself: a change id already carrying a `YYYY-MM-DD-` prefix keeps
   it, so its directory takes the date IN THE ID while the bundle beside it
   takes today. The paragraph now carries the exception on the claim rather than
   beside it.

2. `archive_dates()`'s docstring said the directory date "is what `moved_on`
   records for an archived row" — a promise of equality this estate does not
   keep and the validator deliberately does not require. `render_ledger` applies
   the mapping to rows FLIPPING `active` -> `archived` and to nothing else;
   `archive_date_problems` gates only on the one direction no reading permits;
   equality is `--strict-archive-dates`, and 124 of this corpus's 144 archived
   rows legitimately carry a LATER date. Corrected, with the numbers, so the
   next reader does not infer a rule the arm was narrowed to avoid.

The third finding — refuse archiving a change id that already carries a date
prefix — is REFUSED here and named as a successor. Its underlying observation is
real and measured: `ARCHIVE_DIR` (`^(?P<date>\d{4}-\d{2}-\d{2})-(?P<id>.+)$`)
reads `archive/2026-08-04-foo` as id `foo` dated `2026-08-04`, so such an id IS
recovered wrongly by every reader downstream of the archive. But that ambiguity
is PRE-EXISTING — it belongs to `ARCHIVE_DIR` and to the pinned CLI's own
`#1309` behaviour, neither of which this branch introduced — and refusing an id
shape the pinned CLI supports is a governed change to what the estate accepts,
not a line in a fix round under a merge word. This estate has no such id today
(every archived directory is `<date>-<undated-id>`).

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb
Copilot AI review requested due to automatic review settings September 8, 2026 15:26

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.

🟢 Approval recommended

The UTC standardization and new gate/seeder behaviors are coherently implemented, extensively tested (including adversarial edge cases), and the documentation was updated to match the actual operational semantics.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FROZEN at fcb9e35c. All NINE checks SUCCESS — pytest-suite 22m55s,
selected=10427 passed=10406 skipped=21 failures=0 errors=0 (the skip-pin's 21,
exactly). closingIssuesReferences = [790], one closing keyword in the body.
Zero unresolved review threads (15 of 15 resolved). No openspec/ path: the
diff is seven files — three scripts, three test files, one doc.
mergeStateStatus is BLOCKED on the code-owner-review requirement alone, which
is the coordinator's to clear; the branch does not need a merge from main (every
required-status ruleset is strict: false, checked).

Four commits on top of the merge 2730661b:

commit what
081a9962 the fix round — the tree is inspected on EVERY exit status, plus six smaller corrections
da5e8162 Copilot round 3 — taken as clarity, the finding's premise corrected
36eb8ee5 the doc names the CLI's own naming rule rather than implying it refuses one
81b5ee3b Codex round 2 — both shared-checkout P1s taken, the flip reading refused with its reason
fcb9e35c Copilot round 4 — two claims THIS PR makes that are not true

The MAJOR, measured on the pre-fix head: check=True raised where the
inspection would have run, so a wrong-day directory 2026-09-09-demo-clock was
LEFT ON DISK with the active path gone and the operator told only "Command …
returned non-zero exit status 1". The pinned CLI has three documented
after-the-move failures that each end with the archive standing
(archive.js:449, :852, :1605-1617), plus the SIGINT that leaves a split.

Verification at the frozen head: 375 passed, 2 subtests across
tests/proposal-support tests/sequenced_after tests/scope_globs (main
3504287a: 330) — 95 / 195 / 85. Nineteen mutations run; seventeen fail at
least one test and the two that survive ARE the finding
(an empty --moved-on
is refused twice over, so the or Copilot flagged was unreachable). Live corpus:
plain run exit 0 (41 active, 8 declaring; no archived row's moved_on predates
its directory), --strict-archive-dates 124 findings exit 1, --ledger-diff
consistent at 185 rows exit 0. doc-health --single-repo . — the finding set is
byte-identical to the same run with this round removed; only the two corpus
word counts move (+107, the docs edit). tests/doc-health tests/openspec_cli_pin tests/notebooklm → 1913 passed locally. Ten demos re-run against the REAL
pinned CLI in throwaway repos, each of the three new arms with a pre-fix control
beside it. Nothing real was archived.

Named as successors, not done here: the delayed-flip reading (Codex round 2's
third finding — whether a repair re-seed should stamp its own day rather than the
archive's; a governed reading of release-realization, written into the code);
refusing a change id that already carries a date prefix (Copilot round 4 — real
and measured: ARCHIVE_DIR reads archive/2026-08-04-foo as id foo, but the
ambiguity is pre-existing and the shape is one the pinned CLI supports); the
archive-directory-versus-adding-commit arm (12 of 144 disagree). No ledger
re-seed: LEDGER_HEADER's new lines land at the next real seed rather than as a
185-row diff in a PR about a date.

The coordinator lands fcb9e35c.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FROZEN at fcb9e35c — all nine required checks green (pytest-suite 10406 passed / 21 skipped — pinned skip count met), no further commits from this lane. Review threads: 15 total, 0 unresolved. Codex: two real rounds (round 1 narrowed arms (c)/(d) to what release-realization permits; round 2's two shared-checkout P1s taken, its delayed-flip P1 refused as a governed reading and written into the code). Copilot: four rounds, all taken or refused with a measurement. Two-lens adversarial review (correctness against the REAL pinned CLI; over-reach/record) → 1 MAJOR + 6 MINOR + NOTEs → all taken at 081a9962… fcb9e35c: a failed CLI exit after the move no longer bypasses the inspection (six named outcomes; a wrong-day directory can no longer be left silently); concurrent archives are never blamed or undone; untracked files no longer disable the specs revert; the refusal no longer asserts a diagnosis it cannot know; the seeder's UTC default is testable; the (d) gate respects row state. Tests 330 → 375; 17 of 19 mutations caught (the two survivors are an unreachable or). No openspec/ path — no Rule 6 window.

Provenance for the admin merge of #797 (plain fix; no OpenSpec change — the #638/#752 precedent). Words: Brett Heap, 2026-09-08 ~04:4xZ verbatim "do it" (after the lane's assessment on #780's wrong-day archive; filed + claimed as #790), ~05:5xZ verbatim "merge 797 when green" and ~14:4xZ verbatim "land 797 when green, then author 812" (recorded on #790/#812). Design narrowing disclosed: release-realization (spec.md:349-351) makes a ledger row's date the date of its LAST MOVE, so moved_on takes the directory date only at the active→archived flip and the plain run gates on contradiction (0 rows today); equality drift (124 rows) stays behind --strict-archive-dates. Successor named and ruled: #812 (directory date vs adding commit; ten past archives one day early — rule 1 + 2a, this lane authors it next). Self-authored PR (brettheap) → REVIEW_REQUIRED structural → admin merge (B2). #790 closes with this merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JZqmqSDBCmY4cfhPbxN9Xb

@brettheap
brettheap merged commit 1ef2690 into main Sep 8, 2026
13 checks passed
brettheap added a commit that referenced this pull request Sep 8, 2026
…py tests

MERGED origin/main (1ef2690), which lands #797 — `proposal-support` and the
ledger seeder taking TZ=UTC. Two things it brought needed answering.

ONE MERGE CONFLICT, taken as a union: `tests/proposal-support/test_pinned_openspec_cli.py`
gained `import os` on main while this branch gained `import json`; both are used
and both are kept.

AND ONE REAL FINDING FROM MY OWN NEW TEST. #797 documents `@fission-ai/[email protected]`'s
three archive failure paths in three FUNCTION docstrings of
`scripts/proposal-support.py`, and `test_every_caller_of_the_resolver_hands_it_the_closure`
read them as restatements of the pin. The test was right to look and wrong about
where prose lives: it stripped only the MODULE docstring and `#` comments, which
is the two workflow tests' rule transposed to Python without noticing that Python
puts most of its prose inside functions.

`running_lines()` now walks the AST for EVERY bare string expression and drops
those line ranges along with the comments, so the rule reads as it was always
meant to: a line that RUNS may not restate the pin; a line that EXPLAINS may
quote it. The narrative #797 added is exactly the kind of writing that rule
protects — it names the version whose behaviour it describes — and the assertion
is now sharper rather than looser: it still refuses a literal anywhere in running
code, in both files, including the four values this change introduced. Shared by
the installer test, which was doing the same thing the same wrong way.

Re-run after the merge, with the pinned CLI on PATH and TZ=UTC as #797's own
gate now sets:
  pytest tests/proposal-support tests/openspec_cli_pin tests/sequenced_after -q
  -> 414 passed, 2 subtests passed
  validate-sequenced-after.py --ledger-diff -> consistent (186 rows)
  openspec validate pin-openspec-cli-dependency-closure --strict -> valid

Lane: codexfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UQzYv1nEcjEkidnMUCaJcB
brettheap added a commit that referenced this pull request Sep 9, 2026
… (moved by #825)

tasks.md § 4.3 of the archived packet requires the row to be re-seeded at the
archive (state: active -> state: archived) and --ledger-diff re-run clean at the
head the archive record cites. Its own commit, because the --moved-by pull
request number does not exist until the pull request does.

Performed with the tool rather than by hand:
python3 scripts/validate-sequenced-after.py . --seed-ledger --moved-by '#825'
-> "wrote tests/sequenced_after/corpus-ledger.yaml (188 rows, 1 moved by #825)".

THE DIFF IS THE CHECK, AND IT IS ONE LINE. Exactly one row moves — this change's
own — and git diff --numstat reads 1/1 on the file, so no other row moved and no
header line moved either. class: stays co-modifier and declares: stays
[admit-install-repos-to-aggregation] at depth 1: the ledger's corpus includes
ARCHIVED changes and admit-install-repos-to-aggregation wrote the same
requirement key in August, which is a fact about HISTORY and not a live
collision (design.md D2 measures the absence of the live one). moved_on takes
2026-09-09, the date the
archive/2026-09-09-refresh-install-repository-enumerations directory carries,
which is the reading the ledger's own header requires of a row flipping active
-> archived.

A PREDICTED SECOND HUNK DID NOT MATERIALISE, AND THAT IS WORTH RECORDING RATHER
THAN QUIETLY WELCOMING. A dry run on 2026-09-09 against origin/main at 6da9430
had the seed ALSO rewrite seven lines of the file's own moved_on header comment,
because the tool's template grew the UTC/archive-date paragraph when the #790
fix landed as #797 (1ef2690) after the file was last seeded. Between that dry
run and this act, #817 seeded the ledger from the current template and carried
that header refresh, so nothing was owed here. The pull request body's
disclosure of the hunk is corrected in a comment rather than silently dropped.

Re-verified at this head: --ledger-diff prints "per-change sweep ledger
consistent with the corpus (188 rows)", and the plain run passes 43 active
changes / 10 declaring the field with archive-date agreement clean.

Refs #796, #630

Lane: openxfactory-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FKW67VtDcES9dAs8qdqZ9u
brettheap added a commit that referenced this pull request Sep 9, 2026
…use-4 row is re-measured

Codex P2 on head eed1444, and it is right: `assert set(renamed) ==
set(RENAMED)` was the same defect as the MINOR one level further in. The header
grants a later MEASURED rename inside `archive/` its own lawful entry and the
validator accepts one, so pinning the set would red the suite for exactly the
repair the record permits. Demonstrated: with a synthetic third cause-4 row the
equality is False and the subset is True.

Taken two ways. The set assertion is now `set(RENAMED) <= set(renamed)`. And
the live cause-4 test is GENERALISED OVER THE RECORD rather than written
against the two known names, so a later entry meets the same standard instead
of escaping the check: for EVERY row whose fact begins `renamed within
archive/`, its `adding_commit` must not be the root, must have exactly one
parent, must appear in the fact, the fact must name a SECOND full object name,
`git show --name-status -M <adding_commit>` must really carry a rename whose
destination is that directory, and at least one cited second name must be a
commit whose UTC day EQUALS the date the directory carries. The two rows this
corpus carries additionally pin the name they were renamed FROM and the act
they cite.

CAUSE 1 STAYS PINNED AT TEN, deliberately and with the reason written down: the
header states cause 1 CANNOT RECUR through the wrapper, which has owned the
clock at the archive act since #797, so an eleventh clock row would mean the
wrapper was bypassed and should red rather than pass.

40 passed in the arm's file, 415 in the bench, live corpus green with 0
undispositioned and 12 in force.

Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XPt6t1VcNVB5yGzQGwWUFi
brettheap added a commit that referenced this pull request Sep 9, 2026
…ories in the four enumerations; Purpose widened (§ 4.1) (#825)

* Tick refresh-install-repository-enumerations § 3 and § 4 at the archive: six confirmed dispositions, the Purpose widening on the doing, #796 on the recording

`scripts/proposal-support.py … archive` refuses a packet carrying any `- [ ]`
("change has incomplete tasks"), so the nine boxes § 1 and § 2 do not own must
close before the archive can run. This commit closes them and says, box by box,
what KIND of close each one is. It is the one lawful post-ratification edit to
this packet: proposal.md, design.md, .openspec.yaml and the three deltas are
untouched.

§ 3 IS SIX STATEMENTS OF WHAT THE PACKET DOES NOT DO, AND EVERY ONE IS TICKED AS
A CONFIRMED DISPOSITION RATHER THAN AS WORK PERFORMED. Each clause says the
statement was RE-MEASURED at this commit and what the measurement read. § 3.2,
§ 3.3, § 3.4 and § 3.5 hold unqualified and are re-measured over both pull
requests: no script, workflow or test; no contract, register, digest inventory,
version or tag; no repository created, admitted, renamed, re-pinned or retired
and no submodule pointer anywhere in the estate; and both named candidate sites
still unedited, with NO issue filed at this archive at all. § 3.6 is re-measured
in the promoted file the archive rewrites: "Install repo scope links" is one of
the seven repo-boundary-governance requirements this archive does not name, and
its bytes are identical on both sides of the promotion.

§ 3.1 IS THE ONE PLACE THE ARCHIVE ACT ITSELF MOVES WHAT A BOX NAMES, AND ITS
CLAUSE SAYS SO IN TERMS. The statement is about the PACKET'S OWN DIFF and it
held exactly as written: #818 -> 6da9430 names nine files and no file under
openspec/specs/. The archive commit promotes the deltas into all three of those
files, which is the act proposal.md reserves for the archive ("canon is written
by the archive act") and which § 4 books. The tick claims the measurement at
#818, never that canon is untouched at this commit.

§ 4 IS THREE TICKS OF TWO KINDS, ON A WORD DISTINCT FROM THE RATIFICATION. Brett
Heap, 2026-09-09 ~00:3xZ, in session, verbatim "archive
refresh-install-repository-enumerations", recorded on #591 and given directly
after his separate "ratify refresh-install-repository-enumerations" (~00:2xZ).
§ 4.1 and § 4.3 tick ON THE DOING — the Purpose widening lands in this pull
request in its own commit and its own hunk, and the sweep-ledger row is
re-seeded in its own commit once the pull request number exists. § 4.2 ticks ON
THE RECORDING under the ruling of 2026-09-06 ("Tick on the recording"): #796 IS
OPEN AT THIS COMMIT, its closing is held by the landing lane because the closing
comment must name an archive commit whose merge sha does not exist until the
merge, and the clause drafts that comment's content in full so the record does
not depend on the comment being posted from this lane.

NO TICK CLAIMS WORK THAT WAS NOT DONE, AND NO BOX'S RATIFIED SENTENCE IS
REWRITTEN, WEAKENED OR DELETED. The ratified body of all nine boxes is carried
BYTE-IDENTICAL beneath its archive-time clause, extracted from the ratified file
programmatically rather than retyped and verified as an exact tail of each
rewritten box. The header paragraph that declared every box unticked is likewise
quoted in place and extended by a dated disposition naming which of its clauses
the archive moves and which two still hold unqualified.

§ 1 and § 2 are NOT touched here: they are the ratification's boxes and the
authoring evidence, and they tick in their own act.

Refs #796, #818, #591

Lane: openxfactory-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FKW67VtDcES9dAs8qdqZ9u

* Archive refresh-install-repository-enumerations: the four hand enumerations promoted into canon, five install repositories in all of them

On Brett Heap's separate word of 2026-09-09 (~00:3xZ, in session, verbatim
"archive refresh-install-repository-enumerations"), recorded and claimed on
openxFactory #591 and given directly after his ratifying word "ratify
refresh-install-repository-enumerations" (~00:24Z, comment 5593837071) — two
acts on two words, in the order release-realization requires.

THE GATE, BOTH HALVES. code_surface: none and target_release: implemented, so
per release-realization this packet archives ON LANDING rather than on
merged-plus-green realization evidence. The ratification landed at PR #822 ->
squash 5fb0851 (2026-09-09T01:30:06Z) and that same commit is the RATIFYING
COMMIT the origin gate retained against: ORIGIN RETAINED, declaration unchanged
since 5fb0851. The authoring landed at #818 -> 6da9430.

PERFORMED THROUGH THE PINNED CLI, never a bare openspec archive:
python3 scripts/proposal-support.py . archive
refresh-install-repository-enumerations --date 2026-09-09 --yes, resolving
@fission-ai/[email protected] from the content-addressed pin cache, integrity
sha512-oFE2Lj7WVSc87nSi… verified, no registry fetch. Task status ✓ Complete,
Totals: + 1, ~ 6, - 0, NO SUPPORTING DOCS (the change has no supporting-docs
folder, so nothing was packaged and nothing needed to be).

WHAT WAS PROMOTED, COMPARED RATHER THAN EYEBALLED. Six MODIFIED requirements
and one ADDED, across three capabilities. All seven blocks were extracted
programmatically from delta and canon and hashed, and every pair is
BYTE-IDENTICAL: Install repository scope 2,879 B; Canonical workflow authority
2,508 B; Copy-first migration 2,178 B; the ADDED "Install-repository
enumerations are an index with a named authority" 4,344 B; Contract version
pinning 4,082 B; Submodule sequencing 1,952 B; Contract provenance and
compatibility 1,666 B. NOT ONE OTHER REQUIREMENT MOVED — the 19 requirements
the deltas do not name are byte-identical before and after. repo-boundary-
governance goes 10 -> 11; shared-contract-ownership stays 12 and canonical-
contract-migration stays 3. No file is added under openspec/specs/, so no
codexFactory floor advance is owed.

TWO INCIDENTAL HUNKS ARE THE SERIALIZER'S, NOT AN AUTHORED EDIT, AND THEY ARE
DISCLOSED RATHER THAN LEFT TO A REVIEWER. The pinned CLI rewrites each spec file
it modifies from its own parse, so in the two capabilities whose blank-line
layout differed from its canonical form it added a blank line either side of
"## Requirements" and collapsed a trailing double newline: that is the whole of
canonical-contract-migration's -2 and shared-contract-ownership's -3.
repo-boundary-governance needed neither. Established archive-tool behaviour —
eleven previous archive commits in this corpus carry the same hunk — and no
requirement byte is affected by it.

THE EIGHT FROZEN FILES ARE PURE RENAMES. git diff -M --numstat reports 0 0 on
.openspec.yaml, design.md, proposal.md, tasks.md, the three deltas and
review/ratification-2026-09-09.md. tasks.md's one lawful tick commit landed
BEFORE the serializer's output so it is separable from it.

The README OpenSpec Records row moves active -> archived BY HAND — proposal-
support does not move it (substrate row, claimed for this change on #630).

NOT DONE HERE, AND EACH IS RE-MEASURED IN tasks.md § 3: no script, workflow or
test; no contract, register, digest inventory, version or annotated tag
(release-tag-gate does not fire, the diff touching no contracts/ path); no
repository created, admitted, renamed, re-pinned or retired and no submodule
pointer anywhere in the estate; both named candidate sites still unedited and NO
issue filed at this archive at all. openxFactory#796 is NOT closed by this
commit and is OPEN at it — § 4.2 ticks on the recording and names the landing
lane as the holder, because the closing comment must name an archive commit
whose merge sha does not exist until the merge.

The repo-boundary-governance ## Purpose widening owed by tasks.md § 4.1 is taken
in the FOLLOWING commit, so it is separable from the serializer's output — the
shape publish-openspec-cli-pin-as-contract-member used at its own archive
(promotion 26c2661, then widening e067236).

Refs #796, #818, #591, #630

Lane: openxfactory-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FKW67VtDcES9dAs8qdqZ9u

* Widen repo-boundary-governance's Purpose to name all five install repositories the capability governs (§ 4.1)

tasks.md § 4.1 of refresh-install-repository-enumerations declared this owed AT
THE ARCHIVE and said why: a "## Purpose" in a change's spec delta is read ONLY
at capability creation and is ignored on any later archive, "so this edit is
made in the PROMOTED specification, in the archive commit, in a hunk SEPARATE
from the promotion". design.md D6 records the same reading, and confirmed it
mechanically: a grep for ^## Purpose across every archived change's
specs/*/spec.md returns NOTHING, so no packet in this corpus has ever shipped a
Purpose through a delta. The ratification (#822 -> 5fb0851) is the authority
#803 lacked when it declined exactly this edit for exactly the right reason.

THE ENUMERATION WAS THE FOURTH AND FURTHEST BEHIND. The block had not moved
since 9ebceef (2026-06-26) — 74 days — and named TWO install repositories,
while the capability's own "Install repository scope" requirement enumerated
four before this archive and five after, and its promoted "OmniWorker install
repository boundary" requirement (#803, d7fbe93) made a fifth boundary
governed. Raised as a finding by copilot-pull-request-reviewer on #803, accepted
as correct there, recorded on #796 as its 2026-09-08 addendum, and discharged
here with the authority it lacked there.

THE SENTENCE IS THE ONE tasks.md § 4.1 QUOTED BEFORE THE ACT, unchanged:

  Defines how `openxFactory`, `Hermes-Install`, `Omnigent-Install`,
  `Keycloak-Install`, `OpenXPKI-Install`, and `OmniWorker-Install` assign
  canonical workflow policy ownership, install repository scope, copy-first
  migration rules, and guarded repo-boundary execution.

AND THE EDIT IS EXACTLY THE TWO THINGS § 4.1 SAID IT WOULD BE, MEASURED TOKEN BY
TOKEN RATHER THAN EYEBALLED. A whitespace-insensitive token diff reads 21 tokens
-> 24. Three names are inserted after `Hermes-Install`, and the name following
canon's own `and` becomes `OmniWorker-Install` — the conjunction belonging to the
LAST item, whichever that is, which is what extending a serial list requires.
THE SERIAL COMMA BEFORE THE FINAL `and` IS CANON'S AND IS PRESERVED, now
standing after `OpenXPKI-Install`. Every other token is byte-identical and the
sentence's last two lines are UNTOUCHED BYTES, so the file diff is one line
removed and two added and re-wraps only the line the longer list outgrew.

IT IS ITS OWN COMMIT AND ITS OWN HUNK, TAKEN AFTER THE ARCHIVE, so the pinned
serializer's output and this editorial sentence are separable rather than mixed:
the promotion is 80 added / 8 removed lines inside the requirement bodies and at
the end of the file, this is one hunk at the top. NOTHING ELSE IN THE ## Purpose
BLOCK IS TOUCHED — no clause is reworded, reordered or removed — and no promoted
requirement's text is edited by it. No `Removed from canon by` marker is owed: a
Purpose is prose ABOUT the capability, carries no SHALL, and is not a canon
unit. This is the shape publish-openspec-cli-pin-as-contract-member used at its
own archive on 2026-09-08 for the neutral-product-pin Purpose (§ 5.8): promotion
26c2661, then widening e067236, one hunk at the top of the file.

The change is DISCLOSED rather than silent: it is quoted in the archived
tasks.md § 4.1 tick, in the README archived record row and in the pull request
body, each saying it was taken here and why. Applied by a refuse-on-mismatch
script that requires canon's sentence to be present exactly once, so a Purpose
that had moved since the packet was authored would have stopped the act rather
than been overwritten by it.

Refs #796, #591, #630

Lane: openxfactory-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FKW67VtDcES9dAs8qdqZ9u

* Seed the sweep-ledger row for refresh-install-repository-enumerations (moved by #825)

tasks.md § 4.3 of the archived packet requires the row to be re-seeded at the
archive (state: active -> state: archived) and --ledger-diff re-run clean at the
head the archive record cites. Its own commit, because the --moved-by pull
request number does not exist until the pull request does.

Performed with the tool rather than by hand:
python3 scripts/validate-sequenced-after.py . --seed-ledger --moved-by '#825'
-> "wrote tests/sequenced_after/corpus-ledger.yaml (188 rows, 1 moved by #825)".

THE DIFF IS THE CHECK, AND IT IS ONE LINE. Exactly one row moves — this change's
own — and git diff --numstat reads 1/1 on the file, so no other row moved and no
header line moved either. class: stays co-modifier and declares: stays
[admit-install-repos-to-aggregation] at depth 1: the ledger's corpus includes
ARCHIVED changes and admit-install-repos-to-aggregation wrote the same
requirement key in August, which is a fact about HISTORY and not a live
collision (design.md D2 measures the absence of the live one). moved_on takes
2026-09-09, the date the
archive/2026-09-09-refresh-install-repository-enumerations directory carries,
which is the reading the ledger's own header requires of a row flipping active
-> archived.

A PREDICTED SECOND HUNK DID NOT MATERIALISE, AND THAT IS WORTH RECORDING RATHER
THAN QUIETLY WELCOMING. A dry run on 2026-09-09 against origin/main at 6da9430
had the seed ALSO rewrite seven lines of the file's own moved_on header comment,
because the tool's template grew the UTC/archive-date paragraph when the #790
fix landed as #797 (1ef2690) after the file was last seeded. Between that dry
run and this act, #817 seeded the ledger from the current template and carried
that header refresh, so nothing was owed here. The pull request body's
disclosure of the hunk is corrected in a comment rather than silently dropped.

Re-verified at this head: --ledger-diff prints "per-change sweep ledger
consistent with the corpus (188 rows)", and the plain run passes 43 active
changes / 10 declaring the field with archive-date agreement clean.

Refs #796, #630

Lane: openxfactory-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FKW67VtDcES9dAs8qdqZ9u

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
brettheap pushed a commit that referenced this pull request Sep 18, 2026
THE ACT WAS 2026-09-17 AND IS UNCHANGED. The wrapper
(`scripts/proposal-support.py . archive scope-pinned-arm-root-naming --yes`)
owns the clock at the act (#797) and named
`openspec/changes/archive/2026-09-17-scope-pinned-arm-root-naming/` on Brett
Heap's separate archive word "merge 1051 when green, then archive 1047"
(openxFactory #1047 comment 5714241892). This pull request did not land that
day: it held while `origin/main` was red at `24f7a213` on the undispositioned
`archive-date-vs-commit` finding for `2026-09-16-gate-code-surface-declarations`
(added 2026-09-17 by `5dd0a8dc39899820ab9fad6f02ae9b364bb43dc6`), which lane
`openxfactory-5` repairs in PR #1099.

WHY A RE-DATE AND NOT A DISPOSITION. `sequenced_after.archive_commit_problems`
measures every archived directory's name against the UTC date of the commit
that ADDS it — under this repository's squash landing, the merge commit — so a
directory named 2026-09-17 landing on 2026-09-18 reds `main` as a NAMED
FINDING. The disposition route cannot be taken FIRST: an entry in
`tests/sequenced_after/archive-date-dispositions.yaml` MUST carry a full
40-character `adding_commit` (`DISPOSITION_KEYS`, `FULL_SHA`) that does not
exist until the squash lands — there is no sha-less or directory-plus-PR key —
and the record's own header refuses a pre-emptive entry in terms ("ENTRIES ARE
ADDED ONLY FOR A MEASURED DISAGREEMENT, AND NEVER IN ADVANCE"), the validator
reporting an entry whose directory AGREES as STALE. So the DIRECTORY moves.

EVERY REFERENCE MOVES IN THIS ONE COMMIT: the packet directory itself (six
files, byte-unchanged under the rename), the README archived-ledger entry and
its link, the corpus-ledger row's `moved_on: "2026-09-18"` (a `moved_on`
earlier than its directory is the `archive-date agreement` arm's own
contradiction), `tasks.md` § 2.1 and § 3.1, `design.md` § 5's `ARCH` path, and
the modified-block-currency self-gate's retirement note. § 5's commands were
re-run at this tree and print the same figures (21/8 and four hunks against
pre-promotion canon; no numstat line and zero hunks against live canon).

A LANDING THAT SLIPS PAST 2026-09-19T00:00Z NEEDS THE SAME ACT AGAIN, or a
post-landing disposition once the adding commit exists.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap pushed a commit that referenced this pull request Sep 18, 2026
…ing is not the remedy (document-lifecycle.md:556, #812); the landing route is measured instead

RULED by lane openxfactory-2 on RATIFIED DOCTRINE, and it is not the author's
call to make differently. `docs/document-lifecycle.md:556` — "RENAMING IS NOT
THE REMEDY: history is history, every citation stands" — and the four-cause
paragraph immediately below it (`:559-575`) names THIS shape in terms: "a
correct archive whose commit fell on the next UTC day" is CAUSE 2, and "Each of
those is a lawful disposition once MEASURED, naming its own cause". A landing
that slips a day is a disposition, not a rename. `bd758b29` is therefore
reverted whole: the directory is `2026-09-17-scope-pinned-arm-root-naming`
again, `moved_on: "2026-09-17"`, and the README entry, `tasks.md` § 2.1/§ 3.1,
`design.md` § 5's `ARCH` path and the self-gate's retirement note all read
2026-09-17 as they did at the act. The revert is byte-exact against the
pre-re-date tree (`git diff 9f98270 HEAD` over those nine paths: empty).

THE ACT IS UNCHANGED AND WAS ALWAYS 2026-09-17. The wrapper owned the clock
(#797) and named the directory on Brett Heap's separate archive word; `459d816a`
(2026-09-17T12:47:06Z) is that act.

THE LANDING ROUTE IS MEASURED, NOT ASSUMED — which is what makes the
disposition route affordable. `sequenced_after.adding_commits` walks
`git -c core.quotePath=false log --diff-filter=A --reverse --no-renames
--format=%x00%H%x09%cI --name-only -- openspec/changes/archive` — ONE walk,
oldest-first, `setdefault` keeping the first add of each name, no
`--first-parent` and deliberately no `-M`. Both landings of this head into
`origin/main` at `cb0f8544` were simulated in a scratch worktree:

  SQUASH  — the branch's commits are not in `main`, so the ONLY add of the
            directory is the squash commit itself, dated today. Simulated at
            `a8c41db208f60ef2c91b8f845b41590f3de709e0`:
            "archive-date-vs-commit: 2026-09-17-scope-pinned-arm-root-naming:
            dated 2026-09-17, added 2026-09-18 by a8c41db2… — undispositioned",
            validator exit 1, `tests/sequenced_after` 3 failed / 283 passed.

  MERGE   — the merge commit is TREESAME to the branch parent for that path, so
            the path-limited walk follows the branch and the OLDEST add of the
            name remains the archive act. Simulated at
            `38e49539e7d0f37881b83fa56a470e9f5320cf1f`: `adding_commits()`
            returns ('459d816a300634d1ad79e7f3a4ef733d69092b3f', '2026-09-17'),
            the arm PASSES ("13 disposition(s) in force"), validator exit 0,
            `tests/sequenced_after` 286 passed.

So the act date and the directory name agree IN HISTORY under a merge-commit
landing, and no disposition is owed at all. `--merge` is the recommended flag.
Only if this lands by squash does the post-landing disposition become due, and
only then can it be written: the record refuses a pre-emptive entry, and a full
40-character `adding_commit` does not exist until the landing commit does.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap added a commit that referenced this pull request Sep 18, 2026
… the no-record WHEN narrowed (ratifier's amendment), the block promoted (PR #1052 → f8eba34; code_surface none); the archive directory keeps its 2026-09-17 ACT date — the re-date RULED out, the landing route measured instead (#1089)

Lane: openxfactory-2 (openXfactory-2)

**TWO ACTS OF THE SAME RATIFIER, IN THAT ORDER — an AMENDMENT, then the ARCHIVE.** `scope-pinned-arm-root-naming` was RATIFIED by PR #1052 → `f8eba3455c0a35d2f5e2be91edbe2526063085e4` and carried ONE open question into its own ratification record. Both words below are Brett Heap's, first-hand, in session to lane `openxfactory-2`, on 2026-09-17.

**THE ARCHIVE WORD** — verbatim ***"merge 1051 when green, then archive 1047"***, recorded at [#1047 comment 5714241892](#1047 (comment)). **THE RULING** — an interactive multiple-choice selection, verbatim ***"Apply the narrowing"***, recorded at [#1047 comment 5714432684](#1047 (comment)), answering the RULING NEEDED this packet's record posted on 2026-09-16 (5701322989).

## (1) THE AMENDMENT, APPLIED BEFORE THE BLOCK PROMOTED

The sibling scenario *A pinned target names a pin no resolution root carries*'s WHEN:

**BEFORE** (as ratified at `92d3e0e2`): "…and no pin record for `<pin-id>` exists under any root of the run's precedence, **and at least one resolution root was selected for the run**"

**AFTER** (as amended, and as promoted): "…and no pin record for `<pin-id>` exists under any root of the run's precedence, **and at least one selected root whose boundary was successfully searched**"

**WHY.** `_pinned_arm` appends a root to `searched` only AFTER that root's `contracts/` directory clears `boundary_dir` (`scripts/doc_health/families.py:1604-1613`); a root whose boundary check fails draws its OWN finding instead and never reaches `searched`. Where EVERY root `_pin_roots` returns fails that check, `searched` stays empty, the `if searched:` guard (`:1633`) never fires, and NO aggregate no-record finding is emitted — so the round-1 WHEN described, on that one path, a finding the realized arm does not emit. Nothing is left uncovered: the independent scenario *A root's contracts directory is itself a symlink* already requires the per-root boundary finding for each refused root.

It is BYTE-FOR-BYTE the text fix round 5 applied in the lane's own name (`7055e475`) and fix round 6 reverted (`d138a99d`) — now applied by the only authority that could. **Recorded as an AMENDMENT BY THE RATIFIER in the 2026-09-01 form** (`add-requirement-ref-resolution-integrity/review/ratification-2026-09-01.md`): an **"AMENDED SINCE"** pointer near the head of `review/ratification-2026-09-16.md` and a dated **Addendum, 2026-09-17** at its foot, with `Amended by:` header lines on `proposal.md`, `design.md` and `tasks.md`. The 2026-09-16 body and addendum are left EXACTLY as written, as the evidence of what was true before the word came.

## (2) WHAT THE ARCHIVE DID

`python3 scripts/proposal-support.py . archive scope-pinned-arm-root-naming --yes` (never bare `openspec`). **`code_surface: none`**, so under `release-realization` the packet archives ON LANDING PLUS ITS OWN TASK LIST, and `tasks.md` § 3 was the whole of what was owed.

- **ORIGIN RETAINED** — the tool's own line, "declaration unchanged since the ratifying commit `f8eba3455c0a`". Independently proven: `.openspec.yaml` is blob `4c0a92d1` at `f8eba345` and blob `4c0a92d1` here, and no commit touched the packet between that merge and this act.
- **PROMOTION MEASURED BYTE-IDENTICAL** — canon's *Prose tagging marker hygiene* and the `## MODIFIED` block are both **41,984 bytes, sha256 `c009f5cc3e4aa5aa…`** (the requirement text from its `### Requirement:` line, canon's trailing blank separator excluded on both sides — PR #1042's convention); canon `--numstat` **+21 −8**.
- Packet moved to `openspec/changes/archive/2026-09-17-scope-pinned-arm-root-naming/`; **§ 3.1 and § 3.2 ticked** with ARCHIVED annotations citing the word, and § 3's heading now reads ARCHIVED.
- **§ 3.2's `_LEDGER_SUBJECTS` row DID exist and is RETIRED** with a note in its place, the gate's population narrative and docstring saying which subject moved and why (fifteen → fourteen).
- **README**: the active bullet retired, the archived-ledger entry added.
- **THE FIVE HISTORY-LABELLING CORRECTIONS RULED ACCEPT at round 7 of PR #1052** are folded here as non-normative: the figures labelled BY ROUND (at filing 2 hunks, 17/4, 1 uncarried, 7 new; after round 1's WHEN clause 3, 18/5, 2, 8; from round 5 onward 4, 21/8, 3, 9); `proposal.md` separating the filing generation from round 1's WHEN edit; the record's "ALL FOUR ARE NON-NORMATIVE" corrected to "no LASTING normative change — round 5 was the temporary normative edit, reverted in round 6"; and `tasks.md` § 2.1's "no approval pair claimed" marked as the at-authoring state of 2026-09-15.

## THE #1075 INTERACTION

PR #1075 → `a93d2682` ordered `adopt-entry-grain-dispositions-form` AFTER this packet and carried this scenario into that packet's `## MODIFIED` block VERBATIM. **That carried copy is re-based to the amended WHEN in the same act, under the same ruling** — a carried copy left at the superseded wording would be the very drift the carriage was performed to prevent. Its record gains a dated **"Addendum 2, 2026-09-17"** entry, kept distinct from and pointing at the **"Addendum, 2026-09-17 — carriage on the ratifier's word"** that PR #1082 → `98b172e5` landed there earlier the same day (the merge below keeps BOTH, unedited, in the order the two words were given). **Nothing else of that packet moves** — it still adds EXACTLY ONE scenario of its own, *A pin record's optional dispositions member carries a malformed entry*. Measured against canon AS PROMOTED: **canon 215 units, that block 223, ZERO uncarried and EIGHT new** — its own scenario title and its seven bullets, and nothing else.

## VALIDATION (at `65357341`, after merging `origin/main` at `88a1047`)

- `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` → **Totals: 106 passed, 2 failed (108 items)**; `origin/main` reads **107 passed, 2 failed (109 items)** — ONE FEWER ACTIVE CHANGE, the same two pre-existing failures (`add-chain-attestation`, `add-composed-view-authoring`).
- `python3 scripts/proposal-support.py . verify` → **ok**.
- `doc-health.py --single-repo . --family modified-block-currency` → **14 info, 0 error/critical**; `origin/main` reads **15 info**, and the ONLY difference is this packet's retired row. None unnamed; none for `adopt-entry-grain-dispositions-form`.
- `doc-health.py --single-repo . --family ratified-provenance` → **27 critical, ROW FOR ROW IDENTICAL to main** (compared in same-kind checkouts).
- `python3 scripts/validate-sequenced-after.py .` → **passed** (46 active, 15 declaring); it raises no objection to any `sequenced_after` target now being archived.
- `pytest -q -p no:cacheprovider tests/doc-health/test_modified_block_currency_self_gate.py` → **19 passed**.
- `pytest -q -p no:cacheprovider tests/sequenced_after tests/doc-health/test_modified_block_currency.py tests/proposal-support` → **626 passed, 291 subtests, 3 failed** — the sweep-ledger staleness ONLY, BY DESIGN until the re-seed commit that needs this pull request's number, **and all three are green at `8c72d2ec`** (`tests/sequenced_after` → **286 passed**).
- `pytest -q -p no:cacheprovider tests/doc-health` → **1826 passed**.

**Re-run at the final head `8c72d2ec`:** `openspec validate --all --strict` → **106/2 (108)**; `proposal-support.py . verify` → ok; `--family modified-block-currency` → **14 info**, zero rows naming either `scope-pinned-arm-root-naming` or `adopt-entry-grain-dispositions-form`; `--family ratified-provenance` → **27 critical, row for row identical to main**; `--ledger-diff` → **"per-change sweep ledger consistent with the corpus (216 rows)"**; `pytest tests/doc-health/test_modified_block_currency_self_gate.py tests/doc-health/test_modified_block_currency.py tests/proposal-support` → **362 passed, 291 subtests**.

**Commits.** `459d816a` performed the two acts (a previous author, who died before validating them); `572ff8a0` merges `origin/main` at `88a1047`, one conflict, one file, BOTH SIDES KEPT; `65357341` is the verification pass and its three corrections — § 3.1's byte figures were the PRE-amendment measurement (41,970 / `f4f2e807…`) and are re-measured to 41,984 / `c009f5cc…`, § 3's heading moved from OPEN to ARCHIVED, and the carried record's addendum is described as it now is; `8c72d2ec` re-seeds the per-change sweep ledger (`--seed-ledger --moved-by '#1089'` → 216 rows, ONE moved: `scope-pinned-arm-root-naming` active→archived, `#1052`→`#1089`, 2026-09-15→2026-09-17) and names PR #1089 in the README archived-ledger entry.

**Lands under Rule 6 AFTER PR #1051 lands, on the word's order** ("merge 1051 when green, then archive 1047"). This pull request touches `openspec/changes/`. openxFactory #1047 closes by the lane's hand after the ARCHIVED record, not by a keyword.

**Fix round 2 (`534f065a`)** — Copilot at `8c72d2ec` (one thread, one suppressed), both RULED ACCEPT, non-normative: the archived tasks.md header paragraph now states the archive act WAS performed and recorded in § 3 (word "merge 1051 when green, then archive 1047", citation 5714241892) with the old reading labelled as the at-filing state; design.md's verification commands are labelled PRE-ARCHIVE historical evidence with the heads they ran at, and a new § 5 gives post-archive equivalents run verbatim against the archived block and canon (0 hunks vs live canon; units now 215/215/0 uncarried/0 new; modified-block-currency 14 info naming nothing of this change; promotion-fidelity 0). Validation: `--all --strict` 106/2 (pre-existing); proposal-support ok; self-gate 19 passed; ledger consistent (216). Thread replied and resolved; 0 open. Lands AFTER PR #1051, on the word's order.

**Merged origin/main `5dd0a8dc` (`062fc6de`)** — carrying `893abe97` (PR #1088, the ratifier's partition amendment of `adopt-entry-grain-dispositions-form`), `53769f9e` (PR #1051) and `5dd0a8dc` itself (PR #1076, lane `openxfactory-5`'s archive of `gate-code-surface-declarations`). THREE conflicts, every one resolved by KEEPING BOTH WRITERS; the carried packet's spec delta merged with NO conflict and carries BOTH — #1088's partition clause, byte-unchanged and authoritative, on this branch's re-based sibling WHEN. The ratification record keeps BOTH addenda, ordered by their rulings' timestamps (carriage 12:12:49Z → this branch's Addendum 2, the narrowing, 12:34:53Z → #1088's partition addendum 12:34:55Z), neither text edited; its "AMENDED SINCE" pointer now counts THREE acts rather than two. README keeps both archived-ledger entries. The self-gate keeps main's `adopt-entry-grain-dispositions-form` row whole and applies this archive's retirement of the `scope-pinned-arm-root-naming` row over it: `len(_LEDGER_SUBJECTS)` MEASURED **15** (16 raw literal entries, the pre-existing `add-chain-attestation` duplicate collapsing as before), so the chronology reads 15 → 16 → 15, not 15 → 14. **EVERY FIGURE THE MERGE INVALIDATED IS RE-MEASURED AND CORRECTED** wherever this branch stated it: the carriage ledger is **15 `info`** rows (was 14) and `adopt-entry-grain-dispositions-form` measures **canon 215 units, block 223, TWO uncarried, TEN new** (was ZERO/EIGHT) — the carriage itself is WHOLE, the two uncarried units being the positive-resolution WHEN and disjointness bullet that packet's OWN ratifier moved. Validation at `062fc6de`: `openspec validate --all --strict` **108 passed / 2 failed (110 items)**, the same pre-existing pair; `proposal-support.py . verify` ok; `--ledger-diff` consistent (**219 rows**); `--family modified-block-currency` **0 critical / 0 error / 0 warning / 15 info**, none naming this packet, none unnamed; `--family promotion-fidelity` **0 findings**; self-gate **19 passed**; `pytest tests/doc-health` **1843 passed**; `pytest tests/sequenced_after` **286 passed**.

**RULED — THE RE-DATE IS REVERTED (`122fdda6`). THE DIRECTORY KEEPS ITS ACT DATE: `openspec/changes/archive/2026-09-17-scope-pinned-arm-root-naming/`, `moved_on: "2026-09-17"`.** `bd758b29` had moved the directory to `2026-09-18-…` so the landing would agree with the gate; lane `openxfactory-2` RULED that act back out on ratified doctrine. `docs/document-lifecycle.md:556` — *"RENAMING IS NOT THE REMEDY: history is history, every citation stands"* — and the four-cause paragraph at `:559-575` names this exact shape as CAUSE 2, *"a correct archive whose commit fell on the next UTC day … Each of those is a lawful disposition once MEASURED, naming its own cause"* (issue #812, Brett Heap 2026-09-08). A landing that slips a day is dispositioned, not renamed. The revert is byte-exact against the pre-re-date tree — `git diff 9f98270 HEAD` over those nine paths is empty — and `git grep '2026-09-18-scope-pinned'` returns nothing. Every reference came back with it: the README archived-ledger entry and its two links, the corpus-ledger row, `tasks.md` § 2.1/§ 3.1, `design.md` § 5's `ARCH` path and preamble, and the `modified-block-currency` self-gate's retirement note. **THE ACT ITSELF NEVER MOVED:** the wrapper owned the clock (#797) and named `2026-09-17-…` when it ran on Brett Heap's archive word; `459d816a`, committer-dated 2026-09-17T12:47:06Z, is that act.

**THE LANDING ROUTE IS MEASURED, NOT ASSUMED — and the measurement changes the answer.** The earlier reasoning assumed a squash landing and therefore an unavoidable red `main`. `sequenced_after.adding_commits` runs ONE walk over the whole archive root — `git -c core.quotePath=false log --diff-filter=A --reverse --no-renames --format=%x00%H%x09%cI --name-only -- openspec/changes/archive` — oldest-first with `setdefault` keeping the FIRST add of each name, no `--first-parent`, and deliberately no `-M`. BOTH landings of this head were simulated in a scratch worktree, twice: first against `origin/main` at `cb0f8544` and then RE-MEASURED at `df466597` against `origin/main` at `3e32d987` after it moved. **The verdict is stable across both bases.** Re-measured figures:

| route | sim commit | OUR directory attributed to | findings |
|---|---|---|---|
| pristine `origin/main` (baseline) | `3e32d987` | not landed | **1** — main's own |
| **MERGE COMMIT** (`--no-ff`) | `f6d739ef4ec9dfc3961e7a78cc8d790f72148331` | `459d816a…` — **2026-09-17** | **1** — main's own, unchanged |
| SQUASH | `5e2fff5f5c1daf77fd49d443f8a4f5e209c4ce71` | the squash commit — **2026-09-18** | **2** — main's own **plus ours** |

- **MERGE COMMIT — adds NOTHING.** The merge is TREESAME to the branch parent for that path, so the path-limited walk follows the branch and the OLDEST add of the name remains the archive act: `adding_commits()` returns `('459d816a300634d1ad79e7f3a4ef733d69092b3f', '2026-09-17')`. `pytest -q tests/sequenced_after` → **3 failed, 283 passed**, the failure set BYTE-IDENTICAL to pristine `origin/main`'s. Against the earlier green base `cb0f8544` the same simulation (`38e49539…`) was **fully green: validator exit 0, 286 passed**.
- **SQUASH — adds exactly ONE finding.** The branch's commits are absent from `main`, so the only add of the directory is the squash commit: `archive-date-vs-commit: 2026-09-17-scope-pinned-arm-root-naming: dated 2026-09-17, added 2026-09-18 by <squash sha> — undispositioned`. Same one finding against the earlier base (`a8c41db2…`).

**THEREFORE: LAND THIS WITH `gh pr merge --merge`, AND NO DISPOSITION IS OWED.** Under a merge-commit landing the directory's name and its adding commit agree IN HISTORY, which is exactly what the arm asks. Only a squash landing makes the cause-2 disposition due — and only then can it be written, since `tests/sequenced_after/archive-date-dispositions.yaml` requires a FULL 40-character `adding_commit` (`DISPOSITION_KEYS` + `FULL_SHA`; the loader raises and the CLI answers CANNOT RUN / exit 2 on a missing or abbreviated one), there is no sha-less or directory-plus-PR key, and the record's own header refuses a pre-emptive entry in terms: *"ENTRIES ARE ADDED ONLY FOR A MEASURED DISAGREEMENT, AND NEVER IN ADVANCE"*. In that case the follow-up entry cites `directory: 2026-09-17-scope-pinned-arm-root-naming`, `directory_date: "2026-09-17"`, `adding_commit: <squash sha>`, `commit_date_utc: "2026-09-18"`, a `fact:` naming cause 2 (act `459d816a` on 2026-09-17T12:47:06Z UTC; the landing fell on the next UTC day) and this ruling — the exact row is staged in the lane's `findings/LANDING-ROUTE-1089.md`. Copilot's three threads asked for precisely this route; all three are **RULED ACCEPT, replied and resolved (0 open)**.

**⚠️ `main` IS CURRENTLY RED ON THIS ARM, AND IT IS NOT THIS BRANCH.** `origin/main` at `3e32d987` fails `scripts/validate-sequenced-after.py .` on its own: `archive-date-vs-commit: 2026-09-16-add-composed-view-authoring: dated 2026-09-16, added 2026-09-18 by 3e32d98 — undispositioned`. [PR #1056](#1056) landed by SQUASH this morning and produced cause 2 in the live corpus. This branch INHERITS it through the merge of main; it is another lane's packet and another lane's ruling to cite, so nothing is written for it here. It is the #1076 → #1099 pattern repeating — and it is the live proof that a post-landing disposition is the routine, accepted remedy, which is what this ruling rests on. **Required CI on this PR will be red on those three inherited tests until #1056's finding is dispositioned on `main`; compare against pristine `origin/main` before attributing it here.**

**VALIDATION at `df466597`** — the reverted head after merging `origin/main` at `3e32d987` (ONE conflict, README's "Archived changes:" block, resolved by KEEPING BOTH WRITERS: this branch's `scope-pinned-arm-root-naming` entry above main's `add-composed-view-authoring` entry, reverse-chronological as the block is, neither text edited): `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` → **108 passed, 1 failed (109 items)** — the pre-existing pair is now a single pre-existing failure, `add-chain-attestation`, because main's #1056 closed `add-composed-view-authoring` out of the active corpus; `python3 scripts/proposal-support.py . verify` → **ok**; `python3 scripts/validate-sequenced-after.py . --ledger-diff` → **consistent (219 rows)**; `pytest -q -p no:cacheprovider tests/doc-health/test_modified_block_currency_self_gate.py` → **19 passed**; `pytest -q -p no:cacheprovider tests/sequenced_after` → **3 failed, 283 passed, ALL THREE INHERITED** (identical at pristine `origin/main`). At the pre-merge head `b8015cd0`, against the then-green `cb0f8544`, the same set was **FULLY GREEN**: validator green on both arms (`13 disposition(s) in force`), `--ledger-diff` 219 rows, `tests/sequenced_after` **286 passed**, self-gate 19 passed, `--all --strict` 108/2 (the pair), `proposal-support` ok. **THE BRANCH'S OWN ADDING COMMIT FOR THE DIRECTORY IS `459d816a` (2026-09-17 UTC) — IT AGREES WITH THE NAME**, so no entry is written here; an entry written now would be reported STALE and would red the run, which is the record's intended answer.

**RE-MEASURED AT `4bcbde5d` AGAINST `origin/main` = `4ccab7b9`, AND THE ROUTE IS UNCHANGED.** `main` moved twice more since `df466597`: `bbd1cca8` ([#1106](#1106), lane `openxfactory-4`'s disposition row for `2026-09-16-add-composed-view-authoring`, citing squash `3e32d987`) and `4ccab7b9` ([#1057](#1057), that lane's archive of `2026-09-16-add-doxchat-model-intake`, landed as a MERGE COMMIT whose branch history carries `d8ff2ec2` — the ORIGINAL wrapper commit that created the composed-view directory). Because the arm walks `git log --diff-filter=A --reverse --no-renames` with NO `--first-parent` and keeps the FIRST add, that merge RE-ATTRIBUTED an already-landed directory: `2026-09-16-add-composed-view-authoring`'s adder is now `d8ff2ec2`/2026-09-16, which AGREES with its name, so #1106's row — written for the squash — reads STALE and `main` is red on its own arm (run 35350757712). **THE MERGE INTO THIS BRANCH:** ONE conflict, again the README "Archived changes:" block, resolved by KEEPING BOTH WRITERS — this branch's 2026-09-17 entry above main's two 2026-09-16 closures, main's order between those two untouched, neither text edited. One non-normative bookkeeping correction travels with it, in the practice `c5ddc0c3` set on the other side of the same file: three `_LEDGER_SUBJECTS` rows have now retired on THREE separate branches, and each of the self-gate docstring's three "MEASURED AT THIS HEAD" readings was taken on a tree that did not hold the other two retirements, so a dated paragraph RE-MEASURES at this merged head — THIRTEEN, 14 literal entries / 13 unique — instead of subtracting from a superseded numeral a third time. Neither lane's own paragraph is touched, and the exact-set assertion compares sets, not counts.

**THE TWO SIMULATIONS, RE-RUN IN A SCRATCH WORKTREE OFF `4ccab7b9`.** MERGE COMMIT (`git merge --no-ff`, sim `8b22e9b1`): this branch's directory `2026-09-17-scope-pinned-arm-root-naming` attributes to **`459d816a300634d1ad79e7f3a4ef733d69092b3f` / 2026-09-17** — it AGREES with the name and emits nothing; the validator reports **1 finding, `main`'s own STALE**, and `pytest -q -p no:cacheprovider tests/sequenced_after` → **4 failed, 282 passed**, the failing set BYTE-IDENTICAL to pristine `4ccab7b9`'s. **THIS LANDING ADDS NOTHING.** The REVERTED `2026-09-18-scope-pinned-arm-root-naming` path (added by `bd758b29`, removed by `122fdda6`) does appear in `adding_commits()` — `('bd758b29…', '2026-09-18')` — but is NOT on disk, and `archive_commit_problems` measures only directories present on disk, so it produces **no finding**. SQUASH (`git merge --squash`, sim `2de88a9c`): the directory attributes to the squash commit, **2026-09-18**, and the run reds with **2 findings** — `main`'s STALE plus `archive-date-vs-commit: 2026-09-17-scope-pinned-arm-root-naming: dated 2026-09-17, added 2026-09-18 by 2de88a9c… — undispositioned` (4 failed, 282 passed, two findings inside). The recommendation is unchanged: **`gh pr merge 1089 --merge`**.

**VALIDATION at `4bcbde5d`:** `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` → **107 passed, 1 failed (108 items)**, the single pre-existing `add-chain-attestation`, measured beside pristine `4ccab7b9`'s **108 passed, 1 failed (109 items)** on the same item — the one-item difference is this archive leaving the active corpus, and no failure is added; `python3 scripts/proposal-support.py . verify` → **ok** (rc 0); `python3 scripts/validate-sequenced-after.py . --ledger-diff` → **consistent (219 rows)**, rc 0; `pytest -q -p no:cacheprovider tests/doc-health/test_modified_block_currency_self_gate.py` → **20 passed**; the plain `python3 scripts/validate-sequenced-after.py .` on this branch → the ONE inherited STALE finding and nothing else. **The required pytest suite is RED at this head and the red is `main`'s own** — #1057's merge-commit history re-dated `add-composed-view-authoring`'s adding commit and stranded #1106's disposition row. It is not this pull request's finding, this pull request adds none, and it clears when that row is removed on `main`.

**Merged origin/main `dc242f3a` (`edcdb008`).**

refs #1047

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Apply the ratifier-approved narrowing, promote the validated requirement changes, and archive scope-pinned-arm-root-naming.

Bug Fixes:
- Narrow the pinned-target no-record scenario so it applies only when at least one selected root has been successfully searched, matching the realized health-check behavior.

Enhancements:
- Archive the ratified scope-pinned arm root-naming change while preserving its ratification history and 2026-09-17 archive date.
- Promote the modified document-lifecycle requirements into canon and update the ordered carried copy in adopt-entry-grain-dispositions-form to match the ratifier's amendment.
- Retire the archived change's modified-block currency ledger entry and update the corpus and README archive records.

Documentation:
- Update archived proposal, design, task, and ratification records with the amendment, archive evidence, and post-archive verification details.

Tests:
- Update modified-block currency self-gate expectations and corpus-ledger state for the archived change.

Chores:
- Preserve the archive date and document measured landing-route guidance without adding a premature archive-date disposition.
brettheap added a commit that referenced this pull request Sep 18, 2026
…lized at 8f93cbc, promoted as amended, ledger row retired (#1114)

Lane: openxfactory-2 (openXfactory-2)

**THE ARCHIVE OF `adopt-entry-grain-dispositions-form`, ON BRETT HEAP'S OWN ARCHIVE WORD AND ON MERGED-PLUS-GREEN REALIZATION EVIDENCE.** `code_surface:` is NON-EMPTY, so under *release-realization* this packet could never archive on landing: it archives only on its realization being MERGED AND GREEN, and only then on a further word. Both conditions are now met and both are cited below. Every word is Brett Heap's, first-hand, in session to lane `openxfactory-2`.

## THE WORDS, IN ORDER — ALL FIVE VERBATIM

1. [#1045 comment 5714433011](#1045 (comment)), 2026-09-17T12:34:52Z, an interactive multi-choice selection, TWO words: ***"Apply the partition"*** — the ratifier amending his OWN ratified `## MODIFIED` block, the positive-resolution scenario's WHEN gaining the entry-grain clause and its disjointness bullet the matching exclusion — and ***"Realize now, land when green"*** — the § 3 realization authored as ONE pull request, *"archive (§ 4) remains a later word on merged-plus-green evidence"*.
2. [#1045 comment 5716521100](#1045 (comment)), 2026-09-17T14:59:21Z: ***"merge 1051 when green, then 1088, then archive 1047"*** — the landing word that let the partition amendment (PR #1088 → `893abe97e0b0ad6166cf59408daabd812a933bc1`) merge.
3. [#1045 comment 5717398099](#1045 (comment)), 2026-09-17T15:59:46Z: ***"merge 1094 when green after 1089"*** — the landing word for the realization.
4. [#1045 comment 5717476696](#1045 (comment)), 2026-09-17T16:05:19Z — **THE ARCHIVE WORD**: ***"merge 1070 fix when green, then archive 1045"***, naming its own precondition chain, verbatim: *"Prerequisite chain: #1088 (amend) → #1089 → #1094 (realize; the code surface's merged + green evidence) → #1070 fix → archive."*
5. [#1045 comment 5730133649](#1045 (comment)), 2026-09-18T12:41:38Z — **THE ARCHIVE WORD REAFFIRMED**: ***"after 1094 lands, do 1070 fix, merge when green, then archive 1045"***, which also states the landing route — *"the archive PR lands by MERGE COMMIT under Rule 6 on green (so the directory's adding commit stays the wrapper's act)"*.

## THE EVIDENCE CHAIN, EVERY LINK MEASURED

| act | pull request | merge sha | when |
|---|---|---|---|
| FILED + RATIFIED | [#1050](#1050) | `fa39141cec2b` | 2026-09-16, on *"ratify 1052 when green, then 1050"* (5698480736) |
| AMENDED by the ratifier | [#1088](#1088) | `893abe97e0b0ad6166cf59408daabd812a933bc1` | 2026-09-17T16:09:55Z, on *"Apply the partition"* |
| predecessor archived (Rule 6 order) | [#1089](#1089) | `7d60f128d65d9c47b8ea1f58863c337d21d6104c` | 2026-09-18T14:57:04Z |
| **REALIZED — the code surface's merged + green evidence** | [#1094](#1094) | **`8f93cbc02597f149a9987ce8da5f1c227e66662d`** | **2026-09-18T15:56:55Z, `main` green at that commit** |
| the #1070 fix | to land first | ``0a5c1310` (PR #1117)` (the #1070 fix PR, to land first) | — |
| **ARCHIVED** | **this pull request** | — | 2026-09-18 |

## WHAT THE ARCHIVE DID

`python3 scripts/proposal-support.py . archive adopt-entry-grain-dispositions-form --yes` — **never bare `openspec`** — which printed **`ORIGIN RETAINED adopt-entry-grain-dispositions-form (declaration unchanged since the ratifying commit fa39141)`**.

- **Packet moved** to `openspec/changes/archive/2026-09-18-adopt-entry-grain-dispositions-form/` — all six files, git-detected as renames.
- **PROMOTION MEASURED BYTE-IDENTICAL, not asserted.** After the archive, canon's *Prose tagging marker hygiene* in `openspec/specs/document-lifecycle/spec.md` and this packet's `## MODIFIED` block are both **45,963 bytes, sha256 `2099a22f69cb23b0d333603996512f4daab6bb7bc3fa8518e7b75e4d23388f19`** (the requirement text from its `### Requirement:` line, the trailing blank separator before the next `### Requirement:` excluded on both sides — PR #1042's convention, which PR #1089 used). Canon's `git diff --numstat` reads **+11 −2**; the requirement's scenarios go **24 → 25**.
- **WHAT PROMOTED IS EXACTLY TWO THINGS.** (a) The RATIFIER'S partition amendment of the positive-resolution scenario *A marker names a capability of a pinned neutral product* — its WHEN's entry-grain clause and its disjointness bullet's matching exclusion (#1088, *"Apply the partition"*). (b) This packet's OWN new scenario *A pin record's optional dispositions member carries a malformed entry* — its title and its seven bullets. The **two units the carriage-ledger arm reported as UNCARRIED** against the ACTIVE block on `main` were that same amendment; the promotion is what discharges them, which is why the arm now names nothing.
- **`tasks.md` § 4.1–4.3 TICKED** with ARCHIVED annotations citing the word. § 4.1 records the merged-plus-green gate, § 4.2 the byte measurement, § 4.3 the row retirement. The `- [ ]` → `- [x]` flips, the § 4 heading and one § 3 preamble sentence are the ONLY five lines removed from that file; every other change is an appended annotation, and the RATIFIED task text of § 4.3 keeps its own `'#<archive PR>'` placeholder unedited.
- **THE SELF-GATE ROW RETIRED.** `("adopt-entry-grain-dispositions-form", "document-lifecycle", "Prose tagging marker hygiene")` in `_LEDGER_SUBJECTS` (`tests/doc-health/test_modified_block_currency_self_gate.py`), opened 2026-09-17 by the partition amendment under the condition *"Retires when the packet archives and its block is promoted"* — the condition this archive discharges. A note stands in its place. `len(_LEDGER_SUBJECTS)` **MEASURED at this head reads TWELVE** (13 literal entries, 12 unique, the pre-existing `add-chain-attestation` duplicate collapsing as it always has), down from THIRTEEN. The docstring gains a **dated re-measurement paragraph** rather than subtracting from another lane's numeral, and the failure-message chronology is EXTENDED, not edited.
- **README** — the `adopt-entry-grain-dispositions-form` bullet retired from *Active changes*; an archived-ledger entry added at the head of *Archived changes* in the house style.
- **`tests/sequenced_after/corpus-ledger.yaml`** re-seeded by the tool, never by hand: `python3 scripts/validate-sequenced-after.py . --seed-ledger --moved-by '#1114'` → **221 rows, ONE moved** — `active` → `archived`, `#1050` → `#1114`, `2026-09-15` → `2026-09-18`.
- **`Status:` headers unchanged** — `ratified` on `proposal.md`, `design.md`, `tasks.md` and the ratification record, exactly as PR #1089's archived packet carries them.

## THE ARCHIVE DATE, AND WHY THE LANDING MUST BE A MERGE COMMIT

The wrapper owns the clock (#797): it ran at **2026-09-18T17:19:50Z** and named the directory `2026-09-18-adopt-entry-grain-dispositions-form`. The archive-act commit is **`2cb6145b6c87af0b4500a1e2da038c4053cec5f9`**, committer-dated **2026-09-18T17:24:01Z UTC**, and `scripts/validate-sequenced-after.py`'s `archive-date-vs-commit` arm attributes the directory to exactly that commit — **the name and the adding commit AGREE**, so nothing is owed and no disposition may be written (`tests/sequenced_after/archive-date-dispositions.yaml`'s own header: *"ENTRIES ARE ADDED ONLY FOR A MEASURED DISAGREEMENT, AND NEVER IN ADVANCE"*).

**BOTH LANDINGS WERE SIMULATED IN A SCRATCH WORKTREE OFF `origin/main` (`049d54a9`), and the worktree removed afterwards.**

| route | sim commit | our directory attributed to | validator | `pytest tests/sequenced_after` |
|---|---|---|---|---|
| pristine `origin/main` (baseline) | `049d54a9` | not landed | **passed, 0 findings** | — |
| **MERGE COMMIT** (`git merge --no-ff`) | `eb5d0993` | **`2cb6145b…` — 2026-09-18** | **passed, 0 findings** | **286 passed** |
| SQUASH (`git merge --squash`) | `353e2c40` | the squash commit — 2026-09-18 | passed, 0 findings | 286 passed |

Both routes are clean **only while the landing falls on 2026-09-18 UTC**. A squash discards this branch's commits, so the squash commit becomes the only add of the directory — and a squash that lands after `2026-09-19T00:00Z` would name 2026-09-19 against a directory named 2026-09-18 and add exactly one `archive-date-vs-commit` finding. **A merge commit is immune to that slip**: the walk is `git log --diff-filter=A --reverse --no-renames` with no `--first-parent` and keeps the FIRST add, so `2cb6145b`/2026-09-18 stays the adder however long the landing is held. This pull request is held behind the #1070 fix, so the slip is live — **LAND IT WITH `gh pr merge --merge`**, which is also what the reaffirmed word says. And **RENAMING IS NOT THE REMEDY** if it ever slipped anyway (`docs/document-lifecycle.md:556`, issue #812): a date one day early is dispositioned in place, names untouched.

## THE `tasks.md` § 3 CITATIONS STAND — THE RE-POINT IS RECORDED, NOT APPLIED

§ 3's ticks cite `scripts/validate-openspec-cli-pin.py`'s `pinned_dispositions` at **`:787`**, as MEASURED at the realization's base `4b53ea99`. On `main` it now begins at **`:794`** — PR [#1056](#1056) → `3e32d987` moved that file by **+7 lines**. **RULED STAND by the lane at PR #1094** (comment 5729231240, 2026-09-18T12:57:01Z): a packet's `tasks.md` is RECORD TEXT, the ticks pair with the ratified task text directly above them which cites the same lines, and history is history — the principle `docs/document-lifecycle.md:556` states for archive directory names. The live fact is already carried where it is ASSERTED, in `tests/doc-health/test_pin_shape_adapter.py`. **The re-point is recorded in this archive's own note** — the archived `tasks.md` § 4.1 and the README archived-ledger entry — and NO byte of § 3 moves.

## VALIDATION — at head `baf695f0`, beside pristine `origin/main` `049d54a9`

| command | this branch | pristine `origin/main` |
|---|---|---|
| `OPENSPEC_TELEMETRY=0 openspec validate --all --strict` | **108 passed, 1 failed (109 items)** | 109 passed, 1 failed (110 items) |
| `python3 scripts/proposal-support.py . verify` | **ok** (rc 0) | ok |
| `python3 scripts/validate-sequenced-after.py .` | **passed** — 47 active, 17 declaring; archive-date agreement passed; archive-date-vs-commit passed, 13 dispositions in force | passed — 48 active, 18 declaring |
| `python3 scripts/validate-sequenced-after.py . --ledger-diff` | **consistent (221 rows)** | consistent (221 rows) |
| `python3 scripts/doc-health.py --single-repo . --family modified-block-currency` | **0 critical / 0 error / 0 warning / 12 info** — none naming this packet, none unnamed | 13 info (one of them this packet's) |
| `python3 scripts/doc-health.py --single-repo . --family promotion-fidelity` | **0 critical / 6 error / 0 warning / 0 info** — row-for-row identical to main, none naming this packet | 6 error |
| `pytest -q -p no:cacheprovider tests/doc-health/test_modified_block_currency_self_gate.py` | **20 passed** | 20 passed |
| `pytest -q -p no:cacheprovider tests/sequenced_after` | **286 passed** | 286 passed |

The ONE `openspec validate` failure is the pre-existing `add-chain-attestation`, identical on both sides; the one-item difference is this archive leaving the active corpus, and **no failure is added**. The six `promotion-fidelity` errors are `main`'s own, belonging to the `add-composed-view-authoring` and `add-doxchat-model-intake` closures of other lanes. The single `modified-block-currency` difference is this packet's own row retiring.

**THE WIDER LOCAL SUITE, AND ITS SEVEN FAILURES ARE NOT THIS BRANCH'S.** `pytest -q -p no:cacheprovider tests/doc-health tests/proposal-support` at `baf695f0` → **7 failed, 2089 passed, 1 skipped, 297 subtests passed**. The same four files run against **pristine `origin/main` `049d54a9`** fail the **BYTE-IDENTICAL SET OF SEVEN** — `test_ideation_readiness.py` (3), `test_readiness_dispatch.py` (1), `test_sentinel_vocabulary.py` (2), `test_status_reader_real_lines.py` (1). Every one is INHERITED and none touches this archive's surface — and **CI settles it**: `pytest-suite` is GREEN on this head (21m28s), so all seven are local to this container's environment and not repository failures at all.

**CI AT `baf695f0` — ALL GREEN.** The eight required checks (`signed-execution-chain-gate`, `lane-line`, `former-id-arrival-gate`, `openspec-cli-pin`, `wallet-validation`, `pytest-suite`, `release-tag-gate`, `openxdox-consumer-gate`) all pass, as do `clearing-dispatch-gate`, `merge-master-approval`, `openreposhape-pin` and SonarCloud. **Copilot: 🟢 Approval recommended** at the final head; its two earlier threads — both against the pre-reseed head, both about the `{PR}` / `#<ARCHIVE_PR>` placeholders this branch's own reseed commit filled — are RESOLVED, **0 open**.

**Lands under Rule 6 by MERGE COMMIT AFTER the #1070 fix PR has landed**, when the eight required checks are green and Copilot is clean. This pull request touches `openspec/changes/`, so it takes a LANDING/LANDED window. openxFactory #1045 closes by the lane's hand after the ARCHIVED record, not by a keyword.

refs #1045

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants