Auto-run the matching term-info query for count questions (v3.3.1 follow-up)#6
Merged
Merged
Conversation
After the count -1 fix, "how many images of neurons with a part in the medulla
are available?" correctly saw the data but only told the user to run the query.
Auto-run it instead so the answer gives the number.
Add maybeInjectCountQueryStep: for a count question ("how many … of <term>")
with a single resolved term, pick the term-info query whose label best and
UNAMBIGUOUSLY matches the question's distinctive words (ignoring the term's own
name), and inject a vfb_run_query step for it. The step result (e.g.
ImagesNeurons count 226,524) becomes evidence, so the synthesiser reports the
count rather than deferring to the user. Skipped when a specialised
count/graph/expression step already covers it or the match is ambiguous.
…est.json to the newer run)
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.
Follow-up to the merged PR #5 (
count: -1digest fix). Brings the remaining fix onfeature/answer-quality-recipesintomain.What & why
After the
-1fix, a count question like "how many images of neurons with a part in the medulla are available?" correctly saw the data but only told the user to run the query — the synthesiser is evidence-only, so it can't call a tool mid-answer. This auto-runs the matching query so the answer gives the number.maybeInjectCountQueryStep(lib/orchestrator.mjs, called after the othermaybeInject*steps): for a count question ("how many … of<term>") with a single resolved term,pickBestQueryForQuestionpicks the term-info query whose label uniquely best-matches the question's distinctive words (ignoring the term's own name and stopwords like "part"), and injects avfb_run_querystep.runStep'sextractAnswerturns the resulting count into evidence, so the synthesiser reports it.ImagesNeuronsbeatsNeuronsPartHerefor "images of neurons"); skips if a connectivity/scRNA-seq/neuron-count/run_querystep is already planned.next lintclean.Known limitation / follow-up (not in this PR)
The chat still doesn't understand the individual-image queries vs class queries distinction, which caused a wrong answer (
PartsOf= 28 subparts reported as "28 images", whenImagesNeurons= 226,524 is the real images count). Rows tell them apart: individual-image queries returnVFB_*rows (count = images —ImagesNeurons,ListAllAvailableImages), class queries returnFBbt_*rows whose thumbnails are just examples (count = number of classes —NeuronsPartHere,PartsOf,SubclassesOf). We only expose terse one-line labels, nocountsemantics. Proposed follow-up: a per-query_typesemantics map (kind + count-noun + blurb) surfaced in the digest, plus usingkind: individual-imagesto route "how many images …". Happy to do this next.After merge
Tag v3.3.1 on
mainfor the versioned image build.Note: the large diff is the intentionally-tracked
test-results/task-battery/snapshots; the code delta islib/orchestrator.mjs+ its test (~112 lines). Thelatest.jsonmerge was pre-resolved (kept the newer run) — this generated file conflicts on everyfeature → mainPR and is worth a structural fix (stop tracking it or a merge rule).