Skip to content

OpenSpec: ratify the landed doxBench surfaces; propose the distilled abstract (#84) - #352

Merged
brettheap merged 6 commits into
mainfrom
change/add-doxbench-distilled-abstract
Aug 25, 2026
Merged

brettheap merged 6 commits into
mainfrom
change/add-doxbench-distilled-abstract

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Two OpenSpec change packets for openxFactory #84, per Brett's rulings (option C, 2026-08-25; rulings 0–7 all as recommended — recorded on the issue).

ratify-doxbench-landed-context-surfaces (doc-only, code_surface: none, archives on landing) — promotes the three doxBench surfaces that shipped 2026-08-03 with no requirement text (lens subtabs; docs pane split + wheel; deterministic abstract) into ideation-dashboard spec text, and replaces the ratified :439 "always-present matrix, never toggle-only" clause that the shipped tablist has falsified since then (staging-workbench.js:488). 5 MODIFIED (restated whole, heading-exact, no scenario dropped; :896-899 intact) + 1 ADDED. Every clause verified against the shipped code; clauses the code does NOT yet satisfy were moved to the successor.

add-doxbench-distilled-abstract (Status: ratified, target_release: none) — the model-produced distillation, reversing the 08-03 "not an AI distillation" ruling on the record. Proposal (alignment-reviewed: 35 findings; council-reviewed: 12 VALID, 5 NOTED → clarifications.md), spec delta (3 MODIFIED incl. :1045 widened to every model consumer with the three-member port surface unchanged and :1970 admitting a layer-2-class sibling artifact; 8 ADDED), design.md D1–D10, tasks.md RED-first with 5 mutation rounds and a realization gate requiring one real-adapter operator run. Ratified shape: server-side on-demand via a new same-origin route; session-only (never a snapshot field, byte-identical both directions); explicit invocation never on wheel selection; subject = wheel tile / saved bytes / editable_paths; compact_thread discipline in a new DocumentAbstract with a snapshot-based verifier that fires on generation #1; five captions; one region. §2 wires OmpHarnessBridge as model_port_factory at cli.py:298 as one process-lifetime instance — today no entrypoint declares a port at all.

openspec validate --all --strict: 78 passed. Packet review (Opus, adversarial): A READY-AFTER-FIXES → fixed; B NOT-READY on 4 design/tasks blockers → all fixed. Side finding filed separately: add-doxchat-model-intake's delta is stale against canon and would revert it on archive.

README §OpenSpec Records gains both entries. Speckit follow-on for B: exactly one feature, specs/014-doxbench-distilled-abstract (not created here).

🤖 Generated with Claude Code

brettheap and others added 5 commits August 25, 2026 09:13
Brett ruled option C on 2026-08-25: build the REAL per-document distilled
abstract in the doxBench docs subpane, produced by a model. That reverses his own
2026-08-03 scope ruling that the abstract be "header + structure, honestly
labelled ... NOT an AI distillation" — a ruling pinned not as a comment but as a
test, so the pin is RELOCATED rather than deleted. Its current form could not
survive the change anyway: it is a whole-file substring sweep, both captions will
live in one file, and it bans "distilled" while missing "distillation".

A second reversal was found while grounding the first, and nobody asked for it.
The lens subtabs shipped 2026-08-03 make bullseye and matrix mutually exclusive
tabpanels, which the ratified requirement forbids in those words — "MUST NOT
become a toggle-only alternate". A requirement the code has quietly falsified for
three weeks is worse than a reversal, so it is rewritten around what it was
actually protecting: access to the matrix, not simultaneity.

Council review (product / architect / adversary) changed the substance three
times. A real adapter EXISTS — OmpHarnessBridge supervises an `omp --mode rpc`
child with no credential — so the blocker was never "no provider"; it is that no
entrypoint declares model_port_factory, which makes the honest empty caption the
only thing an operator can see today, and makes an operator run through a real
adapter part of realization rather than a green suite against a constant fake.
The prompt ASSEMBLER is new surface: build_prompt_envelope is chat-shaped to its
bones, so a non-chat assembler and a second packet purpose are required. And
layer 2 is NOT widened — a comma-joined second owner in a one-owner field would
degrade the fidelity checker to a comment, so the abstract is a layer-2-CLASS
SIBLING under the requirement's universal non-authoritative clause.

Eight rulings, none pretended decided. Ruling 0 is the split all three reviewers
recommended independently; ruling 7 is the one that can invalidate ruling 6,
because disclosure on this surface requires edit authority and on a cluster tile
the eligible subject set is empty. Deltas are deliberately withheld until the
rulings land, so --strict reports a no-deltas error by design.

Co-Authored-By: Claude Fable 5 <[email protected]>
…sified a requirement (#84)

Brett ruled the council's split on 2026-08-25 (ruling 0 of
add-doxbench-distilled-abstract). This is the doc-only half: three surfaces
shipped into the doxBench context panes on 2026-08-03 and the spec mentions none
of them — grep abstract or subtab over ideation-dashboard/spec.md and it returns
nothing.

One of them does worse than go unmentioned. spec.md:439 requires the bullseye
"above the always-present flat matrix" and says in those words that the matrix
"MUST NOT become a toggle-only alternate". The shipped three-subtab restructure
makes the sections mutually exclusive tabpanels — staging-workbench.js:488 sets
subPanes.get(name).hidden = !on — so that requirement has been false about this
surface every day since the subtabs landed. Carving this out means the
correction lands now instead of waiting on the model-derived abstract's seven
rulings, its adapter wiring, and its prompt assembler.

The reversal is taken on what the clause was protecting: ACCESS to the flat
matrix, not simultaneous rendering of it. So each section becomes a named,
always-reachable member of one APG tablist, the `above` ordering is discharged by
the tablist's declared section order, and a keyboard scenario is added — the
guarantee moved from geometry to a widget, and a tablist without arrow keys is a
worse promise than the one it replaced.

Six requirements MODIFIED whole and one ADDED. Ruling 6 is settled in the two
places it bites: a surface that selects a subject to DESCRIBE is not a second
buffer-selection surface, so the buffer contract is untouched and pointing at a
document neither loads nor keys nor dirties a buffer; and the phrase naming the
working document is claimed by exactly one surface. The added requirement is the
deterministic abstract's own provenance — "From the document's own headers",
never a distillation, with an absence stated rather than rendered as an empty
box.

No code. The tasks are records plus a cross-check that every promoted sentence
describes what already ships, and if the text is wrong the text is what gets
fixed.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ble (#84)

Brett took all eight rulings as recommended on 2026-08-25. Ruling 0 split this
change: the doc-only half is ratify-doxbench-landed-context-surfaces, which took
BREAKING #2 and all six Group B integration-surface items and archives first, so
this change's deltas are authored relative to its outcome. What is left is the
model-derived abstract itself, and its deltas are now written — three
requirements MODIFIED, seven ADDED.

Three of the seven exist because the council found the first draft describing a
feature that could not run. A real adapter already exists — OmpHarnessBridge
supervises an `omp --mode rpc` child with no credential — but no entrypoint
declares model_port_factory, so _workbench_model_port returns None on every real
serve and the honest empty caption is the only thing an operator can see. Wiring
that at the entrypoint is now task 2, ahead of everything else, and realization
requires one operator run on the real corpus through a real adapter: a green
suite against a fake that returns a constant is not evidence that a feature
works.

The prompt assembler is new surface, not a reuse. build_prompt_envelope is
chat-shaped to its bones — outline plus documents, a non-blank human message, a
transcript, and the only packet purpose that exists — so an abstract request
needs its own assembler and its own purpose, and its prompt must be
byte-identical for identical input so a dispatch is reproducible and a prompt is
reviewable.

Layer 2 is NOT widened. A comma-joined second owner in a one-owner field would
degrade the fidelity checker to a comment, so the abstract is declared a
layer-2-CLASS SIBLING under the requirement's universal non-authoritative clause;
compact_thread keeps sole ownership and its equality pin stays green unchanged.
The verifier's check is named subject-mention coverage rather than fidelity,
because dispatch_turn returns one opaque string and claiming more would be this
change committing the sin it exists to prevent.

Ruling 7 was the sharpest finding: disclosure on this surface requires edit
authority, editable_paths is fed only by owned sections, and exactly one section
is owned — so on a cluster tile the eligible subject set is empty. Ruled 7(a),
with the widening named as a follow-on ruling rather than opened by an
implementation choice inside a UI pull request.

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

Packet review found this change specifying behaviour that does not ship, which
is the one thing a doc-only ratification may not do.

The abstract region's accessible name is the static string "selected document"
today (staging-workbench.js:250), so ruling 6's rename — the region named for its
subject, the selector keeping sole claim on the selected buffer's name — is a
CODE change. It moves to add-doxbench-distilled-abstract, which owns that line,
and the loaded-document-selector requirement goes with it: :1827 is no longer
modified here at all, leaving five MODIFIED rather than six.

No provenance caption exists on the surface either. renderAbstract emits none, so
the ADDED requirement keeps only what is already true and already pinned — never
captioned as a distillation, an absence stated in words rather than an empty box,
a named field omitted rather than placeheld — and the positive "From the
document's own headers" caption moves with the rename. Task 2.6's escape hatch
went too: there is no shipped caption string for the delta to adopt.

Three stale artifacts are now recorded as EXPECTED findings of the cross-check
rather than repaired here, because repairing them is code: the comment at
staging-workbench.js:508 still claims the bullseye sits "ABOVE the always-present
matrix", and two suites still assert the wheel is deferred
(test_doxbench_context_panes.py:19-25 and :217-229) when the wheel shipped. The
arrows/Home/End scenario this delta requires has no test pin either — :166-175
checks roles and roving tabindex only — so its evidence here is a code read at
staging-workbench.js:491-503 and the pin is handed to the successor's task list.

Co-Authored-By: Claude Fable 5 <[email protected]>
…process (#84)

Packet review blocked this change on four things, all verified.

The entrypoint is not serve(). serve() (serve.py:4833) has NO CALLERS; the real
one is cli.py:298's build_server call, which already makes its own install-time
declarations beside it — adapter_factory at :304, knowledge_declaration at :311.
model_port_factory joins those two, and serve()'s setdefault block keeps the same
declaration only as the standalone secondary path.

Declaring it is not enough to make it work. _workbench_model_port calls the
factory with NO arguments (serve.py:1549), while OmpHarnessBridge has a
keyword-only session_root with no default — unconstructible bare — and a catalog
defaulting to EMPTY_CATALOG, which would resolve, disclose nothing, and look like
a working install. So the entrypoint declares catalog, session root and launch
config install-time, in the idiom knowledge_declaration already uses, and task
2.1's pin is now "the entrypoint-built server resolves a port whose catalog
discloses at least one available entry" rather than "resolves non-None".

And it must build ONE instance for the process. The accessor runs per request
(serve.py:2162, :2700) and the bridge is stateful (_sessions/_selected), so a
per-request construction would break spec.md:1991's one-harness-session-per-
document-thread rule by construction and restart a supervised child on every
call. Pinned by object identity across two requests.

Three smaller corrections. The new packet purpose was dead code — the request
carries no packet, so require_valid never runs — replaced by a real pin that the
assembler REFUSES a context packet of any purpose. The in-flight bound is the
adapter's own timeout_seconds (bridge default 60), not the 120s validated
ceiling, because a region stating 120 while the adapter declares 60 lies in the
safe direction and still lies. And the stale "no code below calls it" claims at
serve.py:2128-2134 and :1542-1544 are corrected NOW, not gated behind the first
call site, because that call site already exists at :3422.

Ruling 3 was under-encoded and is now normative: shown-and-labelled-stale with
the source digest stated, and for an unloaded subject the digest is the served
saved content's. Ruling 6 resolved to ONE region whose accessible name composes
subject with provenance, so the two states are distinguishable by name. The
provider-boundary delta folds in add-doxchat-model-intake's additions now rather
than deferring, so whichever archives second drops nothing.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 25, 2026 14:47

@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

This PR records and ratifies two OpenSpec change packets related to doxBench context-pane surfaces: (1) a doc-only packet that promotes already-shipped UI surfaces into ideation-dashboard spec text and removes a now-falsified simultaneity requirement, and (2) a ratified packet proposing a new model-derived “distilled abstract” feature with accompanying spec deltas, design, constraints, and task plan.

Changes:

  • Add OpenSpec Records entries in README.md for the two new change packets.
  • Introduce ratify-doxbench-landed-context-surfaces (doc-only): proposal + spec deltas + tasks + origin metadata.
  • Introduce add-doxbench-distilled-abstract (code-surface): proposal + spec deltas + tasks + design + clarifications + origin metadata.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Adds OpenSpec Records entries describing both change packets and their rationale.
openspec/changes/ratify-doxbench-landed-context-surfaces/tasks.md Task list to verify promoted spec text matches shipped behavior and to archive the doc-only packet.
openspec/changes/ratify-doxbench-landed-context-surfaces/specs/ideation-dashboard/spec.md Spec delta promoting shipped lens/docs surfaces and adjusting requirements accordingly.
openspec/changes/ratify-doxbench-landed-context-surfaces/proposal.md Proposal narrative and governance framing for the doc-only ratification packet.
openspec/changes/ratify-doxbench-landed-context-surfaces/.openspec.yaml Packet metadata (origin/created/approval) for the doc-only change.
openspec/changes/add-doxbench-distilled-abstract/tasks.md Detailed RED-first task plan for implementing the distilled abstract feature and its gates.
openspec/changes/add-doxbench-distilled-abstract/specs/ideation-dashboard/spec.md Spec delta defining model-derived abstract behavior, constraints, and integration requirements.
openspec/changes/add-doxbench-distilled-abstract/proposal.md Full proposal including rulings, rationale, scope, impact, and sequencing.
openspec/changes/add-doxbench-distilled-abstract/design.md Design decisions and module map for implementing the model-derived abstract feature.
openspec/changes/add-doxbench-distilled-abstract/clarifications.md Council constraints (N1–N5) captured during review and their design implications.
openspec/changes/add-doxbench-distilled-abstract/.openspec.yaml Packet metadata (origin/created/approval) for the distilled abstract change.

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

Comment on lines +1 to +6
---
code_surface: none
target_release: none
Status: draft
Ratified: Brett, 2026-08-25 — ruling 0 of `add-doxbench-distilled-abstract` (SPLIT), recorded as a comment on `opensoft/openxFactory#84`
---

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7 — Status: ratified. You were right on the ground you flagged it on: 26 of the 27 other active proposals in this repo carry Status: ratified beside their citation line, and this packet was the sole exception. doc-health --family ratified-provenance is clean before and after the flip. Codex raised the same line as P1 with a projection mechanism attached; that mechanism does not hold (the notebook sync skips every path under openspec/), but the lifecycle contradiction you named was real.

Comment thread README.md
Comment on lines +354 to +355
carry — and the spec mentions NONE of them: grep `abstract` or `subtab` over
`ideation-dashboard/spec.md` and it returns nothing. One of them does worse than

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7. The path is openspec/specs/ideation-dashboard/spec.md; the README now says so, and states that both counts really are zero (verified: grep -c -i abstract and grep -c -i subtab both return 0 against that file at this commit). The sibling proposal already used the full path, so the README was the odd one out.

…istilled-abstract

# Conflicts:
#	README.md
Copilot AI review requested due to automatic review settings August 25, 2026 16:08

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

Suppressed comments (1)

openspec/changes/ratify-doxbench-landed-context-surfaces/proposal.md:4

  • Front-matter has Status: draft while the same front-matter block declares this proposal ratified. Other ratified change proposals use Status: ratified, and README also records this change as ratified; keeping these consistent avoids confusing archive/record readers.
Status: draft

Comment thread README.md
named, always-reachable member of one APG tablist, the `above` ordering is
discharged by the tablist's declared section order, and a keyboard-reachability
scenario is added because the guarantee moved from geometry to a widget and a
tablist without arrow keys is a worse promise than the one it replaced. Six

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7 — FIVE, not six. The count was stale from before packet review CUT the loaded-document selector (:1827) from the split change: the anchors are right and the number was left behind. Same drift fixed in two more places you did not have line coverage on — the split change's tasks intro (your other comment) and this proposal's Group B paragraph, which still claimed four of the six Group B items were modified there when it is three, with :1827 modified by NEITHER change and its obligation carried by this change's added captioning requirement instead.

@@ -0,0 +1,102 @@
# Tasks: ratify-doxbench-landed-context-surfaces

The spec delta is already authored (`specs/ideation-dashboard/spec.md`): six

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7 — FIVE MODIFIED plus one ADDED, and the intro now says why it is five and not six: packet review cut the loaded-document selector (:1827) when it turned out to need code. Counted against the file: five ### Requirement: blocks under ## MODIFIED Requirements, one under ## ADDED Requirements.

Comment on lines +156 to +167
**These pass on the first run under ruling 2(b), and that is the point.** They
are REGRESSION GUARDS, not RED-first pins: with generation session-local there is
nothing to make them fail today. What proves they have teeth is mutation 9.5,
which emits an abstract into a document object and must break 6.1 and 6.2. Do not
mark this section done without running 9.5.

- [ ] 6.1 RED: the generator produces BYTE-IDENTICAL snapshots for one unchanged
tree, once with abstracts generated in-session and once without.
- [ ] 6.2 RED: no snapshot field carries a model-derived value — assert over the
emitted document objects, not over the schema.
- [ ] 6.3 RED: with the port absent, raising, and timing out, the snapshot is
unaffected and no lane or gate action fails.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7. Items 6.1-6.3 are labelled GUARD (green on the first run) now, and the section preamble says outright that a reviewer who saw RED there would rightly expect a baseline failure that cannot exist. The file's own RED-FIRST opening declared no exception either, so it now declares this one explicitly rather than being contradicted five sections later. What gives the section teeth is unchanged: mutation 9.5 emits an abstract into a document object and must break 6.1 and 6.2.

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf00009d17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

---
code_surface: none
target_release: none
Status: draft

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark the ratified packet as ratified

During lifecycle notebook synchronization, scripts/sync-notebooklm-books.py sends Status: draft documents to Working Drafts and Status: ratified documents to Canon. The next line records Brett's ratification and the new README entry also calls this packet ratified, so this header causes the authoritative proposal to be projected into the wrong book and leaves its lifecycle internally contradictory; set the status to ratified.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 799b2b7 — but the mechanism you named does not hold, and the record should say so.

The header was wrong and is now Status: ratified. Every other ratified active proposal in this repo carries Status: ratified (26 of 27 at HEAD; this packet was the sole exception), including its own sibling in this PR. Alongside its Ratified: line and the README entry, draft was internally contradictory. doc-health --family ratified-provenance is clean before AND after the flip — the Ratified: line names an approver and a date, which is the three-way floor fam_ratified_provenance applies to that spelling.

The projection impact you cite does not exist. scripts/sync-notebooklm-books.py never sees this file. Its scan() skips every path under openspec/:

if SKIP_PARTS.intersection(rel.parts) or "openspec" in rel.parts:
    continue

(scripts/sync-notebooklm-books.py:765). The only openspec/ material that reaches a book is the promoted-spec pass immediately after, which globs openspec/specs/*/spec.md and titles them [spec] regardless of any header. So no change proposal is projected into Working Drafts, Canon, or anywhere else, at any status — doc-health --family notebook-projection-drift reports no findings both before and after this edit.

The finding is valid on lifecycle-consistency grounds, which is what Copilot flagged it on. It is not valid on projection grounds.

- **THEN** the deterministic abstract MUST render and the region MUST state that no distillation is available on that plane

### Requirement: The abstract cache is a separate bounded store keyed by content digest
An abstract cache SHALL be a SEPARATE, separately bounded store and MUST NOT share the chat surface's turn-idempotency ledger, whose per-process instance is bounded by entry count and total bytes and would evict chat records under abstract churn — a scope larger than that bound is the ordinary case, not an edge case. The cache key SHALL include the subject's CONTENT DIGEST as well as its path, so a regeneration after an edit is a NEW key rather than a same-key conflict; a store that refused a changed digest under an unchanged key would refuse every regeneration after every edit. The cache SHALL admit at most ONE in-flight generation per key, with a concurrent request for the same key attaching to it rather than dispatching a second time, and SHALL replay a completed result for an identical key without a second dispatch. Eviction SHALL be deterministic and MUST NOT be ordered by wall-clock time, and a re-dispatch after eviction SHALL be stated expected behaviour rather than an error. Nothing in the cache SHALL be authoritative, and its contents MUST NOT outlive the session or be written to any corpus, snapshot, register, or gate artifact.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Let explicit regeneration bypass completed cache entries

When an operator invokes the required RE-GENERATE control without editing the document, the path and current content digest are unchanged, but this clause requires an identical completed key to replay without another dispatch. The control therefore cannot actually regenerate an abstract unless the entry happens to be evicted. Specify an explicit refresh/invalidation or generation identity that bypasses completed replay while retaining same-request in-flight deduplication.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid, and fixed in 799b2b7. Verified by reading the two clauses against each other: Abstract generation is explicitly invoked… requires "A RE-GENERATE control SHALL be offered against the subject's current content digest", and the cache clause required "replay a completed result for an identical key without a second dispatch". Same subject, same digest, same model → identical key → replay. The control could only ever regenerate by the accident of eviction, which is the opposite of a control.

The delta now specifies an explicit refresh intent, which is your first option rather than a generation nonce:

  • A request carrying no refresh intent replays a completed result for an identical key with no second dispatch. That is the path that makes an abstract survive leaving and re-entering the tile, and re-entry explicitly does NOT set refresh intent.
  • A request carrying an explicit refresh intent — which is what RE-GENERATE issues — invalidates the completed entry for its key, dispatches, and its result replaces that entry.
  • The one-in-flight arm is unconditional in both modes: a refresh arriving while a generation is in flight for the same key attaches rather than dispatching, so an impatient double-click spends one model call. Refresh intent MUST NOT be inferred from a selection change, a mount, a re-entry, or anything that is not the human control being invoked.

Four scenarios added across the two requirements (RE-GENERATE on an unchanged document dispatches; RE-GENERATE twice before resolve attaches; re-entering the tile is not a refresh; and the control-side scenario under the invocation requirement). Pinned by new tasks 5.3b and two new 9.3 mutations — refresh-intent-as-no-op must fail the positive half, refresh-skips-the-in-flight-check must fail the attach half.

The nonce/attempt-counter alternative you left open is recorded as rejected in design.md D5: it works, and it also makes every regeneration a permanent new entry, so N regenerations of one document hold N slots in a bounded store and evict N-1 useful neighbours to keep answers nobody asked for. Invalidate-and-replace keeps one live entry per real (subject, digest, model).

Comment on lines +142 to +145
- [ ] 5.3 RED: a separate bounded store, keyed by `(subject path, content
digest)`; one in-flight per key with attach-and-wait; identical-key replay
with no second dispatch; a changed digest is a NEW key and not a conflict;
eviction is deterministic and not clock-ordered.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the selected model in the abstract cache key

When the selected model changes while the document remains unchanged, this (path, digest) key treats the second request as identical and replays the first model's result without dispatching the newly selected model. That conflicts with the provider-boundary requirement that every model consumer accept and resolve a catalog model id, and DocumentAbstract is explicitly designed to record its model id. Include the requested/resolved model identity in cache and in-flight grouping, or otherwise prevent model changes for an existing key.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid, and fixed in 799b2b7. The key is now (subject path, content digest, resolved model id) in the spec delta, design.md D5, tasks.md 5.3, and every place the two-part key was quoted (proposal ## The interaction, stated, task 7.6, the README entry).

Your two supporting citations both check out against this delta as authored: the provider-boundary requirement already says "EVERY MODEL CONSUMER on this surface … SHALL accept only a model id present and available in the current catalog", and design.md D3 already specifies DocumentAbstract as carrying a model id. On a (path, digest) key the second request is identical, so the first model's prose replays under the second model's recorded id — the artifact then lies about its own provenance, which is the specific failure this change exists to prevent.

Two things beyond the literal fix:

  1. Routing rules. The same requirement permits an auto catalog entry that resolves to a model by role, and its scenario already requires that "the resolved model MUST be recorded on the turn". The key therefore carries the resolved id, not the rule's id — otherwise every routed abstract collides in one bucket. Stated in the delta and pinned in task 5.3a.
  2. The artifact side. The verification requirement now states that the verified artifact records the subject path, the subject content digest, and the resolved model id, and that the recorded model id MUST be the model that actually answered. The cache key and the recorded provenance are now the same three facts by construction rather than by coincidence.

Task 5.3a pins it on port.dispatched and the returned DocumentAbstract.model_id rather than on the store's internal dict, and 9.3 gains a "drop the model from the key" mutation that must fail it.

@brettheap
brettheap merged commit 5c54761 into main Aug 25, 2026
3 checks passed
brettheap pushed a commit that referenced this pull request Aug 25, 2026
Codex review on PR #352 found two real holes in the abstract cache this
change specifies, and both are in the spec delta rather than in code, so
both are fixed where the obligation lives.

The RE-GENERATE control the delta requires could not regenerate. A
regeneration against unchanged content and an unchanged model has an
IDENTICAL cache key by construction, and the cache clause required an
identical key to replay without a second dispatch — so the control was
inert except by the accident of eviction. The request now carries an
EXPLICIT REFRESH INTENT: set, it invalidates the completed entry,
dispatches, and replaces it; unset — every selection, mount and tile
re-entry — it replays as before. The one-in-flight arm stays
unconditional in both modes, so an impatient double-click still spends
one model call. A nonce in the key would also have worked and was
rejected in design.md: N regenerations of one document would hold N
slots in a bounded store and evict N-1 useful neighbours.

The RESOLVED MODEL ID joins path and digest in the key. A human can
change the selected model while the document stands still; on a two-part
key that second request is identical, so the first model's prose would
replay while DocumentAbstract records the model the reader just picked —
an artifact lying about its own provenance, which is the exact failure
mode this change exists to prevent, and which the provider boundary's
every-consumer-resolves-a-catalog-model-id rule forbids besides. For an
auto routing entry the key carries the RESOLVED id, not the rule's,
for the same reason a turn records the model that actually answered.
The verification requirement now also states that the artifact records
subject path, digest and resolved model id, so the key and the recorded
provenance are the same three facts. Four scenarios added; tasks 5.3a,
5.3b and the 9.3 mutations pin all of it, positive and negative halves.

Copilot's second round is answered in the same pass, all of it
bookkeeping that had drifted:

- The split packet carried Status: draft beside its own Ratified: line
  while the README called it ratified. Every other ratified active
  proposal in this repo carries Status: ratified; this one now does too.
  Codex's stated mechanism for it does NOT hold — sync-notebooklm-books
  skips every path under openspec/ (scan() line 765), so no change
  proposal is projected into any book at any status — but the lifecycle
  contradiction was real on its own terms.
- Three stale counts, all from the same cut. Packet review removed the
  loaded-document selector (:1827) from the split change when it turned
  out to need code, and three places still said six: the split change's
  tasks intro, the README entry, and this proposal's Group B paragraph,
  which also still claimed four of the six were modified there. It is
  FIVE modified plus one added in the split change, THREE of the six
  Group B items modified there, and :1827 is modified by NEITHER change
  — its obligation rides this change's added captioning requirement.
- The README pointed a literal grep at ideation-dashboard/spec.md, which
  is not a path that exists. It is openspec/specs/ideation-dashboard/
  spec.md, and both counts there really are zero.
- Section 6 declared itself REGRESSION GUARDS, not RED-first pins, and
  then labelled all three items RED. They are GUARD now, and the
  RED-FIRST preamble declares the exception instead of contradicting it.

openspec validate --all --strict: 78 passed, 0 failed.
pytest tests/ideation-dashboard: 4142 passed, 13 skipped.
doc-health ratified-provenance: no findings, before and after the
Status flip.

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

Copy link
Copy Markdown
Contributor Author

Review response — all 8 findings answered in 799b2b77

Codex's 3 (2026-08-25T16:32) and Copilot's round-2 3 plus round-1 2, all in one commit, plus one suppressed comment and three stale counts nobody had line coverage on. Every finding was verified against the file or the code path before it was fixed; one was fixed for a different reason than the one given.

Fixed — substantive (spec delta, not code)

Both Codex P1/P2 findings were about the delta text, so both are fixed where the obligation lives.

1. The RE-GENERATE control could not regenerate (Codex P1, add-doxbench-distilled-abstract/specs/.../spec.md:296). Two clauses in this delta contradicted each other: the invocation requirement offers a RE-GENERATE control against the subject's current digest, and the cache requirement made an identical key replay without a second dispatch. Same subject, same digest, same model → identical key → the control was inert except by the accident of eviction. The delta now specifies an explicit refresh intent: unset (every selection, mount and tile re-entry) it replays; set — which only the RE-GENERATE control does — it invalidates the completed entry, dispatches, and replaces it. The one-in-flight arm is unconditional in both modes, so an impatient double-click spends one model call. A nonce in the key is recorded as rejected in design.md D5: N regenerations of one document would hold N slots in a bounded store and evict N-1 useful neighbours.

2. The selected model was not in the cache key (Codex P2, tasks.md:145). The key is now (subject path, content digest, resolved model id) in the delta, design.md D5, tasks.md 5.3, and every place the two-part key was quoted. A human can change the selected model while the document stands still; on a two-part key that request is identical, so the first model's prose replayed while DocumentAbstract recorded the model the reader just picked — an artifact lying about its own provenance. For an auto routing entry the key carries the resolved id, not the rule's, for the same reason the existing scenario requires a turn to record the model that actually answered. The verification requirement now also states the artifact records subject path, digest and resolved model id, so the key and the recorded provenance are the same three facts.

Four scenarios added. Pinned by new tasks 5.3a (model in key, asserted on port.dispatched and the returned DocumentAbstract.model_id, not the store's internal dict) and 5.3b (refresh bypasses replay — both halves, including the negative ones), with four new 9.3 mutations that must each fail a named test.

Fixed — bookkeeping (Copilot, both rounds, plus the suppressed comment)

  • Status: draft on a ratified packet (Copilot round 1 + the round-2 suppressed comment + Codex P1). Now ratified. 26 of the 27 other active proposals carry Status: ratified beside their citation line; this packet was the sole exception. doc-health --family ratified-provenance is clean before and after.
  • Three stale counts, all from one cut. Packet review removed the loaded-document selector (:1827) from the split change when it turned out to need code, and three places still said six: the split change's tasks.md intro (flagged), the README entry (flagged), and this proposal's Group B paragraph (not flagged), which also still claimed four of the six Group B items were modified there. It is now FIVE modified plus one added in the split change, THREE of the six Group B items modified there, and :1827 modified by NEITHER change — its obligation rides this change's added captioning requirement.
  • A grep pointed at a path that does not exist. ideation-dashboard/spec.md → openspec/specs/ideation-dashboard/spec.md, and the README now states that both counts really are zero (verified: both greps return 0 at this commit).
  • §6 declared itself REGRESSION GUARDS and then labelled every item RED. Items 6.1–6.3 are GUARD (green on the first run) now, and the file's RED-FIRST opening declares the exception instead of being contradicted five sections later. What gives §6 teeth is unchanged: mutation 9.5.

Declined in part — one mechanism claim

Codex's P1 attributed the Status: draft header to a projection failure: that sync-notebooklm-books.py would send the ratified proposal to Working Drafts instead of Canon. That mechanism does not exist. scan() skips every path under openspec/:

if SKIP_PARTS.intersection(rel.parts) or "openspec" in rel.parts:
    continue

(scripts/sync-notebooklm-books.py:765). The only openspec/ material that reaches a book is the promoted-spec pass, which globs openspec/specs/*/spec.md and titles them [spec] regardless of any header. No change proposal is projected into any book at any status — doc-health --family notebook-projection-drift reports no findings before or after. The header was fixed on the lifecycle-consistency ground Copilot raised it on, not on the projection ground.

Records left as authored on purpose: clarifications.md N1 (a captured council record; its "the key MUST include the digest" is a floor, not an exhaustive key statement, so adding the model does not falsify it) and the proposal's pre-ruling ## Rulings requested section.

Verification

check result
openspec validate add-doxbench-distilled-abstract --strict valid
openspec validate ratify-doxbench-landed-context-surfaces --strict valid
openspec validate --all --strict 78 passed, 0 failed
pytest tests/ideation-dashboard/ -q 4142 passed, 13 skipped (exit 0)
pytest tests/doc-health -q 895 passed, 1 failed — pre-existing
doc-health --single-repo . lifecycle families identical to baseline; no new finding

The one tests/doc-health failure is test_ideation_readiness.py::test_derivation_reproduces_the_real_bootstrap_clusters. It is not from this commit: stashing all seven changed files and re-running it on the clean tree at bf00009d reproduces the identical failure. It reads ideation/brainstorm/ and ideation/staging/, neither of which this PR touches. Left for separate triage.

Still doc-only: 7 files, all README.md and OpenSpec packet material. No runtime code, no contract version, no tag.

@brettheap

Copy link
Copy Markdown
Contributor Author

⚠️ Do not merge on the currently displayed checks. 799b2b77 is on the remote branch — GET /git/ref/heads/change/add-doxbench-distilled-abstract returns 799b2b770d443817ed1c481840f5e48df9d28416 — but the PR object still reports head.sha = bf00009d and no synchronize event has fired after ~8 minutes of polling. GET /commits/799b2b77/check-runs returns total_count: 0, so the green pytest-suite / wallet-validation above are from bf00009d and do not cover the review-response commit. Looks like a GitHub event-delivery delay rather than anything about the push.

Whoever picks this up: wait for the head to advance and the suite to re-run green on 799b2b77 before merging. If it stays stuck, a git commit --allow-empty nudge or closing/reopening the PR usually re-fires the event. Locally on 799b2b77: openspec validate --all --strict 78/78, pytest tests/ideation-dashboard/ 4142 passed / 13 skipped.

@brettheap

Copy link
Copy Markdown
Contributor Author

Correction to my earlier comment (#issuecomment-5415871730): that warning rested on a wrong diagnosis and should be disregarded.

There was no stuck synchronize event. This PR had already been merged at 2026-08-25T16:50Z (merge 5c547610, taking head bf00009d) hours before I pushed 799b2b77 to the branch. A closed PR does not advance its head and never re-runs CI, so what I read as GitHub lagging was just the merge having happened. The green checks displayed above are correct and do cover what was merged.

The consequence is that 799b2b77 never reached main — the review fixes for the three Codex findings and Copilot round 2 landed on a branch behind a closed PR. They are relanded off current main as #364, rebased and reduced: two of the Copilot items were already fixed on main by #359's archive pass and are dropped as moot, and one is flagged rather than fixed — the archived 2026-08-25-ratify-doxbench-landed-context-surfaces/proposal.md still carries Status: draft, which is inside an archived packet and wants Brett's call rather than a quiet edit.

The inline replies on this PR's threads still describe the fixes accurately; only the commit that carries them has changed. Nothing to do here.

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