Make count-question auto-run authoritative and deterministic#8
Merged
Conversation
The count-question auto-run was defeated by its own guard (it skipped whenever
the planner had already planned any run_query) and, even when it fired, relied
on the weak extractor to pull the count out of the result table — so "how many
images of neurons with a part in the medulla" regressed to "you can run the
query" (no number), and earlier had run PartsOf (28 subparts) reported as "28
images".
- maybeInjectCountQueryStep no longer skips on a generic run_query. If the
planner planned a run_query with the wrong query_type, it RETARGETS that step
to the semantically-matched query (e.g. PartsOf -> ImagesNeurons); otherwise
it injects one. Still skips only when a specialised connectivity / scRNA-seq /
region-neuron-count macro already covers the count, and only on an unambiguous
match.
- The step is tagged count_query + count_noun + count_term; runStep reads the
count straight from the run_query result and adds a deterministic evidence row
("VFB holds 226,524 images …"), so the number and its correct unit reach the
synthesiser regardless of the extractor.
Offline end-to-end test (mocked ELM/MCP) with the user's exact question incl. the
deliberate "medualla" typo: runs ImagesNeurons (never PartsOf) and the evidence
states "226,524 images". Suites: orchestrator 23, orchestrator_run 23; whole
offline unit suite green; next lint clean.
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.
Fixes the medulla image-count question end to end. After v3.3.1 it regressed to "you can run a query" (no number); before that it had answered "28 images" (
PartsOf, a class query). Both were the same two root causes.Root causes
maybeInjectCountQueryStepskipped whenever the planner had already planned anyrun_query— so when the planner picked the wrong query (PartsOf), the injector stepped aside and the wrong query ran; and when the planner planned nothing concrete, the injector still didn't get to correct it.Fix
run_query. If the planner planned arun_querywith the wrongquery_type, it retargets that step to the semantically-matched query (PartsOf → ImagesNeurons); otherwise it injects one. It still defers only to the specialised connectivity / scRNA-seq / region-neuron-count macros, and only acts on an unambiguous match.count_query+count_noun+count_term;runStepreadscountstraight from therun_queryresult and adds a deterministic evidence row (VFB holds 226,524 images …), so the number and its correct unit reach the answer regardless of the extractor.Tests
New offline end-to-end test (mocked ELM/MCP) with the user's exact question including the deliberate
meduallatypo: it runsImagesNeurons(neverPartsOf) and the evidence reads226,524 images. Suites:orchestrator23,orchestrator_run23; whole offline unit suite green;next lintclean.After merge
Tag v3.3.2. (Small code delta:
lib/orchestrator.mjs+ two tests.)Separately — the task-battery CI gate failed PR #7 on a single transient T3.3 timeout (
errors > 0 → exit 1); worth making that non-blocking / retry-once so live-server flakes don't red-flag good PRs. Happy to do that too.