Repository navigation
Give the origin-retention gate the explicit disposition its requirement promises (refs #745) - #891
Conversation
…nt promises `release-realization` § "Origin retention at archive" ends its mutation scenario with "restoring or accepting the mutation is a contested-class act requiring an explicit disposition". The gate could read the RESTORING half and nothing else: `origin_retention_errors` compared the working tree's `origin:` block against the block at the ratifying commit, read no record, no environment variable and no flag, and ended every refusal at "this gate has no bypass flag". So an owner's ACCEPTED mutation and an unnoticed edit produced byte-identical refusals, and an acceptance was recordable as governance and unrepresentable as a tree state. MEASURED, NOT ARGUED. codeXfactory/codexFactory #318: change `add-floor-regeneration-automation`, ratifying commit `ec286270b10f`, mutating commit `76758a1b` fourteen minutes later in the SAME pull request #235, `changed keys: approved_by`, and the whole of the diff the TENSE of one sentence. Brett Heap ruled "accept the mutation, this lane re-runs the archives"; the acceptance was recorded on #232; the re-run refused identically. THE CHANNEL IS A RECORD, NOT A FLAG, because the module's own reason for refusing a flag — "a flag on this gate would be the disposition nobody records" — is an argument against UNRECORDED acceptance rather than against acceptance. `<repository-root>/openspec/origin-dispositions.yaml` carries `schema_version: 1`, `kind: origin_dispositions` and a `dispositions:` list whose entries name `change_id`, `ratified_at`, `mutation_at` (both FULL 40-hex object names), `changed_keys`, `disposition: accept`, `disposed_by`, `disposed_on`, the verbatim `word` and `cited_to`, with an optional `fact`. The subcommand grows NO flag and `test_the_archive_subcommand_offers_no_bypass_flag` still passes unchanged. AN ACCEPTANCE MOVES THE BASELINE; IT DOES NOT SKIP THE COMPARISON, which is why this cannot decay into a bypass. On a valid `accept` the declaration AT THE ACCEPTED MUTATION becomes the origin of record and every arm of the gate runs against IT: the packet must equal it exactly, and the support manifest's repeated origin fields are measured against it rather than against the superseded ratification. A second, undispositioned edit on top of an accepted one refuses exactly as the first did. The gate accepts only when: one entry names this change; the key set is exactly the required nine plus optional `fact`; `disposition == accept`; `ratified_at` equals the ratifying commit the gate resolved FROM HISTORY; `mutation_at` resolves to a commit, descends from `ratified_at`, is reachable from HEAD and carries an origin block; that declaration differs from the ratified one; the declared `changed_keys` equal the measured key diff between the two commits; and the working tree's block equals the block at `mutation_at`. Anything wider refuses while NAMING WHAT DID NOT MATCH. READ FROM THE ROOT THE GATE WAS GIVEN, so it works where it is actually used: `$OPENXFACTORY_ROOT/scripts/proposal-support.py <consumer-root> archive <id>` reads `<consumer-root>/openspec/origin-dispositions.yaml`, and openxFactory's own archives read openxFactory's own file at that same relative path. Consumers need no change beyond writing the record; none is shipped here, because no mutation has been accepted in this repository and an empty list records nothing. THE SHAPE IS THE ESTATE'S EXISTING ONE. Three disposition records already exist and this is the fourth: `tests/sequenced_after/archive-date-dispositions.yaml` (the header, the list, FULL object names, `fact`, `cited_to`), `contracts/openspec-cli-pin.yaml`'s `dispositions:` list (one entry accepts one finding matched on a tuple compared WHOLE, `cited_to` required and non-empty, an authority named), and `health/dispositions.yaml` (the `cite` that answers doc-health's contested classes, including the nightly `proposal-origin` family's own post-ratification-mutation finding, which keeps its existing channel unchanged). Two departures, both stated in the code: the siblings' bundled `ruled_by` is split into `disposed_by`/`disposed_on`/`word` because this is the first of the four to CHECK that a disposition is dated and quoted; and the citation is `cited_to`, not `recorded_at`, because every other `_at` key in an entry names a COMMIT — an entry writing `recorded_at` is refused as an unknown key and told the estate's spelling. No staleness arm, deliberately: unlike a directory name or a pin finding, an origin disposition is not transient — the packet archives and the entry becomes the only thing in the tree that says why the archived origin differs from its ratification. The refusal now routes the reader instead of stopping at "no bypass flag": it names BOTH repairs, the record's absolute path, and every field an entry needs, with this change's own ratifying commit in full so the entry can be written straight out of it. `archive --help` carries the same routing in an epilog that names no flag, and `docs/document-lifecycle.md` § "Origin at the proposal gate" carries the record's shape. Tests, where the origin-retention tests already live: 22 new tests and 21 new subtests, all measuring against real mini-repositories and real commits — the end-to-end accept (the same `archive_change` call raises `OriginRetentionError` without the record and reaches `change has incomplete tasks` with it), #318's own tense-only case, the anti-vacuity control, the consumer-root property, the manifest arm moving with the baseline, and negative controls for every condition. Three guards were removed one at a time and the suite re-run to prove the controls fail when the code stops checking. tests/proposal-support 128 passed / 66 subtests (main 106 / 45); `-k "proposal or origin or archive"` 477 passed, 1 skipped (main 455, 1); `validate-sequenced-after.py .` passed; `validate --all --strict` at the pinned CLI exit 0 with the same two pre-existing accepted exceptions. Measured with a probe record in place: the pinned OpenSpec CLI tolerates the file inside `openspec/`. No specification is edited and none is owed: this realizes the requirement's own words. If the record's FORM is to be named in canon, that is a `## MODIFIED` scenario in a separate packet. Refs #745 Refs codeXfactory/codexFactory#232 Lane: openxfactory-2 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ition-channel branch Lane: openxfactory-2 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@codex review |
Reviewer's GuideThis PR realizes the existing release-realization requirement’s accepting path by adding a repository-local, owner-attributed origin-disposition record. The archive gate validates the record against Git history, requires the working tree to match the named mutation, then uses that mutation as the comparison baseline while continuing all retention checks; invalid or absent records still refuse with restore/accept guidance, and comprehensive tests cover the acceptance path and negative controls. Sequence diagram for accepted origin mutation during archivesequenceDiagram
participant CLI
participant Gate as origin_retention_errors
participant Record as origin-dispositions.yaml
participant Git
participant Manifest as support manifest
CLI->>Gate: archive_change(change)
Gate->>Git: Resolve ratifying commit and origin block
Gate->>Git: Compare working tree origin block
alt Origin unchanged
Gate->>Manifest: Check repeated origin fields
Gate-->>CLI: ORIGIN RETAINED
else Origin mutated
Gate->>Record: Load record from consumer root
Record-->>Gate: accept entry
Gate->>Git: Validate commits, ancestry, changed_keys, and mutation origin
Gate->>Gate: Move baseline to accepted mutation
Gate->>Manifest: Compare fields against accepted declaration
Gate-->>CLI: ORIGIN DISPOSITION ACCEPTED
Gate-->>CLI: ORIGIN RETAINED
end
Flow diagram for origin mutation dispositionflowchart TD
A[Archive gate finds origin mutation] --> B{Ratified bytes restored?}
B -->|Yes| C[Compare against ratified declaration]
B -->|No| D[Read consumer-root openspec/origin-dispositions.yaml]
D --> E{One valid accept entry matches history?}
E -->|No| F[Refuse and print restore/accept guidance]
E -->|Yes| G[Use mutation commit as origin of record]
G --> H[Require working tree to equal accepted declaration]
H --> I[Run packet and manifest retention checks]
I --> J[Archive proceeds to subsequent gates]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a critical archive gate’s decision logic and introduces a new governance-backed acceptance path, which warrants final human review despite strong test coverage.
Pull request overview
This pull request realizes the “explicit disposition” channel promised by the release-realization origin-retention requirement by allowing a recorded acceptance of a post-ratification origin mutation (without introducing any bypass flag). The archive gate can now consult an owner-attributed disposition record to move its comparison baseline to an accepted mutation, while keeping all origin/manifest comparisons enforced.
Changes:
- Add
openspec/origin-dispositions.yaml(schema-checked) as an acceptance record consulted byorigin_retention_errors(), where a validacceptentry moves the origin-of-record baseline tomutation_at. - Expand
tests/proposal-support/test_proposal_support.pywith end-to-end and negative-control coverage for acceptance, malformed records, ambiguous entries, ancestry/sha validation, and manifest-baseline movement. - Update
docs/document-lifecycle.mdto document the acceptance record shape and clarify that acceptance moves the baseline (it does not disable comparisons).
File summaries
| File | Description |
|---|---|
scripts/proposal-support.py |
Implements origin disposition record loading/validation and baseline-moving acceptance behavior in the origin-retention archive gate, plus help-surface routing text. |
tests/proposal-support/test_proposal_support.py |
Adds extensive tests for the new acceptance-record channel, including controls for malformed/ambiguous/mismatched entries and baseline movement. |
docs/document-lifecycle.md |
Documents the new acceptance record mechanism and its operational semantics for consumers running the archive gate. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
annotation says what it actually returns Both findings are valid and both are fixed with a measuring control. `cited_to` may be a LIST — the shape `contracts/openspec-cli-pin.yaml`'s own `cited_to:` takes, and the shape an entry citing an issue, a pull request and a ruling naturally wants — and `AcceptedOriginMutation.note()` interpolated it straight into the acceptance announcement, so a list printed as a Python repr: brackets, quotes and all, in the one line of operator output that says WHY a mutation was accepted. `citation()` joins it with "; " at one place rather than at four call sites, and the list arm of `test_a_citation_may_be_a_list_and_an_uncited_entry_refuses` now captures the announcement and asserts BOTH halves — the joined prose is present and the repr's opening `['` is not. `load_origin_dispositions()` was annotated `list[dict]` while its own docstring said the entries are unchecked, which is a promise the function never establishes: a hand-written record can put a string or a list where a mapping belongs. It is `list[object]` now, which is what it returns; the caller already selects with `isinstance(entry, dict)` before it reads a key, and entry SHAPE is checked by `_entry_shape_problems` for the one entry that names the change being archived. tests/proposal-support 128 passed / 65 subtests. The subtest count is one lower than the 66 measured before this branch merged `origin/main`, and the reason is the corpus rather than a lost control: `test_the_guard_is_a_no_op_on_this_ corpus` runs one subtest per ACTIVE change, and main archived `amend-neutral-product-pin-interim-copy-vocabulary` (39 active changes at 6678f51, 38 at 9784e38). Refs #745 Lane: openxfactory-2 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The acceptance validator currently risks treating unreadable/unparseable historical origin data as an empty key-diff and can emit a misleading “declares no origin” message, which should be tightened to avoid accepting dispositions without measurable changed_keys.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/proposal-support.py:1292
accepted_origin_mutation()can treat an unreadable historical.openspec.yamlas “declares no origin” (whengit_show_text()returnsNone), and it can also silently treat an unparseable origin mapping aschanged_keys == []via_changed_keys(None, …). That combination can produce confusing operator output and (in the mapping-unparseable case) potentially accept a disposition withchanged_keys: []without actually being able to measure the key diff. It’s safer to (1) distinguish “cannot read file at commit” from “no origin block”, and (2) refuse when the origin mapping at ratification/mutation can’t be parsed, sincechanged_keysis a required safety predicate.
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
…, and
the suppression markers written in the syntax the analyser reads
Six new issues on this branch's code, all six taken. The quality gate PASSED
with them standing, so none of this was forced — they are findings on code
authored an hour ago and worth taking while it is still warm.
TWO CRITICAL (python:S3776, cognitive complexity). `_entry_shape_problems` was
34 against an allowance of 15 and `accepted_origin_mutation` was 17. Both were
one long chain of independent checks, which is exactly the shape that reads
badly and the shape a split fixes without moving an assertion:
* `_entry_shape_problems` is now a concatenation of `_unknown_key_problems`,
the missing-key line, `_string_field_problems` (the non-empty strings and
the date's shape, with the YAML unquoted-scalar trap), `_citation_problems`
(a string or a LIST, non-empty, content not pattern-matched),
`_object_name_problems` (FULL 40-hex only) and `_accept_value_problems`
(`changed_keys`'s shape, and the one disposition this gate reads). Every
helper still reports EVERY problem it finds rather than the first: an
operator repairing a hand-written entry should see the whole list once,
not discover it a line at a time across five refusals.
* `accepted_origin_mutation` is now three named stages in the order each one
presumes the last — `_selected_disposition_entry` (read, parse, select,
refuse ambiguity), `_entry_shape_problems` (so the commit names below are
strings and `changed_keys` is a list), then `_accept_commit_problems` and
`_accept_declaration_problems`. The `or` between the last two keeps the
original short-circuit exactly: the declarations are only read once the
commits that name them are known good.
FOUR MAJOR (python:S7632 ×2, python:S125 ×2) on the two new `# NOSONAR: reason`
comments: that spelling is not the marker's syntax, so the analyser read the
prose as commented-out code and the suppression suppressed nothing. The reason
moves to its own comment line above the call and the marker is bare. The
file's older calls keep their form; they are not this branch's code and
changing them here would be a sweep hiding inside a realization.
NOTHING BEHAVIOURAL MOVED, and that is measured rather than asserted: 128
passed / 65 subtests, unchanged, and the three anti-vacuity probes re-run
against the SPLIT code still fail the controls they are supposed to fail —
removing `if declared != measured:` fails both changed-keys controls, removing
`if now_lines != at_mutation:` fails the "an accepted mutation does not license
the next one" control, and removing `if ratified_at != ratifying:` fails the
baseline control. The file was restored byte-identically after each probe.
Refs #745
Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nnel branch No overlap with this branch's three files; taken so the required checks judge this work against a current base. Lane: openxfactory-2 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a core archive gate’s acceptance/baseline semantics and operator-facing refusal behavior, which warrants careful human verification despite strong test coverage.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
… the
baseline stays put on a record whose predicate failed
THE PROPOSAL IS REFUSED, AND THE NEED BEHIND IT IS TAKEN.
The observation is correct: when a valid record exists but the tree has moved
on again, the headline finding still compares the packet to the RATIFICATION,
so its `changed keys:` names the union — the accepted key and the newly
undispositioned one. Copilot proposed moving the comparison baseline to the
accepted commit anyway, so the headline diff would be the small one.
That is refused, and for two reasons rather than a preference.
ACCEPTANCE IS ALL OR NOTHING. "The working tree carries the accepted
declaration" is one of the acceptance conditions, not a formatting detail; a
record that accepts a declaration the tree does not carry has accepted
nothing, and treating its commit as the origin of record would name a
declaration nobody is archiving. The baseline moves only on a record whose
whole predicate held, which is the property that keeps this a disposition
rather than an allow-list.
AND THE HEADLINE WOULD BECOME FALSE. It reads "differs from the one this
change was ratified over (ratifying commit X)". Moving the baseline under it
puts a commit there that is NOT the ratification, which is a worse defect than
a wide key list.
WHAT THE PROPOSAL IS ACTUALLY AFTER — the operator seeing the difference that
is undispositioned — is delivered where it belongs, inside the record's own
finding, which already diffs against the accepted declaration and now also
names the subtraction:
keys moved BEYOND the accepted declaration: approved_on
`test_an_accepted_mutation_does_not_license_the_next_one` asserts BOTH halves
now — the subtraction line, and the headline's union
(`changed keys: approved_by, approved_on`) — so the division of labour between
the two findings is pinned rather than described. And when a second mutation
is itself accepted, the entry is REPLACED rather than joined by another, which
the ambiguity refusal in `_selected_disposition_entry` already says in terms.
128 passed / 65 subtests.
Refs #745
Lane: openxfactory-2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The updated refusal routing currently appends the origin-disposition channel text even when the packet’s origin: block didn’t mutate (e.g., manifest-only mismatches), which can mislead operators about the correct remediation.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/proposal-support.py:1615
origin_retention_errors()appendsorigin_disposition_channel(...)for any origin-retention error, including cases where the packet’sorigin:block did not mutate (e.g. only the support manifest origin fields differ). That message is specific to “post-ratification origin mutation” and routes the operator toward RESTORE/ACCEPT, which is misleading when the only actionable fix is to update the manifest to match the retained declaration of record.
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 19 hours and 51 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
|
Lane: openxfactory-2 (openXfactory-2) |



Lane: openxfactory-2 (openXfactory-2)
Claim: #745 (comment) — CLAIMED 2026-09-10T02:40:27Z, before this branch was authored. Sibling search by path beforehand: no open pull request touches
scripts/proposal-support.py, its tests, oropenspec/specs/release-realization/spec.md.Refs #745. Refs codeXfactory/codexFactory#232.
A REALIZATION REPAIR, NOT A NEW RULE. The
release-realizationrequirement already says a post-ratification origin mutation may be ACCEPTED by an explicit disposition. The gate could only ever read the RESTORING half. This gives it the accepting half — as a RECORD, not a flag — and edits no specification.The word
Brett Heap, in session, 2026-09-10 (~02:4xZ), verbatim: "add the disposition channel, this lane authors it".
The gap
openspec/specs/release-realization/spec.md§ Origin retention at archive, verbatim:origin_retention_errors()inscripts/proposal-support.pycompared two things and only two: theorigin:block in the WORKING TREE against the block at the ratifying commit. It read no record, no environment variable and no flag, and it ended every refusal here:The module said why it would never grow one, and the reason is right:
That is an argument against UNRECORDED acceptance, not against acceptance. So the requirement promised a disposition the gate could not read, and an owner's accepted mutation was indistinguishable from an unnoticed edit.
tests/proposal-support/test_proposal_support.py::test_the_archive_subcommand_offers_no_bypass_flagforbids--force,--allow-origin-mutation,--skip-origin-retentionand--no-origin-check, and it still passes unchanged — this adds no flag.MEASURED, NOT ARGUED — codeXfactory/codexFactory #318. Change
add-floor-regeneration-automation; ratifying commitec286270b10f; mutating commit76758a1b, fourteen minutes later in the SAME pull request #235;changed keys: approved_by, and the whole of the diff is the TENSE of one sentence ("The packet remains Status: draft" → "At the time this field was written the packet WAS Status: draft"). Brett Heap ruled "accept the mutation, this lane re-runs the archives"; the acceptance was recorded on #232; the re-run refused byte-identically. #318 § The re-run, and the refusal that did not move states the finding this pull request answers: "an acceptance is recordable as governance — it is recorded — and is not a tree state that can be shown to this gate."The record
<repository-root>/openspec/origin-dispositions.yamlThe worked example is #318's own case, and every value in it was read back from the GitHub API rather than typed. This is the exact entry that repository must add:
Every fact in it verified read-only against
codeXfactory/codexFactorybefore it was written here:ratified_atis the full object name ofec286270b10frepos/…/commits/ec286270b10f→ec286270b10fe2e9c0370906fd84b4fab157ffbf,2026-09-06T01:21:40Z, "Ratify add-floor-regeneration-automation …"mutation_atis the full object name of76758a1b76758a1bcb5f10bf6d6cbfd66e6dac1f38c7fb3f,2026-09-06T01:35:44Z— 14 min 4 s latercompare/ec286270…...76758a1b…→status: ahead, ahead_by=1maincompare/main...76758a1b…→status: behind, behind_by=521changed_keysis exactly the key diff.openspec.yamlblobs at the two commits differ inapproved_byand in nothing else (kind,id,reason,approved_on,relatedbyte-identical)76758a1b…is byte-identical to the file atmain(sha256 a937bb06e9ca4c52…), so the acceptance covers the bytes that are actually thereWhy this shape, and not another
The estate already had three disposition records; this is the fourth, and it reuses their vocabulary so the corpus keeps ONE idea of a disposition:
tests/sequenced_after/archive-date-dispositions.yaml— aschema_version+kindheader over adispositions:list, FULL 40-hex object names ("this is a citation, and an abbreviation is ambiguous by construction"), afact, aruled_by, acited_to, and every entry scalar QUOTED.contracts/openspec-cli-pin.yaml's owndispositions:list — the closest sibling and the rule this gate follows most closely: "Each entry ACCEPTS exactly one ERROR-level finding … matched on the tuple … compared WHOLE", withcited_to:required and non-empty and an authority named, refusingpin-disposition-malformedwhen either is missing or when two entries would cover the same finding.health/dispositions.yaml— thecite-carrying entries that answer doc-health'scontestedclasses, including the nightlyproposal-originfamily's own post-ratification-mutation finding (scripts/doc_health/proposal_origin.py:25,:68): the same fact seen from the report side, and it keeps its existing channel. Nothing about doc-health changes here.TWO DEPARTURES, both deliberate and stated rather than silent.
ruled_by/ratified_bystring is split intodisposed_by,disposed_onandword. This is the first of the four records to CHECK that a disposition is dated and quoted rather than only to print it; a bundled string cannot be checked for either.cited_to, notrecorded_at(the field name the task named). Every other_atkey in an entry here names a COMMIT, and the estate already has exactly one spelling for "where the ruling is recorded". It takes a string or a list of them, as the pin manifest's does, and its CONTENT is not pattern-matched: the sibling records cite issue numbers, pull requests, spec lines and council rulings, so a gate demanding a URL would refuse three of those four. Only EMPTINESS refuses — the rule the pin manifest states in those words: "A DISPOSITION WITHOUT A CITATION IS REFUSED, not ignored." An entry that writesrecorded_atis refused as an unknown key and told the estate's spelling, so the near-miss cannot read as a missing field.why(the pin manifest's narrative key) gets the same treatment, pointing atfact.NO STALENESS ARM — the one place the siblings are deliberately not copied. Both of them refuse a stale entry, and both are right, because THEIR conditions are transient: a directory is re-measured on every run, and a pin's findings are re-derived at every bump. An origin disposition is not transient. Its subject archives, and the archived packet then carries — permanently — an origin that differs from the one at its ratifying commit; the entry is the only thing in the tree that says why, and on whose word. A staleness rule would demand the deletion of that explanation on the day it starts mattering most: the day the packet lands in
openspec/changes/archive/and nobody can ask the author any more. The honest cost is stated in the code: an entry whose mutation was afterwards RESTORED in the bytes silences nothing (the gate never reads the record on a tree it is about to pass) and is not reported either.The acceptance predicate
An acceptance MOVES THE BASELINE; it does not skip the comparison. That is the whole mechanism and the reason it cannot decay into a bypass. On a valid
accept, the declaration AT THE ACCEPTED MUTATION becomes the origin of record and every arm of the gate then runs against it — the packet's block must equal it EXACTLY, and the support manifest's repeated origin fields are compared to it rather than to the superseded ratification.The gate accepts only when all of the following hold, and each is measured against HISTORY rather than taken from the entry:
change_id == <this change>(two refuse as ambiguous, naming bothmutation_atvalues; entries for other change ids are ignored and never validated, so one change's bad entry cannot block another's archive);fact— an unknown key refuses, because a key the gate does not read cannot narrow what the entry accepts, so a typo must not be ignored;disposition == "accept"— the ONLY disposition that needs a record. A restoration is the bytes: put the ratified declaration back and the gate passes with nothing to read;ratified_atis a FULL 40-hex object name and equals the ratifying commit the gate resolved from history (a different one disposes some other baseline);mutation_atis a FULL 40-hex object name, resolves to a commit in this repository, is notratified_at, DESCENDS fromratified_at(a post-ratification mutation is one that comes after it), is reachable from HEAD, and carries anorigin:block;mutation_atdiffers from the declaration atratified_at— an entry that disposes nothing refuses;sorted(changed_keys)equals the measured key diff between those two commits — an acceptance covers exactly the keys it names, neither wider nor narrower;origin:block equals the block atmutation_at, byte for byte after the same trailing-whitespace normalisation the gate has always used;disposed_by,disposed_on(YYYY-MM-DD),wordandcited_toare present and non-empty, with the YAML unquoted-scalar trap named in the refusal (a bare2026-09-10is a DATE to YAML, and a bare all-digit object name an INT — the rule the sibling record's header states).Anything wider refuses while NAMING WHAT DID NOT MATCH — which is the difference between a disposition and an allow-list.
What the refusal says now
It still says there is no bypass flag, because there is none. What it no longer does is STOP there — which is what it did to the operator on #318 who was holding a recorded acceptance. Verbatim, from a real refusal on a real fixture (
<root>is the repository root the gate was given):And on the acceptance path, the SAME fixture with the record present — an end-to-end CLI run, not only a unit test (
exit 1,change has incomplete taskson stderr, which is the NEXT gate):The subcommand's own
--helpcarries the same routing (archive --help, an epilog naming BOTH repairs and no flag), anddocs/document-lifecycle.md§ Origin at the proposal gate — the page that already documents this gate — carries the record's shape.Design note: the gate runs in CONSUMER repositories
$OPENXFACTORY_ROOT/scripts/proposal-support.py <consumer-root> archive <id>runs THIS repository's script against somebody else's tree, which is how codexFactory, MedxFactory and the rest archive. The record is therefore read from the ROOT ARGUMENT —<consumer-root>/openspec/origin-dispositions.yaml, beside theopenspec/changes/it disposes — and never from wherever the script itself happens to live. openxFactory's own archives read openxFactory's own file at that same relative path, by the same code.test_the_record_is_read_from_the_root_the_gate_was_givenmeasures it: the right record in the wrong place changes nothing, and moving it to<root>/openspec/flips the same refusal to a pass.Consumers need no change beyond writing the record. No pin moves, no workflow changes, no schema is published for them to adopt: a repository with no accepted mutation has no file, and the gate treats a missing record as "no record". The
schema_version+kindheader is what lets a consumer's own repo-wide YAML convention check (this estate's rule 4 — every YAML carriesschema_version+kind) accept the file without a carve-out. openxFactory ships noopenspec/origin-dispositions.yamlin this PR: a record with an empty list records nothing, and no mutation has been accepted here.Measured, because the file sits inside
openspec/: with a probe record written atopenspec/origin-dispositions.yaml, the pinned CLI'svalidate --all --strict(@fission-ai/[email protected], content address verified) exits 0 with the same 2 pre-existing accepted exceptions and no new finding. The OpenSpec CLI does not mind the neighbour. The probe was deleted; nothing of it is in this branch.The two sibling archive gates are NOT widened.
scripts/scope_globs.py:473andscripts/sequenced_after.py:656carry the identical "restoring or accepting the mutation is a contested-class act requiring an explicit disposition" sentence and have no channel either. This PR touches neither, and the record'skindisorigin_dispositionsrather than a generic name on purpose, exactly asarchive_date_dispositionsis named for its own arm — so widening to a second gate stays a deliberate act with its own ruling rather than a side effect of this one.Negative controls — every one of them MEASURES
Real mini-repositories, real commits, real
gitin a temporary directory, exactly as the existing origin-retention tests do. Each control starts from an entry proven to pass in the same class and changes exactly ONE thing.test_an_accepted_disposition_moves_the_baseline_and_archivesarchive_changeraisesOriginRetentionErrorwithout the record; with it, the SAME call gets past that gate and dies on the NEXT one (incomplete tasks), assertedassertNotIsInstance(…, OriginRetentionError). Also that the acceptance is ANNOUNCED —ORIGIN DISPOSITION ACCEPTED, the commit, the authority, the verbatim word and the citation on stdouttest_the_318_tense_only_approved_by_case_archives_with_the_recordchanged keys: approved_by, then accepted with the recordtest_an_accepted_mutation_does_not_license_the_next_onetest_a_record_naming_a_mutation_that_is_not_a_commit_refusestest_a_record_whose_mutation_precedes_the_ratification_refusestest_a_record_whose_ratified_at_is_not_the_ratifying_commit_refusestest_a_record_declaring_an_extra_changed_key_refuses/…_too_few_changed_keys_refusestest_a_disposition_other_than_accept_refusesrestore,accepted,ACCEPT,noted— four subteststest_a_record_missing_a_required_field_refuses_naming_ittest_an_unknown_key_refuses_and_the_two_near_misses_are_namedrecorded_at→cited_to,why→facttest_a_citation_may_be_a_list_and_an_uncited_entry_refuses[],""," "and[url, ""]refused — four subteststest_an_abbreviated_object_name_refusestest_an_unquoted_date_is_refused_with_the_yaml_trap_namedtest_two_entries_for_one_change_refuse_as_ambiguoustest_an_entry_that_disposes_nothing_refusesmutation_atcarries the RATIFIED declaration accepts nothingtest_a_malformed_record_refuses_naming_the_fileschema_version, wrongkind, non-listdispositions, non-mapping root — five subteststest_a_record_for_another_change_id_is_ignoredtest_the_record_is_read_from_the_root_the_gate_was_giventest_the_support_manifest_is_measured_against_the_accepted_origintest_the_archive_help_names_the_disposition_channeltest_the_cli_refuses_with_exit_2_and_no_traceback(extended)no bypass flag, exit 2, no tracebacktest_the_archive_subcommand_offers_no_bypass_flag(unchanged)The controls were themselves probed. Three guards were removed one at a time and the suite re-run, to prove the tests fail when the code stops checking:
if declared != measured:(the key set)test_a_record_declaring_an_extra_changed_key_refusesand…_too_few_changed_keys_refusesFAILif now_lines != at_mutation:(tree equals accepted)test_an_accepted_mutation_does_not_license_the_next_oneFAILSif ratified_at != ratifying:(the baseline)test_a_record_whose_ratified_at_is_not_the_ratifying_commit_refusesFAILSAll three restored;
git diff --statconfirmed clean before the commit.The OpenSpec judgement — no spec edit, and none is owed
This REALIZES the requirement's own words and adds no rule. The scenario already reads "restoring or accepting the mutation is a contested-class act requiring an explicit disposition". Three of those four terms were already running: the archive MUST FAIL (it does, exit 2), restoring is the bytes (it always was), and the class is contested (the nightly family already files it that way). The only unrealized clause was "requiring an explicit disposition" — a channel for the accepting half. This adds exactly that, and nothing else:
The spec does not name the record's FORM, and this PR does not add one. That is the same division the requirement already lives with everywhere else:
release-realizationdoes not namecontracts/openspec-cli-pin.yaml'sdispositions:list either, norarchive-date-dispositions.yaml, norhealth/dispositions.yaml— three realized dispositions channels whose form lives in the realizing tool and its record, with the requirement naming only that a disposition is required. Naming a filename in a promoted requirement would freeze an implementation detail into canon and make every consumer's path a spec change. If the owner wants the form named in canon, that is a## MODIFIEDscenario in a separate packet and this lane will author it on a word — it is deliberately not in this PR.Verification
Both baselines measured in this same clone with the
openXwalletsubmodule initialised, by stashing this branch's three files and popping them back (the three restored blobs verified byte-identical bysha256sum). The fullpytest-suiteruns on this pull request as one of the six required checks.BOTH SIDES MEASURED AT THE SAME BASE, in this same clone with the
openXwalletsubmodule initialised. The base figures areorigin/mainat804a9170— the commit this branch merged — read by detaching to it, running the two commands, and checking the branch back out (tree verified clean before and after). The-kcounts and the deselect total moved between earlier rounds and these becausemainlanded two new doc-health test files in the meantime; the numbers above are the FINAL head against the FINAL base, so the +22/+21 delta is exactly this branch's own tests.And on the subtest arithmetic, since 21 new subtests do not obviously give 44 → 65:
test_the_guard_is_a_no_op_on_this_corpusruns ONE SUBTEST PER ACTIVE CHANGE, so the pre-existing figure moves with the corpus (45 at6678f51a, 44 at804a9170— main archivedamend-neutral-product-pin-interim-copy-vocabulary, 39 active changes down to 38). 44 + 21 = 65, and the four subtest-bearing tests this branch adds contribute 4 + 8 + 4 + 5 = 21, each measurable on its own.python3 -m pytest tests/proposal-support -qabcb06ed: 128 passed, 65 subtests passed — base804a9170: 106 passed, 44 subtests passed (+22 tests, +21 subtests)python3 -m pytest tests -q -k "proposal or origin or archive"abcb06ed: 478 passed, 1 skipped, 10734 deselected, 65 subtests passed — base804a9170: 456 passed, 1 skipped, 10734 deselected, 44 subtests passed (+22 tests, +21 subtests). Same skip, same deselect count, 0 failures on either sideOPENSPEC_TELEMETRY=0 … validate --all --strictat the pin@fission-ai/[email protected]verified against its content address, "every target validated --strict with 0 UNDISPOSITIONED failures", with the same 2 pre-existing accepted exceptionsmaincarries (add-chain-attestation,add-composed-view-authoring). Unchanged by this branch: no spec, delta or packet is touchedpython3 scripts/validate-sequenced-after.py .sequenced_after validation passed (39 active changes, 9 declaring the field),archive-date agreement passed,archive-date-vs-commit agreement passed (… 12 disposition(s) in force, enforcement error). Identical onmainWhat codeXfactory/codexFactory#318 does next
Add the entry above at
openspec/origin-dispositions.yamlin that repository and re-run the three archives through the declared wrapper from a checkout carrying this change. The origin-retention gate then printsORIGIN DISPOSITION ACCEPTED add-floor-regeneration-automation …followed byORIGIN RETAINED, and the archive proceeds to the next gate — which #318 already measured by hand aschange has incomplete tasksover its eight open boxes. This pull request settles exactly one of the two acts #318 says stand between those packets and their archives; the eight boxes are the other, and remain Brett Heap's.Review rounds
Round 1 — Copilot, 2 comments, both VALID, both taken in
5fe4d7e1, both threads answered and resolved.cited_tomay be a list, andnote()interpolated it directly, printing a Python repr in operator output. Correct, and in the one line that says WHY a mutation was accepted.AcceptedOriginMutation.citation()joins with"; "at one place; the list arm oftest_a_citation_may_be_a_list_and_an_uncited_entry_refusesnow captures the announcement and asserts BOTH halves — the joined prose present, and the repr's opening['absent.load_origin_dispositions() -> list[dict]while its own docstring says the entries are unchecked. Correct — a promise the function never establishes. It islist[object]now, which is what it returns; the caller already selected withisinstance(entry, dict), and entry shape is checked by_entry_shape_problemsfor the one entry naming the change being archived.Round 2 — SonarCloud, 6 new issues on this branch's code, all 6 taken in
59c24303. The quality gate PASSED with them standing, so none of this was forced.python:S3776(cognitive complexity)._entry_shape_problemswas 34 against an allowance of 15,accepted_origin_mutation17. Both were one long chain of independent checks — the shape a split fixes without moving an assertion._entry_shape_problemsis now a concatenation of_unknown_key_problems, the missing-key line,_string_field_problems,_citation_problems,_object_name_problemsand_accept_value_problems, each still reporting EVERY problem it finds rather than the first (an operator repairing a hand-written entry should see the whole list once).accepted_origin_mutationis three named stages in the order each presumes the last —_selected_disposition_entry,_entry_shape_problems, then_accept_commit_problemsor_accept_declaration_problems, theorpreserving the original short-circuit exactly so the declarations are read only once the commits naming them are known good.python:S7632×2,python:S125×2) on the two new# NOSONAR: reasoncomments: that spelling is not the marker's syntax, so the analyser read the prose as commented-out code and the suppression suppressed nothing. The reason moves to its own line above the call and the marker is bare. The file's OLDER calls keep their form — they are not this branch's code, and changing them here would be a sweep hiding inside a realization.Nothing behavioural moved, and it is measured rather than asserted: 128 passed / 65 subtests unchanged across the split, and the three anti-vacuity probes re-run against the SPLIT code still fail exactly the controls they should (the file restored byte-identically after each,
diff -qclean).Round 3 — Copilot again, 1 comment, taken IN PART in
abcb06ed, thread answered and resolved. Copilot observed that when a valid record exists and the tree has moved on AGAIN, the headline finding still compares the packet to the RATIFICATION, so itschanged keys:names the union — the accepted key and the newly undispositioned one — and proposed moving the comparison baseline to the accepted commit anyway so the headline diff would be the small one.The observation is right and the proposed repair is refused, for two reasons rather than a preference. Acceptance is all or nothing: "the working tree carries the accepted declaration" is one of the acceptance CONDITIONS, not a formatting detail, so a record that accepts a declaration the tree does not carry has accepted nothing, and treating its commit as the origin of record would name a declaration nobody is archiving — that all-or-nothing property is what keeps this a disposition rather than an allow-list. And the headline would become false: it reads "differs from the one this change was ratified over (ratifying commit X)", and moving the baseline under that sentence puts a commit there that is not the ratification. A wide key list is a smaller defect than a wrong citation.
What the proposal is actually after is delivered where it belongs — inside the record's own finding, which already diffed against the accepted declaration and now names the subtraction too:
keys moved BEYOND the accepted declaration: approved_on.test_an_accepted_mutation_does_not_license_the_next_oneasserts BOTH halves now — the subtraction line and the headline's union — so the division of labour between the two findings is pinned rather than described.SonarCloud on the final head: 0 open issues on this pull request (all six cleared, quality gate passed).
Round 4 — Codex: QUOTA-REFUSED, disclosed.
@codex reviewwas requested once andchatgpt-codex-connectoranswered "You have reached your Codex usage limits for code reviews" (2026-09-10T04:01:31Z). This head therefore carries Copilot + SonarCloud review only. Sourcery posted a Reviewer's Guide and no findings.Not merged by this lane
Draft until the six required checks are green on the head, 0 unresolved review threads, and
closingIssuesReferences.totalCount == 0. This lane never merges.🤖 Generated with Claude Code
Summary by Sourcery
Implement the explicit origin-disposition channel promised by the release-realization requirement so authorized post-ratification mutations can be accepted and revalidated without weakening archive checks.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: