Type each query in the digest (image vs class) so counts can't be misread#9
Merged
Merged
Conversation
Apply the query-type spec at the stage where the model actually reads counts and picks a query: the term-info digest. Every query line now ends with a compact typing tag [query_type — kind; count = unit; use for …], and the header states the rule: "individual images" means the count is images; "ontology classes" means the count is types/subparts/subclasses (thumbnails are just examples) and is never an image count; answer an "images" question only from an individual- image query. This is what stops the model reading PartsOf's concrete "28 subparts" as the answer to "how many images of neurons …" — the class count is now explicitly typed as subparts, and the image query (ImagesNeurons, uncounted) is typed as individual images. - queryTypes.mjs: add `use` phrases per query_type and queryTypeTag() (kind phrase + count meaning + use). - termInfoDigest.mjs: render the tag on each query line; header explains the image-vs-class rule. Tests: queryTypes 6, termInfoDigest 11 (incl. an image-vs-class-on-same-term typing check); whole offline 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.
Applies the query-type spec at the stage where it bites — the term-info digest the model reads to interpret counts and pick a query. (The planner step schema has no
query_typefield, so the planner never names the query; the digest is where selection/interpretation actually happens.)What changed
Every query line in the digest now ends with a compact typing tag and the header states the rule:
Header rule: "individual images" ⇒ the count is IMAGES; "ontology classes" ⇒ the count is types/subparts/subclasses and any thumbnail is just one example — never report a class count as an image count; answer an "images" question only from an individual-image query.
This is the root-cause fix for the "28 images" answer:
PartsOf's concrete28is now explicitly typed as subparts, and the image query (ImagesNeurons, uncounted) is typed as individual images — so the model can't grab the class number and call it images.Files
lib/queryTypes.mjs— per-query_typeusephrases +queryTypeTag()(kind phrase + count meaning + use).lib/termInfoDigest.mjs— render the tag per line; header explains image-vs-class.Tests / lint
queryTypes6,termInfoDigest11 (incl. an image-vs-class-on-same-term typing check); whole offline unit suite green;next lintclean.After merge
Tag v3.3.3. Pairs with the authoritative/deterministic count injector already in v3.3.2 — that runs the right query; this stops any competing digest number from being misread.