Repository navigation
Route text changes on existing terms for CLARA review - #3720
Merged
Merged
Conversation
Existing-term prose was dropped wholesale with reason existing_term_text_not_yet_routed, so on PR #3717 CLARA routed 1 target out of 12 reviewable changes and ran no searches at all. Consume stage-1 text_deltas and split by what actually changed: - text_revision — prose changed; decompose the new wording. - refs_added — prose byte-identical, a reference newly attached. Only the delta refs are routed, so the check is 'does this new paper support the existing definition?' rather than a re-verification of the whole definition against every ref it has ever carried. Both are needed together: without the split, ROBOT's removed/added pair makes a one-dbxref edit indistinguishable from a rewrite. Also: - ref-only edits whose new refs aren't searchable (GOC:, MESH:) are ignored as refs_added_not_searchable rather than routed to a guaranteed 'uncertain'. - text removals are ignored explicitly as text_removal_not_reviewable. - equivalence axioms get validation_mode validate_equivalent_class_axiom; calling them atomic relationship checks was misleading. Payloads without text_deltas keep the previous behaviour, so this can land before the stage-1 change ships. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comment hardcoded ntr/relationship/synonym, so a PR routing 5 targets reported '0 NTR, 1 relationship, 0 synonym' and the 3 text_revision and 1 refs_added targets were invisible — the breakdown didn't add up to the total. Also iterate ignored_reason_counts instead of naming two reasons, so a newly added ignore reason can never go unreported. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Structural targets took candidate_refs from the axiom itself, which for a logical axiom is always empty — so every EquivalentTo reached the agent with nothing to check against. Fall back to the term's definition refs for STRUCTURAL_KINDS, and widen the term-level pool to include by_term[*].definition_refs from the head state so a PR that adds a logical definition without touching the text definition still gets the prose's citations. Effect on the cached fixtures: CL:0002149 gains 3 PMIDs, CL:0008005 a PMID and a DOI. CL:0002336 stays empty, correctly — its definition cites only GOC:tfm and MESH:D009061, i.e. it is uncited. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dosumis
approved these changes
Sep 17, 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.
Problem
On #3717 the CLARA review routed 1 target out of 12 reviewable changes and ran no literature searches at all (run 33852530599 —
tool_calls.jsonlis empty).Cause:
clara_select_targets.pydiscarded everytext_def/commentchange on an existing term withreason: "existing_term_text_not_yet_routed". Thentrbundle is the only route carrying prose and is gated onterm_is_new. All three terms in that PR are existing terms, so nothing textual was routed — including the definition change on CL:0002170 whosePMID:12014572was sitting inrouting.jsonunderignored.Change
Consume stage-1
text_deltasand split by what actually changed:text_revision— prose changed; decompose the new wording.refs_added— prose byte-identical, a reference newly attached. Only the delta refs are routed, so the question is "does this new paper support the existing definition?" rather than re-verifying the whole definition against every ref it has ever carried.Both are needed together. ROBOT reports an annotated axiom as a removed/added pair (an OWL axiom's identity includes its annotations), so a one-dbxref edit is otherwise indistinguishable from a rewrite.
Also in here:
GOC:,MESH:) are ignored asrefs_added_not_searchablerather than routed to a guaranteeduncertain.text_removal_not_reviewable.validation_mode: validate_equivalent_class_axiom; calling them atomic relationship checks was misleading, sinceEquivalentToasserts necessary and sufficient conditions.Effect on #3717
CL:0002336's text targets have no searchable refs (
GOC:tfm,MESH:D009061, a scielo URL), so they will still come backuncertain— that is the correct answer, not a gap.Compatibility
Payloads without
text_deltaskeep the previous behaviour exactly, so this can merge before or after the producing change in Cellular-Semantics/clara_workflow#4. It activates only once stage 1 emitstext_deltas.Testing
Run against all six cached stage-1 fixtures plus a fresh ROBOT diff of this PR's own commits. New terms still route as
ntrand are never double-routed astext_revision; obsoleted terms stay excluded; the pre-text_deltasfallback path was verified against the originalchanges.jsonartifact from run 33852530599.Note for later: routing has no test harness in this repo, and it redeclares the change-kind vocabulary that the stage-1 parser owns. Tracked as Cellular-Semantics/clara_workflow#3, which proposes moving selection next to the parser and keeping CL's policy here as data.
🤖 Generated with Claude Code