Let documentation pages and publications be referenced - #33
Merged
Conversation
The synthesiser is forbidden to write URLs, and the automatic linking that
rule promises only ever covered VFB term reports. Anything that was not an
ontology term therefore could not be cited by any route.
The visible case: a neuron-count answer opens by saying there is no single
figure because it depends on the boundaries, the specimen and the method.
That framing comes from VFB's own reviewed article on neuron counts, whose
URL the tool payload carries and whose answer_hint tells the model to point
the reader at it — while the system prompt tells the model never to write a
URL. The two instructions cancelled, so the claim was always uncited.
References are now emitted deterministically, as the term sources already
are, and the model is never asked to produce a link:
- lib/referenceSources.mjs turns literature evidence rows and the reviewed
article and primary papers behind a curated count into sources, deduped
across trailing slash, www and scheme, documentation before publications.
- The Sources line carries kind ('vfb' | 'doc' | 'publication') and its own
hover text, so a term report, a documentation page and a paper no longer
read as the same promise.
- The deterministic count block links each figure to its paper, prints the
curator's note that qualifies it, and closes with the article.
- The article URL comes from config/fly-neuron-counts.json rather than a
string literal in route.js, so moving the page cannot leave the reference
pointing at a 404.
Also fixes doc sources, which have never worked: buildEvidenceRow spreads
the locator, so a row has no .locator, and buildFollowOns read
e.locator?.url. The existing test agreed with the code because it built its
fixture by hand; it now builds it through buildEvidenceRow.
Every host the block can emit is on the default outbound allow-list, and a
test asserts the rendered block survives sanitizeAssistantOutput unchanged.
Only the generated task-battery latest.json collides — item 8 again. Takes this branch's run; the battery regenerates it on main after merge. # Conflicts: # test-results/task-battery/latest.json
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.
The synthesiser is forbidden to write URLs, and the automatic linking that rule promises only ever covered VFB term reports — so anything that was not an ontology term could not be cited by any route.
The visible case: a neuron-count answer opens by saying there is no single figure, because it depends on the boundaries, the specimen and the method. That framing comes from VFB's own reviewed article on neuron counts, whose URL the tool payload already carries under
evidence_summary.reference, and whoseanswer_hinttells the model to point the reader at it — while the system prompt tells the model never to write a URL. The two instructions cancelled, so the claim was always uncited.References are now emitted deterministically, as the term sources already are, and the model is never asked to produce a link.
lib/referenceSources.mjsturns literature evidence rows, and the reviewed article and primary papers behind a curated count, into sources — deduped across trailing slash,wwwand scheme, documentation before publications.kind(vfb/doc/publication) and its own hover text, so a term report, a documentation page and a paper no longer read as the same promise.config/fly-neuron-counts.jsonrather than a string literal inroute.js, so moving the page cannot leave the reference pointing at a 404.Also fixes doc sources, which have never worked:
buildEvidenceRowspreads the locator, so a row has no.locator, andbuildFollowOnsreade.locator?.url. The existing test agreed with the code because it built its fixture by hand; it now builds it throughbuildEvidenceRow.How to test
npm test(1279 pass;tests/unit/referenceSources.test.mjsis new). Live: ask "how many neurons are in the fly brain" and check the Reference line under the estimates block, and the Sources line beneath the answer.Follow-ups
The curated note is rendered for regions that have one — several regions in
config/fly-neuron-counts.jsonstill have none. TermPublicationslists are deliberately not surfaced as sources; only references the answer actually drew on are.