Repository navigation
Record why some answers have no citations, and the option to change it - #245
Merged
Merged
Conversation
Found by measuring citation ordering for the website: a userguide question returns 0 citations and 452 tokens. Not a failure -- a `citation` carries a Reactome stable id, and the userguide collection indexes documentation pages whose metadata is a page URL, so there is nothing that can become one. Worth writing down because it is the opposite of what testing would suggest. It correlates with the *fastest* answers, so it is common rather than exotic, and the four questions anyone would naturally reach for all produce citations. Also records that citations always precede prose, and why that is structural rather than a timing accident: they are emitted on `on_retriever_end`, and token events are gated on the same event because retrieval completing is how the answer's tokens are separated from the query expander's. That makes "sources are complete when the first token arrives" a design fact a caller can rely on. The option to cite userguide pages is recorded in the shape the website proposed and I agreed -- an optional `url` sibling, never a fabricated `R-` id, which would resolve to nothing or to the wrong entity. Not scheduled, and Adam's call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four IDs were duplicated, all by me: I added T021, T022, T023 and T020b across three PRs today without checking that Phase 5 already used them. Mine are renumbered rather than Phase 5's, because the older ones are referenced by the dependency notes. The list had also drifted from the code in both directions. Marked done after verifying each rather than from memory: the branch and baseline (T001, T002), the shared graph via lifespan (T004), the streaming surface (T005) and its more-than-one-token test (T006), spec 009 routing (T021 -- landed and live, and the main reason first-token fell from the ~36s once recorded to 9.6s), telling the website (T023), and recording the measured times (T024). T003 named tests/api/test_middleware_scope.py, which was never written. The behaviour it asked for is tested, in tests/util/test_captcha_scope.py, because the decision moved into a module that can be tested without an app. Recorded where it actually lives rather than left looking undone. T020b's "~16s of preprocessing" is corrected. It never reproduced, it was 5.1s before the two-round change and is 2.6s after, and the sequential half of that question is answered. What remains is whether a search-page question needs all four calls at all. 32 done, 5 open, and the five are genuinely open. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Documentation only. Found while answering a question the website asked about event ordering — the measurement turned up something neither of us knew.
Some answers have no citations, by construction
"How do I use the pathway browser?" returns 0 citations and 452 tokens. Not a failure: a
citationcarriesst_id, a Reactome stable identifier, and only the Reactome and disease-variant collections have them. The userguide collection indexes documentation pages whose metadata is a page URL, so nothing there can become a citation in the contract's shape.Worth writing down because it is the opposite of what testing would suggest:
The website had this right in their panel already — heading and list inside one conditional — but untested, which they have now fixed at two levels.
Citations always precede prose, and that is structural
Measured across five questions: every one producing both had its last citation at event 11 and first token at event 12, no interleaving. But the useful part is the reason, not the samples — citations are emitted only on
on_retriever_end, and token events are gated on that same event, because retrieval completing is how the answer's tokens are told apart from the query expander's.So "sources are complete when the first token arrives" is a design fact a caller can rely on, not a timing observation that might not hold next week.
Open, not scheduled: citing userguide pages
Proposed by the website session, agreed in shape, deliberately not scheduled. A documentation URL does not fit
{st_id, display_name}, and a fabricatedR-id is not an option — it would resolve to nothing, or worse to the wrong entity. An optional sibling works, exactly one of the two present:A consumer that understands only
st_idkeeps working by skipping what it does not recognise. Recorded as T020b; Adam's call, and not a blocker — an answer honest about having no sources beats an invented one.🤖 Generated with Claude Code