Skip to content

Wire the outline tab: section index and add-section affordance (add-staged-topic-outline-template 3.1-3.5, 4.4) - #208

Merged
brettheap merged 3 commits into
mainfrom
change/outline-tab
Aug 19, 2026
Merged

brettheap merged 3 commits into
mainfrom
change/outline-tab

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes the outline-tab slice of the ratified change add-staged-topic-outline-template — tasks 3.1–3.5 and 4.4 — leaving 4.1–4.3, the 5.4 live browser proof, and 6.x bookkeeping as follow-up slices. The change stays active (ratified, not yet fully realized).

What lands

  • The section index renders above the viewer in the outline selection tab: each ## section the primary fragment actually carries, its role (required / added / proposal element), and its Added-by: provenance — built by the pure, fence-aware outline-model.js from the text the viewer already fetched (one new additive onText seam on renderViewer; no second fetch, D15 intact). Labeled "as stored": the index says what the source holds, the canvas says what the human has unsaved (the Phase A two-renderings split, preserved).
  • The add-section affordance inserts the section skeleton into the outline BUFFER through the canvas's own applyProposal — settled-identity gate, EOL re-flavor, and the same dirty-state path as typing, all reused rather than paralleled. The human's existing single Save carries it through edit-document (Q4 as amended by Amendment 1). The tab gains no write verb, no network call, no gate action of its own.
  • Degradation (3.3): a pre-template fragment renders its real sections with a calm migration-stage note — no warning palette, no rewrite on open, bytes proven untouched.
  • Gate-off (3.4): controls render disabled with no listener bound (a DOM re-enable reaches nothing); the index still reads, because reading structure needs no authority.
  • Invariant (3.5): no line of doxbench-state.js, doxbench-editor.js, or doxbench-save.js changed; BUFFER_KINDS and the save order asserted from the live modules.

Review record

Built and then adversarially reviewed in isolated worktrees; the review's verdict was FIX FIRST with five confirmed findings, all discharged in the second commit and re-verified closed by the original reviewer re-running its own repros:

  1. A loosened confinement pin that no longer guarded the call site (proven by mutation — dropping sourceBase at the call left the suite green). Re-pinned; the mutation now fails the suite, and the new pin additionally guards the seam argument.
  2. Free-form add refused 7 of 9 natural headings on a fully templated fragment and silently canonicalized headings containing a template needle. Routes now separated by an explicit required flag; free-form headings land verbatim (9/9), the required-gap route byte-identical to before.
  3. The tab echoed the seam's refusal text instead of mapping outcome.code (the W-10 discipline both other consumers follow). Now a whitelist of four tab-voiced sentences; the unsettled advice is proven true by a hash-hold test.
  4. An unclosed trailing fence disabled the duplicate guard, letting repeated presses pile up copies. Now a stated refusal (never a repair) — zero false positives across 278 corpus markdown files.
  5. A date assertion that passed on the literal "20" — now a real \d{4}-\d{2}-\d{2} match.

Plus two hardenings: onText exceptions contained in viewer.js, and the "as stored" header label.

Known, accepted residue: TEMPLATE_ORDER's header comment slightly overstates its job now that free-form insertions no longer take canonical placement from substring rank (the correct side of that trade — appending never reorders what a human wrote, and the after selector is the escape hatch).

Gates (exit codes read directly)

  • openspec validate add-staged-topic-outline-template --strict and --all --strict: valid, 61/61.
  • python3 -m pytest tests/ideation-dashboard -q: 3131 passed, 6 skipped (72 outline cases, up from 40).
  • doc-health full run: 0 new regressions (report normalized-identical to base; raw diff was the UTC midnight rollover in staged-candidate-aging counters).
  • tests/doc-health carries 4 pre-existing test_client_identity_composition.py failures, reproduced identically at the parent a4a6f6e with this slice stashed — unrelated to this change.

Task 5.4 (live proof in a real browser) is deliberately still open: this slice is proven under the DOM shim.

🤖 Generated with Claude Code

brettheap and others added 2 commits August 18, 2026 19:56
…3.1-3.5, 4.4)

`add-staged-topic-outline-template` had a model with nothing rendering it. Task
3.1 built `outline-model.js` — pure, fence-aware, agreeing with doc-health's
`staged-topic-template` family — and then stopped, because the index and the
add-section affordance share one pane and building that layout twice is the
avoidable cost. This lands both halves of that pane.

WHAT THE TAB DOES NOW. Above the viewer's rendering of a staged topic's primary
fragment sits the templated section index: each `## ` section the fragment
actually carries, its role (required / added / proposal element), its line, and
its `Added-by:` provenance where it has one. Beside each MISSING required section
is a one-press add. A free-form add takes a heading and the section it goes
behind.

WHAT AN ADD IS, AND WHAT IT IS NOT. Design (A), as ruled: the affordance inserts
the section skeleton into the outline BUFFER and stops. It performs no network
call, no gate action and no save. The human's existing Save carries the text to
the session branch through `edit-document` — the verb Amendment 1 settled — so
the tab gains no write verb of its own, which is exactly Q4's intent: section
scoping is a patch-TARGETING detail, not a different kind of action.

The insert lands through the canvas's OWN `applyProposal`, reused rather than
paralleled. That primitive already owns the three things a second insertion
method would have had to re-earn: the settled-identity gate (an insert computed
against text the buffer has since moved off is refused, never forced), the
line-ending re-flavor (without which one reviewed insertion becomes a whole-file
EOL rewrite — a defect this buffer contract has already paid for once), and
`edit()` itself, which is what makes the dirty state, the hashing and the Save
plan byte-for-byte what typing produces.

SCOPING IS REPORTED, NOT IMPLIED. A required section takes its canonical place in
the skeleton's own order — behind the last earlier template section present, else
ahead of the first later one — so an add never reorders what a human already
wrote. A free-form section is anchored by a target the human names, read at CLICK
time. Either way the patch reports the addressing key and the surface says it:
`added "Idea notes (pre-document, non-documented)" to the outline buffer after
"Claims" … unsaved: the canvas Save carries it through edit-document`.

PROVENANCE FOLLOWS THE CONTRACT, WHICH IS NOT UNIFORM. The skeleton stamps the
required trio on the note or question the human is about to write; a section
BEYOND the required set carries the section-level `Added-by:` line, because that
is the one the contract makes attributable. Making it uniform here would have been
tidier and would have disagreed with the ratified text. The seeded Open questions
section carries all four sub-fields: a bare question is non-conforming by the
contract's own rule, so seeding one would be adding a defect.

NON-CONFORMANCE IS NOT AN ERROR STATE (3.3). Conformance is REQUIRED only for
topics staged after ratification and OPT-IN for the 30-odd before, so most of the
corpus carries none of it. A pre-template fragment renders its real sections and
one calm sentence about the MIGRATION STAGE — "the opt-in posture, not a fault …
earned when the topic is next worked, never by opening it here" — with no
warning palette, no failure count, and no rewrite on open: the buffer is still
clean afterwards and its bytes are the stored bytes. A fragment whose bytes never
arrive gets NO index rather than one derived from an absent load.

GATE-OFF IS WITHHELD, NOT DEGRADED (3.4). The predicate is `canvasOffered()` —
the same derivation `drawCanvas` and `docTileVerbs` use, deliberately not
`canvasController !== null`, because `drawTab` runs before the canvas mounts and a
controller check would withhold the affordance on capable consoles too. With no
seam the controls render disabled AND WITH NO LISTENER BOUND: disabled alone would
leave a write path for anything that re-enabled the node. The index still reads on
a gate-off plane, because reading a topic's structure needs no authority.

ONE NEW SEAM, AND WHY IT IS NOT A FETCH. `renderViewer` grew an optional
`onText(text)`, invoked only on a successful load. The viewer owns the one
`/source` read for these bytes (D15); the index is built from the text it already
has rather than from a second request for the same file. Existing callers are
untouched, and a degraded load leaves the seam silent — the viewer has already
said so in its own body.

3.5 HELD. No line of `doxbench-state.js`, `doxbench-editor.js` or
`doxbench-save.js` changed. `BUFFER_KINDS`, `SAVE_DOCUMENT_ORDER_RULE` and
`saveBufferOrder` are asserted from the live modules the new composition test
imports.

TESTS (4.4), split by what each can prove. The pure insertion rules extend
`test_outline_model.py`'s node harness — 12 cases, no DOM: canonical placement,
the heading a required section really lands under, provenance placement, the
already-present refusal, explicit targeting, an unknown target, EOL blindness,
one blank line each side. The wiring is a new
`tests/ideation-dashboard/test_outline_tab.py`, which mounts the REAL
`mountStagingWorkbench` against the DOM instrument `test_doxbench_view.py` owns
(imported, never copied) and presses the buttons. The Save it then presses is the
shipped `savePlanState` + `runSave` over a recording transport, wired exactly as
app.js wires it, so `action: "edit-document"` is read OFF THE WIRE rather than
asserted from a fixture. Its fixture deliberately quotes the canonical skeleton
inside a ```markdown fence, and every heading assertion in the harness is
fence-aware and INDEPENDENTLY implemented — a check routed through the scanner
under test could not have caught a fence bug in it. Three assertions were wrong
on the first pass for exactly that reason and the code was right.

One pinned spelling moved: `test_session_confinement.py`'s outline-pane pins
gained the trailing argument each. What that test guards — that `sourceBase` and
`edit` stay THREADED to the pane and on to the viewer, because dropping either put
a draft view on `main`'s bytes — is unchanged, and its docstring now says why the
pins are substrings.

Gates: `openspec validate --strict` and `--all --strict` both 0 (61/61);
`pytest tests/ideation-dashboard` 3100 passed, 6 skipped, exit 0; doc-health
single-repo run exit 0 with a report byte-identical to the pre-change run — 0 new
findings. `tests/doc-health` carries 4 PRE-EXISTING failures in
`test_client_identity_composition.py` (unresolvable consent citations in the
cross-domain roster fixtures), reproduced with this slice stashed at a4a6f6e.

Co-Authored-By: Claude Opus <[email protected]>
The adversarial review of the outline tab came back FIX FIRST. The core held —
EOL end-to-end, fence-aware anchoring, the click-time race, the gate-off
no-listener posture, the 3.5 invariant — and five confirmed findings did not.
Fixed here as review-fix commits (PR #196's precedent), never an amend.

F1 — A TEST-COVERAGE REGRESSION THIS SLICE INTRODUCED, and the worst of the
five because it silently removed a guard. Widening `renderOutlinePanel`'s
signature made the loosened substring pin in `test_session_confinement.py` a
prefix of the DECLARATION as well as the call, so it stopped constraining the
call site at all: the reviewer replaced `sourceBase` with `null` at the call and
the whole suite stayed green — re-opening PR #49's finding 16, "a draft view
mistaken for main", which is the entire reason that test exists. The pin is now a
regex that must run through the call's own closing arguments, which no
declaration can supply. The mutation was re-run against the final tree: exit 1,
`test_the_outline_pane_reads_through_the_active_keys_source_base` fails.

F2 — THE CONTRACT'S EXTENSION GRANT WAS UNUSABLE. `insertSection` applied a
rank-wide duplicate rule on BOTH routes, and `sectionRank` matches by substring.
On a fully templated fragment that refused "Exit criteria", "Why we deferred",
"Impact analysis", "Claims log", "Prior art on why", "Conflicts with promoted
specs" and "Open questions for Brett" — each naming a section the human never
asked for, and an explicit `after=` target could not get round it because the
refusal fired before the anchor was read. The same loose match silently
canonicalized the near misses: "Notes on conflicts" was written as `## Conflicts`
with the conflict-bullet seed and the typed heading was simply gone. Since the
free-form control is the ONLY route to "either a human or an AI may add a section
beyond the required set", the ratified grant was unreachable in practice — and it
got worse the more conformant a topic became.

The two routes are now separated by an explicit `required` flag rather than by
guessing from the string. The gap row sets it and keeps both loose behaviours,
where they are doing necessary work: it asks by the contract's LABEL, so it must
resolve to the canonical heading and seed, and it must refuse a required section
already present under the skeleton's longer spelling. Everything else is exact —
exact-title duplicates, the human's heading verbatim, the generic skeleton, and
canonical placement only for a title that already IS a canonical heading letter
for letter. One `resolveTemplate` answers "which route" for both callers, so the
rank and the heading cannot disagree.

F3 — A W-10 REGRESSION. The refusal branch echoed the seam's `error` text, which
both other consumers of `applyProposal` explicitly forbid: doxbench-chat.js calls
its mapping a WHITELIST and drops the seam text unread, and the canvas states its
sentences "remain the canvas's and are never echoed". The consequence was real,
not theoretical — the settling window is reachable by pressing add inside a
keystroke's hash flight, and the human got "the buffer identity is still
settling" with no way out of it, while the stale sentence said "proposal", a noun
this tab never uses. `outcome.code` now maps to four fixed tab-voiced sentences,
each naming its own recovery, and the seam's own two refusals gained codes so
they map accurately instead of falling through to the generic one.

F4 — THE DUPLICATE GUARD FAILED EXACTLY WHEN IT WAS NEEDED. On a fragment ending
inside an unclosed fence the insert appended INSIDE the fence, the model then saw
no sections at all, "already carries" could never fire, and repeated presses
piled up copies — each reporting success. `insertSection` refuses on an unclosed
fence now, through the same `isFence` rule `outlineSections` toggles on (one
fact that loop already knows and did not report, not a second scanner). REFUSAL,
NOT REPAIR: closing the fence would rewrite a fragment nobody asked us to change,
which task 3.3 forbids outright.

F5 — `"Added-by: brett · 20"` passed on a literal "20". The date half is a
`\d{4}-\d{2}-\d{2}` match, which also survived the UTC rollover mid-session that
a hardcoded date would not have.

H1 — the `onText` invocation is CONTAINED. Callers do not await `renderViewer`,
so a throw inside a caller's derivation was a silent unhandled rejection, and it
happened after the document had already rendered. The honest degraded outcome is
a missing index and nothing said on the page: a message about a caller's bug
would libel the document. Proven by removing the guard and watching the promise
reject.

H2 — the index header says "as stored". It describes the SAVED fragment while the
canvas holds unsaved work, so after an add a gap row above ("no pre-document idea
notes section") sits over a refusal below ("this outline already carries…") —
two honest answers about two different texts, which without the label reads as
one surface arguing with itself. The two-renderings split itself is deliberate
and stays.

EVERY NEW REGRESSION TEST WAS VALIDATED AGAINST THE PRE-FIX CODE rather than
assumed, by running the previous commit's `insertSection` over each fixture. That
is what caught the one place the first draft of these tests was worthless: F2's
seven headings only misbehave on a FULLY templated fragment, so the original
three-section fixture would have passed before and after and proven nothing. The
fixture is now the whole ratified skeleton, with a test asserting it really is
conforming — if it drifts, the seven cases stop testing anything. The unclosed
fence, the settling window (driven through a holdable hash seam, including that
its advice is TRUE: the same press lands once the identity settles) and the
throwing `onText` were each verified the same way. 72 cases across the two files,
up from 40.

Gates, exit codes read directly: `pytest tests/ideation-dashboard -q` 3131
passed, 6 skipped, exit 0; `openspec validate --strict` exit 0 and
`--all --strict` exit 0 (61/61); doc-health single-repo exit 0, and its report
identical to the pre-change baseline once the UTC date rollover and the aging
counters it moves are normalized — 0 new findings. `tests/doc-health` still
carries the same 4 pre-existing `test_client_identity_composition.py` failures
reproduced at a4a6f6e with this work stashed.

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

@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 outline-tab slice of add-staged-topic-outline-template: it renders a section index “as stored” above the outline viewer, and adds an add-section affordance that writes into the outline buffer via the existing canvas applyProposal path (so the existing Save persists via edit-document).

Changes:

  • Wire an outline section index (headings, role chips, provenance) using a new renderViewer(..., { onText }) read-back seam to avoid a second fetch.
  • Add the add-section affordance (required-gap adds + free-form add) implemented via a pure insertSection() model and applied through the canvas’s applyProposal.
  • Add/extend tests for the pure insertion rules and the real DOM composition wiring; add styling for the new index/controls; update the OpenSpec task log.

Reviewed changes

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

Show a summary per file
File Description
tests/ideation-dashboard/test_session_confinement.py Tightens the call-site pin to ensure sourceBase/edit threading remains constrained at the call site.
tests/ideation-dashboard/test_outline_tab.py New end-to-end DOM-shim test that mounts the real workbench and exercises the outline index + add-section + Save wiring.
tests/ideation-dashboard/test_outline_model.py Extends the node harness to assert pure insertion behavior (placement, duplicates/refusals, fences, targeting, EOL normalization).
scripts/ideation_dashboard/web/views/viewer.js Adds onText seam to hand loaded bytes back to callers after successful load.
scripts/ideation_dashboard/web/views/staging-workbench.js Wires the outline index and add-section affordance into the outline panel using outline-model.js + canvas applyProposal.
scripts/ideation_dashboard/web/views/outline-model.js Extends pure model with section insertion logic (insertSection, fence refusal, canonical placement rules).
scripts/ideation_dashboard/web/styles.css Adds CSS for the outline index rows, gap rows, add controls, and note.
openspec/changes/add-staged-topic-outline-template/tasks.md Marks tasks 3.1–3.5 and 4.4 as complete and records the realized design + test coverage notes.

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

Comment on lines +375 to +385
if (onText) {
// CONTAINED. Callers do not await this function (the outline pane mounts it
// and moves on), so a throw while a caller builds its own derivation would
// become a silent unhandled rejection — and it would be the LAST statement
// that failed, after the document itself rendered. Nothing is said on the
// page beyond the derivation simply being absent: the body above is already
// correct, and a message about a caller's bug would libel the document.
try {
onText(text);
} catch (unused) { /* the caller's derivation, not the viewer's read */ }
}
PR #208 review (Copilot), and it is a comment-versus-code gap rather than a live
bug: the containment added for H1 catches a SYNCHRONOUS throw, and its comment
said "CONTAINED" flatly. An `onText` that is async never throws — it hands back a
rejected promise, which sails straight past a bare try/catch and becomes exactly
the silent unhandled rejection the comment claimed to prevent.

Latent today: our one caller (the outline tab's section index) is synchronous. It
stays worth closing because that comment is what the next caller reads before
writing an async one, and a containment claim that holds for only one of the two
shapes a caller can fail in is worse than no claim at all — it invites the shape
it does not cover.

The return value is now captured and, when thenable, its rejection is settled
with a no-op handler. `.then(undefined, handler)` rather than `.catch`, because
only `then` is required of a thenable; and settled rather than awaited, because
the read is finished and the viewer does not wait on anybody's derivation to call
itself done. A hostile thenable whose own `then` throws synchronously still lands
in the outer catch. Behaviour on the page is unchanged in both shapes: nothing is
said, the derivation is simply absent, and the already-rendered body stands —
a message about a caller's bug would libel the document.

The test sits beside the synchronous one and is the same instrument turned on the
other shape: an async `onText` that rejects, asserting the viewer's own promise
still resolves, the body still rendered, and nothing escaped to the process as an
unhandled rejection. Installing a `process.on('unhandledRejection')` handler is
what makes the escape observable instead of fatal — without one node prints the
rejection and takes the harness down, which is the failure mode being closed.
Verified by removing ONLY the thenable branch, leaving the synchronous try/catch
in place: the new test fails on the escaped rejection and the old one still
passes, so the two halves are pinned independently.

No governed doc touched, so no openspec revalidation. Gates, exit codes read
directly: test_explorer_viewer.py 24 passed exit 0 (its viewer.js source pins —
single vendor import, one fetch call site, the mountSafeMarkdown sink — are all
untouched); test_outline_tab.py 28 passed exit 0; test_session_confinement.py 53
passed exit 0; full `pytest tests/ideation-dashboard -q` 3132 passed, 6 skipped,
exit 0.

Co-Authored-By: Claude Opus <[email protected]>
Copilot AI review requested due to automatic review settings August 19, 2026 01:24
@brettheap
brettheap merged commit cd9f683 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 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (1)

scripts/ideation_dashboard/web/views/staging-workbench.js:778

  • titleLabel/afterLabel are rendered as <label> siblings of the <input>/<select> but are not associated via for/id (and the inputs are not nested inside the labels). That makes the <label> elements semantically inert and can confuse accessibility tooling; either wire them up with htmlFor/id or use non-label elements.
  const titleLabel = el("label", "swb-clabel", "add a section");
  const titleInput = el("input", "swb-outlinetitle");
  titleInput.type = "text";
  titleInput.setAttribute("placeholder", "section heading");
  // Named for assistive navigation. The visible `label` beside it carries no

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/outline-tab branch August 21, 2026 23:57
brettheap added a commit that referenced this pull request Sep 5, 2026
…ddition grace (#686)

* Advance the review-lane pin to codexFactory e57643a7, carrying the addition grace

Lane: openxfactory-2 (openXfactory-2)

Realization Commit A of `mirror-floor-addition-grace` (tasks.md task 1): the
five-site lockstep advance the mirror in Commits B/C depends on, per
requirement 6 ("the mirror is inert until the pin carries the rule, and the
pin moves as one act").

codexFactory `origin/main` re-measured at realization time (task 1.1's own
instruction, not the packet's dispatch-time value): it had moved past
`712fc8ca` (PR #206, merge, realizing the ratified `add-floor-addition-grace`)
to `e57643a7` (PR #208 merge) by way of one intervening PR (#207, a vendored
`uv.lock` only). `git merge-base --is-ancestor 712fc8ca e57643a7` holds, and
the floor document at `e57643a7` is byte-identical to the document at
`712fc8ca` and at `467cec42` (sha256 `0eba8e58…7ba4be`, 15402 bytes) — PR #207
and #208 touch unrelated `exercise-gate-footing` files only, never
`repository_floor_drift.py`, `specs_floor_block.py`, the floor document, or
the vectors fixture.

This is the FIRST advance in this pin's history whose floor grew by ZERO
paths: the generated block is unchanged (`generated_at` stays `3afd8a8c`,
`entry_count` stays 59, floor total stays 67); the object of this advance is
the addition-grace mechanism the core shipped alongside it — one new
hand-authored field, `floor.pending_floor_extension_tolerance: 3`, outside the
generated block — not a spec promotion. `floor_snapshot.sha256` moves
(`c4a386db…` -> `0eba8e58…`) because it hashes the whole document;
`floor_snapshot.entry_count` does not (67 -> 67).

Five sites, one commit: `contracts/review-lane-pin.yaml` `core_commit`;
`.github/workflows/merge-master-approval.yml` `PINNED_CORE_COMMIT` and its
core checkout `ref:`; `.github/workflows/pytest-suite.yml`'s core checkout
`ref:`; and `contracts/review-lane-floor-snapshot.yaml`, re-copied byte for
byte from codexFactory `e57643a7` (not hand-edited) and gated by `cmp` against
a codexFactory clone before this commit. `pytest tests/review_lane_pin` is
green both without the core on disk (55 passed, 1 skipped) and with
`PINNED_CORE_CHECKOUT` pointed at a codexFactory checkout of `e57643a7` (56
passed, freshness verifier runs and passes). The 40-hex guard holds: exactly
one `\b[0-9a-f]{40}\b` token in `contracts/review-lane-pin.yaml`
(`core_commit` itself).

`pinned_members` gains two new entries this advance makes load-bearing:
`scripts/merge_master/specs_floor_block.py` (`paths_added_after_pin` /
`pin_window_for_document`, B1's measurement) and
`tests/merge-master/fixtures/floor-addition-grace/` (the replayable vectors
the required lane's mirror is falsified against, Commit B). Neither is a pin
site; both are read out of the pinned tree and are named here so a future
re-point ceremony knows they are now consumed.

Refs #675

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

* Mirror the addition-grace completeness rule into the required coverage assertion

Lane: openxfactory-2 (openXfactory-2)

Realization Commit B of `mirror-floor-addition-grace` (tasks.md task 2). The
required coverage assertion (LQ-A7,
`test_every_tracked_openspec_spec_path_is_on_the_floor`) and its two negative
controls now classify an off-floor tracked path exactly as the pinned core's
`evaluate_floor_completeness` does: covered-pending when the candidate's own
diff creates it, or when it landed on the base branch after the snapshot's
declared `generated_at` (B1); uncovered otherwise; no grace when the base or
the pin is unmeasurable (fail-safe, the default).

Authoring decision A, as ratified: the assertion RE-IMPLEMENTS the rule from
git alone (`resolve_base_branch`, `created_since_merge_base`, `pin_window`,
`graced_uncovered`) rather than importing the pinned core — the core checkout
carries `continue-on-error: true` by design, so an importing required
assertion could only skip on an outage (a CSC-F16 silent-false-green) or fail
for a cause no candidate can fix. It is FALSIFIED instead, by a new
`TheVectorReplay` class that replays the pinned core's own 16 accepted and 5
refused vectors (`tests/merge-master/fixtures/floor-addition-grace/
vectors.json`), read from the checkout, comparing `tracked_under_prefix`,
`uncovered` and `pending` — the facts this mirror actually computes; `stage`/
`escalated`/drift are the advisory lane's concern (Commit C), not this one's.

`test_the_unmutated_surface_is_a_positive_first` and
`test_a_fabricated_off_floor_spec_path_is_refused` move onto the graced
expression, keeping their meaning; the fabricated path is created by no diff
and lies in no window, so it stays refused — asserted explicitly, so the
grace cannot be misread as "additions are free" (decision E). A new
`TheGraceItself` class adds the negative controls the grace itself needs: a
created path is pending; a modification/copy/rename/removal are not,
including real disposable-git-repository tests proving the actual
`git diff --diff-filter=A` / `git log --diff-filter=A` invocations exclude
each; an unmeasurable base or an unmeasurable/non-ancestor pin grants nothing
from that half alone, without disabling the other half's independent grace.

The vector replay's skip is watched BY NAME in `pytest-suite.yml`
(`VECTOR_REPLAY_CLASSNAME`/`VECTOR_REPLAY_TESTNAME`), same discipline as the
freshness verifier's, with `EXPECT_SKIPPED` moving 21 -> 22 and a new
`test_the_required_suite_watches_the_vector_replay_by_name` asserting the pair
against the live class/method objects. The JUnit-parsing python is factored
into one `named_verdict()` helper called for both watched pairs, rather than
duplicated.

`pytest tests/review_lane_pin` is green both without the pinned core (72
passed, 2 skipped, 22 subtests) and with `PINNED_CORE_CHECKOUT` pointed at a
codexFactory checkout of `e57643a7` (74 passed, 43 subtests — the vector
replay's 21 subtests plus the negative-control subtests, all exercised rather
than skipped).

Refs #675

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

* Import the addition-grace completeness rule into the advisory lane's step 8

Lane: openxfactory-2 (openXfactory-2)

Realization Commit C of `mirror-floor-addition-grace` (tasks.md task 3).
`.github/workflows/merge-master-approval.yml` step 8 now imports the pinned
core's `evaluate_floor_completeness` and `pin_window_for_document` directly
(authoring decision A: the advisory lane already refuses to run at all when
the pinned core is unreadable, so it has nothing to lose by importing and
everything to lose by keeping a second copy of the classification) and
DELETES both the hand-rolled `sorted(set(tracked) - set(floor.
never_clearable_paths))` completeness set difference and the separate,
conditional `candidate_floor_drift` call: both partitions
(`caused_by_candidate`/`already_unreachable` and `uncovered`/`pending`) now
come from ONE call over the SAME post-merge facts, superseding two callers of
the pinned core's own `_drift_between` with one. `refusals[0].stage` keeps its
documented order (drift, then already-unreachable, then completeness, with
`pending_floor_extension` reported only when nothing refuses) because that
order is the core's own `FloorCompleteness.refusals()`, not re-derived here.

Requirement 5 / decision C: step 3's base checkout ("Checkout base (this
repository)") now carries `fetch-depth: 0` — measured cost 2,025 commits /
29.6 MiB on this branch, 2026-09-05 — because B1's window
(`generated_at..origin/main`) is unmeasurable on the shallow checkout this
step had before, which would fail-safe the pin-relative grace off on every
run of this lane while it worked in the required lane (`pytest-suite`,
already full history). The targeted-fetch alternative is recorded as cheaper
but strictly more fragile (a depth sufficient today silently fails into the
fail-safe as the pin ages).

Task 3.4: the jq report and the rendered advisory-verdict table both gain a
covered-pending count, per-path reasons, the escalation state and whether B1's
pin was measured; every new lookup keeps the `// []` / `// "-"` default
discipline the early refusal stages need. Task 3.5: the anti-vacuity step
gains a POSITIVE assertion that the addition-grace computation produced a
result (`has("pending_floor_extension")` plus its own four-field shape), same
form as the existing three (b′) guards.

Verified against three real, hand-constructed scenarios run through the
extracted step-8 script with the pinned core on disk (not CI — a local
pre-merge check, not the archive-gate evidence tasks 5.2/5.3 require of a real
run): a clean tree (`floor_complete`); a candidate that adds an off-floor spec
path (`pending_floor_extension`, path named, tolerance 3, pin correctly NOT
measured — `3afd8a8c` is not an ancestor of this branch's `origin/main`,
exactly the live-pin defect the packet's own proposal documents); and a
candidate that removes a floored path (`floor_drift_caused_by_candidate`,
unchanged from before this commit).

Updates two pre-existing `test_review_lane_caller.py` assertions that named
the old shape by literal string: `test_the_caller_calls_the_three_amended_core
_functions` now names `evaluate_floor_completeness` in place of
`candidate_floor_drift` (still exercised — the SAME underlying function, one
call rather than two); `test_the_caller_asserts_the_floors_completeness`
(renamed `..._and_grace`) gains assertions for `pin_window_for_document` and
`pending_floor_extension`; a new
`test_the_base_checkout_carries_the_history_the_pin_window_needs` asserts
`fetch-depth: 0` on the named checkout step. `pytest tests/review_lane_pin` is
green both without the pinned core (73 passed, 2 skipped, 22 subtests) and
with `PINNED_CORE_CHECKOUT` pointed at a codexFactory checkout of `e57643a7`
(75 passed, 43 subtests). `tests/doc-health/test_workflow_contract.py` (18
tests) is unaffected.

Refs #675

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

* Tick tasks.md for the mirror-floor-addition-grace realization's first PR

Lane: openxfactory-2 (openXfactory-2)

Ticks 1.1-1.5 (the pin advance), 2.1-2.8 (the required lane's mirror and
vector replay) and 3.1-3.6 (the advisory lane's import and reporting), each
with an evidence line naming the commit and the measured test counts; ticks
5.4 (the vector replay green on this head, against the pinned core). Does
NOT tick 4.1-4.3 (the first landed floor regeneration is a separate,
later codexFactory act), 5.1 (the full `pytest-suite` green is CI's own
required check, not yet observed on this head), 5.2-5.3 (the
`pending_floor_extension` outcome and a real promoting pull request observed
NOT RED are reserved for a real run, which this PR's local verification is
not), or 6.1-6.3 (the owner's own acts, per that section's own heading).

Refs #675

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

* Fix: EXPECT_SKIPPED stays 21, not 22 — CI proved the assumption wrong

Lane: openxfactory-2 (openXfactory-2)

`pytest-suite` reds on PR #686's first push (run 33978773175): "skipped 21,
pinned exactly 22", with BOTH named verdicts (freshness verifier, vector
replay) reporting `passed`, not skipped. Commit f6185a1 moved
`EXPECT_SKIPPED` 21 -> 22 on tasks.md task 2.7's literal instruction, on the
assumption that the new vector-replay test always contributes a skip. It does
not: on the normal path (pinned core present, the common case in CI) it RUNS
and PASSES, exactly like `TheFreshnessVerifier` beside it — the two share the
same `locate_pinned_core()` guard and only skip TOGETHER, on a core-checkout
failure, which would report 23 (not 22). The happy-path aggregate is
therefore unchanged at 21, and pinning it at 22 reds every normal run.

Reverts `EXPECT_SKIPPED` to `"21"` with a corrected comment; fixes the two
`test_floor_snapshot.py` docstrings that repeated the wrong assumption
(`test_the_required_suite_watches_the_vector_replay_by_name` and
`TheFreshnessVerifier`'s own class docstring); corrects tasks.md's 2.7
evidence line to record the deviation from that task's own prose, with the
CI run that caught it.

`pytest tests/review_lane_pin -q`: 73 passed, 2 skipped, 22 subtests
(unchanged in shape — the fix is a comment and one string literal, not a
test-count change).

Refs #675

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

* Tick tasks.md 5.1: pytest-suite green on CI, and the local-clone submodule gap

Lane: openxfactory-2 (openXfactory-2)

`pytest-suite` passed on CI at head `8e3910d9` (run 33979893935, 22m21s):
selected=9725 passed=9704 skipped=21 failures=0 errors=0, both named verdicts
passed. Ticks task 5.1 with that evidence alongside the already-measured
subset results.

Also records what the ~95 failures / ~50 errors in the FIRST local full-suite
run (noted but not yet explained in the prior commit) turned out to be: this
clone never ran `git submodule update --init openXwallet`, and every one of
them sat in `tests/trust-anchor/`, `tests/openxwallet_pin/`,
`tests/clearing/`, or was the flat-checkout case pytest-suite.yml's own
header already documents (`test_find_validator_locates_pinned_checkout`).
Initializing the submodule and re-running each affected subtree cleanly
(311 passed, 203 passed) confirms this was a local setup gap, not a defect
this PR introduces — CI's own "Init the openXwallet gitlink only" step does
this already, which is why the CI run above needed no such correction.

Refs #675

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

---------

Co-authored-by: Claude Fable 5.1 <[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