Skip to content

doxBench: the abstract prompt asks for words a model can count, and every refusal says why (#84) - #386

Merged
brettheap merged 4 commits into
mainfrom
change/abstract-length-cap-and-visible-refusal
Aug 26, 2026
Merged

brettheap merged 4 commits into
mainfrom
change/abstract-length-cap-and-visible-refusal

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

From the first real operator run of add-doxbench-distilled-abstract (2026-08-26, T100 subscription adapter, Brett at the console): Generate appeared to do nothing — "No distillation generated" every time.

What was actually happening (proven with one diagnostic dispatch):

  1. The operator adapter (outside the repo) read prompt_envelope.observed_hashes, which AbstractEnvelope deliberately lacks → AttributeError after the model answered → route's fixed model_failed. Patched in the operator's file.
  2. Pane defect (this PR): every error-shaped answer (model_failed, model_timeout, model_capability_unavailable, …) names no subject, so the paint-time subject recheck dropped it before recording — the whole ABSTRACT_ERROR_SENTENCES map was unreachable. The control looked inert. Now a refusal/error is recorded against the path the request was dispatched for (an answer naming a different document is still dropped whole; one naming none is this request's — safe because refusals carry no prose). RED reproduced the operator's symptom (note is None under the not-yet-generated caption); GREEN.
  3. Product finding (this PR): sonnet answered 2,018 bytes against MAX_ABSTRACT_PROSE_BYTES = 1500 despite "under 1500 bytes" in the prompt — byte counts are not something a model obeys. The bound stays (it is the measured 280px region); the instruction now asks for ONE paragraph of about 150 words (~1000 bytes), with an anti-drift pin that the stated word cap × 7 stays under the byte bound. abstract-too-long's reason now names both numbers.

The verifier, incidentally, accepted the 2,018-byte abstract on first generation (9 declared topics covered) — the pipeline is sound; only length and error visibility needed work.

Five suites 365; tests/ideation-dashboard 4455 passed / 13 skipped; openspec validate --all --strict green. No spec delta (neither prompt wording nor the byte number is spec-pinned).

🤖 Generated with Claude Code

… refusal says why (#84)

THE OPERATOR EVIDENCE. The first real run of add-doxbench-distilled-abstract
(2026-08-26) put a live model -- claude sonnet through the T100 adapter -- on
the abstract prompt. It answered with 2_018 bytes against
MAX_ABSTRACT_PROSE_BYTES = 1_500. The answer was a GOOD abstract: the verifier
accepted every claim in it, and only the bound refused it, in full, after a
model call had already been spent. (The adapter's own bug from that run is
fixed separately, outside this repo.)

That is not a model disobeying an instruction. It is an instruction no model
can obey: "keep it under 1500 bytes of UTF-8" asks a writer to measure the
encoded length of prose it has not written yet. Words it can count.

SO THE BOUND STAYS AND THE ASK CHANGES. 1_500 bytes is pinned to the measured
280px region and is not moved. The response instruction now asks for ONE
paragraph of plain prose -- no preamble, no heading, no list -- of about 150
words, roughly 1_000 bytes, stated beside the hard bound that does the
refusing. `MAX_ABSTRACT_PROSE_WORDS` is a constant, and the envelope test pins
`MAX_ABSTRACT_PROSE_WORDS * 7 < MAX_ABSTRACT_PROSE_BYTES` (7 bytes a word is
ordinary English rounded up), so raising either number alone fails rather than
quietly recreating the same refusal. `rendered()` stays byte-deterministic.

AND THE REFUSAL IS NOW VISIBLE. The second half of the operator's report was
that the pane showed only the not-yet-generated caption after a refused
generation. A STATED refusal did render its reason -- `abstractRegionState`
carries it as `note` and `renderAbstract` draws it under the caption -- but
every ERROR-shaped answer was dropped: `doxbench_error_body` is
`{ok, error, message}` and NAMES NO SUBJECT, so the subject recheck at the
paint boundary returned before recording anything, and the whole of
`ABSTRACT_ERROR_SENTENCES` was unreachable. `model_failed`, `model_timeout`,
`console_required`, an unparseable body: all of them looked like a control that
did nothing. The refusal is now recorded against the path THIS REQUEST was
dispatched for, before the recheck, which keeps its real job -- a refusal
carries no prose, so there is no wrong-document text it could paint.

The `abstract-too-long` reason also names both numbers now. "Too long" without
them is a verdict a reader cannot act on: the operator had to read 1_500 out of
the server's source. The two integers are server measurements carried by
`TurnLimitError`; no caller field and none of the measured text reaches the
sentence.

RED first: the two envelope pins failed on a missing constant, and the pane
pins showed `note: null` under the not-yet-generated caption for a model_failed
and for an unreadable answer -- the operator's exact symptom, reproduced.

Tests: test_doxbench_abstract_envelope.py, test_doxbench_abstract_route.py,
test_doxbench_abstract_pane.py, test_doxbench_context_panes.py,
test_doxbench_turns.py -- 365 passed. Whole ideation-dashboard suite: 4455
passed, 13 skipped. `openspec validate --all --strict`: 79 passed, 0 failed.

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

@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 addresses doxBench “distilled abstract” operator experience issues by (1) ensuring refusal/error outcomes are recorded and displayed in the abstract pane, and (2) rewriting the abstract prompt to ask for a word-bounded form (which models can follow) while retaining the hard byte refusal bound enforced by the server.

Changes:

  • Record and render refused/error/unreadable abstract-generation outcomes in the pane even when the response names no subject path.
  • Replace “keep it under N UTF-8 bytes” prompt guidance with a word-cap (and an anti-drift pin tying the cap to the byte bound).
  • Improve refusal reasoning for over-long answers to include measured and maximum sizes, with new/expanded tests across route, pane, and envelope.

Reviewed changes

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

Show a summary per file
File Description
tests/ideation-dashboard/test_doxbench_abstract_route.py Adds a route-level test asserting over-long refusal reasons include both measured size and bound.
tests/ideation-dashboard/test_doxbench_abstract_pane.py Adds pane coverage ensuring refused/error/unreadable outcomes are visible, persist across redraws, and clear on next attempt.
tests/ideation-dashboard/test_doxbench_abstract_envelope.py Pins prompt wording to a word cap and asserts the cap stays comfortably under the byte bound.
scripts/ideation_dashboard/web/views/staging-workbench.js Records refusal/error sentences before the paint-time subject recheck so failures aren’t dropped for subject-less payloads.
scripts/ideation_dashboard/serve.py Composes an over-long refusal reason including measured/max values from TurnLimitError.
scripts/ideation_dashboard/doxbench_turns.py Introduces MAX_ABSTRACT_PROSE_WORDS and updates abstract response instructions to target a word-bounded, single-paragraph shape.

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

# cap raised without raising the bound would recreate the same refusal, only
# with the prompt's own blessing.

_ABSTRACT_WORD_CAP_PATTERN = re.compile(r"\b(1[0-9]{2}) words\b")
Comment on lines +637 to +639
"the model answered with " + str(int(measured)) + " bytes of prose "
"and this region renders at most " + str(int(maximum)) + ": an "
"over-long answer is refused in full rather than trimmed into it, "
brettheap and others added 2 commits August 26, 2026 13:35
…here else (#84)

THE QUESTION THE LAST COMMIT OPENED. Recording a refusal BEFORE the subject
recheck is what made a refused generation visible at all -- the recheck used to
be the only thing standing between an answer and the region, and an ERROR-shaped
body names no subject, so it dropped every reason the route had composed. With
the recording now ahead of that recheck, WHICH KEY it is filed under is the whole
of the guarantee, and that half was pinned by nothing.

FOUR ARMS, FOUR PINS, in the mounted workbench harness. The key is the path THIS
REQUEST WAS DISPATCHED FOR -- never the one the reader happens to be looking at
when the answer lands, and never one the answer names for itself:

  * a refusal for the dispatched subject renders on THAT subject when it is next
    shown, whatever the reader spun to meanwhile, and leaves the document that
    asked for nothing exactly as it was;
  * an answer echoing a DIFFERENT subject_path is not this request's answer and
    is dropped whole, recorded against neither document;
  * a wait a human took back records nothing -- the token arm is checked before
    anything is stored, because a cancelled ask is not owed a reason;
  * and the same question asked of a SUCCESS, which is where writing the pin
    first FOUND A DEFECT.

THE DEFECT (N3). The recheck asked whether the ECHO matches the LIVE subject;
the session store keys by the DISPATCHED path. Those two questions agree
everywhere except in one shape -- an answer echoing a path that is NOT the
dispatched one but IS the document the reader has since spun to -- and there they
disagreed in the worst direction: the answer passed the recheck and was cached as
the DISPATCHED document's abstract. One document's prose filed under another's
name is precisely what the recheck exists to prevent. `foreign` is now part of
that test, so recheck and store key ask one question.

MUTATION TABLE (each applied, seen RED on the named pin, reverted):

  session.subject.path instead of the dispatched path  -> refusal-renders-where-
      it-was-asked AND foreign-answer pins both fail
  `if (!succeeded)` without `!foreign`                 -> dropped-whole pin fails
  recording moved above the token check                -> cancelled-wait pin fails
  ABSTRACT_PROSE_WORDS_APPROX_BYTES 1_000 -> 1_400     -> word-cap/byte-gloss
      coherence pin fails
  the N3 pin was RED against HEAD and green only after the recheck took
      `foreign` into account

ALSO PINNED. The prompt's third number: the word cap is stated in words and
GLOSSED in bytes, and the gloss must stay the cap's own honest conversion --
between six and seven bytes a word, and strictly under the hard bound. A gloss
that drifted would be the original defect wearing a different hat: an instruction
whose two halves ask for different lengths, one of which the bound refuses. The
word-cap regex is shape-only (`\d+`, not `1[0-9]{2}`) -- a pattern spelling the
current value into itself goes BLIND the day the cap moves, and "assert found"
failing then reads as "the prompt states no cap" when the prompt states a
perfectly good one.

THE RECORDS. The spec delta's discard scenario carries the carve-out: a SUCCESS
is discarded unrendered AND uncached; a REFUSAL or ERROR for the dispatched
subject is recorded and renders on THAT subject when next shown, never on
another; an answer naming a different subject is discarded whole. Tasks 7.2 and
9.5 carry dated refinements, design.md D6 likewise, and the stale comment in
test_doxbench_abstract_pane.py now says what the recheck actually guards. The
ABSTRACT_ERROR_SENTENCES note states the invariant that HOLDS rather than the one
that used to: the wording is the server's, the only variable parts are at most
two integers this process measured, and no prose ever reaches it.

REALIZATION EVIDENCE now records ATTEMPT 1 (2026-08-26, operator Brett, T100
subscription adapter): four presses, every answer failing in the adapter on
`observed_hashes` and routing to model_failed, with the pane showing no reason --
and a diagnostic dispatch whose 2_018-byte abstract the VERIFIER ACCEPTED while
the byte bound would have refused it whole. Both surface defects are fixed here;
the run closed nothing, so the header stays PENDING and the record stays empty
for attempt 2.

Tests: test_doxbench_abstract_pane.py, test_doxbench_abstract_envelope.py,
test_doxbench_abstract_route.py, test_doxbench_context_panes.py,
test_doxbench_turns.py -- 370 passed. Whole ideation-dashboard suite: 4460 passed, 13 skipped (12m04s).
`openspec validate --all --strict`: 78 passed, 0 failed.

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

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

@brettheap
brettheap merged commit d474041 into main Aug 26, 2026
3 checks passed
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/abstract-length-cap-and-visible-refusal 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