Skip to content

doxBench: the distilled abstract — realized behind the model boundary, session-only, verified before it renders (#84) - #365

Merged
brettheap merged 15 commits into
mainfrom
change/apply-doxbench-distilled-abstract
Aug 26, 2026
Merged

brettheap merged 15 commits into
mainfrom
change/apply-doxbench-distilled-abstract

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes OpenSpec change add-doxbench-distilled-abstract (ratified 2026-08-25; issue #84 option C). 11 commits, applied in four waves with strict file ownership; every section RED-first with mutation rounds; adversarially reviewed twice (one BLOCKER found and fixed, then re-reviewed READY).

Merge, not archive. The change stays active after merge: §10.3 needs one operator run through the real adapter (recipe: openspec/changes/add-doxbench-distilled-abstract/realization-evidence.md, marked PENDING) before §10.5 archive — and add-doxchat-model-intake must archive first (ordering constraint in tasks 1.2). Speckit slot renumbered to specs/015-* (014 was taken on main).

What lands

  • §2 The model port exists at all. No entrypoint declared model_port_factory — every real serve ran portless. doxbench_install.py declares a process-lifetime OmpHarnessBridge at cli.py's build_server (catalog constant, --model-session-root, LaunchConfig); identity pinned across resolutions; omp joins GUARDED_BINARIES (marker generalized to XF-HERMETIC with per-binary requirement citations); two stale "no dispatch" banners corrected.
  • §3 Prompt. build_abstract_envelope: one subject (served saved bytes) inside a data fence, no packet/transcript/second buffer, byte-deterministic, MAX_ABSTRACT_PROSE_BYTES = 1500 refused-not-truncated (pinned absolutely to the 280px budget).
  • §4 DocumentAbstract + verifier (doxbench_knowledge.py): non-authoritative / regenerable-from-document / review = unreviewed / fidelity = lossy-by-design as frozen single-value fields; verify_document_abstract is subject-mention coverage, named as such (base = snapshot topics + destinations, so it fires on generation Record repo boundary policy pilot evidence #1; foreign path and wrong subject refused); a refusal is a value with no renderable field. Layer 2's owner unchanged (pinned).
  • §5 Route + store. POST /actions/workbench/document-abstract behind the same three-part verdict as a turn; closed request shape; eligibility = editable_paths (ruling 7a) refused before any bytes are read; request_paths ∩ (editable ∪ context); binds its own harness conversation ["doxbench-abstract", scope…, subject_path] before dispatch (see review); separate scope-qualified AbstractStore (64 / 1 MiB, attach-and-wait, digest-in-key) that never evicts the chat TurnStore.
  • §6 Snapshot indifference, both directions, with the mutant that proves it (a session-derived field survived until 6.1 got a real without-generation arm).
  • §7/§8 Browser. Explicit Generate/Cancel/toggle on the centred wheel tile — spinning dispatches nothing; discard-on-subject-change (unrendered AND uncached); stale shown-and-labelled with a digest prefix; five ruled captions asserted equal to the Python constants; ONE region named title — caption (never "selected document"); one app.js fetch site, both count pins widened by name; the old whole-file "distilled" sweep relocated onto the abstract model and the 08-03→08-25 reversal recorded, not erased; the lens tablist finally has a behavioural arrows/Home/End pin.

Review record

First review: BLOCKER — the route dispatched the bridge unbound: a fresh process always returned model_failed (the shipped adapter could never produce a first abstract), and after any chat turn the abstract landed in the chat document's harness session (canon :2026). Fixed at the seam; proven against the real OmpHarnessBridge over the fake child: first generation on a fresh process → 200 with the abstract session selected; after a chat turn the two sessions are distinct. Reverting to the raw port fails four pins. Plus 7 SHOULD-FIX/NIT items, all applied. Re-review: READY; every spot-checked pin killed exactly its mutant.

Evidence

tests/ideation-dashboard: 4412 passed / 13 skipped (+~250 pins over main). openspec validate --all --strict: 77/77 (after merging main). 15 mutations across §9 + reviews, 2 survivors → pinned. Whole-repo gate locally: 2 pre-existing failures reproduced on pristic main (doc-health bootstrap-cluster drift; hermes release-inventory merge-base in a worktree) — this PR's pytest-suite run is the authority.

🤖 Generated with Claude Code

brettheap and others added 11 commits August 25, 2026 15:34
…on, and says so in five guards (#84)

Section 6 of add-doxbench-distilled-abstract. Ruling 2(b) keeps the distilled
abstract session-local, so these five tests are REGRESSION GUARDS that pass on
their first run — that is the point, and tasks.md says so. Their teeth are
proven by mutation 9.5 (a document object that carries an abstract key must
break 6.1 and 6.2), which runs in the mutation round.

6.1 byte-identical snapshot with and without an in-session dispatch through the
real _workbench_model_port seam; 6.2 no documents[] key in {abstract,
distilled, distillation, model_abstract, generated_abstract} and no value
embedding the dispatched sentinel; 6.3 port absent / factory raising /
dispatch raising or timing out (scripted clock) → snapshot bytes and
nightly_lane.run_lane unchanged, nothing raises. Hermetic: FakeWorkbenchModelPort
and tmp_path trees only. §1 gate ticked in the same commit (A archived, intake
fold verified per #351, validate 78/78).

Co-Authored-By: Claude Fable 5 <[email protected]>
…its verifier is named for what it checks (#84)

Section 4 of add-doxbench-distilled-abstract, in doxbench_knowledge.py as a
sibling layer-2-class artifact — layer 2's owner stays
doxbench_threads.compact_thread and assert_fidelity(2, lossless) still
refuses (4.6 pinned).

The type refuses at construction any authority other than non_authoritative
and any regenerable_from other than the document, mirroring DocumentThread.
The verifier, verify_document_abstract, is a SUBJECT-MENTION COVERAGE check
and says so in code: dispatch_turn hands back one opaque string
(doxbench_model.py:985), so this cannot be fidelity. Its base is the
snapshot's declared topics + destinations, so it fires on generation #1
with no previous abstract; a previous abstract is an additional base. It
refuses an empty answer, a subject with no declared base, a repository path
absent from the request, an answer that never names the subject, and lost
coverage. A refusal is a returned AbstractRefused with code + reason and NO
renderable field — refused bytes never leave the verifier. No clock anywhere:
generation is a monotonic sequence, pinned. The default fake port's constant
answer is refused (N5). Five caption states and ruling 5's wording are
exported for the route and renderer.

RED for every pin was the missing attribute; 49 new tests, 191 across the
knowledge/packet suites, 391 in the regression sweep.

Co-Authored-By: Claude Fable 5 <[email protected]>
…, and omp is hermetically unreachable (#84)

Section 2 of add-doxbench-distilled-abstract — the part nothing else is visible
without. Until now NO entrypoint declared model_port_factory (cli.py omitted
it; serve()'s setdefault block never set it), so every real serve resolved
None and the whole model seam was a posture.

doxbench_install.py is the install-time declaration: HARNESS_CATALOG (one
available omp-local entry), LaunchConfig(command="omp", provider_id=
"local-proxy"), session_root beside the run dir (new --model-session-root
flag), and a zero-argument model_port_factory that closes over ONE
process-lifetime OmpHarnessBridge — two resolutions return the same object
(identity pinned) and no child starts until a turn needs one. Declared at
cli.py's build_server call beside adapter_factory and knowledge_declaration;
serve() gets the same as the standalone secondary path. The four absence
pins in test_doxbench_request_handling.py pass unchanged because they inject
into build_server directly.

RED 2.1 was `assert None is not None` from the entrypoint-built server; GREEN
discloses one available catalog entry with zero spawns. omp joins
GUARDED_BINARIES; the shim refuses it (exit 97); the refusal MARKER is
generalized to XF-HERMETIC with a per-binary requirement table, so an omp
refusal no longer cites the NotebookLM FR-043 (pinned). The two stale
"no code below calls it" statements in serve.py are corrected — the dispatch
call site has existed at _deadline_bound_dispatch since T051.

Suites: entrypoint+hermeticity 34; bridge/request/routes 281 (8 live skips);
notebooklm 129; ideation-dashboard 4063 passed / 13 skipped.

Co-Authored-By: Claude Fable 5 <[email protected]>
… no transcript, one bound (#84)

Section 3 of add-doxbench-distilled-abstract. build_prompt_envelope is
chat-shaped by construction (it requires an outline buffer and at least one
document buffer, and forcing a subject through it discloses an outline
buffer AND a context packet — pinned as the 3.1 barrier), so the abstract
gets build_abstract_envelope beside it: a frozen AbstractEnvelope whose
section keys are zipped from ABSTRACT_SECTION_ORDER (strict) so the order
constant cannot drift, whose rendered() bytes are byte-identical for
identical construction input, and which carries EXACTLY one subject section
— the served saved bytes inside an explicit fence the instruction text marks
as DATA — with no layer-1 packet, no second buffer, no transcript. A
ContextPacket of any purpose handed to it is refused
(AbstractPacketRefusedError); no new PACKET_PURPOSE_* constant, because the
request carries no packet and the constant would be dead code.
MAX_ABSTRACT_PROSE_BYTES = 1500 (the region is a measured 280px box) and
validate_abstract_prose REFUSES an over-long answer as
TurnLimitError(abstract_prose_bytes) — never truncates into the region. The
prompt tells the model to name the subject by path or title and no other
repository path, which is exactly what the verifier checks. Injection
posture stated honestly in a comment: the fence is a label; the defense is
the single-subject rule plus the verifier.

+376 lines, purely additive. RED was the missing import; 53 new tests;
mutations neutering the packet check (7 fail), truncating instead of
refusing (4 fail), adding a transcript section (2 fail) all caught. 322
across envelope/turns/packet; 662 across every importer of doxbench_turns.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ablist's keys are finally pinned (#84)

Sections 8.1/8.3/8.4 and task 2.5 of add-doxbench-distilled-abstract.

The old guard swept the whole of staging-workbench.js for "distilled" — a
spelling test on source text, and one that would go red the moment a ruled
caption containing "Distilled" ships. It is RELOCATED, not deleted: the
relocated pin reads documentAbstract()'s output through the node harness and
asserts the deterministic abstract's caption field equals ruling 5's text once
that field exists (TODO(§7.8) removes the fallback); until then it asserts the
same invariant over every string in the model (closing the old sweep's
"distilled"-but-not-"distillation" gap). The half of the guard that stays
true forever — the deterministic abstract is never captioned as a
distillation — is its own unconditional test. The module docstring RECORDS
the 2026-08-03 ruling and the 2026-08-25 reversal in part, rather than
erasing either; the operator-rig note stands.

Handed over from the archived ratification change (its §2.7): the lens
tablist's arrows/Home/End reachability now has a BEHAVIOURAL pin — real
keydown events dispatched on the tablist node in a mounted workbench,
asserting roving tabIndex, aria-selected, preventDefault on the four
navigation keys only, and that document.activeElement follows selection (the
APG requirement the role-only check never proved). Harness shim gaps
(createElementNS, style.setProperty) patched in this file only. The stale
"ABOVE the always-present matrix" comment at staging-workbench.js:508 is
corrected (comment only); the stale wheel-is-deferred docstring is rewritten,
and test_the_deferred_wheel_is_recorded_where_the_selector_stands — green only
by accident — is deleted as fully redundant with test_doc_wheel.py's
mounts-the-wheel and deferral-note-is-gone pins.

panes + doc_wheel + renderer: 89 passed.

Co-Authored-By: Claude Fable 5 <[email protected]>
… a turn, and caches it apart from chat (#84)

Section 5 of add-doxbench-distilled-abstract. POST
/actions/workbench/document-abstract sits beside the chat-turn route and
behind the SAME three-part verdict (loopback human console, real checkout,
resolved actor; gate capability for generation; the hosted plane refuses).
The request is a CLOSED shape — scope, subject_path, model_id — so a smuggled
buffer, packet or message is refused, not ignored. The subject bytes are the
SERVED SAVED CONTENT; the server computes the digest and cross-checks it into
the envelope. Eligibility is ruling 7(a): a subject outside
projection.editable_paths is refused with a stated reason and reaches no
provider (mutation: widening to context_paths made the provider answer come
back — caught by 5.2). A subject whose snapshot declares neither topics nor
destinations is refused before dispatch as subject-not-distillable, because
the verifier would have nothing to check against. After dispatch the answer
passes validate_abstract_prose (over-long is refused, never trimmed) and
verify_document_abstract; a refusal is a fixed seven-key body with NO prose
(mutation: leaking prose onto a refusal fails four tests). Success echoes
subject_path and subject_digest, the caption state from the abstract itself,
the store's generation counter, and wait_bound_seconds = the adapter's own
timeout — never the 120s ceiling (pinned).

AbstractStore (doxbench_abstract_store.py) is SEPARATE from the chat
TurnStore (N1): keyed (subject_path, content_digest), 64 entries / 1 MiB,
one in-flight per key with attach-and-wait, identical-key replay without a
second dispatch, a changed digest is a new key not a conflict, counter-ordered
eviction, and abstract churn over a 200-document scope leaves the chat
store's idempotency records untouched (5.4 asserts against its contents).
Refusals release the key so re-generate can retry unchanged content.

Also: the closed DOXBENCH_ERROR_CATALOG pin widened by name for the two new
codes (its recorded idiom); the live-smoke harness discovery ignores a
which() result that is the hermeticity shim; serve.py's "catalog-only core"
paragraph corrected; doxbench_install hoisted to module scope (import graph
verified acyclic).

RED was the missing module, then the missing route constant; 42 route + 22
store tests; the six-suite set 460 passed / 8 live skips.

Co-Authored-By: Claude Fable 5 <[email protected]>
…asks, and names what it shows (#84)

Section 7 and task 8.2 of add-doxbench-distilled-abstract — the browser half.

staging-workbench-model.js (still pure, import-free, fetch-free) gains the
five ruled captions — asserted EQUAL to doxbench_knowledge.RULED_CAPTIONS
through the tests, since the JS cannot import them — and abstractRegionState,
a pure formatter from (subject, view, plane, capability, generated,
currentDigest, inFlight, waitBound, refusal, dirty) to one frozen render
state. documentAbstract() now carries caption = the deterministic ruled
sentence, which closes the two-phase pin left by 8.1.

staging-workbench.js: generation is an EXPLICIT control on the centred tile —
spinning the wheel across N documents dispatches nothing (7.1 pinned against
onSelect per notch and at mount). A response paints only if its token is
still live AND its echoed subject_path is the current subject; otherwise it
is discarded unrendered and not cached (7.2). The in-flight state is
cancellable and states its wait from the adapter's own wait_bound_seconds as
learned from the latest response — never the 120 ceiling, and no number
before one is known (7.3). The request body is the closed
{scope, subject_path, model_id} — no buffer text ever leaves the browser, and
a dirty loaded subject is captioned as describing the saved version (7.4).
ONE region, one state at a time, deterministic opens, 280px budget intact
(7.5); the abstract survives leaving and re-entering the tile in a bounded
session keyed (path, digest), no clock (7.6); a digest that moved is shown
LABELLED STALE with a 12-char source prefix — never discarded, never silently
refreshed (7.6a/b, unloaded vs loaded pinned separately); with no gate
capability the control is absent and a cached abstract stays readable; the
hosted plane shows the hosted-plane caption (7.7). The region's accessible
name is `title — ruled caption`, recomputed per render, so the five states
have five distinct names and none is "selected document" (7.10; the static
label at :250 is gone). N2: no promotion affordance, one comment marks where
a future "propose as Summary:" verb would attach.

app.js: the ONE fetch call site for /actions/workbench/document-abstract;
both count pins (test_renderer.py :152 and test_doxbench_transport.py :172)
widened 5 → 6 by name. Two source-window pins re-anchored on the code they
meant (tile_verbs, staging_workbench). styles.css: eight compact rules for
the swb-abstract* controls.

RED: 3 failed / 25 errors on the missing export; the caption-field and
transport pins each failed on the old value. 29 new pins; the eight-file
suite 442; whole ideation-dashboard 4390 passed / 13 skipped.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ecipe the operator run needs (#84)

Sections 9 and 10.1/10.2/10.4 of add-doxbench-distilled-abstract, plus the
§10.3 recipe (the run itself is Brett's) and the §11 renumber.

Mutation round, each mutant applied to the real file and reverted: the three
verifier refusals inverted (4/6/8 named failures); generation fired from the
wheel's onSelect (7.1 red, 13 failures); the store keyed on path alone (5.3);
the abstract cache sharing the chat TurnStore (5.4); eligibility widened to
context_paths (5.2); a fourth port member (test_doxbench_model :522/:444);
a constant abstract emitted into a document object (6.2). TWO SURVIVED, and
each exposed a pin that asserted less than it claimed: removing the
subject-recheck at paint left 7.2 green because painting the current subject
is not evidence of a discard — the pin now asserts the late answer never
entered the cache; and a session-derived document field survived all five §6
guards because 6.1's "without generation" arm was the same post-dispatch call
as its "with" arm — it now takes a genuine pre-dispatch reading. Both pins
RED against their mutant, GREEN on real code. The §6 prose (tasks preamble
and module docstrings) claimed 9.5 breaks 6.1 AND 6.2; a constant emission is
byte-identical in both arms by construction and can only break 6.2 — the
claim is corrected to what was measured, naming both mutants.

named_repository_paths is now a public alias in doxbench_knowledge; serve.py
no longer reaches a private name across modules.

Gates: ideation-dashboard 4390 passed / 13 skipped; validate --all --strict
78/78; .openspec.yaml byte-identical to its ratified state. Whole-repo gate:
6416 passed with two PRE-EXISTING failures unrelated to this branch
(doc-health bootstrap-cluster drift; hermes release-inventory merge-base in a
worktree) — CI on the PR is the authority.

realization-evidence.md: PENDING — the recipe for ONE operator run through
the real omp bridge (entrypoint, provider profile, subject selection, POST
body, pass criterion, record template). A green suite against the fake
closes nothing. §11: specs/014 is taken on main (014-register-and-reader);
the Speckit slot renumbers to specs/015-doxbench-distilled-abstract.

Co-Authored-By: Claude Fable 5 <[email protected]>
…spatching into the chat's (#84)

Adversarial-review fix round for add-doxbench-distilled-abstract.

BLOCKER. The route handed the raw port to dispatch. OmpHarnessBridge refuses
an unbound dispatch on a fresh process (BridgeSessionConflict → model_failed:
the shipped adapter could never generate a first abstract) and after any chat
turn silently REUSES the last-selected session — the abstract prompt entered
the chat document's harness session, violating canon's one-session-per-thread
rule (:2026) and falsifying the envelope's own "you have no other material"
contract. FakeWorkbenchModelPort has no for_conversation, so 42 route tests
never saw it. Fixed the way the chat route does it: bind before dispatch,
refuse if binding raises, never dispatch unbound — under the abstract's OWN
key, doxbench_abstract_conversation_key = JSON ["doxbench-abstract",
repository, ref, tile_kind, tile_id, subject_path], a kind no document
thread or outline can spell, so an abstract neither borrows nor pollutes a
chat session. Proven against the REAL bridge over fixtures/fake_omp_child.py:
a fresh process's first generation returns 200 with the abstract session
selected; after a chat turn on the same document the two sessions are
distinct. Mutating back to the raw port fails exactly the three B1 pins; a
bind failure that failed to release the store key makes the next request
attach-and-hang — pinned.

Also from the review: request_paths is intersected with the reader's own
disclosure set (editable ∪ context paths) so a document cannot pre-authorize
a name outside what the reader may see; AbstractKey is scope-qualified
(repository, ref) and latest_for_path is keyword-only, so one repository's
abstract is never another's previous base; MAX_ABSTRACT_PROSE_BYTES == 1500
is pinned absolutely to the 280px budget (1500→2000 now fails exactly one
test — it survived every pin before); DocumentAbstract carries review =
"unreviewed" and fidelity = lossy-by-design as frozen single-value fields, and
declares none of layer 2's commitment obligations (all pinned; the
"no public name says fidelity" guard is narrowed to callables so the ruled
fidelity WORD may be carried); the readable-not-editable pin asserts its
precondition against the real projection; the dirty-buffer caption has a
mounted pin through the real canvas (ctx.dirtyFor→false fails only it); the
client scopeKey is JSON-composed (a join collision pair pinned); a served
process with no abstract store refuses abstract_unavailable rather than
dispatching. "The no-new-analysis clause is read against the bullseye" is
reviewed-not-pinned: its decidable half is the §6 byte-identity suite.

design.md D5 corrected to the scope-qualified key with a dated note; new D5a
records the conversation binding and its cost (one harness session per
(scope, document) abstract). Eleven suites 743; ideation-dashboard 4412
passed / 13 skipped (+22 pins); validate --all --strict 78/78.

Co-Authored-By: Claude Fable 5 <[email protected]>
Re-review NITs on add-doxbench-distilled-abstract. An adapter whose
for_conversation returned None (rather than raising) reached
_deadline_bound_dispatch as None and died on port.timeout_seconds — a dropped
connection with no verdict. It is now the same fixed model_failed refusal as a
raising bind, the store key released by the same finally; pinned with a
None-returning port and a second request that must not hang. The S2 "outside
the disclosure set" pin now asserts its precondition against the real
projection, matching its readable-not-editable sibling. tasks.md 9.5 count
corrected (the raw-port mutant fails four pins, not three).

abstract-route + routes: 221 passed.

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

@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 pull request realizes the OpenSpec change add-doxbench-distilled-abstract by adding a session-only, model-derived “distilled abstract” capability to doxBench behind the model boundary, including a non-chat prompt/envelope, verification rules, a separate bounded cache, a new same-origin route/transport, and UI/state/accessibility wiring to render it safely.

Changes:

  • Declare and wire a real entrypoint model_port_factory (process-lifetime) and extend test hermeticity to guard the omp harness binary.
  • Add the distilled-abstract pipeline: non-chat abstract envelope assembly + DocumentAbstract + verifier + separate bounded AbstractStore, with extensive regression tests (snapshot non-interference, hermeticity, renderer call-site pins).
  • Extend the web model/view layer and app transport to support a single abstract region that can toggle between deterministic and model-derived states with ruled captions and accessible naming.

Reviewed changes

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

Show a summary per file
File Description
tests/notebooklm/test_hermeticity_guard.py Updates hermeticity guard wording and asserts guarded-binary requirement citation behavior.
tests/ideation-dashboard/test_staging_workbench.py Updates pin for renderAbstract(...) to include the new controller argument and related invariants.
tests/ideation-dashboard/test_snapshot_abstract_noninterference.py Adds snapshot non-interference regression guards (with/without generation; port failure modes).
tests/ideation-dashboard/test_renderer.py Widens and names app.js fetch-callsite pins to include the new document-abstract route.
tests/ideation-dashboard/test_hermeticity.py Adds per-binary probe argv, asserts omp is guarded, and tightens refusal expectations.
tests/ideation-dashboard/test_doxbench_transport.py Updates app.js fetch-count and route uniqueness pins for the new abstract transport.
tests/ideation-dashboard/test_doxbench_tile_verbs.py Re-anchors the selection-window pin without a fragile magic character count.
tests/ideation-dashboard/test_doxbench_request_handling.py Extends the closed verdict-code catalog for abstract-route transport/provider errors.
tests/ideation-dashboard/test_doxbench_entrypoint.py Adds entrypoint-path tests asserting model port declaration, memoization, and no real omp spawn.
tests/ideation-dashboard/test_doxbench_document_abstract.py Adds comprehensive verifier/type tests for DocumentAbstract and refusal semantics.
tests/ideation-dashboard/test_doxbench_context_panes.py Updates context-pane scope notes/pins; relocates captioning assertions; adds absolute prose bound pin.
tests/ideation-dashboard/test_doxbench_bridge_live.py Adjusts live-bridge discovery to avoid the hermeticity shim and skip cleanly.
tests/ideation-dashboard/test_doxbench_accessibility.py Pins the abstract region’s accessible naming strategy and removal of “selected document”.
tests/ideation-dashboard/test_doxbench_abstract_store.py Adds tests for the separate bounded abstract cache (attach-and-wait, deterministic eviction, scope-qualified key).
tests/ideation-dashboard/test_doxbench_abstract_envelope.py Adds tests for non-chat abstract prompt assembly, fencing, determinism, and refusal/truncation behavior.
tests/hermeticity.py Extends guarded binaries to include omp, generalizes marker, and adds per-binary requirement/seam citation.
scripts/ideation_dashboard/web/views/staging-workbench-model.js Adds ruled caption vocabulary + abstractRegionState(...) logic and accessible-name composition.
scripts/ideation_dashboard/web/styles.css Adds styling for the abstract region’s controls/caption/in-flight lines.
scripts/ideation_dashboard/web/app.js Adds DOCUMENT_ABSTRACT_ROUTE transport (createDoxBenchAbstractRequester) and wires it into the mount.
scripts/ideation_dashboard/doxbench_turns.py Implements build_abstract_envelope and validate_abstract_prose with tight bounds and no chat material.
scripts/ideation_dashboard/doxbench_knowledge.py Adds DocumentAbstract, AbstractRefused, verifier rules (coverage + path rule), and ruled caption constants.
scripts/ideation_dashboard/doxbench_install.py Introduces install-time model-provider declaration + memoizing zero-arg factory for OmpHarnessBridge.
scripts/ideation_dashboard/doxbench_abstract_store.py Implements the separate bounded AbstractStore keyed by (scope, path, digest) with deterministic eviction.
scripts/ideation_dashboard/cli.py Declares model_port_factory at the real entrypoint and adds --model-session-root.
openspec/changes/add-doxbench-distilled-abstract/tasks.md Updates the OpenSpec task checklist with completion marks and recorded review adjustments.
openspec/changes/add-doxbench-distilled-abstract/realization-evidence.md Adds operator-run recipe and pending realization-evidence record for §10.3.
openspec/changes/add-doxbench-distilled-abstract/design.md Updates design notes (scope-qualified key; binding its own conversation) per adversarial review findings.

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

@@ -160,23 +160,35 @@ def test_app_js_defines_a_module_scope_source_loader_factory():


def test_app_js_carries_exactly_the_four_named_fetch_call_sites():
Comment on lines +144 to +148
def _run_lane(tmp_path: Path, root: Path) -> nightly_lane.LaneOutcome:
""""The existing generator entry the nightly lane calls" -- `run_lane`'s
own default `generate=generate_snapshot`. Never raises by the lane's own
contract (task 4.1: any error is a SKIP, never a propagated exception);
calling it directly is what proves that here rather than assuming it."""
@brettheap

Copy link
Copy Markdown
Contributor Author

Catching up to main. PR #364 (85e05ebe, from the codex review on #352) amended this change's ratified spec delta while this branch was in apply: an explicit refresh intent on the abstract request (a re-generate that only replays is not a control) and the resolved model id in the cache key (a model switch must never replay another model's prose under the new model's name). This branch realized the pre-#364 delta, so it is being brought up to canon before merge — merging main (design.md/tasks.md conflicts), then RED-first realization of both obligations with the 5.3a/5.3b pins and §9.3 mutations. Do not merge until the next push is green.

🤖 Filed via Claude Code

brettheap and others added 2 commits August 25, 2026 23:24
…ranch's realization

`85e05ebe` (#364) amended this change's ratified artifacts while the branch was
being applied, and the two sides edited design.md and tasks.md in the same
places. Both sides are kept.

D5 now states ONE key with BOTH dated corrections: `AbstractKey` is
`(repository, ref, subject_path, content_digest, resolved_model_id)` — scope
qualified per the 2026-08-25 adversarial review's S3, model qualified per the
same day's packet review. They do not compete: the requirement composes the key
from the three facts that vary WITHIN one scope, and the scope qualification is
the store's tenancy boundary, which can only split a bucket and never merge two.
`latest_for_path` stays a per-(scope, path) question across models, because the
verification rule takes a previous abstract as an ADDITIONAL base and says
nothing that would narrow it to one model. D5a (the abstract's own bound
conversation) is unchanged and follows the new refresh-mode paragraphs.

tasks.md keeps #364's 5.3a/5.3b/9.3 obligations and its §6 GUARD relabel, and
keeps this branch's dated ticks and the richer §6 preamble (9.5 breaks 6.2 only;
9.5b is what 6.1's without-generation arm catches). Items #364 WIDENED beyond
what is realized here are honestly re-opened: 5.3a, 5.3b, 9.3, and 7.6, whose
(path, digest) half was green on 2026-08-25 and whose model-id and no-refresh
halves are not yet written.

openspec validate --all --strict: 77 passed, 0 failed.

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

`85e05ebe` (#364) closed two holes in the abstract cache where the obligation
lives, in the spec delta. This realizes both, RED first, and carries the client
halves neither of them could state.

THE RESOLVED MODEL ID JOINS THE KEY. `AbstractKey` is five fields now —
`(repository, ref, subject_path, content_digest, resolved_model_id)`: scope
qualified by the 2026-08-25 adversarial review's S3, model qualified by the same
day's packet review. They do not compete, and D5 says so with both dates: the
requirement composes the key from the three facts that vary WITHIN one scope,
and the scope qualification is the store's tenancy boundary, which can only
split a bucket and never merge two. The route resolves through
`doxbench_selected_model` — the one function the chat wire record and the thread
sidecar already read — ONCE, and both keys and RECORDS by that value, so the key
and the artifact's provenance are the same three facts and an `auto` entry keys
on the model that answered rather than on the rule. `latest_for_path` stays a
per-(scope, path) question ACROSS models, because the verification rule takes a
previous abstract as an ADDITIONAL base and says nothing that narrows it to one
model.

THE REQUEST CARRIES AN EXPLICIT REFRESH INTENT: one OPTIONAL boolean `refresh`
inside the same CLOSED shape, so an unknown key is still refused and `1` /
`"true"` are MALFORMED rather than truthy. Set, `reserve` invalidates the
completed entry, takes the in-flight slot and dispatches, and the answer
replaces the entry; unset — every selection, mount and tile re-entry — it
replays exactly as before. The one-in-flight arm is UNCONDITIONAL: a caller that
WAITED replays the holder's answer even having asked for a refresh, so an
impatient double-click spends one model call. And the invalidated
`DocumentAbstract` rides back on the lease as that generation's PREVIOUS
verification base — the rule makes a previous abstract an additional base "where
one exists" and RE-GENERATE is the one path where one always does, so
invalidating it out of the replay index and out of the verifier's reach in the
same breath would have verified the regenerate path against a strictly weaker
base than every other path.

THE CLIENT HALVES, which #364 could not state because they are code. The
browser's session cache is keyed by the model too: a page replaying its own
cached prose after a model switch never asks the server at all, so the server's
correct key is never consulted and the reader gets one model's prose under
another model's name. It keys on the REQUESTED id — the only one it can know
before asking — while the entry still carries the RESOLVED id the answer echoed;
where NO model is selectable at all (ruling 7.7's ungated console) the lookup
falls back to this document's most recent answer under any model, because "any
already-generated abstract SHALL remain readable" outranks a qualification with
nothing to disambiguate. The rail's model choice now REPAINTS the docs region,
without which the DOM kept the previous model's prose under the model-derived
caption. And the RE-GENERATE control is the one place a refresh intent is
issued; GENERATE, the mount, a notch and a re-entry issue none.

RED then GREEN, per pin: the store's model-in-key and five-field shape; replay
unchanged with no intent; refresh invalidates and dispatches; the invalidated
abstract on the lease; the byte total returned to the bound; two attach-and-wait
pins. At the route: same bytes under a different model dispatch twice and each
records its own model; a switch never replays the first model's prose; an `auto`
entry and its resolved model are ONE key; the key read back off the served
process; refresh dispatches again on unchanged bytes and the entry is REPLACED;
no intent replays byte-identically; the shape stays closed; a mid-flight refresh
spends one call. In the pane: the RE-GENERATE control's intent and the closed
four-key body; a re-entry is not a refresh; a model switch shows
not-yet-generated and hides the other model's prose; switching back replays with
no new request.

9.3 — SEVEN mutants, all caught, all reverted, md5 verified clean: key on path
and digest alone (4 fail); drop the model (the three 5.3a route pins); key on the
REQUESTED id (the routing-rule pin and the key readback, and only those, which is
the discrimination that clause is for); refresh a no-op (3 store pins + the route
pin); refresh skipping the in-flight arm (both attach pins + the one-call pin);
the client key dropping the model (2 pane pins); RE-GENERATE issuing no intent (1
pane pin). Plus the chat `TurnStore` shared as one instance — 5.4's churn pin and
the own-store pin fail — and a shared records dict, which fails
`test_two_stores_share_no_state`.

STATED ADJUSTMENT, second instance under task 7.8: the rail's `onState` grew by
ten lines, and `selectBuffer:` fell off the far edge of a flat 5000-character
window at `test_doxbench_tile_verbs.py:747` — a pin whose claim was perfectly
intact. Re-anchored at BOTH ends, exactly as the sibling pin in the same file was
re-anchored by this change; teeth re-proved by renaming the seam inside the call.

realization-evidence.md's recipe gains the `refresh` field, a step 7 that presses
re-generate on the unchanged document, and a note on switching model mid-run —
the half of the key a single-model install never exercises.

pytest tests/ideation-dashboard: 4442 passed, 13 skipped (12:00).
openspec validate --all --strict: 77 passed, 0 failed.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 26, 2026 04:07

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

Comment on lines +429 to +433
with self._lock:
record = self._records.get(key)
if record is None:
return None
return dataclasses.replace(record, result=copy.deepcopy(record.result))
…e first model's abstract (#84)

Final polish after the #364 catch-up review (READY; one SHOULD-FIX).

Putting the resolved model id in the cache key made a model switch dispatch
instead of replaying — correct — but the verifier's "previous abstract is an
additional base" then compared model B's FIRST answer against model A's
abstract and refused it as a regeneration that dropped coverage. RULED: the
tightening base is a predecessor of the same (scope, path, MODEL) question.
latest_for_path gains an optional resolved_model_id filter (the model-agnostic
lookup stays the reader-facing default); the route passes the model; RED was
`previous-coverage-dropped` on model-b's first answer, GREEN is 200 with
model-b's own prose. Two guard pins prove the base was narrowed, not thrown
away: a same-model regeneration after a saved edit, and a same-model
RE-GENERATE, that drop coverage are still refused (the fixture subject gains
a second declared topic so the clause is decidable).

The spec delta's key sentence — tightened by #364 to a closed three-part
list — now says what is built: path, digest and resolved model id, QUALIFIED
BY the request's scope, so no key is shared across scopes (design D5 carries
both dates and why the two corrections compose). D5 also records the
consequences the review named: a refused RE-GENERATE forfeits the previous
base (cache, not record); during a refresh window a same-key request attaches
rather than replays; the model dimension multiplies slot pressure on both
64-entry bounds; latest_for_path picks by last access and replay touches
recency.

NITs: teardownRail repaints the abstract session like the onState path
(pinned at source); the mid-flight refresh test handshakes on an Event set
inside the store's wait instead of a 0.5 s join; the tile-verbs window
comment discloses its 7399-vs-5000 widening; tasks.md 10.1/10.2 counts
updated and a duplicated 5.3b sentence removed.

Five suites 214; ideation-dashboard 4447 passed / 13 skipped; validate
--all --strict 77/77.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 26, 2026 05:00

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

Suppressed comments (1)

tests/ideation-dashboard/test_doxbench_transport.py:163

  • The test name still says “four” fetch call sites, but the pin now asserts 6 and the docstring describes 6. This makes the failure output and test intent misleading when it trips.
def test_app_js_carries_exactly_the_four_named_fetch_call_sites():
    """PIN EVOLUTION (T023 wire clause, then add-doxbench-editing-phase-b §9.5,

brettheap added a commit that referenced this pull request Aug 26, 2026
…d, and canon carries the distilled abstract (#84) (#389)

* The distilled abstract's operator run is on record, and the fold now runs the way the archive order does (#84)

Two things, and the second follows from the first.

§10.3 is CLOSED. Attempt 2, 2026-08-26: operator Brett at the local console
served by `~/doxbench-operator/t100_serve.py` — the T100 subscription adapter
over the `claude` CLI, which is the second of the two adapters §10.3 allows
(`omp` is not installed on that host, so the bridge lane was never reachable and
this run evidences none of it; the file says so rather than implying otherwise).
Corpus at main `d4740415`, i.e. after the #386 fix, so the run exercised the
~150-word ask Attempt 1 bought. Subject
`ideation/staging/avatar-pilot-hardening/avatar-pilot-hardening.md`, digest
`20b36eb3…be505a`; model `claude-haiku-subscription.low` as evidenced by the
adapter's own dispatch record; 1119 bytes, inside the 1_500-byte bound; the pane
rendered it under the ruled model-derived caption beside both controls, which is
`caption_state: model-derived` and no refusal class. `generation` and
`wait_bound_seconds` are recorded as NOT CAPTURED — the operator read the pane,
not the network tab — rather than invented. Attempt 1 stays: it closed nothing
and found the two defects that made a pass possible.

Which makes this change archivable, and that flips the fold. Both this change
and `add-doxchat-model-intake` MODIFY `doxBench model catalog and provider
boundary`, and archive replaces canon's block with the archiving delta's raw
markdown — no merge — so the LAST archiver must already carry the other's text.
The recorded plan had intake archive first and this change carry intake's four
additions. Intake stands at 0/22 tasks with a real code surface and a blocking
dependency on `add-model-provider-broker`; its merged-plus-green gate is far
off. Waiting on it would hold a realized change open indefinitely — and
archiving this change with intake's text inside would write an intake affordance
NOBODY HAS BUILT into canon, which is precisely the invariant
`release-realization` exists to hold.

So the order is reversed and the deltas re-authored to match. This change's
block is now canon plus ITS OWN additions only: the three intake sentences, the
widened selector bullet, the intake scenario and the hosted-plane intake bullet
are removed from it. Intake's block is now (canon + this change's widening +
this change's four scenarios) + intake's same four additions — the LATER change
declaring relative to the earlier's OUTCOME, which is what
`release-realization/spec.md:64-74` asked for all along. Nothing about intake's
own content changed; only its base did.

Verified mechanically: this change's block minus canon is exactly its two
widened sentences, its three added sentences and its four added scenarios
(34 → 52 lines); intake's block carries every line of it but the one selector
bullet it deliberately widens, plus exactly its four additions (52 → 60 lines).
Both delta headers now state the base they are authored against, so the next
reader does not have to reconstruct this from the task notes. `openspec validate
--all --strict`: 78 passed, 0 failed.

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

* Archive add-doxbench-distilled-abstract: the model-derived abstract is what the spec now says ships (#84)

Every arm of the gate checked rather than asserted
(`release-realization/spec.md:23-32`): code MERGED on main — #365 `02477d40` and
#386 `d4740415`, both contained in `origin/main`; CI GREEN — `pytest-suite`
concluded `success` at `d4740415`; the OPERATOR RUN recorded at §10.3, Attempt 2
on 2026-08-26; origin UNCHANGED — `.openspec.yaml` blob `428e06ed`, byte-identical
to ratification commit `1ccb2ae0`, its whole history the single creation commit
`5c547610`; `openspec validate --all --strict` green either side.

The run this gate was waiting on. Attempt 1, the same day, closed nothing and was
worth everything: four failed presses proved the pane could not say WHY — a
`model_failed` body names no subject, so the paint-boundary recheck returned before
recording, `ABSTRACT_ERROR_SENTENCES` was unreachable, and the required control
read as inert — and a diagnostic dispatch returned a 2_018-byte abstract the
verifier would have ACCEPTED on every claim and the length bound would have refused
in full, after the model call was spent. #386 fixed both. Attempt 2, on the corpus
at `d4740415`, passed: Brett at the local console served by
`~/doxbench-operator/t100_serve.py` — the T100 subscription adapter over the
`claude` CLI, `omp` not being installed on that host, so this run evidences the
adapter seam and NOT the bridge lane, and the file says so —
`ideation/staging/avatar-pilot-hardening/avatar-pilot-hardening.md`, digest
`20b36eb3…be505a`, `claude-haiku-subscription.low`, 1119 bytes, rendered under the
ruled model-derived caption beside both controls. `caption_state: model-derived`,
verifier ACCEPTED, no refusal class. `generation` and `wait_bound_seconds` are on
record as NOT CAPTURED.

Promotion, reconciled against the delta rather than trusted: three requirements
MODIFIED (+3, +4, +2 scenarios) and seven ADDED (+31), so canon moves 88 → 95
requirements and 404 → 444 scenarios — exactly the delta's arithmetic. A
requirement-by-requirement diff of canon before and after shows 85 byte-identical,
0 removed, and only the three intended blocks changed. The promoted provider-
boundary block is byte-identical to this change's delta and carries NO intake text:
`INTAKE affordance` and `intake affordance is submitted` each grep 0 over promoted
canon, which is the whole point of the reversed fold in the previous commit —
`add-doxchat-model-intake` is 0/22 with a real code surface, and an unbuilt
affordance had no business entering canon on this change's back.

Task 10.5 is ticked in the archived copy with that reconciliation. 11.1 stays OPEN
on purpose: `specs/015-doxbench-distilled-abstract` is created by the Speckit flow,
not here. The README entry moves Active → Archived in the neighbours' form.

`pytest tests/doc-health`: 896 passed. `pytest
tests/ideation-dashboard/test_doxbench_abstract_route.py
tests/ideation-dashboard/test_doxbench_context_panes.py`: 84 passed. (Run
separately — the two trees carry colliding `conftest` module names.) `openspec
validate --all --strict`: 77 passed, 0 failed.

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

* Archived proposal carries the fold-direction addendum (#84)

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

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
@brettheap
brettheap deleted the change/apply-doxbench-distilled-abstract branch September 2, 2026 18:54
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