Skip to content

Archived directories are measured against the UTC date of their adding commit; the ten one-day-early names and the two renamed-within-archive names are dispositioned in place - #820

Merged
brettheap merged 9 commits into
mainfrom
fix/archive-date-vs-adding-commit
Sep 9, 2026
Merged

brettheap merged 9 commits into
mainfrom
fix/archive-date-vs-adding-commit

Conversation

@brettheap

@brettheap brettheap commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-1 (openXfactory-1)

#797 made proposal-support.py archive own the clock GOING FORWARD (UTC date,
TZ=UTC for the pinned CLI, the created directory asserted) and gated the
ledger on a row's moved_on contradicting its directory. Neither arm looks at
HISTORY
— the date an archived directory carries against the UTC date of the
commit that added it — so the ten directories a local clock one day behind UTC
named before either existed are invisible to both, and nothing measures them.

That directory name is the archive's date of record: ledger rows,
ratification records, the README index and cross-references in other archives
all read it, and sequenced_after.ARCHIVE_DIR parses it as fact. A name one day
away from the commit that created it states a day the archive did not happen on.

The rulings

Brett Heap, 2026-09-08T14:30:58Z, verbatim: "rule 1 + 2a on 812, this lane
authors it"
.

Brett Heap, 2026-09-08T14:38:49Z, verbatim: "land 797 when green, then author
812"
. — this branch is cut from the main that contains #797 (1ef26900).

Brett Heap, 2026-09-08T16:14:28Z, verbatim: "merge 812 when green".

(1) The measurement arm

On the plain validate-sequenced-after.py . run — the one CI already invokes
through tests/sequenced_after/test_validate.py::test_corpus_sequenced_after_all_validate
— every directory under openspec/changes/archive/ matching ARCHIVE_DIR is
measured against the UTC committer date of the OLDEST commit that added it.

One walk, not one per directory. git log --diff-filter=A --reverse --no-renames --name-only -- openspec/changes/archive visits every add under the
archive root once, oldest first; the first commit to touch a directory is the
one that created it, and setdefault keeps it. The many-directories-one-commit
shape falls out of it
: one commit adding many directories attributes all of
them to itself, which is what 01198cce did when it archived two changes at
once. Measured at 83 ms against 9.3 s for 144 per-directory git log
calls (113×), and the two attributions were compared directory by directory
and agreed on all 144, under history simplification and --full-history
alike — test_THE_BATCH_WALK_AGREES_WITH_A_PER_DIRECTORY_LOG_on_every_DISPOSITION
keeps that equivalence honest for every dispositioned row.

--no-renames deliberately: the question is when did this NAME come to exist,
and rename detection answers a different one — a directory renamed within the
archive would be paired as R and never reported as an add at all, so the gate
would not merely misdate it, it would not see it. The price of that choice is
cause 4 below
: a directory renamed inside archive/ after its archive act
attributes to the RENAME commit and can disagree by any distance. That is a
finding a disposition can answer, which beats a directory the gate cannot
measure. The committer date because it is when the commit entered this
history, which is
the act the name claims to date; author and committer dates agree on all 144
here, so nothing turns on it today and the reason is written down for the day a
rebase moves one and not the other.

Findings, by name:

archive-date-vs-commit: <dir>: dated <d>, added <utc-date> by <sha> — undispositioned
archive-date-disposition STALE: <dir>: <why the entry describes a fact that is not there>

Equal → silent. Disagrees and dispositioned → silent. Disagrees with no
disposition → the finding. A stale disposition is itself a defect and is
reported in the same list: an entry naming a directory that no longer exists,
one whose directory AGREES with its adding commit, and one citing a commit or a
date history does not carry. The record's whole authority is that every entry
states a fact anyone can re-measure; an entry nobody can check silences a
finding on nothing.

Both archive-date arms now run on one pass. They read different things — a
ledger row against a directory name, and a directory name against history — and
want different repairs, so the first one's failure no longer returns before the
second has reported. Visible in Verification: under --strict-archive-dates the
ledger arm's 124 pre-existing findings and this arm's verdict both print.

A checkout that DECLINES the question and git FAILING are different facts,
and they are a TYPE and not a phrase in a message
(ArchiveHistoryUnavailable,
a subclass — Codex P2, taken). Not a git work-tree root, a nested tree (a
corpus written under some other checkout is untracked in it), a SHALLOW
clone, or no git binary at all → NOT RUN, verdict unchanged: those are
properties of the checkout, and refusing there would red every consumer
validating an exported tree. But a git log that exits non-zero after those
probes passed — a partial clone with objects unavailable, a corrupt object store
— is git failing in a checkout that claimed it could answer, and is CANNOT RUN,
exit 2. Reporting that as NOT RUN would leave the run green with a gate the
record asks for at error silently off, which is the one answer a gate must
never give. The shallow probe failing fails closed for the same reason.

The shallow guard is the load-bearing decline: in a depth-1 clone the graft
boundary appears to have added every archived directory, so all but the newest
would be reported as disagreements nobody made — a hundred findings with no cause
an author could act on. pytest-suite.yml already checks out at
fetch-depth: 0. A directory with no adding commit (uncommitted in this work
tree) is skipped: it has no date in history to disagree with, and its clock is
#797's to own at creation.

A missing or unreadable record is CANNOT RUN, exit 2, in the existing
style — and it wins over the first arm's exit 1, because "the run could not do
its job" and "the corpus disagrees" want different repairs. The order of the two
refusals is the point: git is probed FIRST (a property of the checkout), the
record SECOND (a property of the repository — it is part of this diff, and
reading "no record" as "no dispositions" would turn one bad line into twelve
findings whose real cause is the file).

Severity design, and why error ships

The record carries the dial (enforcement: warning | error), so a
repository can adopt this arm and measure before it gates; --strict-archive-dates
asks for error regardless, and never for less. The instruction was to ship
error only if the plain run is green with the twelve dispositioned. It is:

$ python3 scripts/validate-sequenced-after.py .
archive-date-vs-commit agreement passed (every archived directory is named for the UTC date of the commit that added it, or is dispositioned in place; 12 disposition(s) in force, enforcement error).
rc=0

144 archived directories, 132 agree, 12 disagree, 12 dispositioned, 0
undispositioned
— so error is what the ruling's own condition asks for, and
it ships. One dial covers both finding classes, including stale
dispositions, deliberately: warning exists precisely for the window in which a
repository is writing its dispositions by hand, and making one class
unconditionally fatal would defeat the dial's only purpose.

(2a) The disposition record — the twelve, in place

tests/sequenced_after/archive-date-dispositions.yaml, beside the corpus ledger
and read the same way (strict loader; anchors, aliases, merge keys, directives
and multi-document input refused). Names untouched. History is history and
every citation stands
— a rename would move every record that points at the
directory, to correct a name whose only defect is that it is one day early.

Every sha and date below was re-derived here, by the shipped code and again
by the issue's own per-directory method. No discrepancy against #812's table:
all ten one-day-early rows match sha for sha and date for date, and both
initial-import directories are 746be44f, six days apart. The only difference
from the issue is the corpus total — #812 measured 143 directories (131 agree),
this branch measures 144 (132 agree); one archive has landed since it was
filed, and it agrees.

# archive directory dir date adding commit (UTC) sha (full) fact
1 2026-06-26-enable-live-openxfactory 2026-06-26 2026-07-02 746be44f7af6f6bce51ee75602d7a77951efa1df renamed within archive/ from …-enable-live-openworkflow-factory; the archive act itself, 484042de… on 2026-06-26, AGREES with the name
2 2026-06-26-migrate-canonical-policy-to-openxfactory 2026-06-26 2026-07-02 746be44f7af6f6bce51ee75602d7a77951efa1df renamed within archive/ from …-migrate-canonical-policy-to-openworkflow; the archive act itself, d7b66d72… on 2026-06-26, AGREES with the name
3 2026-08-04-add-ideation-cross-reference-readiness 2026-08-04 2026-08-05 7bf79c63af9d9d73b0419d13136d7ba20c589f6a local clock one day behind UTC
4 2026-08-04-add-possibles-derivation-lane 2026-08-04 2026-08-05 6d1994c7695328d5a2441dc3da537e3577e785dd local clock one day behind UTC
5 2026-08-04-adopt-neutral-utility-pack 2026-08-04 2026-08-05 61ecb5a5a3632a7aad03879892b6f143bcf31deb local clock one day behind UTC
6 2026-08-04-implement-avatar-client-lab 2026-08-04 2026-08-05 25d8e1c6691f0b636de8eff8acee4d171d206f5e local clock one day behind UTC
7 2026-08-06-add-opendox-project-header 2026-08-06 2026-08-07 01198cce1244a938243120232b5ad379cd94a4bb local clock one day behind UTC
8 2026-08-06-add-project-scoped-selection 2026-08-06 2026-08-07 01198cce1244a938243120232b5ad379cd94a4bb local clock one day behind UTC
9 2026-08-06-add-proposal-origin-contract 2026-08-06 2026-08-07 5ea242643f0466641b84ff72e51790074cc1e297 local clock one day behind UTC
10 2026-08-09-qualify-avatar-brokered-call-feasibility 2026-08-09 2026-08-10 e34dce6e8cbd7e86cc946b1e0556ece65b5dbcf4 local clock one day behind UTC
11 2026-08-25-add-dispatch-credential-contract 2026-08-25 2026-08-26 881e1c058fba71668224380ede404c5f9e7c0eb1 local clock one day behind UTC
12 2026-09-04-add-chain-anchoring 2026-09-04 2026-09-05 66d11a2422e778e9c6f7fe6dc358af83f9c1648d local clock one day behind UTC

Rows 3–12 carry fact: "named by a local clock one day behind UTC; #780's defect, unnoticed" and are exactly one day early, every one (asserted, not
described). Rows 1–2 carry a different fact — cause 4, a rename inside
archive/
— corrected in the fix round below; each names the rename commit,
the name it was renamed FROM, and the archive act that actually created it, in
full:

fact: "renamed within archive/ on 2026-07-02 by
  746be44f7af6f6bce51ee75602d7a77951efa1df, from
  2026-06-26-enable-live-openworkflow-factory; the archive act itself,
  484042de8b83d8b96d8e1eb32ef848c2356eab74 on 2026-06-26 UTC, AGREES with
  the name - under --no-renames the new name attributes to the rename
  commit"

fact: "renamed within archive/ on 2026-07-02 by
  746be44f7af6f6bce51ee75602d7a77951efa1df, from
  2026-06-26-migrate-canonical-policy-to-openworkflow; the archive act
  itself, d7b66d725cd8f291366871fb2f09f5a4b1587579 on 2026-06-26 UTC,
  AGREES with the name - under --no-renames the new name attributes to the
  rename commit"

All twelve carry ruled_by: 'Brett Heap 2026-09-08 "rule 1 + 2a on 812"' and
cited_to: "opensoft/openxFactory#812".

What the measurement can and cannot say

The arm compares a NAME to a COMMIT. It cannot say WHY they differ, and
four causes produce the same shape — which is why an entry carries a fact
and a ruled_by rather than merely a directory name (Codex P2, taken; my first
header got this wrong, and named only three of the four):

  1. A local clock behind UTC named the directory. The defect, and the ten.
    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 made this cause unable to recur through the wrapper, which owns the
    clock at the archive act.
  2. The archive act and its commit fell on different UTC days. The wrapper
    owns the clock at the act; the adding commit is made — and, squash-merged,
    dated — later. An archive named just before UTC midnight and merged just
    after is a correct archive that this arm reports. 132 of 144 agree, so it
    is rare, not impossible.
  3. The change id arrived carrying its own YYYY-MM-DD- prefix, which the
    pinned CLI preserves deliberately (archive.js:1119-1124; re-prefixing
    would stutter the name and sort the folder under a day the change did not
    happen on) and which archive_directory_name() computes by that same rule.
    Such a directory takes the date in the id and will normally disagree. The
    estate has no such change today.
  4. An archived directory was RENAMED inside archive/ after its archive
    act.
    The walk is --no-renames deliberately, so the destination reads as
    an ADD at the RENAME commit and may disagree by any distance, not merely a
    day
    — a fixture renaming a directory a month later reproduces it exactly.
    The lawful disposition cites the rename commit as adding_commit and names
    the archive act itself in fact, which is what rows 1–2 do. Rename
    detection is not the repair
    : under -M the destination never appears as
    A at all, so the directory would be silently unmeasured — worse than a
    finding a disposition can answer.

Causes 2, 3 and 4 are LAWFUL entries once actually measured, naming their own
cause rather than borrowing the clock sentence. What the header forbids is only
what should be forbidden: writing an entry before the disagreement is
measured. (My first version forbade every future entry, which at
enforcement: error left a correct cause-2 or cause-3 archive with no lawful
repair — a contradiction, and the sharper half of Codex's finding.)
docs/document-lifecycle.md carries the same limitation, so a lifecycle reader
is not told the arm judges a cause it cannot judge.

Empirically, cause 1 is what happened to all ten. Every one was committed at
-04:00 between 20:34 and 23:22 local — evening America/New_York, next UTC
day. Not one is a merge that drifted:

archive directory committed in UTC
2026-08-04-add-ideation-cross-reference-readiness 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21
2026-08-04-add-possibles-derivation-lane 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21
2026-08-04-adopt-neutral-utility-pack 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21
2026-08-04-implement-avatar-client-lab 2026-08-04T22:34:37**-04:00** 2026-08-05 02:34
2026-08-06-add-opendox-project-header 2026-08-06T22:25:35**-04:00** 2026-08-07 02:25
2026-08-06-add-project-scoped-selection 2026-08-06T22:25:35**-04:00** 2026-08-07 02:25
2026-08-06-add-proposal-origin-contract 2026-08-06T21:55:00**-04:00** 2026-08-07 01:55
2026-08-09-qualify-avatar-brokered-call-feasibility 2026-08-09T20:34:19**-04:00** 2026-08-10 00:34
2026-08-25-add-dispatch-credential-contract 2026-08-25T23:22:00**-04:00** 2026-08-26 03:22
2026-09-04-add-chain-anchoring 2026-09-04T20:36:17**-04:00** 2026-09-05 00:36

Two corroborations from outside this branch that the walk attributed the right
commits: 66d11a24's own subject is "Archive add-chain-anchoring … (#669)"
landing at 00:36 UTC, the time this lane's record of #669 carries; and
01198cce archived two changes in one commit, which is why rows 7 and 8
share a sha — the many-directories-one-commit shape occurring naturally. The two
+08:00 rows are visibly a different fact: 746be44f lands at 10:18 UTC on
2026-07-02, the same UTC day it was committed, six days after the
2026-06-26 names it carried in — renamed, not archived, and not an import
either (see the fix round).

Every scalar is quoted, the rule _render_row already settled on for the
ledger beside it: unquoted 2026-06-26 is a date to YAML and not a string, an
all-digit object name would be an int, and one quoting rule is easier to keep
right than a per-key judgement. adding_commit is the full 40-character
object name and an abbreviation is refused — this record is a citation, and an
abbreviation is ambiguous by construction. A directory dispositioned twice
is refused by name: the entries are a sequence, so the strict loader's
duplicate-KEY refusal does not reach them, and last-one-wins would silently
apply whichever decision the file ends with.

Where the record lives, and why this is not an OpenSpec change

It is not canon. It sits under tests/sequenced_after/ beside
corpus-ledger.yaml because it is the same kind of object — a machine-read
record of MEASURED FACTS that the validator consults — and the ledger is itself
not under openspec/specs/. Nothing here adds, modifies or removes a
requirement; the arm enforces the archive-date rule document-lifecycle.md
already states, and the record is its measured input. No openspec/ path
appears in the diff.

Verification

All on the live corpus at this branch's head.

Plain run — green, 0 undispositioned:

$ python3 scripts/validate-sequenced-after.py .
sequenced_after validation passed (44 active changes, 11 declaring the field).
archive-date agreement passed (no archived row's moved_on predates its directory).
archive-date-vs-commit agreement passed (every archived directory is named for the UTC date of the commit that added it, or is dispositioned in place; 12 disposition(s) in force, enforcement error).
rc=0

--strict-archive-dates — both arms report; the new one passes:

$ python3 scripts/validate-sequenced-after.py . --strict-archive-dates
sequenced_after validation passed (44 active changes, 11 declaring the field).
archive-date agreement FAILED (124 finding(s)):
  … 124 `archive-date drift` findings — the PRE-EXISTING ledger arm, byte-identical to main's opt-in output …
archive-date-vs-commit agreement passed (every archived directory is named for the UTC date of the commit that added it, or is dispositioned in place; 12 disposition(s) in force, enforcement error).
rc=1

Before this branch the run returned at the first arm's failure and the second
never printed. The 124 are the known opt-in drift --strict-archive-dates
already reported on main; this branch neither adds to them nor removes one.

--ledger-diff — rows unchanged:

$ python3 scripts/validate-sequenced-after.py . --ledger-diff
per-change sweep ledger consistent with the corpus (188 rows).
rc=0

$ git diff origin/main --stat -- tests/sequenced_after/corpus-ledger.yaml
(no output — the ledger is byte-identical to main)

Tests:

$ python3 -m pytest tests/sequenced_after tests/scope_globs tests/proposal-support -q
main (89242304):  375 passed, 2 subtests passed
this branch:      415 passed, 2 subtests passed      (+40, 0 regressions)

The 40 are tests/sequenced_after/test_archive_commit_dates.py, and the
fixtures are real git repositories with controlled commit dates
(GIT_AUTHOR_DATE/GIT_COMMITTER_DATE carrying offsets) — the whole arm is a
statement about history, and a fixture that faked the walk would assert only
that the fake was read. 23:30 -01:00 on the 4th is 00:30 UTC on the 5th,
which is the defect's actual shape and the reason the comparison converts rather
than slicing the timestamp string.

Covered: one-day-early → finding; dispositioned → silent; equal → silent; stale
disposition (agrees / directory gone / wrong sha / wrong date) → finding; record
missing → exit 2; record unreadable (6 shapes) → exit 2; duplicate entry →
refused by name; abbreviated sha → refused; initial-import shape (two
directories, one commit, plus a later touch that must NOT win) → attributed
correctly; uncommitted directory → skipped; a file directly under archive/
dates nothing; non-git tree → NOT RUN; nested tree → NOT RUN; shallow clone →
NOT RUN; enforcement: warning → printed, verdict unchanged; strict overrides
the dial upward; both arms report on one run; CANNOT RUN wins over the first
arm's failure; a failing git log → CANNOT RUN exit 2, not a silent pass;
an unanswerable shallow probe fails closed; the decline cases are a
subclass; a rename inside archive/ is cause 4, is any distance wide, and a
disposition citing the rename commit is its lawful repair
; rename detection
would hide the directory from the arm entirely
(measured on the same fixture,
which is why --no-renames stays); the record names all four causes, and so do
the module, the CLI help and the lifecycle doc. The two git-failure tests are
driven by a git shim that delegates to the real binary except for one
argument, so the branches are exercised rather than asserted.

Mutation checks:

mutation result
drop the disposition lookup (if name in dispositions.entries: continue) live plain run → 12 findings, rc 1, one per dispositioned directory; 5 tests fail
drop the comparison (if day != dated → never) the one-day-early and the cause-4 rename fixtures' findings vanish; both named-finding tests fail, 12 fail overall
drop the stale-disposition loop its three fixtures go green; the 3 STALE tests fail, nothing else

Each mutation was applied to scripts/sequenced_after.py, run, and reverted from
a pristine copy (md5 compared); the file is green again at the end (40 passed).

doc-health — unchanged:

$ python3 scripts/doc-health.py --single-repo .
origin/main 89242304 (control worktree): Findings: 10 critical, 9 error, 57 warning, 16 info. rc=0
this branch:                             Findings: 10 critical, 9 error, 57 warning, 16 info. rc=0

92 findings each side; the normalized finding sets diff IDENTICAL (only the
repo= token differs, being the directory name). Re-measured after the fix
round against both origin/main and this PR's previous head 60fe7647; the
only delta anywhere in the report is the governance word count (+88 words, the
lengthened document-lifecycle.md paragraph), and canon share is unchanged at
39.1%. The control was a detached worktree created outside this clone.

The arm's timing on the live corpus (best of 7, 144 directories):

step min median
git walk 83 ms 86 ms
record load (strict loader) 18 ms 19 ms
compare + stale check 1 ms 2 ms
arm total 102 ms 106 ms

The whole plain run goes from 0.41 s to 0.56 s wall.

Fix round (adversarial review)

Head ae179edc. Two majors, one minor and one note — all four taken, each
re-measured here before it was acted on, plus two review rounds on the fix round
itself (Copilot: a docstring wrap broken to 115 columns by the CAUSE 4
insertion; Codex P2: the cause-4 set was pinned by equality, forbidding the very
future entry the header grants — both taken, threads replied and resolved). The
comparison and the --no-renames choice are unchanged; nothing under
openspec/ is touched; the ledger is untouched; no archived directory is
touched.

MAJOR 1 — rows 1–2 called a rename a repository import

Measured, in this checkout:

$ git rev-list --max-parents=0 HEAD
3fd3e33e791789b64d7f2ec27056e2429eeb4e8f        # 2026-06-21 "Document initial AI factory workflow"

$ git log -1 --format='%P | %s' 746be44f
818d177f09a25c997bf9c1d3ef8b9354ff2c6f3d | Add avatar-first client workflow scaffolding
                                          # ONE parent — not a merge, not the root

$ git show --name-status -M --format= 746be44f | grep -c '^R.*archive/2026-06-26-'
57                                        # RENAMES, -openworkflow → -openxfactory

$ TZ=UTC git log -1 --format=%cd --date=iso-strict-local 484042de   # enable-live
2026-06-26T05:55:08+00:00
$ TZ=UTC git log -1 --format=%cd --date=iso-strict-local d7b66d72   # migrate-policy
2026-06-26T04:37:58+00:00

So 746be44f is neither an import nor a merge: it is a single-parent commit
that renamed both directories out of their -openworkflow names on
2026-07-02. The names are correct. Their archive acts — 484042de and
d7b66d72, both on 2026-06-26 UTC — agree with the 2026-06-26 the names
carry, and the disagreement the arm reports is an artefact of --no-renames
attributing a rename's destination to the rename commit.

Taken (e4206845): both fact values now state the measured cause, each citing
its own archive act in full (adding_commit, ruled_by and cited_to
unchanged — the schema has no field for a second commit, and the header's
vocabulary field is fact); the table and the sentence above are corrected; and
test_EVERY_CAUSE_4_DISPOSITION_CITES_A_RENAME_AND_AN_AGREEING_ARCHIVE_ACT
re-measures both halves — the rename out of git show --name-status -M, the
archive act's UTC day out of git log, plus the parent count and the root — so
the corrected entry is checkable rather than prose. It is written over the
record
, not against the two known names, so a later cause-4 entry meets the
same standard rather than escaping the check (Codex round 2). The old
expected-fact set is gone from the live-record test.

MAJOR 2 — a fourth cause of the shape existed and was unnamed

A rename of an archived directory inside archive/. Proven on a fixture
(_renamed_inside_archive): archive act 2026-08-01, git mv a month later.

--no-renames :  2026-08-01-add-thing-renamed  added 2026-09-01 by <rename sha>
                → a false disagreement A MONTH WIDE
-M           :  2026-08-01-add-thing-renamed  never appears as `A`
                → the directory is SILENTLY UNMEASURED

The record header, the module, the CLI help, docs/document-lifecycle.md and
the pin test all said "three". All five now name four, and the pin test asserts
the fourth in all five places — because a cause named in one of them and
missing from the others is exactly how a rename came to be recorded as an
import. Three new fixture tests carry it: the finding and its distance, the
lawful cause-4 disposition, and the measurement showing rename detection would
hide the directory entirely.

The --no-renames choice stands, and the trade is now written down where the
choice is made
: a finding a disposition can answer beats a directory the gate
cannot see.

MINOR — the live-record test forbade the entries the header permits

It asserted the fact set by exact equality and a hard twelve — which
forbids in the suite exactly the lawful future entries (causes 2, 3, 4) the
header grants, the same defect Codex P2 found one level up. Now: the known facts
must be present, every entry's fact must be a non-empty string, the ten
clock rows are still exactly one day early, and the count is a lower bound.
test_THE_LIVE_PLAIN_RUN_IS_GREEN_WITH_ZERO_UNDISPOSITIONED reads the count
from the record instead of pinning 12, and the cause-4 set is a subset
rather than an equality (Codex round 2 — demonstrated: with a synthetic third
cause-4 row the equality is False and the subset is True). Cause 1 stays
pinned at ten, deliberately
, with the reason written beside it: 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 means the wrapper was
bypassed and should red rather than pass.

NOTE — _git_shim

shutil.which("git") was interpolated into a /bin/sh script unquoted; a
checkout under a path with a space would build a shim that execs the wrong
thing. shlex.quoted.

Scope

scripts/sequenced_after.py, scripts/validate-sequenced-after.py,
tests/sequenced_after/test_archive_commit_dates.py (new), the one record file
tests/sequenced_after/archive-date-dispositions.yaml (new), and one paragraph
in docs/document-lifecycle.md beside #797's. No archived directory is
renamed or touched
; nothing under openspec/specs/; no ledger row; not
contracts/openspec-cli-pin.yaml. No openspec/ path in the diff, so no Rule 6
window.

No OpenSpec change — plain fix per the #638 precedent, on Brett Heap's word
2026-09-08.

Closes #812

🤖 Generated with Claude Code

https://claude.ai/code/session_01XPt6t1VcNVB5yGzQGwWUFi

…ommit, and disposition the twelve in place

#797 made `proposal-support.py archive` own the clock going forward and gated
the ledger against the directory name. Neither arm looks at HISTORY, so the ten
directories a local clock one day behind UTC named before either existed are
invisible to both, and nothing measures them. The directory name is the
archive's date of record — ledger rows, ratification records, the README index
and cross-references in other archives all read it — so a name one day away from
the commit that created it states a day the archive did not happen on.

(1) The MEASUREMENT arm, on the plain `validate-sequenced-after.py .` run CI
already invokes: one `git log --diff-filter=A --reverse --no-renames
--name-only` walk over `openspec/changes/archive`, oldest first, attributing
each directory to the first commit that adds any file under it — so the
initial-import shape (many directories, one commit) attributes correctly, and
the cost is 83ms rather than the 9.3s of 144 per-directory calls (113x; the two
attributions agree on all 144). A disagreement with no disposition is a named
finding; a disposition naming a directory that does not disagree, no longer
exists, or cites a commit history does not carry is a finding too — a stale
disposition silences a finding on a fact nobody can check. Both archive-date
arms now report on one pass rather than the first returning before the second
runs. A checkout that cannot answer — not a work-tree root, nested, or SHALLOW,
where the graft boundary would appear to have added everything — says NOT RUN
and leaves the verdict alone; a missing or unreadable record is CANNOT RUN,
exit 2.

(2a) The DISPOSITION of the twelve IN PLACE, names untouched, in
`tests/sequenced_after/archive-date-dispositions.yaml` beside the corpus ledger
and read the same way: ten named by a local clock one day behind UTC (#780's
defect, unnoticed) and two that are the repository's initial import rather than
an archive act, each citing its adding commit, the fact and the ruling. History
is history and every citation stands; a rename would move every record that
points at the directory. Every sha and date was re-derived by the shipped code
and again by the issue's per-directory method, with no discrepancy against
#812's table.

The record carries the severity dial. It ships `error` because the ruling's own
condition is met: 144 archived directories, 132 agree, 12 disagree, 12
dispositioned, 0 undispositioned, plain run green.

Ruled by Brett Heap 2026-09-08, verbatim "rule 1 + 2a on 812, this lane authors
it", "land 797 when green, then author 812" and "merge 812 when green". No
OpenSpec change — plain fix per the #638 precedent.

Refs #812

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

@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

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Date note, for the record. Authoring began 2026-09-08 UTC and the clock
crossed midnight mid-task: this pull request was opened 2026-09-09T00:10:31Z.
Every date written into the diff is a RULING date, not a today: the twelve
disposition entries carry ruled_by: 'Brett Heap 2026-09-08 "rule 1 + 2a on 812"' and the docs/document-lifecycle.md paragraph cites the same
2026-09-08, which are the dates Brett Heap ruled (14:30:58Z, 14:38:49Z and
16:14:28Z on #812). Nothing in this change stamps the authoring day, so the
crossing changes no recorded value — which is itself the point of #797's rule,
one door down.

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 new disposition record’s header comment is internally inconsistent about quoting rules and should be corrected to avoid misleading future edits.

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

Pull request overview

Adds a second “archive-date” validation arm to validate-sequenced-after.py that checks archived directory names against the UTC date of the commit that originally added them, with an explicit disposition record for historically “wrong-day” directories.

Changes:

  • Implement batch git-history attribution (git log --diff-filter=A --reverse --no-renames --name-only) to map each archived directory to its oldest adding commit (UTC committer date).
  • Add strict, schema-checked disposition record (tests/sequenced_after/archive-date-dispositions.yaml) to silence known historical disagreements and to flag stale/incorrect dispositions.
  • Add a comprehensive test suite using real git repos with controlled author/committer timestamps, plus live-corpus equivalence checks.
File summaries
File Description
scripts/sequenced_after.py Implements the “archive-date vs adding-commit” measurement, strict disposition parsing, and stale-disposition detection.
scripts/validate-sequenced-after.py Runs the new arm on the plain validator path (even if the first archive-date arm fails) and applies severity rules (warning/error + strict override).
tests/sequenced_after/test_archive_commit_dates.py Adds real-git fixtures and coverage for disagreement detection, stale dispositions, and “cannot/not run” cases.
tests/sequenced_after/archive-date-dispositions.yaml Adds the disposition record for the 12 known historical disagreements (10 one-day-early + 2 initial-import).
docs/document-lifecycle.md Documents the new history-based measurement and the in-place disposition approach.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

…g note to entry scalars

Two corrections to the arm as landed on this branch.

A MISSING GIT BINARY WAS A TRACEBACK I INTRODUCED. Every other git caller in
`sequenced_after.py` sits behind `--archive-gate`, which an operator asks for;
this arm runs on the DEFAULT validation run, so a machine with no `git` in PATH
would have gone from a working validator to a `FileNotFoundError` out of the
middle of a corpus check. `_git` now converts `OSError` into
`SequencedAfterError`, which the CLI already reports as `NOT RUN` with the
verdict unchanged — the same answer it gives a shallow or non-work-tree
checkout, and for the same reason: the checkout cannot answer the question.

THE RECORD'S HEADER CONTRADICTED ITSELF (Copilot round 1, taken). It said
"EVERY SCALAR IS QUOTED" while `schema_version`, `kind` and `enforcement` sit
unquoted above it. The rule is about ENTRY scalars, and the three file keys
must STAY unquoted: `schema_version` is an INTEGER the loader compares to `1`,
so quoting it would make it the string "1" and the record would be refused.
The header now says so, and a parametrized case asserts the refusal, so the
claim is checked rather than merely written.

Refs #812

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

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Copilot round 1 — 1 finding, TAKEN (781f3327).

"EVERY SCALAR IS QUOTED" contradicted the file's own three unquoted keys —
correct, and the sentence was the wrong one. The rule is about ENTRY scalars
(2026-06-26 unquoted is a date to YAML and not a string; an all-digit object
name would be an int). The three FILE keys must STAY unquoted, which the header
now says explicitly: schema_version is an integer the loader compares to
1, so quoting it would make it the string "1" and the record would be
REFUSED; kind and enforcement are enumerated bare tokens compared to a fixed
set. A parametrized case now asserts that refusal, so the claim is checked
rather than merely written.

Also in the same commit, found by my own adversarial pass rather than by the
bench, and the more serious of the two: the plain validation run did not shell
out to git before this arm.
Every other git caller in sequenced_after.py
sits behind --archive-gate, which an operator asks for — so on a machine with
no git in PATH this change would have turned a working validator into a
FileNotFoundError traceback out of the middle of a corpus check. _git now
converts OSError into SequencedAfterError, which the CLI already reports as
NOT RUN with the verdict untouched — the same answer a shallow or
non-work-tree checkout gets, for the same reason: the checkout cannot answer the
question. Covered by
test_NO_GIT_ON_PATH_is_NOT_RUN_rather_than_a_TRACEBACK, which runs the
validator with PATH pointing at an empty directory.

Tests 375 → 407 on tests/sequenced_after tests/scope_globs tests/proposal-support (+32, 0 regressions); the live plain run is still green
at 0 undispositioned.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

The recorded fact is PROVEN from the commits, not inferred. The record says
of ten entries "named by a local clock one day behind UTC". That is a claim
about a cause, and a record should not assert a cause it cannot show — so here
are the twelve adding commits with the offset each was actually committed at:

archive directory committer date AS COMMITTED in UTC shape
2026-06-26-enable-live-openxfactory 2026-07-02T18:18:41**+08:00** 2026-07-02 10:18 initial import (one merge, 746be44f)
2026-06-26-migrate-canonical-policy-to-openxfactory 2026-07-02T18:18:41**+08:00** 2026-07-02 10:18 initial import (same merge)
2026-08-04-add-ideation-cross-reference-readiness 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21 evening local → next UTC day
2026-08-04-add-possibles-derivation-lane 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21 evening local → next UTC day
2026-08-04-adopt-neutral-utility-pack 2026-08-04T21:21:31**-04:00** 2026-08-05 01:21 evening local → next UTC day
2026-08-04-implement-avatar-client-lab 2026-08-04T22:34:37**-04:00** 2026-08-05 02:34 evening local → next UTC day
2026-08-06-add-opendox-project-header 2026-08-06T22:25:35**-04:00** 2026-08-07 02:25 evening local → next UTC day
2026-08-06-add-project-scoped-selection 2026-08-06T22:25:35**-04:00** 2026-08-07 02:25 evening local → next UTC day
2026-08-06-add-proposal-origin-contract 2026-08-06T21:55:00**-04:00** 2026-08-07 01:55 evening local → next UTC day
2026-08-09-qualify-avatar-brokered-call-feasibility 2026-08-09T20:34:19**-04:00** 2026-08-10 00:34 evening local → next UTC day
2026-08-25-add-dispatch-credential-contract 2026-08-25T23:22:00**-04:00** 2026-08-26 03:22 evening local → next UTC day
2026-09-04-add-chain-anchoring 2026-09-04T20:36:17**-04:00** 2026-09-05 00:36 evening local → next UTC day

All ten are -04:00, all ten between 20:34 and 23:22 local. Not one is a
random one-day slip: every one is an archive made in the evening on a clock four
hours behind UTC, where the local calendar still said the 4th / 6th / 9th / 25th
/ 4th and UTC had already turned over. That is #780's defect exactly, and
fact: "named by a local clock one day behind UTC" is what the commits say.

Two independent corroborations that the batch walk attributed the right
commits, from outside this branch:

And the two +08:00 rows are visibly not the same fact: 746be44f is the
merge that imported the archive tree, at 10:18 UTC on 2026-07-02 — the SAME UTC
day it was committed, six days after the 2026-06-26 names it carried in. No
clock was one day behind; those directories were imported, not archived, which
is what their fact says.

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

ℹ️ 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/validate-sequenced-after.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

It changes core validation gating behavior and adds new git-history parsing paths that should be confirmed by a human reviewer in CI and typical developer workflows.

Review details

Suppressed comments (1)

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

scripts/validate-sequenced-after.py:618

  • The --strict-archive-dates help text refers to the "archive-date-vs-adding-commit" arm, but the CLI output prefix for this arm is "archive-date-vs-commit". Using two different names makes it harder to grep logs and connect docs/help to output; consider aligning the help string to the emitted finding prefix.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…awful repair for two shapes it cannot judge

Both findings are Codex P2 on #820, both taken.

GIT FAILING IS NOT THE SAME FACT AS A CHECKOUT THAT DECLINES THE QUESTION, and
the arm raised one error class for both — so the CLI mapped both to NOT RUN. A
partial clone with objects unavailable, or a corrupt object store, would have
left the run GREEN with a gate the record asks for at `error` silently off,
which is the one answer a gate must never give. The distinction is now a TYPE,
`ArchiveHistoryUnavailable`, and not a phrase in a message: a tree that is not a
work-tree root, one nested in another repository, a SHALLOW clone and a machine
with no git are contexts this arm deliberately does not serve (NOT RUN, verdict
unchanged); a `git log` that exits non-zero AFTER those probes passed is git
failing (CANNOT RUN, exit 2). The shallow PROBE failing moves to fail-closed for
the same reason: it answers the question that decides whether the walk can be
believed at all.

THE RECORD FORBADE THE ONLY LAWFUL REPAIR FOR TWO SHAPES THE ARM CANNOT JUDGE.
This arm compares a NAME to a COMMIT; it cannot say WHY they differ, and three
causes produce the same shape. Besides the clock defect there are (2) a CORRECT
archive whose act and whose commit fell on different UTC days — the wrapper owns
the clock at the ACT, and a squash-merge is dated later — and (3) a change id
that arrived carrying its own `YYYY-MM-DD-` prefix, which the pinned CLI
preserves DELIBERATELY (`archive.js:1119-1124`) and `archive_directory_name()`
computes by that same rule, so the directory takes the date IN THE ID. The
header said no future entry may ever be written, which at `enforcement: error`
left both of those with no repair but a disposition its own text forbade. It now
names the three causes, says that 2 and 3 are LAWFUL entries once actually
MEASURED and must name their own cause rather than borrowing the clock sentence,
and forbids only what should be forbidden: writing an entry BEFORE the
disagreement is measured. `docs/document-lifecycle.md` carries the same
limitation, so a reader is not told the arm judges a cause it cannot judge.

The dial stays `error`: the ruling's condition is met (144 directories, 132
agree, 12 dispositioned, 0 undispositioned, plain run green), and the escape for
a future correct archive is now one truthful entry rather than a contradiction.

Refs #812

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

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Codex round 1 — 2 × P2, BOTH TAKEN (901c53a5). Both were right, and the
second one found a contradiction I had written into the record's own header.


P2 — "Fail closed when the history walk itself errors" — TAKEN, in code

Correct, and it is the more serious of the two: adding_commits() raised ONE
error class for "this is a checkout I deliberately do not serve" and for "git
just failed", and the CLI mapped both to NOT RUN. A partial clone with objects
unavailable would therefore have left the run green with a gate the record
asks for at error silently off
— the one answer a gate must never give.

The distinction is now a type, not a phrase in a message:

  • ArchiveHistoryUnavailable (a subclass) — not a work-tree root, nested inside
    another repository, SHALLOW, or no git binary at all → NOT RUN, verdict
    unchanged.
  • plain SequencedAfterError — git log exiting non-zero after those
    probes passed → CANNOT RUN, exit 2.

The shallow probe failing moved to fail-closed on the same reasoning, which
your finding's principle reaches even though it did not name it: that probe
answers the question deciding whether the walk can be believed at all, so a
probe that cannot answer it in a tree that just claimed to be a work-tree root
is git failing, not a context declined. It now refuses rather than skipping.

Three new tests, driven by a git shim that delegates to the real binary except
for one argument, so the branches are exercised rather than asserted:
test_a_FAILING_HISTORY_WALK_is_CANNOT_RUN_not_a_silent_pass,
test_an_UNANSWERABLE_SHALLOW_PROBE_FAILS_CLOSED, and a subclass assertion.


P2 — "Do not equate the archive operation date with commit date" — TAKEN, in the record and the docs; the comparison stands

Your two sub-claims are both true, and I want to separate what I accept from
what I am not changing.

Accepted, and it is a contradiction I wrote. The arm compares a NAME to a
COMMIT and cannot say why they differ. Three causes produce the same shape:

  1. a local clock behind UTC named the directory — the defect, and the ten;
  2. a correct archive whose act and whose commit fell on different UTC days
    (the wrapper owns the clock at the ACT; a squash-merge is dated later);
  3. a change id that arrived carrying its own YYYY-MM-DD- prefix, which the
    pinned CLI preserves deliberately (archive.js:1119-1124 — re-prefixing
    would stutter the name and sort the folder under a day the change did not
    happen on) and which archive_directory_name() computes by that same rule,
    so the directory takes the date in the id.

And my record's header said "entries are added only for a measured
disagreement, and never in advance… an entry for a future archive must not be
written"
— which at enforcement: error left causes 2 and 3 with no lawful
repair
, exactly as you say. That was my error, not a tolerable edge.

The header now names all three causes, states that 2 and 3 are lawful entries
once actually MEASURED
and must name their own cause rather than borrowing the
clock sentence, and forbids only what should be forbidden: writing an entry
before the disagreement is measured. docs/document-lifecycle.md carries the
same limitation, so a lifecycle reader is not told the arm judges a cause it
cannot judge. test_THE_RECORD_NAMES_THE_THREE_CAUSES_and_forbids_only_UNMEASURED_entries
pins it.

Not changed: the comparison itself, and the error dial. "Measure the
archive act instead of requiring equality with the later commit date" has no
implementation I can honour — the archive act leaves no trace in the tree.
The directory name IS the only record of it, which is the whole reason #812
exists; there is no second timestamp to compare against, and inferring one from
the bundle's packaged_at would just move the trust to another author-written
field. And the two shapes are indistinguishable by construction: cause 1 and
cause 2 both read as "name = commit − 1 day". Any tolerance wide enough to
forgive cause 2 forgives all ten of the defects this arm exists to catch — they
are every one exactly one day early.

So the design is deliberately: measure mechanically, judge in the record.
That is what a fact and a ruled_by on each entry are for, and it is what
Brett Heap's ruling asked for in those two halves ("rule 1 + 2a on 812").
enforcement: error stays because the ruling's own condition is met — 144
directories, 132 agree, 12 dispositioned, 0 undispositioned, plain run green
— and the cost you identify is now one truthful entry for a genuinely
measured cause-2 or cause-3 archive, rather than a contradiction. The dial is
one word in the record if Brett would rather it sat at warning for a while;
I have not moved it on my own judgement.

Empirically, cause 1 is what happened. All ten were committed at -04:00
between 20:34 and 23:22 local — evening America/New_York, next UTC day —
which is in the evidence comment above. Not one is a merge that drifted; they
are ten evening archives on a clock four hours behind UTC.


Tests 375 → 411 on tests/sequenced_after tests/scope_globs tests/proposal-support (0 regressions). All three mutation checks still bite on
the final code: drop the disposition lookup → 12 findings; drop the comparison →
the fixture's finding vanishes and all 12 dispositions go STALE; drop the
stale-disposition loop → its three fixtures go green.

The `--strict-archive-dates` help said "archive-date-vs-adding-commit" while
every line the arm emits is prefixed `archive-date-vs-commit`, so the help, the
module docs and the output could not be grepped with one token. The emitted
token wins everywhere — it is the one an operator has in front of them — and the
docstring now says so explicitly rather than leaving the reader to notice.

Copilot round 2 (suppressed comment, taken); no behaviour change.

Refs #812

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

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 new validation arm is well-guarded for unanswerable checkouts, uses a single-pass git walk for performance, and is backed by thorough fixture-based tests plus an explicit, strict disposition record for the known historical cases.

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

Copilot AI review requested due to automatic review settings September 9, 2026 00:26
…he two raise classes where the caller reads them

A 120-column run-on where the initial-import paragraph should have started, and
a RAISES paragraph still describing one error class after the fail-closed split
made it two. The second was the one that mattered: `adding_commits` now raises
`ArchiveHistoryUnavailable` when the CHECKOUT declines the question and plain
`SequencedAfterError` when git FAILS, and the docstring a caller reads before
writing the `except` said neither. Prose only; no behaviour change.

Refs #812

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

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 validation behavior and exit-code semantics on the default validation path, so it warrants final human verification despite strong test coverage.

Review details

Suppressed comments (1)

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

tests/sequenced_after/test_archive_commit_dates.py:463

  • Test docstring starts with four quotes ("""") which injects an extra leading " character into the docstring text; this looks like a typo and makes the string content misleading.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 00:29

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 test git shim delegates to the resolved git binary without shell-quoting its path, which can break delegation when the git path contains spaces or special characters.

Review details

Suppressed comments (1)

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

tests/sequenced_after/test_archive_commit_dates.py:595

  • In _git_shim, the generated shell script uses exec {real} "$@" without quoting the resolved git path. If shutil.which('git') ever returns a path containing spaces or shell metacharacters, the shim will fail to delegate correctly (and could run the wrong binary). Quoting the path via shlex.quote() makes the shim robust.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Whole-suite comparison against origin/main, and the merge ref exercised.
Two additional verifications beyond the ones in the body, both run locally
because they answer questions CI's single green tick does not.

1. pytest tests/ -q -m "not postgres" — this branch against a clean
origin/main control
, the control being a detached worktree created OUTSIDE
this clone:

selected outcome
origin/main (control) 96 failed, 10067 passed, 110 skipped, 338 deselected, 50 errors
this branch 96 failed, 10097 passed, 110 skipped, 338 deselected, 50 errors

The failure and error sets are identical, breakdown for breakdown — 66
tests/trust-anchor/test_negative_corpus.py, 28 tests/clearing/test_validator_refusals.py,
15 tests/clearing/test_origin_signature.py, 14
tests/trust-anchor/test_declaration_perimeter.py, and so on, the same counts on
both sides. They are this workstation's missing optional dependencies, present on
main before this branch existed, and CI does not have them. What moves is
passed, +30, and nothing else.

skipped is unchanged at 110 on both sides, which is the number
pytest-suite.yml cares about: EXPECT_SKIPPED is pinned EXACTLY, and
"a directory that silently turned into skips is exactly what this pin exists to
catch". This change adds no skip. MIN_SELECTED/MIN_PASSED are floors and both
move up.

(The branch run reads +30 rather than the +36 the targeted suites show, because
it was launched before the last three commits and pytest had already collected
the file. The targeted run at the final head is 411.)

2. The MERGE REF, which is what CI actually runs. main advanced under this
branch (refresh-install-repository-enumerations landed, adding one ledger row
and no archived directory). Test-merged in a throwaway worktree outside the
clone:

$ python3 scripts/validate-sequenced-after.py .
sequenced_after validation passed (43 active changes, 10 declaring the field).
archive-date agreement passed (no archived row's moved_on predates its directory).
archive-date-vs-commit agreement passed (every archived directory is named for the UTC date of the commit that added it, or is dispositioned in place; 12 disposition(s) in force, enforcement error).
rc=0

$ python3 scripts/validate-sequenced-after.py . --ledger-diff
per-change sweep ledger consistent with the corpus (187 rows).

$ python3 -m pytest tests/sequenced_after tests/scope_globs tests/proposal-support -q
411 passed, 2 subtests passed

Worth stating because this arm reads the ARCHIVE CORPUS, so a sibling landing an
archive could move its answer under a frozen head: git diff --name-only <base> origin/main -- openspec/changes/archive is empty, so the merge ref measures
the same 144 directories, and main touches none of this branch's five files.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FROZEN — head 60fe76473326bea4d8c3c3377a86567d3fcfe16b, all ten check-runs SUCCESS, 0 open threads.

check-run conclusion
pytest-suite success
clearing-dispatch-gate success
lane-line success
merge-master-approval success
openreposhape-pin success
openspec-cli-pin success
release-tag-gate success
signed-execution-chain-gate success
wallet-validation success
copilot-pull-request-reviewer success

mergeable=MERGEABLE; closingIssuesReferences is exactly [812]; no
openspec/ path in the diff
, so no Rule 6 landing window; nothing under
openspec/specs/, no archived directory renamed or touched, no ledger row, and
contracts/openspec-cli-pin.yaml untouched. mergeStateStatus=BLOCKED is the
code-owner review requirement only — this PR was opened as brettheap by gh,
so it cannot be self-approved (the standing B2 pattern).

Bench, complete. One @codex review requested and answered with a real
review
, not an absence: 2 × P2, both taken — 901c53a5 (fail closed when
git FAILS rather than silently disabling the gate; and the record header no
longer forbids the only lawful repair for the two shapes the arm cannot judge).
Copilot ran 2 rounds, both taken: 781f3327 (the record's quoting note) and
899699cd (one name for the arm, and it is the one it prints). Sourcery is the
usual upsell stub. All review threads resolved (0 unresolved).

Five commits, five files, +1462/−9. I have not merged — that is Brett
Heap's act under "merge 812 when green", and the head above is what "green"
now names.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

brettheap and others added 2 commits September 8, 2026 21:13
…an import

The adversarial review of PR #820 measured two things the arm's own record got
wrong about itself.

THE TWO OLDEST ENTRIES WERE NOT A REPOSITORY IMPORT. Measured: this history's
root is 3fd3e33 (2026-06-21); 746be44 has ONE parent, the subject "Add
avatar-first client workflow scaffolding", and `git show --name-status -M`
shows it RENAMED both directories out of their `-openworkflow` names on
2026-07-02. Their archive acts are 484042d (2026-06-26T05:55:08Z) and
d7b66d7 (2026-06-26T04:37:58Z), both AGREEING with the 2026-06-26 the names
carry. So the names are right and the disagreement is an artefact of
`--no-renames` attributing a rename's destination to the rename commit. Both
`fact` values now say that, each citing its own archive act in full, and the
live-record test re-measures both halves — the rename out of `git show -M`,
the archive act's UTC day out of `git log` — rather than taking the entry's
word for them.

A FOURTH CAUSE OF THE SHAPE EXISTS AND WAS UNNAMED: a rename of an archived
directory INSIDE `archive/`. Proven on a fixture — `git mv` a month after the
archive act yields a false disagreement a month wide, and with rename detection
on the destination never appears as `A` and the directory is silently
unmeasured. The record header, the module, the CLI help, the lifecycle doc and
the pin test now name all four; the pin test checks all five places, because a
cause named in one and missing from the others is how a rename came to be
recorded as an import.

The comparison and the `--no-renames` choice are UNCHANGED. The trade is
written down where the choice is made: a finding a disposition can answer beats
a directory the gate cannot see.

Also: the live-record test asserted the fact set by exact equality and a hard
twelve, forbidding in the suite exactly the future entries (causes 2, 3, 4) the
header grants — it now asserts the known facts are PRESENT, that every entry
states one, and a LOWER bound on the count. And `_git_shim` interpolates the
real git path into a `/bin/sh` script; it is `shlex.quote`d.

Bench 415 passed (was 411): three cause-4 fixture tests and one live
rename-disposition test. Live corpus green, 0 undispositioned, 12 in force.

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

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 introduces a substantial new validation/gating path with nuanced git-history probing and exit-code behavior that warrants final human review despite strong test coverage.

Review details

Suppressed comments (1)

tests/sequenced_after/archive-date-dispositions.yaml:111

  • The header comment implies kind and enforcement must be unquoted “bare tokens”, but quoting them would still parse as strings and would not change what the loader compares; only schema_version must remain an integer. Clarifying this avoids readers thinking quoting enforcement would break the record when it wouldn’t.
# unquoted. THE THREE FILE KEYS ABOVE ARE DELIBERATELY NOT QUOTED and must stay
# that way: `schema_version` is an INTEGER the loader compares to `1`, and
# `kind` and `enforcement` are enumerated bare tokens it compares to a fixed
# set — quoting `schema_version` would make it the string `"1"` and the record
# would be refused. (Copilot round 1: the sentence said "every scalar" and the
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/sequenced_after.py Resolved
@brettheap brettheap changed the title Archived directories are measured against the UTC date of their adding commit; the ten one-day-early names and the two initial-import names are dispositioned in place Archived directories are measured against the UTC date of their adding commit; the ten one-day-early names and the two renamed-within-archive names are dispositioned in place Sep 9, 2026
…ep the wrap at 80

Copilot round 2 on head e420684, taken: the CAUSE 4 paragraph I inserted into
`adding_commits` left `core.quotePath=false` appended mid-line at 115 columns,
so it read as part of the rename sentence rather than as the separate note it
is. It is its own paragraph again.

Also reflowed the four new lines that ran past 80 (a constant, two test names,
three assertions, one record comment) to the width the rest of these files
keep. No behaviour, no assertion semantics and no record content changed;
40 passed in the arm's file, 415 in the bench, live corpus green.

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

brettheap commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

Fix round (adversarial review) — FROZEN at head ae179edc

Four findings, all taken, each re-measured in a fresh clone before it was acted on. The comparison and the --no-renames choice are unchanged. No openspec/ path; the ledger is untouched; no archived directory is touched.

MAJOR 1 — rows 1–2 called a rename a repository import. Measured here: the root commit is 3fd3e33e (2026-06-21), 746be44f has one parent and the subject "Add avatar-first client workflow scaffolding", and git show --name-status -M 746be44f shows it renamed both directories out of their -openworkflow names (57 R lines under archive/2026-06-26-). The real archive acts are 484042de (2026-06-26T05:55:08Z) and d7b66d72 (2026-06-26T04:37:58Z) — both agree with the 2026-06-26 the names carry. So the names are right and the disagreement is an artefact of --no-renames attributing a rename's destination to the rename commit. Both fact values now state that, each citing its own archive act in full; the PR body's table and sentence are corrected; and a new live test re-measures both halves (the rename out of git show -M, the archive act's UTC day out of git log, plus the parent count and the root) so the corrected entry is checkable rather than prose.

MAJOR 2 — a fourth cause existed and was unnamed: a rename of an archived directory inside archive/. Proven on a fixture — git mv a month after the archive act:

--no-renames :  the renamed directory  added 2026-09-01 by <rename sha>   → a false disagreement A MONTH WIDE
-M           :  the renamed directory  never appears as `A`               → SILENTLY UNMEASURED

The record header, the module, the CLI help, docs/document-lifecycle.md and the pin test all said "three". All five now name four, and the pin test asserts the fourth in all five places — a cause named in one and missing from the others is exactly how a rename came to be recorded as an import. --no-renames stays, and the trade is now written down where the choice is made: a finding a disposition can answer beats a directory the gate cannot see.

MINOR — the live-record test forbade what the header permits. It pinned the fact set by exact equality and the count at a hard 12, forbidding in the suite exactly the lawful future entries (causes 2, 3, 4) the header grants — the same defect Codex P2 found one level up. Now: known facts must be present, every entry's fact must be non-empty, the ten clock rows are still exactly one day early, and the count is a lower bound (the plain-run test reads it from the record).

NOTE — _git_shim interpolated shutil.which("git") into a /bin/sh script unquoted; shlex.quoted.

Review rounds on the fix round, both taken, both threads replied and resolved: Copilot (a docstring wrap broken to 115 columns by the CAUSE 4 insertion) — eed1444f; Codex P2 (set(renamed) == set(RENAMED) pinned the cause-4 set by equality, forbidding exactly the lawful future entry the header grants — the same defect as the MINOR one level further in) — ae179edc, where the set became a subset and the live cause-4 test was generalised over the record so a later entry meets the same standard rather than escaping the check. Demonstrated: with a synthetic third cause-4 row the equality is False and the subset is True. Cause 1 stays pinned at ten, deliberately — the header states it cannot recur through the wrapper, so an eleventh clock row means the wrapper was bypassed and should red.

Re-verification at this head

check result
validate-sequenced-after.py . rc 0 — 12 disposition(s) in force, enforcement error, 0 undispositioned
--strict-archive-dates rc 1 — the pre-existing ledger arm's 124 opt-in drift findings; this arm passes and prints
--ledger-diff rc 0 — per-change sweep ledger consistent with the corpus (188 rows)
pytest tests/sequenced_after tests/scope_globs tests/proposal-support -q 415 passed, 2 subtests (main 89242304: 375; this PR's previous head 60fe7647: 411 — +4: three cause-4 fixture tests, one live cause-4 disposition test)
drop the disposition lookup live run → 12 findings, rc 1; 5 tests fail
drop the comparison the one-day-early and cause-4 fixtures' findings vanish; 12 fail
drop the stale loop its three fixtures go green; the 3 STALE tests fail, nothing else
doc-health.py --single-repo . unchanged — 92 findings, normalized sets diff IDENTICAL against both origin/main and the previous head 60fe7647; only delta anywhere is +88 governance words (the lengthened lifecycle paragraph), canon share 39.1% either way

Each mutation was applied, run, and reverted from a pristine copy compared by md5.

FROZEN

ae179edc1dad91571e8ec2378015f5f6680c8442 — all ten check-runs SUCCESS, mergeable: MERGEABLE, 0 unresolved threads, closingIssuesReferences exactly [opensoft/openxFactory#812], no openspec/ path in the diff (five files: scripts/sequenced_after.py, scripts/validate-sequenced-after.py, tests/sequenced_after/archive-date-dispositions.yaml, tests/sequenced_after/test_archive_commit_dates.py, docs/document-lifecycle.md). The corpus ledger is byte-identical to origin/main; no archived directory is renamed or touched.

check-run conclusion
pytest-suite SUCCESS
lane-line SUCCESS
signed-execution-chain-gate SUCCESS
clearing-dispatch-gate SUCCESS
openreposhape-pin SUCCESS
openspec-cli-pin SUCCESS
wallet-validation SUCCESS
release-tag-gate SUCCESS
merge-master-approval SUCCESS

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 introduces a new history-dependent validation arm with nuanced exit-code semantics that affects gating behavior, so it warrants final human review despite strong test coverage.

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

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

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

…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
Copilot AI review requested due to automatic review settings September 9, 2026 01:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The new gate is well-scoped, heavily fixture-tested, and integrates cleanly with the existing validator flow (only minor maintainability nits remain).

Review details

Suppressed comments (2)

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

scripts/validate-sequenced-after.py:383

  • validate_corpus() reuses the name problems for the archive-date-vs-commit arm results, after already using problems for sequenced_after validation earlier in the same function. Renaming the second variable avoids shadowing and makes future edits less error-prone.
    tests/sequenced_after/test_archive_commit_dates.py:766
  • monkeypatch is listed as a fixture argument here but never used in the test body. If this repo runs any linting (or if someone copies this pattern), unused fixture parameters can create noise; removing it keeps the test minimal.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1 (openXfactory-1)

FROZEN at ae179edc — all required checks green (pytest-suite pinned skip count met), no further commits from this lane. Review threads: 0 unresolved (Codex two real rounds — shallow clones fail closed, the record forbids only unmeasured entries, the cause-4 live test generalised; Copilot two rounds, all taken). Adversarial pass → gate sound (batch attribution == per-directory, 0 merge-commit attributions, CI fetch-depth 0 so the arm runs) → 2 MAJOR in the RECORD's facts taken: the two 2026-06-26 rows now state the measured cause (renamed within archive/ on 2026-07-02 by 746be44f from the -openworkflow names; the archive acts 484042de/d7b66d72 on 2026-06-26 AGREE with the names), and the fourth cause — a rename inside archive/ — is named in the record header, the module, the CLI help, the lifecycle doc and the pin test. Tests 375 → 415; every mutation caught. Five files, no openspec/ path — no Rule 6 window; ledger byte-identical; no archived directory touched.

Provenance for the admin merge of #820 (plain fix; no OpenSpec change — the #638/#797 precedent). Words: Brett Heap, 2026-09-08, verbatim "file the successor arm issue, unclaimed" → #812; "rule 1 + 2a on 812, this lane authors it"; "land 797 when green, then author 812"; "merge 812 when green" (all recorded on #812). Arm (1): every archived directory measured against the UTC date of its oldest adding commit, enforcement: error from the record, shipped green with 0 undispositioned; (2a): the ten one-day-early names and the two renamed names dispositioned IN PLACE, names untouched. The first author agent died on a rate limit before the restart (nothing pushed); relaunched clean. Self-authored PR (brettheap) → REVIEW_REQUIRED structural → admin merge (B2). #812 closes with this merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XPt6t1VcNVB5yGzQGwWUFi

@brettheap
brettheap merged commit 870727f into main Sep 9, 2026
11 checks passed
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