Skip to content

Realize align-demote-to-round-trip-rule: demote refreshes the outline, never resets it - #215

Merged
brettheap merged 4 commits into
mainfrom
change/demote-round-trip
Aug 19, 2026
Merged

brettheap merged 4 commits into
mainfrom
change/demote-round-trip

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes the ratified change align-demote-to-round-trip-rule (#212, ratified #213): the demote verb now satisfies the round-trip rule it previously inverted. Three commits — implementation, review fixes, record corrections.

What lands

  • New pure round_trip.py owning the slot fill and the xspec:candidate section refresh, with its own three-line-ending split (join∘split == identity asserted over 64 shapes across every exotic separator) because str.splitlines breaks on \x0c/U+2028-class characters inside a function whose whole promise is byte preservation.
  • gate_console.py: plan_demotion marks the outline move path-only in the pure plan (the plan declares which file will be treated as the outline before anything writes); execute_demotion_plan gains the three-case restore — absent → restore snapshot then refresh; byte-identical → applied; differs → refresh IN PLACE bounded to the five provenance slots and the marked sections, snapshot preserved beside as a visible <topic>.snapshot-<change-id>.md named in the README record. Status: staged kept on a fragment destination (draft flip unchanged for openspec/-bound documents). _flip_status repointed at the safe split — which also fixes two pre-existing damages for every openspec/-bound flip (a \x0c inventing a line boundary; U+2028s inflating the scan window past Status:).
  • Unclosed-fence refusal: a fragment ending inside an open fence gets its provenance insert REFUSED (stated in the execution record, the README, and the CLI — never silent), keeping the refresh idempotent instead of piling invisible sections inside the fence; pinned alongside the three-way fence agreement test (~~~ deliberately unsupported in all three implementations so no single one can quietly diverge).
  • CLI: gate demote --execute now tells the human the snapshot disposition and the preserved path — "not applied over your work" is checkable from the terminal.

Realization evidence — driven, not asserted

A real GateConsole.demote + execute_demotion_plan over a real tree with a live, differing CRLF fragment: human work survived byte-for-byte, aspirational text kept out, Status: staged held, all five slots filled (unavailable recorded as unavailable), the xspec: body carries the returned proposal's real text, snapshot preserved and named, selector still picks the outline, structural diff shows exactly two changed regions with every untouched line keeping its own individual line ending. A second demote of the same change is a clean no-op. The 83 pre-existing demote tests never exercised the new arm (fixtures ship no supporting-docs) — a test now pins that inertness so green-but-inert can't recur silently.

Review record

Two adversarial rounds. Round 1 (FIX FIRST): the splitlines hazard living one function from where the new module documented it, with two demonstrated damages including a failing ratified MUST scenario; the unclosed-fence idempotence break; the uncheckable preserved-snapshot record. All fixed and mutation-pinned (12 mutations total across the slice, each caught by a named test). Round 2: LAND, no collateral damage, plus record corrections — including retracting a fabricated gate-based justification in favor of the measured truth (zero of 1079 governed files carry an exotic separator; the corpus.parse_status read-side blindness is real but belongs to its own change as doc-health's shared reader behind fifteen families).

Known bounds, recorded in the change's tasks.md rather than glossed: the fence-broken-snapshot case where the absent-branch and idempotence clauses cannot both hold (idempotence + stated refusal chosen; 0 of 1079 files reachable); the read-side parse_status ruling left open; the corpus-scan .git/modules exclusion trap that nearly falsified a measurement.

Gates (exit codes read directly)

  • python3 -m pytest tests/ideation-dashboard -q: 3240 passed, 6 skipped.
  • python3 -m pytest tests/doc-health -q: 4 failed, 661 passed — exactly the known pre-existing test_client_identity_composition.py set, enumerated.
  • openspec validate align-demote-to-round-trip-rule --strict and --all --strict: valid, 62/62.
  • doc-health full run: 0 new regressions, raw-diff-identical at the branch base.

Realizing this unblocks add-staged-topic-outline-template task 4.2 (the round-trip test, which stays that change's task) and opens this change's archive gate under release-realization.

🤖 Generated with Claude Code

brettheap and others added 3 commits August 19, 2026 10:09
…line

The mechanism performed the exact reset the ratified rule is titled against. It
does not any more, and the proof is a driven demote rather than a reading of the
code — which is the only kind of evidence this defect has ever yielded, since
nothing writes the round-trip slot by name and a grep for it concluded the rule was
merely unimplemented.

WHAT LANDED, against the seven ratified scenarios.

`scripts/ideation_dashboard/round_trip.py` — new, pure, text in and text out. Two
addressed operations: the provenance slots, and the `xspec:candidate`-marked
section bodies. Nothing else in the document is touched, and that boundedness is
what makes it safe to refresh a fragment a human has been working in.

The plan half marks the ONE move whose destination is the topic's declared primary
fragment, path-only and in the PURE plan, so `demote-<stamp>.plan.yaml` declares it
before anything is written — a human reviewing the plan should not have to infer it
from a basename. That move keeps `Status: staged`, set positively rather than by
omitting a flip, so a snapshot whose header had drifted is normalized too. The
`draft` flip is untouched for the documents bound for `openspec/`.

The executor half is a new `_restore_outline` with the three cases: absent →
restore then refresh; byte-identical → the same; DIFFERS → the live fragment is the
authority, its bytes are never replaced, the refresh applies into it, and the
snapshot is preserved beside it as a VISIBLE `<topic>.snapshot-<change-id>.md` and
named in the README. "Never byte-replace" must not quietly become "silently discard
the other copy".

THREE THINGS THE DESIGN DID NOT FORESEE, all found by writing tests rather than by
review.

`str.splitlines(keepends=True)` — the obvious row model, and the one `_flip_status`
uses — also breaks on \\x0b, \\x0c, \\x1c-\\x1e, \\x85, U+2028 and U+2029. A
governance document containing one would be re-split and rejoined into DIFFERENT
BYTES by a function whose entire promise is that unchanged bytes survive. The
module carries its own three-ending split, and `join(split(t)) == t` is asserted
over eight ending shapes: every other guarantee here is phrased as "these bytes
survive", and that sentence is only meaningful if the pair is lossless.

Per-line endings, not one detected flavor. A rewritten line keeps ITS OWN ending
and only CREATED lines take the document's first-break flavor. Detecting one flavor
and rejoining with it — easier, and what a first draft would do — silently
normalizes every ending in a mixed-EOL document: the same defect class from the
other direction.

And the trap the tasks predicted, hit anyway: `Path.read_text` has no `newline=` in
3.12, and its universal-newline mode translates CRLF to LF ON THE WAY IN. The first
cut of the differs branch read the live fragment with it, so a CRLF outline came
back wholly LF — this verb's move arm was already fixed for exactly that once, and
it re-entered through the newest arm. Every document read is `read_bytes().decode`
now. The CRLF test caught it; nothing else would have.

TESTS: 45 in `test_round_trip.py` and 9 driven cases in `test_gate_console.py`,
whose 83 pre-existing tests stay green untouched. They stay green for a reason
worth asserting rather than assuming — the fixture change ships with no
supporting-docs, so it has no outline move and this arm is inert for it, which a new
test now pins so that "the old tests pass" cannot mean "the new code never ran".

The three-way fence agreement my design promised as the mitigation for a THIRD
implementation of one rule is built, and it compares what each module DOES with
fences rather than a private helper's signature: for ten fixtures, the set of
headings `round_trip.py`, `doc_health.families` and `outline-model.js` each treat as
REAL must be identical. It also pins the predicate's spelling in all three files,
because a fixture set only samples the input space. `~~~` is in there deliberately
— it IS a CommonMark fence and none of the three treats it as one, so a future
"improvement" to any one of them fails here rather than silently diverging.

Every non-obvious bite was mutation-validated: seven mutations, each caught by the
intended test — the outline arm removed entirely (the pre-change defect; 7 tests
catch it), the outline flipped back to draft, a differing destination byte-replaced,
the slot search made fence-blind, replacement lines taking the proposal's endings, a
fabricated `Raised`, and `read_text` re-armed. Both files restored and re-verified
byte-identical.

ONE TASK WAS NOT IMPLEMENTABLE AS I WROTE IT, recorded in tasks.md rather than
quietly narrowed. My 3.3 asked for the snapshot disposition in "the transition
manifest AND the README note". The manifest is written BEFORE any file moves, so it
cannot know whether a destination existed and differed — that is an execution-time
fact about the real tree. Split accordingly: the plan and manifest declare the RULE,
the README records the OUTCOME and names the preserved file. The ratified
requirement asks for it "named in the transition's own record", singular, and the
README is that record — so the contract is met and it was my task wording that
over-specified. Task 2.1's wording was likewise narrowed: `classify_change_file`
was left exactly as it is, because widening a path-only public contract to carry a
topic name its caller already has is the wrong trade; `plan_demotion` marks the move
instead, which is still the pure plan.

DRIVEN PROOF: real `GateConsole.demote` + `execute_demotion_plan` over a real tree
with a live differing fragment. Disposition `preserved`; the live Summary and the
human's own idea-note survived; the aspirational text stayed out; `Status: staged`
held; all five slots filled including `Raised` from the manifest; the `xspec` body
equals the RETURNED proposal's `## Why`; the snapshot kept visible and named;
`_primary_fragment` still selects the outline. No demote was run against the LIVE
corpus — that deletes a change folder and moves real material, and reverting is not
the same as never having done it; the fixture copy runs byte-identical code paths,
and the narrowing is recorded.

Gates, exit codes read directly: `pytest tests/ideation-dashboard -q` 3229 passed,
6 skipped, exit 0; `pytest tests/doc-health -q` exit 1 with the SAME four
pre-existing `test_client_identity_composition.py` failures, diffed as a set
(identical); openspec `--strict` exit 0 and `--all --strict` exit 0 (62/62);
doc-health single-repo exit 0 and byte-identical to a stashed baseline run at the
branch base, no normalization — its 6 -> 7 error count between slices is
`docs/notebooklm-sync-open-item.md` from `47b062e` (#209), untouched by this branch
and proven so rather than asserted.

Not archived, and the parent change's task 4.2 is untouched: realization evidence
and the archive gate come after merge, and that test stays the parent's task.

Co-Authored-By: Claude Opus <[email protected]>
…eport the snapshot

Review of `a9c44eb` found three, two of which failed ratified scenarios. All
reproduced against the tree before fixing and re-run against it after.

F1 — THE HAZARD NOTE WAS VIOLATED ONE FUNCTION AWAY. `round_trip.py` opens with a
paragraph about why `str.splitlines(keepends=True)` is unusable on these documents,
and `_flip_status` twelve hundred lines up was still using it — which mattered
newly, because this change routes a topic's PRIMARY FRAGMENT through that function.
Two damages, both reachable, both now pinned:

`Status: draft\x0crest of the line` was seen as TWO pseudo-lines. The first matched
`startswith("Status:")`, was replaced with no ending, and the remainder was GLUED
onto the new value: `Status: stagedrest of the line`. Text moved across a line
boundary the file does not contain. And a header carrying U+2028s inflates the
pseudo-line count past the 15-line window, so a real `Status:` inside the header is
never found and the flip silently does nothing — failing the ratified "the restored
fragment MUST carry `Status: staged`" scenario on input you get by pasting from a
web page.

`_flip_status` shares `round_trip.split_keepends` / `join_rows` now, and keeps the
P3 guarantee it already had (a rewritten line keeps its own ending).

THE FIX IS NOT CONFINED TO THIS CHANGE'S SURFACE, and saying so is the point rather
than a bonus to hide: every `openspec/`-bound document this verb flips to `draft`
ran through the same code and was exposed to the same two damages before today. A
pre-existing defect goes out with this one.

F2 — IDEMPOTENCE HAS NO QUALIFIER. On a fragment ending inside an unclosed fence
the provenance insert landed INSIDE the open span, where `find_provenance_section`
cannot see it — so every pass inserted again: 1 -> 2 -> 3 sections. The corpus had
already ratified the answer on the JS side, where `outline-model.js`'s
`endsInsideFence` refuses this exact input, so `round_trip.py` now carries the same
predicate under the same name and refuses the same thing.

The refusal is NARROW on purpose: it withholds the INSERT, not the whole refresh.
Slots that ARE findable outside the fence are still filled, because refusing those
would punish a document for a defect somewhere below them. And it is surfaced —
`outline_refusal` on the execution record and a sentence in the README — rather than
reported as a refresh that did not happen. Corpus reachability is zero today; the
clause carries no qualifier, which is why zero was not an answer.

Two smaller things came with it: the destination is written only when its bytes
actually move, so a withheld refresh leaves a live fragment's mtime alone as well as
its content; and ends-inside-fence is pinned as a FOURTH agreed behavior in the
three-way fence test, computed for all three implementations even though
`doc_health.families` has no such predicate of its own — its shared toggle implies
the same answer, and the test computes it so a divergence in any of the three
surfaces there.

F3 — A RECORD NOBODY READ. `snapshot_disposition` and `preserved_snapshot_path`
were populated and consumed by nothing, so "we did not overwrite your work" — which
this change's own comment calls exactly the sentence a human needs to be able to
check — never reached the human who ran the verb. `cmd_gate_demote --execute` prints
the disposition, the preserved path, and any withheld-refresh reason. Asserted
through the REAL parser rather than a hand-built Namespace, because a Namespace's
field set can drift from the CLI's while the test keeps passing.

Each revert was mutation-checked and each is caught by its own test: splitlines
restored (2 tests), the fence guard removed (2), the CLI silenced (1).

ONE READER-SIDE DEFECT FOUND AND DELIBERATELY LEFT: `corpus.parse_status` has the
same pseudo-line blindness (`text.splitlines()[:15]`), so a U+2028 header hides the
status from doc-health's READER too — the write side is fixed and the read side is
not. It is outside this change's surface and touching it would move corpus findings
this slice's own gate forbids. Recorded in tasks.md for whoever rules on it rather
than quietly fixed or quietly ignored.

Gates, exit codes read directly: `pytest tests/ideation-dashboard -q` 3240 passed,
6 skipped, exit 0; `pytest tests/doc-health -q` exit 1 with the SAME four
pre-existing `test_client_identity_composition.py` failures, diffed as a set
(identical); openspec `--strict` exit 0 and `--all --strict` exit 0 (62/62);
doc-health single-repo exit 0 and byte-identical to the branch-base baseline, raw,
no normalization.

Co-Authored-By: Claude Opus <[email protected]>
…overstated pin

Documentation only — no production line changed, `git diff HEAD -- scripts/` is
empty. Three records that said more, or less, than the code does.

1. THE INVENTED EXCUSE, RETRACTED. This change's note claimed that fixing
`corpus.parse_status` "would move corpus findings this slice's own gate forbids".
That was false, and it is now measured false: 1079 governed markdown files under
this checkout carry ZERO instances of `\x0b \x0c \x1c \x1d \x1e \x85` U+2028 U+2029
anywhere in the file, let alone in a header window, and there are zero files where
the pseudo-line and real-line windows even differ. Fixing `parse_status` today would
move no finding at all.

The conclusion survives for the right reason — `parse_status` is doc-health's shared
reader behind fifteen check families, so a change to it deserves its own change with
its own baseline diff rather than riding a gate-console fix. Only the justification
was invented, and the note now says which one was which. It is named as a PATTERN
rather than a line: this is the second time in this change's family that an accurate
finding got a fabricated gate-based excuse, the 4.x order-check justification being
the first, and a reviewer had to measure both. The measurement also records a trap
worth keeping: `corpus.EXCLUDED_PARTS` must be applied to the RELATIVE path, because
this worktree lives under `.git/modules/` and an absolute-parts check silently
excludes every file in the corpus — my first attempt scanned 0 files and reported
clean.

BOTH REVIEW-SUPPLIED SHAPES NEEDED CORRECTING BEFORE THEY WENT IN, which is the
whole point of not transcribing. The window-overrun threshold is not "≥6
separators": six still parses fine at 11 pseudo-lines, and a minimal header needs
about twenty to reach 25. And the second shape does NOT arise from
`Status: draft Kind: x` with a plain space — that is one real line to both
algorithms and they emit identical bytes. It needs an exotic separator, and then it
is real and measured: pre-fix the flip produced `Status: stagedKind: x`, which the
reader parsed as the invalid status `'stagedKind: x'` while keeping the text;
post-fix the whole real line is the header, so its value is replaced and `Kind: x`
goes with it and the reader sees a valid `'staged'`. Better on validity, and it does
delete text a pre-fix reader could see — the one place the read and write sides
disagree about CONTENT.

2. A RESIDUAL BOUND F2's FIX CREATES, recorded so a completeness sweep does not read
it as an oversight. Where the destination is ABSENT and the change folder's snapshot
is itself malformed — ending inside an unclosed fence — the ratified absent-branch
scenario asks for `Status: staged` AND filled slots, and the file gets the first with
a withheld refresh. The two clauses cannot both hold for a malformed snapshot:
filling the slots means writing into an open span, which is exactly what breaks the
unqualified idempotence clause. Idempotence plus a stated refusal was chosen over a
silent non-idempotent insert, and the refusal is visible in three places rather than
inferred. Counted, not assumed: 0 of 1079 governed markdown files end inside an
unclosed fence, and 0 of the 31 staged topics with a primary fragment do. Reversing
the choice is one line and costs idempotence, which is why it is a ruling.

3. AN OVERSTATED PIN, narrowed to what it pins.
`test_ends_inside_fence_agrees_with_outline_model_js` claimed to catch a divergence
in "any of the three surfaces". It does not: its third value RETYPES the backtick
test rather than consuming `_scan_lines`' own `in_fence` flag — which it cannot,
because `_scan_lines` never reports its final fence state — so a families-side
divergence is caught by the other two fence tests, not this one. The docstring now
says it pins two implementations and keeps the third as a cheap consistency check on
the shared rule. A test that overstates its reach is worse than a narrow one,
because the gap it leaves is invisible. The upgrade path is named and its blocker
with it: a real three-way pin wants an exotic-separator fixture, and that fixture
would expose the `parse_status` read/write divergence this change deliberately does
not touch — so it gets built when `parse_status` is ruled on.

Spot-run: `tests/ideation-dashboard/test_round_trip.py` 50 passed, exit 0;
`openspec validate align-demote-to-round-trip-rule --strict` exit 0.

Co-Authored-By: Claude Opus <[email protected]>
Copilot AI lite review requested due to automatic review settings August 19, 2026 15:07

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

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.

Pull request overview

Implements the ratified align-demote-to-round-trip-rule behavior so gate demote refreshes a topic outline in a bounded, byte-preserving way (provenance slots + marked xspec:candidate sections) instead of resetting the outline to the pre-proposal snapshot.

Changes:

  • Add a new pure text transform module (scripts/ideation_dashboard/round_trip.py) for lossless line splitting/joining, provenance slot filling, and marked-section refresh (fence-aware and idempotent).
  • Update demotion planning/execution to explicitly mark the outline move, preserve Status: staged on the outline, and implement the 3-way restore logic (absent / identical / differing → refresh in place + preserve snapshot).
  • Add extensive pure + end-to-end tests, plus update CLI output to report snapshot disposition/refusal details.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/ideation-dashboard/test_round_trip.py Adds exhaustive pure tests for split/join identity, fence behavior agreement, provenance slot filling, and marked-section refresh semantics.
tests/ideation-dashboard/test_gate_console.py Adds driven tests covering the demote plan/execution outline-restore behavior (absent/identical/differing), snapshot preservation, refusals, and CLI messaging.
scripts/ideation_dashboard/round_trip.py New pure module implementing fence-aware, byte-preserving, idempotent provenance + marked-section refresh.
scripts/ideation_dashboard/gate_console.py Marks outline move in the plan, fixes _flip_status to use lossless splitting, and adds execution-time outline restore/refresh logic + execution reporting.
scripts/ideation_dashboard/cli.py Prints execution-time outline snapshot disposition/preserved path/refusal details during gate demote --execute.
openspec/changes/align-demote-to-round-trip-rule/tasks.md Updates the change record/tasks with implementation notes, bounds, and validation evidence.

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

Comment on lines 422 to 424
ex = gate_mod.execute_demotion_plan(res.plan, repo_root)
print(f" EXECUTED: {len(ex.moved)} file(s) moved into {res.plan.topic_path}/openspec/; "
f"README+INDEX updated; change folder removed={ex.removed_change_folder}")
Copilot review on PR #215 flagged that the EXECUTED summary line in
`gate demote --execute` said every moved file went into
`{topic_path}/openspec/`, but supporting-docs restores and the outline
restore (the topic's primary fragment, landed via `_restore_outline`)
move into the topic ROOT instead — that file is included in
`ex.moved` alongside the openspec/-bound ones, so the claim was wrong
whenever an outline or non-openspec supporting doc moved.

Reword the line to count both destinations from the data already on
hand (`ex.moved`'s `to_path`s against `res.plan.openspec_workspace`)
rather than asserting a single destination for every move. Output
text only; no behavior change.

Co-Authored-By: Claude Sonnet <[email protected]>
Copilot AI review requested due to automatic review settings August 19, 2026 15:14
@brettheap
brettheap merged commit 79ed72e into main Aug 19, 2026
1 check passed

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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (4)

tests/ideation-dashboard/test_gate_console.py:582

  • For the same reason as above, counting literal U+2028 characters is clearer/safer when written as an explicit \u2028 escape rather than embedding the invisible character in the test source.
    # …and every U+2028 the author had survives
    assert out.count("
") == src.count("
")

scripts/ideation_dashboard/cli.py:426

  • Inline comment references a specific “Copilot review, PR #215”, which will become stale and is not meaningful to future maintainers. Prefer a timeless rationale that explains why the summary counts both destinations without tying it to a particular review/PR.
        # Not every move lands in openspec/ — supporting-docs restores and the
        # outline restore (below) can land in the topic ROOT instead, so the
        # summary counts both rather than naming a single destination
        # (Copilot review, PR #215).

tests/ideation-dashboard/test_round_trip.py:115

  • This test includes a literal U+2028 line-separator character, which is visually ambiguous and easy to corrupt during edits/copy-paste. Using an explicit \u2028 escape keeps the fixture unambiguous while still exercising the same behavior.
    text = "a\x0cb\x85c
d\n"
    assert len(text.splitlines(keepends=True)) > 1      # the stdlib would split
    assert [body for body, _ in rt.split_keepends(text)] == ["a\x0cb\x85c
d"]
    assert rt.join_rows(rt.split_keepends(text)) == text

tests/ideation-dashboard/test_gate_console.py:576

  • This fixture relies on a literal U+2028 character in the source (between v and the real newline). Making it an explicit \u2028 escape avoids invisible-character issues (formatters, editors, copy/paste) while keeping the same test semantics.

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

    header = "".join(f"Field{i}: v 
\n" for i in range(9))
    src = "# Staged: t\n" + header + "Status: draft\n\n## Why\n"

brettheap pushed a commit that referenced this pull request Aug 19, 2026
…mote green)

The release-realization archive gate is satisfied: the code is merged on the
implemented target as PR #215 and green there — `tests/ideation-dashboard` 3240
passed / 6 skipped / exit 0, `openspec validate --all --strict` 62/62, doc-health
byte-identical to its baseline, and the realization proof is a DRIVEN demote whose
fragment came back carrying the returned proposal's real text, `Status: staged`,
and the five filled provenance slots. That last one matters more than the counts:
this defect was invisible to every grep and only ever yielded to driving the verb.

MECHANICS, following the corpus:

* `OPENSPEC_TELEMETRY=0 openspec archive align-demote-to-round-trip-rule -y` from
  the openxFactory root — the bare CLI, not `proposal-support.py archive`. The
  wrapper exists to package `supporting-docs.tar.gz` + manifest, and
  `docs/release-realization-flow.md` scopes that to a change that OWNS
  `supporting-docs/`. This one has none (ad_hoc origin, born from a review
  finding), so the wrapper would have added a synthetic empty bundle and its own
  "no unchecked tasks" precondition for no benefit.
* The change folder MOVED to `openspec/changes/archive/2026-08-19-align-demote-to-round-trip-rule/`,
  matching the `<YYYY-MM-DD>-<slug>` pattern.
* The delta promoted into `openspec/specs/ideation-dashboard/spec.md`: the CLI
  stripped the `## ADDED Requirements` wrapper and appended the bare
  `### Requirement:` block with its seven scenarios at end of file, which is what
  the three most recent archives did. `--all --strict` now reads 61 items rather
  than 62 — the change left the active set and its requirement landed inside a
  capability already counted.
* README's row moved from "Active changes:" into the "Archived changes:" block,
  with the link repointed at the archive path and a closing "Realized … and
  archived …" sentence.

TWO PLACES PRECEDENT DIFFERED FROM THE BRIEF, resolved and recorded rather than
quietly followed:

Realization evidence does NOT go in the proposal's front matter. All three recent
archive commits leave `proposal.md` a pure rename and record realization inline in
`tasks.md` as `(DONE <date> — …)` prose citing the PR, the shas and the named
checks. This follows that: §6.2 carries the evidence, including the fourth commit
`79ed72e` — a Copilot catch that this change's own work made necessary, since the
`--execute` summary claimed every moved file landed in `openspec/` and the outline
restore added a topic-ROOT destination to `ex.moved`.

The README convention is genuinely split, and I took the older of two. The two
prior archives relocate the row into "Archived changes:"; the most recent one
(`3c9eeb2`) instead left a short "ARCHIVED" stub sitting inside the "Active
changes:" list, where it still is. That reads as a slip rather than a new
convention — an ARCHIVED row inside a list of active changes is self-contradictory
— so this relocates.

ONE DELIBERATE DEVIATION. The "APPROVED BUT NOT YET REALIZED … none of it is
built … Nothing here should be read as shipped" banner is REWRITTEN to state
realization, not carried through the rename. No archived change in the corpus has
ever had one — the convention arrived after the three most recent archives — so
there was no precedent either way, and archiving a record whose first paragraph is
false is the more expensive break. The rewritten block says it replaced the banner
and why; `tasks.md` §6.3 records the same.

Tasks: 25 of 26 ticked. 7.2 stays open on purpose and is precedented —
`add-client-identity-roster` archived carrying fifteen open items — because its
two items are Brett's rulings rather than work, and ticking them would claim a
decision nobody made. Three further open items the realization surfaced are
recorded there too rather than filed silently: `corpus.parse_status` still carries
the pseudo-line blindness `_flip_status` just shed (measured harmless today, 0 of
1079 files, but it is doc-health's shared reader behind fifteen families);
`plan_demotion` resolves the origin topic only from a possible's pick edge that
the forward transition erases, so all six active changes with a declared staged
origin report `origin_staging_id: None` and a real demote needs `--staging-topic`
even though the `.openspec.yaml` origin block the transition itself writes would
answer it; and a demote leaves its own `openspec/INDEX.md`, which carries no
`Status:` header and so refuses the next whole-folder forward transition.

Co-Authored-By: Claude Opus <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 21, 2026
The README row and the PR description disagreed about which PRs realized this
change. Neither list was right, so neither was adopted: the answer was
re-derived mechanically from gh pr view --json files, asking of every
candidate whether it edits a file under
openspec/changes/add-staged-topic-outline-template/.

Eight PRs pass that test and are this change's own chain: #193, #195, #198,
#208, #211, #217, #224, #227. The PR description omitted the first three -
they predate the session handoff it was written from - and wrongly claimed
#215, #221 and #222, which fail the test: each touches only its own change's
documents and code, so each belongs to align-demote-to-round-trip-rule,
refine-demote-round-trip-mechanics and align-status-reader-to-real-lines
respectively, all three of which already have archive records carrying their
own evidence. What #217 contributes here is task 4.2 and the archiving of the
first of them, not the fix.

The README row, the proposal banner and the tasks.md evidence section now
state the two categories explicitly and name the test, so the chain can be
re-derived rather than trusted. One exception is recorded rather than left to
surprise a reader: #228 also edited this change's tasks.md, to repoint 5.3 and
6.3 after the doxbench topic exited staging - a cross-change bookkeeping
repoint that discharges no task here.

Co-Authored-By: Claude Fable 5 <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 21, 2026
The README row and the PR description disagreed about which PRs realized this
change. Neither list was right, so neither was adopted: the answer was
re-derived mechanically from gh pr view --json files, asking of every
candidate whether it edits a file under
openspec/changes/add-staged-topic-outline-template/.

Eight PRs pass that test and are this change's own chain: #193, #195, #198,
#208, #211, #217, #224, #227. The PR description omitted the first three -
they predate the session handoff it was written from - and wrongly claimed
#215, #221 and #222, which fail the test: each touches only its own change's
documents and code, so each belongs to align-demote-to-round-trip-rule,
refine-demote-round-trip-mechanics and align-status-reader-to-real-lines
respectively, all three of which already have archive records carrying their
own evidence. What #217 contributes here is task 4.2 and the archiving of the
first of them, not the fix.

The README row, the proposal banner and the tasks.md evidence section now
state the two categories explicitly and name the test, so the chain can be
re-derived rather than trusted. One exception is recorded rather than left to
surprise a reader: #228 also edited this change's tasks.md, to repoint 5.3 and
6.3 after the doxbench topic exited staging - a cross-change bookkeeping
repoint that discharges no task here.

Co-Authored-By: Claude Fable 5 <[email protected]>
@brettheap
brettheap deleted the change/demote-round-trip branch August 21, 2026 23:57
brettheap pushed a commit that referenced this pull request Aug 22, 2026
The register `docs/archive-record-discrepancies.md` enumerated seven classes of
archived-record discrepancy and said each needed a Brett ruling or an OpenSpec
change to close it. Brett ruled every class in-session on 2026-08-22, a
multiple-choice round in which the recommended option was adopted on each. This
slice executes those rulings and records the per-item outcomes in the register.

C7 AND C3'S ACCOUNT-MENU HALF, closed on a fact Brett declared rather than one
found in the archive. He ratified add-dashboard-account-menu in-session on
2026-08-21, its authoring date. The proposal's Status flips draft -> ratified
with a `Ratified:` citation line, the change gains the `.openspec.yaml` it never
had (ad_hoc origin, approved_by Brett Heap, approved_on 2026-08-21), and the
tasks.md note that recorded the flip being DECLINED is kept word for word with a
resolution appended after it, per Brett's 2026-08-10 append discipline. Three
things are said plainly in all three places because they are easy to lose: the
fact is a declaration, not a discovery; re-reading the record still turns up no
contemporaneous trace; and the citation names this ruling round rather than the
new origin file, since citing a file written in the same act from the same
declaration would be circular. That is a deliberate departure from B1, whose
origin file predated its correction and was independent evidence.

C1, FOUR OF SIX FIXED AND THE TEMPLATE CORRECTED THREE TIMES. d9b80c1's spelling
does not transplant: its "cut as contract-v1.35" clause is specific to
add-roster-device-admission-surface, and three of the four fixed changes cut no
contract bundle at all, their surfaces being code-only. What was copied is the
shape, not the sentence. align-demote-to-round-trip-rule (PR #215),
align-status-reader-to-real-lines (PR #222) and refine-demote-round-trip-mechanics
(PR #221) each name their own merge-plus-green discharge in their own banner and
tasks.md and are rewritten from it. add-client-identity-roster is rewritten from
its archive commit and README row and NOT from its tasks.md, whose archive-gate
boxes are still unticked - recorded rather than papered over. Also recorded:
contract-v1.33 and contract-v1.35 are bundles, not git tags, so the rewritten
value says bundle and the register carries the tag gap.

Two of the six are untouched. split-ideation-book-per-repo is genuinely
ambiguous - its only realization statement is "discharged by the archive commit
itself", which is circular, since the archive is the act the token was gating.
add-worker-credential-by-reference is a different case and the one thing this
round needs a word back on: its evidence is adequate on its own terms, but the
same ruling round said "do not touch it" while closing C3, and two ruled
sentences point opposite ways over one file. The conservative reading was taken
because the cost of being wrong that way is one more sentence from Brett.

C2, TWO OF SEVEN BACKFILLED. add-governed-derived-model gets a date-only
citation in the spelling add-roster-device-admission-surface already uses; no
approver is named anywhere in its record and none is claimed, and the header is
added as bare lines because that proposal has no front-matter fences.
add-lens-gate-verbs gets an approver and a date from its 3.3 disposition, with
the caveat written into the citation itself that the record's own word is
"disposition" and never "ratified". Five are left headerless: the three
2026-07-25 changes carry origin-approval pairs that approve AUTHORING ad hoc and
are dated at creation, so reading them as ratification would date each
ratification to its proposal day; add-propose-verb has nothing; and
add-workbench-integrated-editor-chat must stay headerless because its own
archive commit records a decision against writing a status value.

C5 recorded as ruled legacy, no file touched. C6 annotates the four avatar
ledgers with a trailing section each, ticking nothing - the counts re-verified
at 8/0, 11/0, 4/0, 14/1, and the annotations able to say where the evidence
lives because the ticking happened in the Speckit ledgers (54/54, 65/65, 37/37)
and was never mirrored back. One of the four is named as not belonging to the
class as stated: clarify-avatar-revocation-client-enforced makes no realization
claim to disagree with.

TWO CORRECTIONS TO THE REGISTER'S OWN CLAIMS. A4 said each of six open boxes
carries its own reason; two of them, add-crystallizer-contracts 3.1 and
add-capability-steward 3.1, are bare. And the "Why this file exists" section
said a dispositions entry is a way to revise a record document - half wrong,
measured below.

THE RECORD-IMMUTABILITY COST, MEASURED IN-TREE RATHER THAN ASSUMED, because a
git archive export loses the git-dependent families and this register records
that trap. Before: 3 critical, this file not among them. After: 4 critical, the
fourth being this file, exactly as predicted. A health/dispositions.yaml entry
does NOT silence it - a run with the entry is BYTE-IDENTICAL to a run without,
because fam_record_immutability emits unconditionally and the dispositions set
feeds only report.uncited_resolutions. What it does buy was measured end to end:
against a previous report carrying the four contested findings, a run in which
they are absent emits 4 uncited-resolution ERRORs with an empty file and 0 with
the entries present. So no disposition is claimed as a mute button, and the
entry is not written here at all: it lives at the AGGREGATION root, is never
loaded on the --single-repo run a pull request self-gates with, and editing the
shared aggregation checkout carries the sweep hazard. The ready-to-paste entry
and the whole measurement are recorded in the register.

Gates, exit codes read directly and never through a pipe:
openspec validate --all --strict 67/67 exit 0, unchanged from baseline;
pytest tests/doc-health 704 passed exit 0, unchanged;
pytest tests/ideation-dashboard -k workbench 140 passed exit 0;
doc-health single-repo full run 4 critical / 6 error / 69 warning / 4 info
against a 3/7/69/4 baseline - the one new regression is this register's own
expected critical, and the error count FELL by one because the account-menu
origin declaration cleared a proposal-origin ERROR (2 error -> 1 error on that
family, 30 warnings unmoved);
presence sweep exact, 86 archived dirs to 86 README rows and 18 to 18.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants