Repository navigation
fix(wiley-nexus): keep NexusWriter citation numbers aligned with evidence_passages.md - #248
Merged
ryansok merged 2 commits intoOct 27, 2026
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
…mbers NexusWriter renumbered citations by first appearance in its own answer, so [n] in research_response.md did not match [n] in evidence_passages.md. - NexusWriter reuses each publication's evidence number, matches analysis files by DOI, keeps gaps, orders References by evidence number, and never reuses a number that belongs to another paper. - NexusSearch writes a "## Index" ([n] DOI - Title) at the top of evidence_passages.md so the writer sees every number even when a long file is only partly read; NexusWriter takes its numbers from it. - Task 1 asks for and validates the Index; Task 3 no longer asks for first-appearance numbering; the pipeline README lists the Index.
Sahasra (Sahasra98)
force-pushed
the
fix/nexus-writer-citation-numbering
branch
from
October 20, 2026 14:48
3d0fad1 to
13e4502
Compare
Contributor
Author
|
@microsoft-github-policy-service agree company="Wiley" |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fallback numbering instruction can assign the same citation number to multiple publications absent from the evidence file.
1 open issue
What changed in this PR
Aligns Wiley Nexus pipeline citations with evidence-file numbering so answers can be checked against their sources.
Changes:
- Adds a compact publication index to search output.
- Updates writer instructions to preserve evidence numbers and citation gaps.
- Aligns task instructions, validation criteria, and output documentation.
| File | Description |
|---|---|
agents/wiley-nexus/tasks/README.md |
Documents the evidence index. |
agents/wiley-nexus/tasks/nexus-writer-agent.md |
Preserves evidence numbering in citations and references. |
agents/wiley-nexus/tasks/nexus-search-agent.md |
Adds the index before detailed evidence. |
agents/wiley-nexus/tasks/nexus-research-task.md |
Updates task requirements and index validation. |
Review effort: Balanced
…umber Addresses review feedback: two cited publications absent from evidence_passages.md could both receive the same new number. Each now gets the next unused number above the evidence maximum, and keeps it for every citation.
faranm-stack
approved these changes
Oct 27, 2026
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.

Summary
In the Wiley Nexus Discovery Engine pipeline, NexusWriter numbered citations by order of first appearance in its own answer instead of reusing the numbers NexusSearch assigns in
evidence_passages.md. A paper listed as### [7]in the evidence could appear as[1]inresearch_response.md, so the answer could not be checked against its evidence by number.This PR makes NexusWriter reuse the evidence numbers. Testing on a full pipeline run then showed a second problem: on a long evidence file (20 papers), NexusWriter only saw roughly the first 13 entries, so papers further down got wrong numbers. To fix that, NexusSearch now writes a short
## Indexat the top ofevidence_passages.md, and NexusWriter takes its numbers from it.Type of change
agents/<name>/)starter-kits/<name>/)docs/schemas/**).github/**)Related issue / tracking
Follow-up to #111. Internal tracking: AISVC-3007.
Schema impact
breaking-changelabel and link the rollout plan belowValidation checklist
README.md, schemas) is updated to match the change..auto-registry/**(it is generated post-merge)..DS_Store,.env,*.swp,.idea/,.vs/, etc.).What changed
All changes are in
agents/wiley-nexus/tasks/.NexusResearcher(agent.yaml) is unchanged: it is a standalone chat agent with no evidence file to match.nexus-writer-agent.md## Index(falls back to reading every### [n]entry if there is no Index), matches analysis files by DOI, never renumbers by first appearance, keeps gaps when papers are not cited, orders References by evidence number, and only assigns a new number above the highest existing one, never one already in use.nexus-search-agent.mdevidence_passages.mdnow opens with## Index, one line per publication:[n] DOI — Title, matching the###entries.nexus-research-task.mdtasks/README.mdTesting
All runs in Discovery Studio with the updated agent instructions.
[6]cited first)[6]stayed[6]; the old behaviour would make it[1].[1], [3], [5], [6], [8], gaps kept.### [19]was cited as[20], then[14]on a rerun. NexusWriter never cited entries[14]–[20], even on-topic ones, consistent with the long file being only partly read. This led to the Index change.[1],[2],[4],[9],[12]). The answer first cites[1], [4], [2], [12], [9]and none were renumbered.Not yet covered: the last run's evidence file had 12 papers, below the length at which the earlier run lost entries, so the Index was not exercised against a truncated read. It is designed for that case, since every number is in the file's first lines.
Reviewer notes
evidence_passages.mdwere being silently left out of the final answer. The old renumbering hid this, because the answer never pointed back to evidence numbers. The Index makes those papers visible to the writer again.