Make the same analysis read the same way twice - #283
Merged
Merged
Conversation
Spec 011 Phase 7, which completes the feature. FR-014 wants a token to yield the same summary request after request. Generation cannot provide that -- the same question through the same surface scores 0.33 similarity twice -- so stability is **reuse**, and FR-015 exists because the interface must say which it is looking at. `cached` on `start` is now true when a summary was served rather than generated, and it was always false before because nothing was ever stored. Keyed `(token, release, tier)`, and each key earns its place. Release, because the Analysis Service deletes results on a new release and without it we would serve a confident account of an analysis that no longer exists. Tier, because an aggregate summary and a disclosing one are different artefacts -- sharing a key would hand a reader who chose the default a summary built from their identifiers, which is a disclosure nobody asked for. Keyed on the tier that *applied* rather than the one requested. A disclosure that could not be honoured produces an aggregate summary, and storing that under `identifiers` would serve it back later as though the identifiers had been used -- the failed-disclosure bug from Phase 4, preserved in the cache instead of the stream. Two behaviours chosen deliberately. An empty summary is never stored: a failed or abandoned generation leaves no text, and storing it would serve the emptiness back forever, indistinguishable from a result with nothing to say. And eviction drops the oldest rather than refusing the newest, because an evicted reader regenerates while a refusing store silently stops working for everyone after a few hundred readers. The store is in process and lost on deploy. That is honest only because `cached` makes regeneration visible, and the durable version is recorded as open in research D4 rather than implied. Caught while wiring it: the tests began serving each other cached summaries, because the store is module state that outlives a request by design. The fixture now gives each test its own, as it already did for the limiter. Verified by sabotage, with the sabotage asserted to have applied. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
adamjohnwright
force-pushed
the
011-phase7-stability
branch
from
September 20, 2026 18:29
a600e2c to
9fe1461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec 011 Phase 7 — the last one. The feature is complete.
Stability is reuse, not determinism
FR-014 wants a token to yield the same summary request after request. Generation cannot provide that — the same question through the same surface scores 0.33 similarity twice — so stability comes from storage, and FR-015 exists because the interface must say which it is looking at.
cachedonstartis now true when a summary was served rather than generated. It was alwaysfalsebefore, because nothing was ever stored.Every part of the key earns its place
(token, release, tier):And it is keyed on the tier that applied, not the one requested. A disclosure that could not be honoured produces an aggregate summary; storing that under
identifierswould serve it back later as though the identifiers had been used — the Phase 4 failed-disclosure bug, preserved in the cache instead of the stream.Two deliberate behaviours
Known state, not a bug
The store is in process and lost on deploy. That is honest only because
cachedmakes regeneration visible. The durable version is recorded as open in research D4 — there is no existing home to reuse, sincePOSTGRES_LANGGRAPH_DBis unset on beta and LangGraph already falls back toMemorySaver.Caught while wiring it
The tests began serving each other cached summaries, because the store is module state that outlives a request by design. The fixture now gives each test its own, as it already did for the limiter — otherwise a test failure would have looked like the feature being broken.
Verified by sabotage, with the sabotage asserted to have applied. All checks gated with
set -e.🤖 Generated with Claude Code