Skip to content

Record the source-list stripper's one measured residual risk - #261

Merged
adamjohnwright merged 1 commit into
mainfrom
docs/sources-strip-residual-risk
Sep 19, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
docs/sources-strip-residual-risk

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Comment only, no behaviour change — this needs no deploy.

The website session found that their client-side equivalent truncates mid-stream at a partially typed heading and recovers only because it recomputes over accumulated text: once the rest of the heading arrives it stops matching, so the finished answer is correct and the reader sees at most a flicker on a line that is mid-render anyway.

Ours cannot recover. It is a state machine, and by the time it is wrong it has already dropped the tokens. That asymmetry leaves exactly one way to lose an answer here that does not exist there: a complete ## Sources line in the middle of an answer, with real prose after it.

Measured rather than argued

Six real answers, spanning the reactome and userguide prompts:

  • heading text: ## Sources — six of six
  • position: last — six of six
  • content after it: list items only, zero prose lines

No mid-answer occurrence at all.

So it is recorded, not built

Defending it would mean holding the text after a heading until a list item confirms the verdict. That is buildable and it is more state than an unobserved failure justifies — and this file already carries the rule that when in doubt it must not match. The comment states the risk, the measurement behind the decision, and what the fix is if a mid-answer heading is ever seen.

🤖 Generated with Claude Code

The website session found that their client-side equivalent truncates
mid-stream at a partially typed heading, and recovers only because it
recomputes over accumulated text -- once the rest of the heading arrives it
stops matching and the answer comes back. Ours cannot recover: it is a state
machine, and once it commits to a heading it has already dropped the tokens.

That asymmetry leaves one way to lose an answer here that does not exist
there: a complete `## Sources` line in the middle of an answer with real prose
after it.

Measured over six real answers across the reactome and userguide prompts
rather than argued about. The heading was `## Sources` every time, last every
time, with nothing but list items following. Zero mid-answer occurrences.

So the guard is not built. Defending it would mean holding the text after a
heading until a list item confirmed the verdict, which is more state than an
unobserved failure justifies -- and this file already carries the rule that
when in doubt it should not match. What is recorded is the risk, the
measurement, and what the fix would be if a mid-answer heading is ever seen.

Comment only; no behaviour change, so this needs no deploy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 91ee818 into main Sep 19, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the docs/sources-strip-residual-risk branch September 19, 2026 04:32
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.

1 participant