Skip to content

Realize doxbench Phase B core: N-buffer editing, loaded-set selector, tile verbs, thread scaffolding - #207

Merged
brettheap merged 14 commits into
mainfrom
change/realize-doxbench-phase-b-core
Aug 18, 2026
Merged

brettheap merged 14 commits into
mainfrom
change/realize-doxbench-phase-b-core

Conversation

@brettheap

@brettheap brettheap commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Realizes the core ungated slices of the ratified change
add-doxbench-editing-phase-b — the ones tasks.md does not gate on its §3
verify list. Nothing here touches the knowledge service (§10), the harness
bridge (§11), share-session (§12), or the chat-turn contract release (§13);
where a core slice reaches one of their seams it leaves a clean interface and a
tasks.md-referenced TODO naming the gated slice.

Slices → requirements → scenarios

1. The buffer set widens to a keyed set (doxbench-state.js)

Requirement: doxBench editor buffer contract (MODIFIED) · The doxBench
loaded set is the outline plus the documents the human loaded
(ADDED).

BUFFER_KINDS survives as the KIND vocabulary and stops being the state's key
list. validatedDoxBenchState's exactly-two-keys throw is REPLACED clause by
clause: outline present and holding the outline; every other key holding a
document; a document key equal to its own path; no two buffers claiming one
path; every buffer's repository equal to the scope's; active_buffer naming a
key the set actually holds.

Design D1's migration-free property is real and pinned against a CAPTURED
Phase A envelope — {outline, document} with a real path under the reserved key
is a LEGAL INSTANCE, so there is no envelope version bump, no migration and no
"old shape" branch anywhere. New primitives: loadDocumentBuffer (the one route
in, refusing at the declared bound with the measured number stated rather than
evicting a buffer that may hold unsaved work — D6), unloadDocumentBuffer
(refused while dirty unless the discard is explicit), rekeyDocumentBuffer (the
reserved unbacked slot onto the path a first Save created).

The five per-buffer primitives are BYTE-IDENTICAL, verified by diff:
beginBufferEdit, settleBufferHash, adoptSavedBase, discardBuffer,
applyProposalToBuffer — the design's central claim about this layer.

Scenarios: A second document is loaded · A document already loaded is loaded
again
· An unbacked document buffer is first saved · A dirty document is
unloaded
· A context-only document is loaded · The loaded-set bound is
reached
· Membership is asked to persist · A human discards local edits.

2. The turn contract over a buffer set (doxbench_turns.py, serve.py)

Requirement: Grounded doxBench chat turn · Typed AI proposals and
stale-application protection
· The doxBench chat binds to the active buffer
selection
(all MODIFIED).

require_outline_and_document → require_outline_and_documents (one outline
plus N documents, each keyed by its own path; the same document twice is a
refusal). revalidate_scope's active-path EQUALITY becomes a SET rule: the
request's DECLARED bound-buffer key must name a supplied buffer, and EVERY
supplied path must be in-scope and editable. ObservedHashes is keyed by buffer
key. PROPOSAL_TARGETS' fixed enum is retired for
permitted_proposal_targets, derived from the observed identities so "a target
the request did not supply" and "a target whose shown identity we do not hold"
are the same refusal by construction. The proposal cap becomes the request's own
buffer count. PROMPT_SECTION_ORDER's document_buffer slot becomes the
document_buffers GROUP, expanded to one section per loaded document in the
declared order. SYSTEM_CONTRACT_TEXT carries the source-ranking hierarchy.

bound_buffer_key=None means the caller's wire envelope declares no binding —
which the released v1 shape does — and the binding is never inferred from an
adjacent field
(design D17, the defect Phase A's review killed). The set is
then required to hold no path-backed document, preserving Phase A's refusal
exactly.

Scenarios: A turn is bound to one of several loaded documents · A turn names a
bound buffer it did not supply
· A proposal targets a buffer that was not
sent
· Two proposals name one buffer · A turn's declared binding does not
match its buffers
· Binding is mistaken for grounding.

3. Save ordering: ancestry, then independence (doxbench-save.js)

Requirement: doxBench editor buffer contract's ordering clause · One Save
and one Cancel govern the doxBench canvas
(MODIFIED).

Design D3, restated rather than lengthened. SAVE_BUFFER_ORDER becomes
saveBufferOrder(bufferKeys): the outline FIRST as ancestry, then documents in
a DECLARED deterministic order. A dirty outline that did not land still stops
every document with the missing-ancestry not_attempted verdict. One
document's refusal now stops no other
— keeping Phase A's chain would have
reported untried work as blocked by a refusal that had nothing to do with it.
runSave(state, {only}) scopes the act to one document plus the ancestry step,
which is the tile Save (D4): the same pipeline through the same transport, a
second ENTRY POINT and never a second save path.

The per-buffer row's first field is renamed kind → key and carries the
buffer KEY. Still exactly seven fields; a field named kind carrying
ideation/staging/x/y.md would have been a false statement about the field.

Scenarios: Several dirty documents are saved · One document's save refuses ·
The outline's save refuses · The canvas Save is invoked with several buffers
dirty
· The tile save runs with a dirty outline.

4. The loaded-document selector and the tile's three verbs

Requirement: The loaded-document selector names the working document
(ADDED) · A docs tile carries read, load-for-editing, and save (ADDED) ·
doxBench scoped view (MODIFIED).

Q1 ruled: the rail header stops being a label and becomes a SELECTOR. A native
scrolling <select> IS the overflow policy (D6) — no folding, no chip row,
no eviction. The reserved outline entry leads, because the selector's selected
entry must be able to BE the selected buffer. Long names reveal on HOVER and,
separately, to assistive technology through a live region. Basename collisions
grow leftwards until every label is distinct. Selecting is immediate and goes
through the canvas's own setActiveBuffer — a selection surface, never a second
state authority (D7).

Q3 ruled: read (Phase A's open, renamed per D8) / load-for-editing /
save. Save is reachable only while that document's buffer is dirty. A LOADED
tile and a LOADED-AND-DIRTY tile are separately marked from LIVE buffer state,
announced as well as coloured, never written into the snapshot (D9). A
context-only (owned: false) document loads for grounding with no reachable
Save and NO must-save marking (D2).

Scenarios: Several documents are loaded · A long filename does not fit ·
Two loaded documents share a basename · Selection is changed from another
route
· Nothing is loaded yet · A tile is expanded · Read is unchanged ·
A loaded document's tile is marked · Editing is unavailable · A retrieval
result is not a loaded document
.

5. Thread sidecar scaffolding

Requirement: Each loaded document carries a session thread with a structured
state header
(ADDED) · Context compression is a three-layer stack with
declared fidelity
(ADDED, layer two only).

The file format, the sidecar path rule, the compaction contract, the
persistence seam that rides the document's own Save through the existing
one-commit-per-gate-action substrate, and the promotion-exclusion declaration
§12 will consult. The OMP mirroring hooks are the gated §11 slice; what lands
here is the interface they will call, fully functional with no harness present.

Scenarios: The selected document changes · A thread is compacted · A
document is saved
· A thread finding should become durable · Threads are
asked for on a surface without sessions
.

Deliberately NOT here

The knowledge service and its MCP boundary, the packet assembler (§10); the OMP
bridge and the model menu beyond what exists, /shake (§11); share-session's
verb (§12 — its CONTRACT is in the change already); the chat-turn contract
release (§13). Each is gated on §3's verify list or sequenced later, and each
seam this PR touches carries a TODO naming it.

Pinned tests

Every moved assertion is re-pinned with a docstring stating what moved, that
add-doxbench-editing-phase-b moved it, and why it is not a weakening. No
assertion was deleted and none was loosened to make a refactor pass.

Gates

  • python3 -m pytest tests/ideation-dashboard/ -q → 3050 passed, 6 skipped
    (baseline on the branch point: 2892 passed, 6 skipped — +158 tests).
  • OPENSPEC_TELEMETRY=0 openspec validate --all --strict → 61 passed, 0 failed.
  • doc-health pre/post diff → zero NEW findings.
  • scripts/validate-ideation-dashboard-contracts.py → 0 errors, 0 warnings.

Findings recorded rather than papered over

  • Task 7.4 — the canvas STRUCTURE held exactly as Phase A predicted, and the
    requirement's own prohibition caught what did not: the module's buffer
    ENUMERATION was expressed over the BUFFER_KINDS constant, a literal two-name
    list baked into the surface's structure. The enumeration SOURCE moved to
    state.buffers; nothing structural did. A second defect surfaced with it and is
    fixed (switchDocument omitted the key, so a switch added a new key beside the
    reserved slot instead of replacing it).
  • Task 4.4 — the re-key PRIMITIVE is realized and pinned, but its UI half is
    unreachable as the task assumes: the ratified seven-field outcome row carries no
    path, so the canvas cannot learn what a create-document created, and widening
    the row would contradict the same requirement's "unchanged in shape" clause. The
    case is also unreachable today (a path-less create request declares no document,
    which the server's transaction refuses). Needs Brett's call.
  • Task 3.5's finding landed on main mid-flight and is realized here: an
    artifact:// pointer in a sidecar can never resolve for a colleague who fetched
    the shared branch, so a turn body carrying one is refused at construction, with
    both of the finding's remedies (dereference_bodies, elided_note) built.

🤖 Generated with Claude Code


Review fixes (adversarial review of this PR)

The contract layer was verified strong under attack. The composition layer had
broken flows every harness-stubbed test was blind to, because those tests supplied
the seam the shipped code does not. All thirteen findings are addressed below, and
tests/ideation-dashboard/test_doxbench_composition.py is the structural answer:
it mounts mountStagingWorkbench for real, against the same DOM instrument the
canvas suite drives (imported from it, never copied), and every assertion in it
fails against the code as this PR first proposed it.

# Finding Fix
F1 BLOCKING — loading a document killed the chat The released wire's invariant restored (reservedDocumentPath()); a selection the v1 envelope cannot carry is a stated pre-flight posture (chatBindingPosture) — Send closed before the click, the reason on the control and in the aria-describedby region, no transport consulted, and the sentence says what still works. Never a redacted governance refusal for a limitation of our own wire.
F1 root cause The loaded set could never hold two documents A docs-row selection bound the canvas by switching the single reserved slot, so the LOAD that followed always found the document already loaded. The delta names exactly three selection routes and a row selection is not one; a selection now moves the abstract, and the tile's LOAD verb binds. selectDocument and its unsaved-edit guard are kept and still reached for the one transition that does replace content — filling a reserved slot that is still unbacked.
F2 BLOCKING — tile Save enabled-then-refused on every restored Phase A session The marking resolved the buffer by path, saveDocument takes a key, and they differ for exactly a real document under the reserved key. One resolver (docBufferState) now answers both.
F3 BLOCKING — Editing is unavailable unrealized Verbs withheld by the same canvasOffered() derivation the canvas mount reads — deliberately not by whether the controller has mounted yet, which would have withheld them on capable surfaces too (the docs pane draws first).
F4 PromptEnvelope.bound_buffer_key Removed. It is the exact server-side-only-field-no-reader-consults construct Phase A's review killed, and it mis-derived. The declared binding is still checked by revalidate_scope; it returns as a record field with §13's envelope, the only place it can be read from.
F5 artifact:// refusal covered only bodies Moved into the one validator every frontmatter value, commitment item and turn-header field funnels through, so all six state-header classes are covered by construction. A header pointer travels further than a transcript one — the header is what a packet carries to other threads.
F6 Selector empty state could never render Same path !== null rule the canvas's own loadedBuffers() applies; pinned against the state the canvas actually produces.
F7 The only-drop tripwire was hollow Both claims corrected, not propped up. The canvas narrows the buffer set before building the request, so forwarding the scope is defence in depth — said as such in app.js, with the mechanism pinned where it lives (runSave over a four-buffer state).
F8 Body rule could not store a real answer Transcript block boundary moved to the turn header (which a body cannot contain); blank lines are content, interior indentation including tabs is untouched, round trip still identity. Every marker-collision protection survives with its round-trip reason. Done now rather than after §11, because re-cutting later costs a schema_version bump.
F9 unloadDocument had no control The loaded set's one way out now exists: beside the selector, scoped to the selected document, never offered for the reserved outline, and it refuses a dirty buffer on the first press while re-labelling itself to say what a second press discards.
F10 Allowlist widening Annotated against §9.5: one prefix, one gate, no wider, and why a prefix rather than a path.
F11 Retired "0-2 proposals" docstring Follows PROPOSAL_CAP_RULE.
F12 Repo-root outline file threw A named refusal (LOAD_REFUSED_RESERVED_KEY) that tells the human which file and why, instead of a thrown validator error reported as "the load failed".
F13 Docstring framing Says plainly that the path clause is a self-comparison for documents and does no work; the outline is where it stays live.

The DOM shim gained removeAttribute, remove, style and clientHeight —
all real DOM members the shipped code has always used. Their absence is why no test
in this suite had ever driven the docs wheel's layout, and three of these
defects were hiding behind exactly that gap.

Honesty pass. Tasks 7.1, 8.2 and 8.5 were ticked but not realized in
composition (F6/F2/F3). They keep their ticks because the composition tests now
prove them, and each records what was found and what changed. A new task 8.6
records the two acts that had no control at all (F9 and F1's root cause).

Pinned tests re-pinned honestly, each with its reason in place: the two Phase A
selection tests follow the binding route to the LOAD verb (their claims unchanged —
a mount seed must not act; a route that moves the binding must refresh the header),
the guard test now pins that a load replaces nothing and needs no guard, and
the canvasOffered source pins follow the derivation into its own function.

Review gates

  • python3 -m pytest tests/ideation-dashboard/ -q → 3065 passed, 6 skipped
  • OPENSPEC_TELEMETRY=0 openspec validate --all --strict → 61 passed, 0 failed
  • doc-health pre/post → zero NEW findings
  • validate-ideation-dashboard-contracts.py → 0 errors, 0 warnings

Re-verification fixes (round two)

All thirteen round-one findings were confirmed fixed by revert-testing. Four
small items remained; all four are closed below, and the three behavioural ones
are revert-tested — each guard was removed, the named test was confirmed to
fail, and the guard restored.

N3 (MUST-FIX) — unloading the reserved document slot wedged the chat.
loadedSelectorModel listed that key as an ordinary loaded entry whenever it
carried a path, so Unload was reachable for it; one click emptied the slot and
buildTurnRequest then read buffers.document.path on an absent buffer. That
threw, was caught as the generic unsettled-buffer failure, and the rail said "the
buffers are still settling; try Send again in a moment"
forever — a permanently
false sentence.

Fixed by carrying the code's own reasoning about the outline to its sibling: under
the released v1 envelope the reserved document slot does not merely reserve a name,
it rides every turn (buildTurnRequest sends exactly buffers.outline and
buffers.document), so it can no more leave the set than the outline can. Each
selector entry now declares reserved; the control withholds itself for either
reserved key with a reason naming why and what to do instead ("load another
document to work beside it"); and the click path refuses independently, so the
render's disabled state is not the only thing standing between a human and a wedged
chat. Listing the slot stays right — it is selectable and the chat binds to it.
test_the_reserved_document_slot_is_selectable_but_never_unloadable drives the
reviewer's reproduction (reserved slot backed → select it → unload → send) and
asserts the turn still builds.

N1 — the F1 wire fix was not actually pinned. Reverting activeDocumentPath
to canvasDocumentPath() left all eight composition tests green, because the
fixture's detail.md and second.md both sort after the literal reserved key
"document", so the reserved slot won by accident rather than by rule. The fixture
now loads a key that sorts before it (BOOK.md/README.md — two, so whichever
the projection makes reserved, one is still loadable), and the test asserts that
ordering fact explicitly so the discrimination cannot rot. Revert-tested: the old
code now names BOOK.md and the test fails.

N2 — F12's second half. The guard read only outline while its comment claimed
both reserved names. The outline half was caught by the validator (a thrown
TypeError); the document half was caught by nothing — a repository-root file
named exactly document keys to the reserved slot, and the load would have
overwritten whatever it held, including a create buffer holding unsaved human
text. That is the silent eviction design D6 forbids outright. Both halves now
refuse by name, and new tests assert the reserved slot's own bytes survive.
Revert-tested.

F11 — ValidatedAssistantResponse's docstring stated PROPOSAL_CAP_RULE's
bound in place of the retired literal "0-2".

Item 4 — the N4 trade, recorded (no behaviour change; N4 is with Brett).
Under the released v1 envelope the chat's document binding is pinned to the
mount-time reserved slot
once that slot is backed: no route re-points it, because
the envelope carries only that slot and nothing may empty it (N3). Phase A did
allow a row-selection swap of which document the chat was about, so this is a
user-visible reduction
, accepted here as a stated interim posture — a human can
load and edit any number of documents and Save each, and the chat states plainly
when it cannot be bound to one, but it cannot be re-pointed at a different document
within a session. It ends either with §13's widened envelope (which carries N
documents and a declared bound-buffer key, retiring the limit) or sooner, if Brett
rules that a clean reserved slot may be re-pointed. Selection semantics are
deliberately unchanged pending that ruling. Recorded in task 8.6.

Re-verification gates

  • python3 -m pytest tests/ideation-dashboard/ -q → 3068 passed, 6 skipped
  • OPENSPEC_TELEMETRY=0 openspec validate --all --strict → 61 passed, 0 failed
  • doc-health pre/post → zero NEW findings
  • validate-ideation-dashboard-contracts.py → 0 errors, 0 warnings

brettheap and others added 12 commits August 18, 2026 15:11
`doxbench-state.js` held exactly two buffers. add-doxbench-editing-phase-b
ratifies a KEYED SET -- the permanently reserved `outline` key plus one key per
loaded document, each keyed by its own repository-relative path -- and this is
that widening, at the one layer the design says has to carry it.

* `BUFFER_KINDS` survives as the KIND vocabulary and stops being the state's
  key list. Consumers read the keys from `state.buffers`.
* `validatedDoxBenchState`'s exactly-two-keys throw is REPLACED, clause by
  clause: `outline` present and holding the outline; every other key holding a
  document; a document key equal to its own path; no two buffers claiming one
  path; every buffer's repository equal to the scope's; `active_buffer` naming
  a key the set actually holds.
* Design D1's migration-free property is real and pinned: a Phase A state and a
  Phase A session envelope -- `{outline, document}` with a real path under the
  reserved key -- are LEGAL INSTANCES. No envelope version bump, no migration,
  no "old shape" branch.
* New primitives: `loadDocumentBuffer` (the ONE route into the loaded set,
  refusing at the declared bound with the measured number stated rather than
  evicting a buffer that may hold unsaved work), `unloadDocumentBuffer` (refused
  while dirty unless the discard is explicit), `rekeyDocumentBuffer` (the
  reserved unbacked slot onto the path a first Save created),
  `bufferKeysInOrder`/`loadedDocumentKeys`/`orderedDocumentKeys`, and the
  declared deterministic order `DOCUMENT_KEY_ORDER_RULE`.
* The five per-buffer primitives are BYTE-IDENTICAL, verified by diff:
  `beginBufferEdit`, `settleBufferHash`, `adoptSavedBase`, `discardBuffer`,
  `applyProposalToBuffer`. The generation guard was always buffer-scoped;
  widening the set means applying it N times, which a new test drives directly.

Pinned tests re-pinned honestly, never weakened:

* `active_buffer`'s refusal message moves from the retired two-value enum to
  the set-membership rule. Still a hard refusal.
* Phase A's exactly-two test becomes the legal-instance test it predicted
  ("Phase B is what re-cuts it" -- its own docstring).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…B slice 3)

Phase A's `SAVE_BUFFER_ORDER` was a fixed ordered pair with a fail-closed CHAIN:
any earlier buffer that neither committed nor was unchanged stopped the ones
behind it. Widening that list to N documents would have kept the chain and got
the semantics wrong, so add-doxbench-editing-phase-b restates the rule (design
D3) and this is that restatement.

* `saveBufferOrder(bufferKeys)` replaces the constant: the outline FIRST because
  its commit establishes the session ancestry, then documents in a DECLARED
  deterministic order (`SAVE_DOCUMENT_ORDER_RULE` -- ascending lexicographic by
  buffer key). "Documents in any order" constrains the contract, not the code.
* A dirty outline that did not land still stops EVERY document with the
  missing-ancestry `not_attempted` verdict. Unchanged.
* One document's refusal now stops NO other document. Documents carry no
  ancestry dependency on each other -- each save is one gate action producing one
  commit on the same branch -- so reporting untried work as blocked by a refusal
  that had nothing to do with it was a false statement about both buffers.
* `runSave(state, {only})` scopes the act to one document plus the ancestry step
  (design D4). That is the `docs` tile's own Save: the same pipeline through the
  same transport, so a control that lives on one document's tile cannot persist
  three others the human is not looking at. A second ENTRY POINT, never a second
  save path -- no force, no bypass, no widened authority.
* The per-buffer row's first field is renamed `kind` -> `key` and carries the
  buffer KEY. The row still has exactly seven fields; a field named `kind`
  carrying `ideation/staging/x/y.md` would have been a false statement about the
  field. `transportRequest` keeps its Phase A `kind` spelling AND its Phase A
  meaning, derived rather than carried, so the wire shape is untouched.
* `savePlanState` keys rows by `row.key ?? row.kind`, so the create flow's
  single-document seam request keys as the reserved `document` slot -- which is
  exactly what it is mid-create.

Pinned tests re-pinned honestly: the declared-order test now asserts the RULE
and its declaration rather than a retired constant, and the seven-field outcome
pin follows the rename. No assertion weakened.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…e 2)

`doxbench_turns.py` was two-buffer-shaped at three points, and
add-doxbench-editing-phase-b gives each an exact generalization (design §1.2).

* `require_outline_and_document` becomes `require_outline_and_documents`: one
  outline plus ONE OR MORE documents, each keyed by its own path (or by the one
  reserved unbacked slot). The same document supplied twice is a refusal, not a
  last-write-wins, because a duplicated key makes "which text did the model see"
  unanswerable.
* `revalidate_scope`'s active-path EQUALITY becomes a SET rule: the request's
  DECLARED bound-buffer key must name one of the supplied buffers, and every
  supplied path must be in-scope and editable. Confining only the bound buffer
  would have let a turn carry material from outside the tile as long as it
  claimed to be working on something else.
  `bound_buffer_key=None` means the caller's wire envelope declares no binding
  at all -- the released v1 shape -- and the binding is NOT inferred from an
  adjacent field (design D17, the defect Phase A's review killed). The set is
  then required to hold no path-backed document, which preserves Phase A's
  `None != path` refusal exactly.
* `ObservedHashes` is keyed by BUFFER KEY. `outline` survives as a property
  because that key is permanently reserved; `document` does not, because it is
  now one key among N and an attribute named after one key is a literal buffer
  name baked into a surface expressed over the set.
* `PROPOSAL_TARGETS`'s fixed enum is retired for `permitted_proposal_targets`,
  derived from the observed identities -- so "a target the request did not
  supply" and "a target whose shown identity we do not hold" are the same
  refusal by construction. G-1's outline-only narrowing survives and stays a
  narrowing: it cannot admit a buffer the model was never shown.
* The proposal cap stops being the literal 2 and becomes the request's own
  buffer count (`PROPOSAL_CAP_RULE`), so widening the loaded set neither widens
  what one response may rewrite beyond what it was grounded on nor narrows it,
  which a fixed 2 would have done at the third document.
* `PROMPT_SECTION_ORDER`'s `document_buffer` slot becomes the
  `document_buffers` GROUP, expanded by `prompt_section_keys` to one
  `document_buffer:<key>` section per loaded document in the declared
  deterministic order. Still nine declared entries, still one constant.
* The declared order is sorted on UTF-16 code units so the Python and browser
  spellings cannot disagree about a key; a test asserts the rule string is
  identical in all three modules.
* `SYSTEM_CONTRACT_TEXT` carries the SOURCE-RANKING HIERARCHY (task 5.5),
  stated in rank order with its last rank named non-authoritative.
* `validate_request_body_bytes` measures every loaded document.

`serve.py` is adapted to the new signatures with NO change in verdict: the
released v1 envelope still carries exactly two buffers and no declared binding
field, so the route translates its `active_document_path` to a declared bound
KEY where it names one and to `None` where it does not, and a TODO names
tasks.md §13 -- the gated contract release that widens the wire.

Pinned tests re-pinned honestly. `_revalidate_v1_shaped` performs, in ONE place,
exactly the translation the route performs, so every Phase A scenario keeps
asserting the verdict the real route produces rather than a weakened one.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…se B slice 4)

Two of Brett's 2026-08-18 rulings, realized on their own surfaces.

Q1 -- the chat rail's header stops being a LABEL and becomes a SELECTOR.
`doxbench-chat.js` gains `loadedSelectorModel` (pure, exported, so the whole
listing rule is pinnable without a DOM) and a native scrolling `<select>`:

* The reserved `outline` entry LEADS, because the ratified rule is that the
  selector's selected entry IS the selected buffer and every route must leave
  the selector, the canvas and the chat agreeing -- a selector that could not
  show an outline selection would disagree with the canvas the moment the outline
  tab was focused.
* Documents list in the DECLARED deterministic order, so the listing cannot
  reorder itself under the human's cursor.
* The dropdown IS the overflow policy (design D6): no folding, no chip row, and
  deliberately NO eviction anywhere -- every loaded buffer may hold unsaved work.
* A long name is revealed on HOVER (Q1's own word) and, separately, to assistive
  technology through a live region, because a title attribute alone does not
  discharge the assistive obligation.
* Basename collisions grow leftwards one path segment at a time until every
  label in the collision is distinct; non-colliding entries keep short names.
* Selecting is IMMEDIATE, with no confirmation step, and goes through the
  canvas's own `setActiveBuffer` -- the selector is a selection surface, never a
  second state authority (D7). A value naming no held buffer is put back.
* The empty state RENDERS rather than hiding, and says the outline is workable
  on its own.

Q3 -- the docs tile carries READ / LOAD-FOR-EDITING / SAVE (`doc-wheel.js`):

* `read` replaces Phase A's `open` (design D8), keeping its class so existing
  CSS and pins still name the control that IS the reader. It needs no gate
  capability and stays available.
* Load is the ONE route into the loaded set (D5).
* Save is reachable ONLY while that document's buffer is dirty and visibly inert
  otherwise, so the control's own state answers "does this need saving". It runs
  the SAME pipeline scoped to that document plus the outline-ancestry step (D4).
* A LOADED tile is marked and a LOADED-AND-DIRTY tile is marked as needing a
  save -- two distinguishable states because Brett named both -- driven off LIVE
  buffer state, announced as well as coloured, and never written into the
  snapshot (D9).
* A context-only (`owned: false`) document LOADS for grounding and offers no
  reachable Save and NO must-save marking (D2): marking a document "must be
  saved" when the tile may not save it would be a false statement about the
  surface's own authority.
* Where editing is unreachable, load and save STATE the absence rather than
  failing on activation; read remains.

`staging-workbench.js` wires both through the canvas controller's own
primitives -- no second loaded-set store, no second save path -- and generalizes
the shell's remaining two-name buffer reads: the wheel reconciles to the
SELECTED buffer whichever key holds it, proposal currency refreshes for every
buffer key, and the v1 turn's single `active_document_path` narrowing carries a
TODO naming tasks.md §13. New styles for every new surface, per the house rule.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…seam)

add-doxbench-editing-phase-b makes a proposal's target a BUFFER KEY drawn from
the request's own supplied set, and the SERVER half is realized: the closed set
is derived from the identities the request was shown, so a path-keyed target
routes and an unsupplied one is refused as unroutable.

The WIRE has not moved. The released v1 chat-turn envelope declares
`typed_proposal.target` as the two-value enum, so no other target can reach this
module today, and these two names are a LEGAL INSTANCE of the keyed shape by the
same argument design D1 makes for `{outline, document}`.

The behaviour a widened wire needs is already correct and already fail-closed: a
target this set does not hold is DROPPED rather than recorded, which IS the
delta's "refused as unroutable, no Apply control", and currency now refreshes
against whichever hashes the shell supplies -- which is every buffer key.

TODO comment naming tasks.md §13 rather than building ahead of the envelope that
would be needed to exercise it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
… 6.3)

The shape no Phase A scenario could take -- an outline plus THREE documents --
driving the three cases the delta's own scenarios name, plus design D4's scoped
entry point:

* all four land, each through its own existing gate action, in the declared
  order;
* a refused OUTLINE stops every document with the missing-ancestry
  `not_attempted` verdict and nothing is sent;
* one document's refusal stops NO other -- all four are attempted, the report
  names the committed, refused and remaining buffers separately, and no row
  claims to have been blocked by a refusal that had nothing to do with it. This
  is the case Phase A's fail-closed chain got wrong and is the whole reason D3
  restated the rule rather than lengthening the list;
* the tile Save persists that document plus the ancestry step and NOTHING else,
  skips a clean outline, and cannot commit a document when the ancestry step
  refused -- so a scoped entry point is not a way around the ordering rule.

`wholeStatus`'s `partial` verdict gets its direct coverage here, which is the
verdict the widening makes much more likely.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
`test_renderer.py`'s T100 P1-1 guard caught it: the sr-only region carrying the
selected entry's FULL name had zero styles.css rules, so the "visually hidden"
half of "revealed on hover AND available to assistive technology" was a claim the
stylesheet did not back. Same idiom as `doxchat-announce` one region over.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ice 5)

The per-document thread's FILE FORMAT and PERSISTENCE, which are ours and not
harness-dependent. The OMP mirroring hooks are the gated §11 slice; what lands
here is the interface they will call, fully functional with no harness present.

`scripts/ideation_dashboard/doxbench_threads.py` (stdlib-only, frozen dataclasses):

* THE FORMAT, per design §4.1 and pinned as a golden render: frontmatter
  (`schema_version`, `kind`, `document`, `scope`, `authority:
  non_authoritative`, `regenerable_from: transcript`), then `## Thread state`
  with the six commitment classes, then `## Transcript` with per-turn headers
  naming the MODEL and the BOUND BUFFER -- the same pair the released envelope
  carries, so the sidecar and the wire agree by construction rather than by two
  conventions. Key order is part of the format, which is what makes
  render -> parse -> render byte-identical.
* `render_state_header` returns frontmatter + the state header ONLY, and is a
  literal PREFIX of the whole file: a packet can carry OTHER threads' headers
  without carrying their transcripts, and a test asserts no turn text leaks.
  The authority declaration rides the header, so nothing downstream has to
  infer that a summary is not truth.
* THE PATH RULE mirrors the document's own repo-relative path under
  `ideation/dashboard/session-threads/`, reversibly -- basename keying would
  have merged two conversations about two `README.md` files. Absolute,
  traversal-shaped and thread-of-a-thread paths refuse rather than normalize,
  because normalizing breaks the reversibility the rule is for.
* COMPACTION is layer two of the compression stack: lossy over the TRANSCRIPT,
  and a RAISE over the header. Dropping an accepted fact, an open question, a
  decision, an evidence ref or a pending action is a refusal that names the
  class and the item -- a defect a test catches rather than a review. The active
  goal is treated as a sixth class, which strengthens past the delta's
  enumerated five and says so.
* THE PERSISTENCE SEAM: `thread_commit_paths` yields the paths a Save adds to
  `commit_gate_action`'s declared document set, so a thread and the document text
  it discusses cannot land through separate commits.
  `write_thread(gate, thread)` is the only write route and goes through the
  injected `HumanGate`, inside the session worktree and never into the served
  checkout.
* `gate_routes.first_edit_gate_factory` DECLARES the thread prefix (task 9.5).
  That gate is doxBench's governed Save; without the declaration the boundary
  refuses the sidecar as `outside-allowlist`. No other gate widens, and a test
  asserts the prefix appears exactly once.
* PROMOTION EXCLUSION: `promotion_excluded_prefixes()` plus its stated reason --
  no default promotion, an explicit human opt-in, and the lifecycle verbs as the
  only route for a finding. Nineteen forbidden source spellings and a
  public-surface check assert the negative: no parallel decision store, no
  `promote*`/`publish*` name, no write route of its own.
* `ThreadMirror` is the Protocol the §11 bridge implements. `mirror_turn`
  appends to the SIDECAR first and completely, then consults the mirror; a
  raising mirror cannot cost a turn. The split-brain prohibition is stated in
  source and asserted: harness-native memory MUST NOT hold the thread, and any
  that is enabled is non-authoritative and ranked last.
* DEGRADED POSTURES: `require_thread_capability` refuses on the hosted plane and
  where the gate capability is absent, with a fixed reason and a named cause, and
  refuses an undeclared plane rather than guessing.

Also re-pins `test_bullseye_widget.py`'s create-seam source assertion for the
outcome row's `kind` -> `key` rename: the reader's target string is unchanged
(the create seam's row keys by its `kind` onto the reserved `document` slot), the
row is still found by identity rather than by index, and the map-shaped reading
is still forbidden.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
… B slice 4b)

The canvas STRUCTURE held exactly as Phase A predicted: the view tabs still
render whichever buffer is selected and enumerate none, one Save and one Cancel
still sit outside both tabs, Cancel still targets the selected key alone, and the
chat still binds to the selected key. Widening the buffer set required no
structural change to any of them.

What Phase A's own prohibition CAUGHT -- and this is the finding task 7.4 says to
raise rather than a task -- is that the module's buffer ENUMERATION was expressed
over the `BUFFER_KINDS` constant: a literal two-name list baked into the
surface's own structure, which the ratified delta forbids in as many words. So
the SOURCE of every enumeration moved, and nothing else did:

* `bufferKeysNow()` reads `bufferKeysInOrder(state)`, with the `BUFFER_KINDS`
  fallback narrowed to the pre-state mount window at exactly two commented sites.
* `holdsBufferKey(key)` replaces `BUFFER_KINDS.includes(...)`: membership is asked
  of `state.buffers`, which refuses strictly MORE than the old two-name test.
* `applyVisibility` reads the key set ONCE per pass, so its five steps cannot walk
  different sets.
* Per-buffer DOM became lazy (`ensureBufferDom`), idempotent, and is run for
  `BUFFER_KINDS` at mount so the initial DOM is byte-identical -- proven by 300
  unchanged Phase A assertions. Per-buffer maps register per key; `perBuffer` is
  gone.
* Declared and pinned: the LABEL rule (reserved keys keep their names; a path key
  takes the shortest trailing suffix no other loaded key shares, recomputed
  set-wide because a second `README.md` must lengthen the first one's label too)
  and the CSS SLUG rule (reserved keys verbatim, so existing class names are
  unchanged; a path gets sanitised basename plus an FNV-1a of the whole key, so
  `a/b.md` and `a-b.md` cannot collide).

New controller members, which are what the rail's selector and the tile's verbs
call: `loadDocumentForEditing` (bound refused BEFORE the source read, with the
measured number; an already-held path SELECTS without re-reading, so no unsaved
text is discarded), `unloadDocument`, `saveDocument` (literally
`save({ only: key })` -- one call site, no second write route), `loadedBuffers`,
`bufferKeys`, and the `onLoadedSetChanged` seam, chosen to match the module's
existing injected-callback idiom rather than adding a listener registry.

Two defects fixed, both found by the widening:

* `switchDocument` called `replaceBuffer(state, buffer)` without naming the key.
  Phase B resolves an omitted key by PATH, so a switch added a NEW key beside the
  reserved slot instead of replacing it. It now names the reserved key.
* `app.js` dropped `only` when composing the save seam, so the tile Save would
  have persisted EVERY dirty document -- the exact widening design D4 forbids,
  performed silently by a composition. The scope now rides the request.

Also in this commit:

* `syncContextSelection`'s Phase B rule was too narrow and broke the wheel's
  keyboard selection: with the OUTLINE selected it reconciled to nothing, so the
  wheel sat at the top of the reel instead of on the document the canvas holds.
  One stated rule now answers "which document is the canvas on" for BOTH the
  wheel reconcile and the v1 turn's single path -- the selected buffer when it is
  a document, else the first loaded document in the declared order -- because
  reading it in two places with two spellings is exactly how those two controls
  came to disagree before.
* `doxbench-state.js` drops the property-removal operator for rest-omission at
  its two new sites, so the mutation-boundary guard on FR-037's removal verb
  keeps an UNBROKEN surface. The narrow carve-out that had been added to that
  negative-space test is removed with it: a tripwire's whole value is having no
  exceptions.

Pinned tests re-pinned honestly, each with its reason in place: the rail header's
grounding half now states the loaded COUNT (an enumeration of N filenames in a
one-line header is unreadable at four documents and impossible at twenty; the
enumeration moved into the selector, where a human can also act on it), and the
save-seam rows follow the `kind` -> `key` rename with a new assertion that the
whole-canvas Save sends NO `only`.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Ticked only what landed, and annotated in place what did not:

* §4 (state) 4.1-4.7 · §5 (turn contract) 5.1-5.3, 5.5-5.6 · §6 (save ordering)
  6.1-6.4 · §7 7.1, 7.3, 7.4, 7.5 · §8 (tile verbs) 8.1-8.5 · §9 9.1, 9.3, 9.4.
* 5.4 stays OPEN with its half recorded: the document sections are realized as a
  declared group expanded per loaded document; the PACKET's sections wait on §10,
  which is gated on §3.
* 7.2 stays OPEN with its half recorded: the selection move is realized through
  the one state authority; the THREAD switch waits on §9's store, and the change
  handler carries the TODO naming it rather than being half-wired.
* 9.2 and 9.5 state SEAM LANDED, ROUTE UNWIRED: the commit paths, the write
  route, the gate allowlist and the degraded postures are realized; the call from
  the save route and the HTTP route's own loopback/fail-closed obligations belong
  with §11's turn mirroring, which is the first caller a thread route would have.

Two findings recorded rather than papered over:

* 4.4 -- the re-key PRIMITIVE is realized and pinned, but its UI half is not
  reachable as the task assumes: the ratified seven-field outcome row carries no
  path, so the canvas cannot learn what a `create-document` created, and widening
  the row would contradict the same requirement's "unchanged in shape" clause.
  The case is also unreachable today, since a path-less create request declares no
  document and the server's transaction refuses it. Resolving it is Brett's call
  between the row carrying the path and the re-key staying a state primitive.
* 7.4 -- the canvas structure held, and the requirement's prohibition CAUGHT the
  enumeration source. Recorded with what moved, why it refuses strictly more, and
  the second defect it surfaced.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…s finding)

The §3 verify list landed on main while this branch was in flight, and 3.5's
finding adds a concrete requirement to task 9.1: the harness's own
session/artifact store lands OUTSIDE the git worktree, in a home-relative tree
keyed to an encoding of the invoking cwd, with zero relationship to git branches
or worktrees. So an `artifact://<id>` reference persisted into a sidecar is
scoped to the ORIGINATING harness session's own directory and will never resolve
for a colleague who fetches the shared branch -- the referenced file simply does
not exist in their checkout, whatever they fetch.

The sidecar is THE RECORD, and a record that points at something the branch does
not carry is not a record. So this is a REFUSAL, not a warning, and it sits on
`ThreadTurn` itself: absolute, no flag, no strict-mode switch, and no route by
which a pointer becomes the record. The match is deliberately broad -- a pointer
buried mid-sentence is exactly as unresolvable as one on its own line.

Both of the finding's remedies are realized:

* `dereference_bodies(..., dereference=...)` resolves the content FIRST through a
  seam the §11 bridge supplies, since the bridge is the only component that can
  read the harness's own store. A half-resolving implementation cannot slip a
  survivor through, because the seam's answer goes straight back through
  `ThreadTurn`'s refusal; a non-string answer and an absent seam are refused
  rather than coerced or skipped; and a body with no pointer is handed to no seam
  at all, so the common path cannot be rewritten by a mirror that decided to edit
  prose.
* `elided_note(byte_count, reason)` states the FACT and the size for output too
  large to inline -- a record a reader can act on, where a pointer is not.

`mirror_turn` needs no check of its own, which is the point of putting the
refusal on the dataclass: a turn carrying a pointer cannot exist to be handed to
it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 18, 2026 20:23

@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 “Phase B core” doxBench editor generalization from a fixed {outline, document} pair to a keyed buffer set (outline + N loaded documents), and threads that shape through the turn contract, save ordering, and the two main UI surfaces (loaded-document selector + doc-tile verbs). This aligns the browser state, server turn validation, and save pipeline around buffer keys (paths) while preserving Phase A’s envelope as a legal instance.

Changes:

  • Generalize doxBench state + turn contract to operate over a keyed buffer set, including per-buffer observed hashes, proposal targets, and deterministic section ordering.
  • Update save planning/execution to “outline ancestry first, then documents independently” with deterministic ordering and per-buffer outcome rows keyed by buffer key.
  • Add/rewire UI surfaces: loaded-document <select> in the chat rail, and doc-tile verbs (read/load-for-editing/save) with live-state-driven marking; plus scaffolding/allowlist for thread sidecars.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/ideation-dashboard/test_doxbench_turns.py Re-pin and extend turn-contract tests for keyed buffer sets, section key expansion, binding semantics, and proposal targeting/caps.
tests/ideation-dashboard/test_doxbench_tile_verbs.py New Node-based DOM shim tests covering doc-tile verbs and the loaded-document selector behavior/accessibility.
tests/ideation-dashboard/test_doxbench_state.py Re-pin state contract tests for keyed buffers, validation clauses, load/unload/rekey behavior, and Phase A envelope compatibility.
tests/ideation-dashboard/test_doxbench_save.py Re-pin save-order and outcome assertions for keyed buffers, deterministic ordering rule, and multi-document independence/only scoping.
tests/ideation-dashboard/test_doxbench_accessibility.py Update accessibility pins to reflect buffer-key naming in live status/refusal announcements.
tests/ideation-dashboard/test_bullseye_widget.py Re-pin save-verdict reading to use per-buffer key rather than kind, and assert planner fallback behavior.
scripts/ideation_dashboard/web/views/staging-workbench.js Wire tile verbs through the canvas controller, refresh currency for all buffer keys, and centralize active-document-path derivation for v1 narrowing.
scripts/ideation_dashboard/web/views/doxbench-state.js Replace fixed two-buffer shape with keyed buffer set; add load/unload/rekey primitives, deterministic key ordering, and keyed persist/restore.
scripts/ideation_dashboard/web/views/doxbench-save.js Replace constant save order with ordering rule/function; key plan/outcome rows by buffer key; add ancestry-only blocking and only scoping.
scripts/ideation_dashboard/web/views/doxbench-chat.js Add loaded-document selector model + UI mount/rendering, including distinguishing labels and assistive-technology full-name live region.
scripts/ideation_dashboard/web/views/doxbench-chat-model.js Document why the v1 wire target enum remains ["outline","document"] while server-side targets become buffer-key based.
scripts/ideation_dashboard/web/views/doc-wheel.js Add tile verbs (read/load-for-editing/save), live marking, and refresh hook; maintain backward compatibility for onOpen.
scripts/ideation_dashboard/web/styles.css Add styles for the loaded selector, tile verb buttons, tile marking states, and verb outcome note region.
scripts/ideation_dashboard/web/app.js Thread request.only into runSave options to support tile-scoped saves without widening the canvas save.
scripts/ideation_dashboard/serve.py Translate released v1 wire shape into Phase B keyed-set internals (binding, keys, observed hashes, permitted targets).
scripts/ideation_dashboard/gate_routes.py Extend first-edit gate allowlist to include the thread sidecar prefix.
scripts/ideation_dashboard/doxbench_turns.py Implement keyed buffer set semantics: key ordering, per-buffer observed hashes, binding validation over sets, per-buffer sections, dynamic proposal target set/cap.
openspec/changes/add-doxbench-editing-phase-b/tasks.md Mark completed tasks and capture the recorded findings/TODOs for gated slices.

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

Comment on lines +1230 to +1232
supplied = permitted_proposal_targets(observed)
allowed = supplied if permitted_targets is None else tuple(
target for target in permitted_targets if target in supplied)
Comment on lines +61 to +65
_sync() {
const base = String(this.className).split(' ').filter(
(c) => c && !this._tracked.has(c));
this.className = base.concat([...this._classes]).join(' ').trim();
}
Comment on lines +812 to +816
const select = options.selectBuffer;
if (typeof select === "function") await select(wanted);
renderLoadedSelector();
renderHeader();
});
The contract layer held under attack; the COMPOSITION had broken flows every
harness-stubbed test was blind to, because those tests supplied the seam the
shipped code does not. `test_doxbench_composition.py` is the answer to that: it
mounts `mountStagingWorkbench` for real, against the SAME DOM instrument the
canvas suite drives (imported, never copied), and every assertion in it fails
against the code as this PR first proposed it.

F1 (BLOCKING) -- loading a document killed the chat. `activeDocumentPath` was
handed the SELECTED buffer's path while `buildTurnRequest` still sends only the
outline and the reserved `document` slot, so the route refused every turn with its
fixed redacted `turn_scope_refused` code: a governance refusal for a limitation of
our own wire. The wire's invariant is restored (`reservedDocumentPath()`), and a
selection the released envelope cannot carry is now a STATED PRE-FLIGHT POSTURE --
`chatBindingPosture`, Send closed before the click, the reason on the control AND
in the sr-only region it already points at with `aria-describedby`, no transport
consulted, and the sentence says what still works.

F1's ROOT CAUSE, found by the reproduction: the loaded set could never hold two
documents. A docs-row selection bound the canvas by switching the single reserved
slot, so the LOAD that followed always found the document already loaded. The
ratified delta names exactly three selection routes -- the outline tab, LOADING,
and the rail's selector -- and a docs-row selection is not one of them. So a
selection now moves the ABSTRACT above it (the other half of the annotation that
asked for the wheel) and the tile's LOAD verb binds. `selectDocument` and its
unsaved-edit guard are KEPT and still reached for the one transition that does
replace content -- filling a reserved slot that is still unbacked -- which is the
delta's own prediction that the guard is "unchanged WHERE IT STILL APPLIES".

F2 (BLOCKING) -- the tile Save was enabled and then refused for every restored
Phase A session: the marking resolved the buffer BY PATH and `saveDocument` takes
a KEY, and the two differ for exactly a real document under the reserved key. ONE
resolver (`docBufferState`) now answers both.

F3 (BLOCKING) -- `Editing is unavailable` was unrealized: the verbs existed
unconditionally, so a gate-off surface failed ON ACTIVATION with the wrong
sentence. They are withheld by the SAME `canvasOffered()` derivation the canvas
mount reads -- deliberately not by whether the controller has mounted yet, which
would have withheld them on capable surfaces too, since the docs pane draws first.

F4 -- `PromptEnvelope.bound_buffer_key` removed. It is the exact
server-side-only-field-no-reader-consults construct Phase A's review killed, and
it mis-derived. The declared binding is still CHECKED by `revalidate_scope`; it
returns as a RECORD field with §13's envelope, which is the only place it can be
read from.

F5 -- the `artifact://` refusal covered only turn bodies. It now lives in the ONE
validator every frontmatter value, commitment item and turn header field funnels
through, so all six state-header classes are covered by construction. A header
pointer travels FURTHER than a transcript one: the header is what a packet carries
to other threads.

F6 -- the selector's empty state could never render: the always-present reserved
`document` slot was counted as loaded. Same `path !== null` rule the canvas's own
`loadedBuffers()` applies.

F7 -- the `only`-drop tripwire was hollow, and both claims are corrected rather
than propped up. The canvas narrows the buffer set BEFORE building the request,
so forwarding the scope is DEFENCE IN DEPTH; the mechanism is pinned where it
lives, on `runSave` over a four-buffer state.

F8 -- the body rule refused blank lines, so an ordinary multi-paragraph answer,
a fenced code block or a spaced list was UNSTORABLE. The transcript block boundary
moved to the turn HEADER (which a body cannot contain), blank lines became
content, interior indentation including tabs is untouched, and the round trip is
still identity. Every marker-collision protection survives, each for a stated
round-trip reason. Done now rather than after §11 starts mirroring real turns,
because re-cutting the format later costs a `schema_version` bump.

F9 -- `unloadDocument` had no control, so the ratified "explicit human act" to
leave the loaded set did not exist and the declared bound was a dead end. The
control lives beside the selector, is never offered for the reserved outline, and
REFUSES a dirty buffer on the first press while re-labelling itself to say what a
second press discards.

F10 -- the allowlist widening is annotated against §9.5 with why it is one prefix,
one gate, and no wider. F11 -- the retired "0-2 proposals" docstring follows
`PROPOSAL_CAP_RULE`. F12 -- a document whose path IS a reserved key (a repo-root
file named `outline`) was a thrown validator error reported as "the load failed";
it is now a named refusal that tells the human which file and why. F13 -- the
docstring says plainly that the path clause is a SELF-COMPARISON for documents and
does no work, rather than implying otherwise.

The DOM shim gained `removeAttribute`, `remove`, `style` and `clientHeight` -- all
real DOM members the shipped code has always used. Their absence is why no test in
this suite had ever driven the docs wheel's LAYOUT, and three of these defects were
hiding behind exactly that gap.

Pinned tests re-pinned honestly, each with its reason in place: the two Phase A
selection tests follow the binding route to the LOAD verb (their claims unchanged
-- a mount seed must not act; a route that moves the binding must refresh the
header), the guard test now pins that a load REPLACES NOTHING and needs no guard,
and the `canvasOffered` source pins follow the derivation into its own function.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings August 18, 2026 22:10

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 24 out of 24 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

scripts/ideation_dashboard/doxbench_turns.py:607

  • require_outline_and_documents() permits document buffers whose path is a reserved key ("outline" or "document"). This creates key collisions: "outline" is filtered out by ordered_document_keys(), which would cause build_prompt_envelope() to silently drop that document from revalidation, identities, and prompt sections. Add an explicit refusal for reserved-key document paths (while still allowing the unbacked slot where path is None).
        elif buffer.kind == "document":
            key = buffer_key_for(buffer)
            if key in documents:
                raise TurnBufferKindError("the same document buffer was supplied twice")
            documents[key] = buffer

Comment on lines +665 to +669
const target = bufferKeyFor(buffer);
if (target === OUTLINE_BUFFER_KEY) {
// The reserved outline key, claimed by a document's own path. Refused rather
// than thrown (F12): the state module owns membership, so it owns the
// sentence too.
N3 (MUST-FIX) -- unloading the reserved `document` slot wedged the chat.
`loadedSelectorModel` listed that key as an ORDINARY loaded entry whenever it
carried a path, so Unload was reachable for it; one click emptied the slot and
`buildTurnRequest` then read `buffers.document.path` on an absent buffer. That
threw, was caught as the generic unsettled-buffer failure, and the rail said "the
buffers are still settling; try Send again in a moment" FOREVER -- a permanently
false sentence, which is the worst thing a refusal can be.

Fixed by the code's own reasoning about the outline, carried to its sibling: under
the released v1 envelope the reserved document slot does not merely reserve a name,
it RIDES EVERY TURN -- `buildTurnRequest` sends exactly `buffers.outline` and
`buffers.document` -- so it can no more leave the set than the outline can. Each
selector entry now declares `reserved`, the control withholds itself for either
reserved key with a reason that names why AND what to do instead ("load another
document to work beside it"), and the click path refuses independently, so the
render's disabled state is not the only thing between a human and a wedged chat.
Listing the slot stays right: it is selectable and the chat binds to it.

N1 -- the F1 wire fix was not actually pinned. Reverting `activeDocumentPath` to
`canvasDocumentPath()` left all eight composition tests green, because the
fixture's `detail.md` and `second.md` both sort AFTER the literal reserved key
`"document"`, so the reserved slot won by accident rather than by rule. The
fixture now loads a key that sorts BEFORE it (`BOOK.md`/`README.md`, two of them so
whichever the projection makes reserved, one is still loadable), and the test
asserts that ordering fact explicitly so the discrimination cannot rot.
REVERT-TESTED: the reverted implementation now names `BOOK.md` and the test fails.

N2 -- F12's second half. The reserved-key guard read only `outline` while its
comment claimed both names. The `outline` half was caught by the validator and
became a thrown TypeError; the `document` half was caught by NOTHING -- a
repository-root file named exactly `document` keys to the reserved slot and the
load would have OVERWRITTEN whatever it held, including a create buffer holding
unsaved human text. That is the silent eviction design D6 forbids outright ("no
eviction anywhere ... every loaded buffer may hold unsaved work"). Both halves now
refuse by name, and the new tests assert the reserved slot's own bytes survive.
REVERT-TESTED: removing the second half restores the overwrite and two tests fail.

F11 -- `ValidatedAssistantResponse`'s docstring still said "0-2 validated
proposals"; it now states `PROPOSAL_CAP_RULE`'s bound and notes that the v1 wire's
two buffers make its effective bound unchanged.

Item 4 (record only, no behaviour change) -- task 8.6 now names the N4 trade
plainly: under the v1 envelope the chat's document binding is PINNED to the
mount-time reserved slot once backed, because the envelope carries only that slot
and nothing may empty it. Phase A allowed a row-selection swap, so this is a
user-visible REDUCTION, accepted as a stated interim posture, ending either with
§13's widened envelope or sooner if Brett rules that a CLEAN slot may be
re-pointed. Selection semantics are deliberately unchanged pending that ruling.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings August 18, 2026 22:35
@brettheap
brettheap merged commit a4a6f6e into main Aug 18, 2026
1 check passed
@brettheap
brettheap deleted the change/realize-doxbench-phase-b-core branch August 18, 2026 22:36

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 24 out of 24 changed files in this pull request and generated no new comments.

Suppressed comments (2)

scripts/ideation_dashboard/web/views/doxbench-state.js:711

  • loadDocumentBuffer accepts options.maxLoadedDocuments as long as it’s a safe integer, which currently includes 0 and negative values. That makes the bound check (current.documentKeys.length >= bound) always true and will refuse every load with a nonsensical bound value. It’s safer to treat non-positive values as invalid and fall back to DOXBENCH_MAX_LOADED_DOCUMENTS.
  const bound = Number.isSafeInteger(options.maxLoadedDocuments)
    ? options.maxLoadedDocuments
    : DOXBENCH_MAX_LOADED_DOCUMENTS;

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

  • docTileVerbs().save() falls back to calling canvasController.saveDocument(path) when docBufferState(path) can’t resolve a live buffer key. If the document was unloaded or the live state changed between render and click, this can attempt to save a non-existent buffer key (a path string) instead of refusing cleanly. Since the Save button is meant to govern a specific loaded buffer, it should require live.loaded === true and a resolved live.key before dispatching the save.
        const live = docBufferState(path);
        const key = live && live.key ? live.key : path;
        let outcome = null;
        try {
          outcome = await canvasController.saveDocument(key);

brettheap added a commit that referenced this pull request Aug 21, 2026
… record realization evidence (#228)

* Phase A task 9.1: record the realization evidence at the archive gate

Derived from git log over the change directory, not from recollection: the
realization is PR #196 / 6ac42ed plus this change's own annotation round at
#199 / 224bf22 and #201 / 96975c1. PR #207 realized Phase B's core and touched
no file here — named in the block only to say so. Green at landing: this
change's own five pinned files 487 passed exit 0; tests/ideation-dashboard
3699 passed / 15 skipped. The block also states what Phase B has since done to
the surface, so the archived spec is not read as current two-buffer truth.

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

* proposal-support: archive a change that has no supporting documents

The promoted rule scopes packaging to a change WITH supporting documents, and
verify() already reads it that way on both sides — but archive_change called
package() unconditionally, so a staged-origin change that legitimately never
took its topic with it could not archive through the sanctioned path at all.
Fifteen archived staged-origin changes already have that shape, so the wrapper
was the only thing that could not produce it, which is precisely what pushes an
operator toward a bare 'openspec archive' and around the gate.

Found archiving add-doxbench-editing-phase-a, whose task 9.2 deliberately kept
the topic staged for Phase B. --final-import-complete with no bundle is now
refused rather than silently ignored.

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

* Land doxbench Phase B wave 2: archive Phase A, exit the staged topic, record realization evidence

Phase A archived via proposal-support as 2026-08-21-add-doxbench-editing-phase-a
(+5 ADDED, ~2 MODIFIED promoted). 13.7 verified against the promoted text, not
assumed: the three Phase-A-relative names are present to amend, and the promoted
F2 deferral sentence is the one Phase B's MODIFIED block replaces — the hazard
was real. 13.6 exits the staged topic into Phase B's supporting-docs with the
origin byte-identical, and dispositions the two parked items (Headroom's five
gates, the graph graduation trigger) to live code that refuses adoption.
13.8 records the evidence and stays OPEN: the gate is written over the whole
code surface and share-session is not built. §12 adjudication recorded against
12.6 — Phase B stays ACTIVE, NOT archived; the call between realizing §12 and
carving it out is Brett's.

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

* Repoint the two references to Phase A's now-archived path

The README's active-block entry linked a directory that no longer exists;
it now points at the archive, records the realization evidence and the
discharged F2 obligation, and drops the 'archive gate still needs 9.1'
sentence that has stopped being true. add-staged-topic-outline-template's
cross-change citation is repointed too — the finding it cites is unchanged,
only its location is.

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

* Review round: correct the precedent count, align the predicate, make the F4 test bite

F1 the comment said fifteen; sixteen archived staged-origin changes had the
bundle-less shape before this one, and fifteen is the count of the complement.
Corrected, with the recount method stated so it cannot be miscounted again.
F3 .exists() rather than .is_dir(), so this predicate is the same one verify()
applies and the two readers cannot disagree.
F4 the final-import-complete test asserted a bare SupportError, which the
PRE-fix path also raised — tightened to assertRaisesRegex on the message.

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

* F5 the full open ledger for Brett; F2/F3 recorded as a follow-up item

F5 the recorded exit note named §12 alone, which would have put a partial
ledger in front of the ruling. Nine tasks are open across three families —
10.7 and 11.7 each need a contract release, 12.1-12.6 need a realization slice,
13.8 follows whichever lands last — so carving §12 out narrows the blocking set
from three families to two rather than clearing it.

F2/F3 recorded in docs/support-bundle-scope-open-item.md and linked in the
README doc index: the staged-origin scenario reads more absolutely than the
requirement it illustrates (the fix is a spec-text change, not authorized here),
and the deleted-supporting-docs surface stays open with its predicate half
already closed. Status is 'record' per the controlled taxonomy — the
open-item doc I modelled it on uses a free-form status that doc-health flags.

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

* Reconcile the outline-template's 5.3 enumeration and 6.3 path with the doxbench topic exit

The merge of origin/main brought add-staged-topic-outline-template's gate
records onto the same branch that exits doxbench-editing-model from staging,
so two of its recorded claims now describe a corpus that moved under them.
Neither is wrong; both would rot silently if left alone.

6.3 cited the handoff note at its staging path. The note is unchanged and
still present -- it rode with the fragment into Phase B's support bundle, so
the citation is repointed and the reasoning noted as strengthened, not
weakened: the note existed so "Phase B inherits it" and now sits inside Phase B.

5.3's sha-pinned enumeration is unaffected in substance: doxbench-editing-model
is not one of its 29 findings (it carries both required headings), and a
doc-health run on the merged tree is byte-identical to its base at the new main
tip -- 3/8/76/3, new findings [], empty finding-by-finding diff. What moved is
the corpus size, so the real post-exit figures are recorded for the next re-run
rather than leaving the pin to be discovered stale.

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

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 23, 2026
… Brett's explicit word

This was the one archived proposal among forty-four carrying `Status: ratified`
with no ratification citation. The promoted rule in
`openspec/specs/document-lifecycle/spec.md` makes a bare uncited `ratified`
header a violation whatever else the document says, and
`sanction-ratified-record-spelling` parked this record at its tasks.md 5.2 as
out of scope, routed through a citing change. This is that change.

THE RATIFICATION FACT, DERIVED FROM THE RECORD RATHER THAN ASSUMED. Three
points on this change's own record name it:

* The archive commit `02a71d6` (PR #264, 2026-08-22): "Archived on Brett's
  explicit word, through proposal-support.py's archive verb". PR #264's body
  opens "Brett's word given."
* Task 13.8, written before the archive: "`proposal-support.py archive` is the
  sanctioned path and it is Brett's act on his explicit word, not a consequence
  of this box being checked."
* The commit inside PR #264 that actually WROTE the `ratified` value --
  `bdd09c2`, "Bot round on the archive: a mislabelled sha and a stale proposal
  Status" -- recording why: "a change whose spec deltas have PROMOTED is
  ratified by construction."

So the ratification is the archive act and the promotion it performed, Brett
Heap, 2026-08-22 -- an approver, a date, and a resolvable record, all three
axes of the record-citing form's floor.

THE HEADER'S HISTORY IS NOT WHAT A READER WOULD ASSUME, and it was checked
commit by commit. The proposal read `Status: draft` from its proposing commit
`d3d7f58` (2026-08-18, PR #205) through EVERY realization slice -- `e7e7a84`,
`a4a6f6e`, `5daa173`, `ece236a`, `4926b7c`, `08c5aa9`, `0f50b35`, `671a690` --
and `ratified` was written only at the archive, on a Codex review finding.

THE ORIGIN PAIR IS DELIBERATELY NOT CITED. `.openspec.yaml` carries
`approved_by: Brett Heap (live-UI annotations and in-session rulings ...)` and
`approved_on: 2026-08-18`, but those fields are nested under `origin:` and
approve the staged topic's EXIT and this change's authoring. Citing them is the
error `docs/archive-record-discrepancies.md` C2 names: "Reading them as
ratification would date each change's ratification to the day it was proposed."
B1's phase-a citation, which did cite an `.openspec.yaml` pair, is not a
precedent -- the register states its condition, "its `approved_on` coincided
with the ratification", and that fails here by four days. PRs #206 and #207 do
call this a "ratified change" in prose, but that is builder prose written
against a header still reading `draft`, and no ratification act distinct from
the origin approval is recorded on 2026-08-18; it is reported, not cited.

`Ratified:` is the correct spelling, verified rather than assumed: no approving
OpenSpec change exists. The only other changes naming this one are Phase A, its
two citers, and `sanction-ratified-record-spelling`, which found this defect.

THE ORIGINAL RECORD STANDS WORD FOR WORD -- the diff is 96 insertions and zero
deletions, so unlike Phase A's own bookkeeping correction (which had to
overwrite the `Status:` value) the 2026-08-10 append ruling is honoured
literally. Reasoning recorded in phase-b's tasks.md "Bookkeeping correction";
5.2's phase-b half discharged inline with a dated suffix, its roster-device
half left open and the box left unticked.

Gates: `openspec validate --all --strict` 68 passed / 0 failed (main moved from
67 while this was authored); `tests/doc-health` 724 passed, unmoved before and
after; `tests/ideation-dashboard -k workbench` 140 passed. Census re-measured
the way the sanction authoring did: 88 archived proposals, 44 `Status:
ratified`, 44 carrying exactly one citation, 0 missing. The line was also driven
through the real checker helpers -- `fam_ratified_provenance`'s count is 1 and
all three floor axes read True, with three resolvable record paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
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]>
brettheap added a commit that referenced this pull request Sep 17, 2026
…Manifest provisioning shape, as a credential-contracts MODIFIED delta (RULED 5704187317) (#1073)

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Refs #656 (stays OPEN).
CLAIM: #656 (comment)
RULED: **5704187317** (2026-09-16, option (1) SPLIT AND NARROW — clause (E) is this act, clauses (B) and (D) are what it refuses); **Q3** (2026-09-04T15:32Z, one instance and one database per tenant, always, in both cases); **5700622683** (the class in which § 7.4's delta-text defects are RECORDED rather than silently fixed — this packet opens a second one and fixes neither).

## What

Proposes the OpenSpec change `add-per-tenant-app-manifest-provisioning`: **ONE `## MODIFIED` block, on ONE requirement of `credential-contracts`, over CANON.** Packet only — no schema, no validator arm, no contract cut, no code.

It **takes the FIRST HALF of the declared exit path** of the staged topic `openxdox-install-app-provisioning` (staged 2026-08-14, gate met 2026-08-15, **exit unraised for thirty-three days**) by taking that topic's own OQ-1 **option (a)** — a MODIFIED `credential-contracts` delta — which is what RULED `5704187317` (E) chose over the new `install-app-provisioning` capability the topic offered beside it. **It does NOT close that topic**, and the claim is kept narrow on purpose: the topic's Exit path names Q1 (**RULED**), Q2 the managed-versus-self-hosted flow (**unruled, and neither decided nor waived here**), a named `Omnigent-Install` realization change (**owed, authored nowhere here**) and a further gate on the opensoft QA dispatch migration (**not asserted met**). What authorizes authoring with those open is clause (E) DIRECTING the authoring in the operator's own words, not a finding by this author that Q2 is dispensable — an author does not amend another document's gate from inside a packet. The fragment STAYS STAGED.

## Why

The dispatch/content separation is **already canon** and this packet does not restate it as new. `openspec/specs/credential-contracts/spec.md:169` has said since `add-dispatch-credential-contract` archived on 2026-08-25 that the two credentials are DISTINCT bindings and that a zero-write-authority serving surface *"MUST NOT hold — nor hold key material capable of minting — a content-write credential."*

**That requirement governs a credential that already exists. It says nothing about where the credential came from.** RULING Q3 makes that a gap: the pair is provisioned ONCE PER TENANT, N times, in N organizations this estate does not own. The two cheapest ways to lose the invariant at provisioning time both pass every check the promoted requirement makes, because it is not looking there — have an OPERATOR identity create the Apps inside the tenant's org, or create ONE App and widen it.

## Measured, not asserted

| read | result |
|---|---|
| Base | branched off `origin/main` `4cef77af`; merged up to `a93d2682` at `5e84904b`, which carries `main`'s own repair of the inherited self-gate failure and no packet text |
| Active changes carrying a `credential-contracts` delta | **2** — `add-credential-escrow-checkout` (MODIFIED *Canonical credential record shapes* + 9 ADDED), `add-requirement-ref-resolution-integrity` (2 ADDED) |
| …of which write *Dispatch-only credential least privilege and serving-tier separation* | **0** → block is over CANON, **no `Modified over` marker owed** (stated in the delta's own preamble) |
| Open openxFactory PRs read for their file lists | **13** (#1071 #1069 #1068 #1066 #1065 #1060 #1058 #1057 #1056 #1051 #1043 #594 #518) — **not one** touches `credential-contracts` or the staged topic |
| `openspec validate add-per-tenant-app-manifest-provisioning --strict` | **valid** |
| `openspec validate --all --strict` | 108 passed, **2 failed — both pre-existing** (`add-chain-attestation`, `add-composed-view-authoring`, each omitting a canon scenario); this change is not among them, which is the tool confirming the block carries every promoted scenario |
| `"App Manifest"` in `opensoft/Omnigent-Install` | **0** occurrences — the mechanism is contracted nowhere today |
| `"provisioning manifest"` under `contracts/ examples/ templates/ requirements/` | **0**, exit 0 over four roots that all EXIST — the record kind these clauses constrain exists in no corpus this repository validates, which is why `code_surface: none` and no validator arm is authored. (An earlier spelling of this command named a root `schemas/` that this repository does not have, so it warned on a missing path instead of proving the zero; schemas live at `contracts/schemas/`, inside the first root. Same conclusion, now actually measured.) |

## What the block adds

Canon's body paragraph and all three promoted scenarios are restated **VERBATIM**; five clauses and ten scenarios are added — the first two being the provisioning rule and the scoping rider that keeps it case-neutral.

1. **Where the pair is provisioned THROUGH A MANIFEST, creation is in the tenant's OWN SEAT AT THE PROVIDER — their organization where they are organization-backed, their own account where canon's self-hosted individual applies — and the identity is never an operator-owned one installed into it**, and never one provisioned identity creating the other (which the promoted sentence already forbids the serving tier to be capable of). The clause binds WHERE the identity lives — not who drives the flow, and not who holds its material.
2. **One pair per tenant, never shared**, under a pattern-discoverable naming convention of the form `<product> — <tenant>` whose TENANT COMPONENT is an identifier unique in the provider's own namespace, canonicalized to what that provider's names admit — a display name two tenants may share is not one, and which grain carries the uniqueness (slug, handle, issued id) stays the install's choice. The convention is load-bearing twice: the provider's App name is a GLOBAL slug, so it is the only way the flow completes for the second tenant; and it makes "never shared" auditable from a binding without reading the tenant's organization.
3. **The dispatch identity's one named target is a repository that holds no governed content**, and that repository is part of the provisioning. The refusal is on the TARGET'S PROPERTY and never on a count: the identity still names exactly one repository, and what is wrong is that a trigger on a content-bearing one leaves the serving tier one workflow away from content-write authority it must not hold.
4. **Capture is time-bound, lands in the DECLARED custody by reference, and leaves whoever drives the flow not an UNDECLARED custodian** — the custody's operator being the per-install execution binding this capability already fixes rather than a party this contract names — and no manifest, record or template carries a secret value, private key or installation token.

### What the block does NOT repeal, asserted in two of the eight scenarios rather than argued in prose

Canon keeps both operating models legitimate — *"Both cases SHALL remain legitimate. Self-hosted operation by an individual or a client is not a degraded form of operator-hosted operation"* (`openspec/specs/credential-contracts/spec.md:141`, scenario at `:164-167`) — `docs/openxdox-dispatch-credential-binding.md:31-37` records a **live** operator-hosted Case A in which the operator creates the dispatch App and holds its key in the OPERATOR's vault, and *An operated identity's credential is held in governed custody and reached only by reference* puts the custody party in the BINDING and forbids a contract artifact from naming one (`:216`). The added clauses are therefore scoped to the shape they introduce: they name no custody party, they leave who OPERATES the install to the per-install execution binding, and they do not retroactively refuse a pair already in service. Two added scenarios assert exactly that — *An operator-executed install drives the manifest flow* CONFORMS, and *A pair already in service was created without a manifest* is NOT refused. Whether Case A migrates to the manifest shape is the installer's act and the topic's unruled Q2. (This is round 3's correction: the first draft's clauses were unconditional and repealed both references in passing.)

## What this does NOT do

- **It touches not one byte of `opensoft/OpsxFactory` or `opensoft/Omnigent-Install`**, the two repositories § 7.4 of `split-opendox-two-layer-product` tags. RULED `5704187317` **(B)**: § 7.4's `openxdox` DNS sentence is discharged by **NAMING**, per that packet's own `design.md` § Non-goals (*"…or the `openxdox` DNS record's ungoverned status, **beyond naming them**"*), leaving the ceremony-reach widening inside `opensoft/OpsxFactory`'s active `add-governed-dns-administration` on Brett Heap's OQ-E word (OpsxFactory #207 comment `5649809425`). RULED **(D)**: the `dox` workload set's per-tenant declaration waits for § 3.5 — there is one tenant and one plane subject today — and its requirement stands under lane opsXfactory-3's claim `5638511222`.
- **It does not author the installer.** `Omnigent-Install` owns the flow under its own change and its own code surface; tasks § 3.1 names it as owed. That repository's README forbids the alternative in its own words — it *"should not contain … canonical shared contracts that belong in `openxFactory/contracts`"* — which is CLAUDE.md working rule 1 from the other side.
- **It reserves no contract bundle number** and adds no schema field, warning code or validator arm. Both active siblings on this capability already owe an additive minor on the same schema file; a number written here is a number one of them is spending.
- **It edits `split-opendox-two-layer-product/tasks.md` by not one byte.** § 7.4's tick, and the **second delta-text defect this packet RECORDS** — `design.md:133-134`'s *"beyond naming them"* against `tasks.md:1979`'s *"is governed here"*, in the class of `5700622683` — are the bookkeeper's amendment #5.

## Open questions carried, neither blocking

- **OQ-1 (the topic's Q2, unruled): the managed `opsxfactory_executed` flow** — operator-driven or tenant click-through. The delta is written **CASE-NEUTRAL** *in its wording as well as its intent* after round 3: it binds WHERE the identity is created and WHOSE it is, and RULING Q3's *"in both cases"* plus the topic's claim 3 make both true either way. Q2 decides who clicks, which is the installer's sequence.
- **OQ-2: the apply-workflow repository's provenance** — fresh per install or a forked template. The requirement binds the PROPERTY (the one named target holds no governed content), not the provenance.

## Gate note

`tests/doc-health/test_modified_block_currency_self_gate.py` was **RED on `main` itself** over two carriage-ledger subjects opened by another lane — the one failure in this PR's run at `b383098d` (`35159631088`: `1 failed, 7715 passed, 6 skipped, 338 deselected`). It was **INHERITED and never this packet's**: this block carries every promoted unit of the requirement it modifies, so the carriage-ledger arm has nothing to report about it — which `openspec validate --all --strict` independently confirms by not listing this change among the two scenario-omission failures.

**It is resolved at `5e84904b`.** `main` was repaired by #1075 → `a93d2682` and this branch merges it; the merge carries `main`'s two commits (`c6997f12`, `a93d2682`) and no packet text, and its tree `27b00694` is byte-identical to the tree of GitHub's own merge ref `4e479a48`. Locally on that exact tree, `pytest tests/doc-health/test_modified_block_currency_self_gate.py tests/carve_manifest tests/sequenced_after -q` reads **486 passed, 0 failed**.

A re-run of the red suite would not have shown this: run `35159631088` fetched the PINNED merge commit `+9782db6aefa1d9d9a2be7b5d0af0782ec47d65cb:refs/remotes/pull/1073/merge` — `b383098d` merged with the OLD `main` `4cef77af` — and a re-run replays the same event SHA, so only a push makes CI read the current merge ref.

## Review rounds

**Fifteen Copilot rounds, 38 findings — 8 arrived as inline threads and 30 as SUPPRESSED comments**, every one of which was read out of the review BODY. A gate reading "0 unresolved threads" alone would have seen a fifth of this PR's review. Threads: **9 total, 0 unresolved**. Each round's disposition is a comment on this PR: [rounds 1-2](#1073 (comment)) · [round 4](#1073 (comment)) · [round 5](#1073 (comment)) · [round 6](#1073 (comment)) · [round 7](#1073 (comment)) · [round 8](#1073 (comment)) · [round 9](#1073 (comment)) · [round 10](#1073 (comment)) · [round 11](#1073 (comment)) · [round 12](#1073 (comment)) · [round 13](#1073 (comment)) · [round 14](#1073 (comment)) · [round 15](#1073 (comment)).

The findings worth the rounds were structural, not prose: the added clauses silently repealing canon's two operating models and the ratified operator-hosted Case A (round 2); a conformance scenario that read as a licence for the identity the clause above refuses (round 4); the self-hosted individual left with **no** conforming identity, against canon's *"Both cases SHALL remain legitimate"* (round 10); and a naming convention that bound the manifest but not the identity it names, whose check sat in an unreachable branch (round 11). Round 12's one suppressed finding — `declared custodian` used for an actor the sentence defines as *the operator the per-install execution binding declares* — is neither a canon contradiction nor a false statement, so under the severity gate declared at `1ea066ad` it is answered by measurement and **registered for the ratification read (`tasks.md` § 2.1)**, where this `Status: draft` packet's requirement wording is decided in any case.

**Round 13, at the merge head `5e84904b`, raised two inline findings and both were factual errors in the landed text — the class the gate admits — so both are fixed at `a642a3c5`:** `design.md` D3 still counted TWO scenarios asserting the case-neutral reconciliation where the other three places in the packet read THREE, and the one it omitted was the self-hosted individual canon's *"Both cases SHALL remain legitimate"* rule turns on; and the `code_surface` evidence recorded a zero-occurrence `grep` as `exit 0`, where a clean zero is **exit 1** and **exit 2** is the error status the earlier `schemas/` spelling actually produced (both measured at this head, GNU grep and ugrep alike). **Nothing normative moved in either fix** — no clause, no scenario and no count in the delta block changed. Both threads are answered by measurement and resolved.

**Round 14, at `a642a3c5`, suppressed two.** One is fixed at `00685387`: § 1.7's gate box still recorded the inherited failure and a repair *"in flight"* that had landed — corrected, and its FORM corrected with it, by recording each head with its own run id (`b383098d`/`35159631088` red-inherited; `5e84904b`/`35221707064` SUCCESS; `a642a3c5`/`35223896296` SUCCESS) and stating that the box is ticked at the ratification read against the head then current, which is the only way a head measurement is still true when it is read. The other — whether the added clauses are provider-neutral — is answered by measurement and **registered for the ratification read**: the added clauses name no provider at all (*the provider*, *the tenant's own seat*, *organization or account*, *the provider's namespace*), the block's single `GitHub` is canon's own promoted paragraph carried verbatim as a MODIFIED block must (`openspec/specs/credential-contracts/spec.md:170`), and the canon sentence cited governs the naming of a FIELD — `realm` versus `identity_namespace` at `:346-353` — not a clause describing a flow. Neither fix touched the delta block.

**Round 15, at `00685387`, suppressed two of one class, and the head did not move for them.** The naming clause's rationale claims the identities of one tenant *"can be enumerated without reading that tenant's own account"*; a pattern makes a name RECOGNIZABLE, not LISTABLE, and the inventory source is the staged topic's own open question 5 (*"how does opensoft support enumerate them across tenant orgs it may not directly see?"*). The uniqueness half is untouched — a tenant component unique in the provider's namespace needs no inventory — and over the estate's own bindings and manifests the pattern does what the clause says; what it cannot reach is an identity in no binding at all. That is requirement wording, so it is [answered by measurement and registered for the ratification read](#1073 (comment)) with a recommended narrowing. **The stopping rule in force from `00685387`: the head moves only for a canon contradiction in the delta block** — rounds 13 and 14 moved it because each found a false statement in the landed text, and both classes are now closed by construction (counts are grepped; the gate box records heads and runs, so it cannot stale).

**Rule 6 applies** (this PR touches `openspec/changes/` and the README **OpenSpec Records** block). Brought to READY, **not landed**; this lane never merges.

Lane: openxfactory-4
Author opus-max, actor `ops74`, session `openxfactory-4` f3c8d406.

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


Lane: openxfactory-4
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