Skip to content

Let documentation pages and publications be referenced - #33

Merged
Robbie1977 merged 3 commits into
mainfrom
feat/reference-links-for-docs-and-publications
Aug 16, 2026
Merged

Let documentation pages and publications be referenced#33
Robbie1977 merged 3 commits into
mainfrom
feat/reference-links-for-docs-and-publications

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

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 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 a 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.

How to test

npm test (1279 pass; tests/unit/referenceSources.test.mjs is 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.json still have none. Term Publications lists are deliberately not surfaced as sources; only references the answer actually drew on are.

Robbie1977 and others added 3 commits August 16, 2026 07:35
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
@Robbie1977
Robbie1977 merged commit 5be963d into main Aug 16, 2026
4 checks passed
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