Resolve a bare class symbol to its class; retry a stale class-connectivity zero - #69
Merged
Merged
Conversation
Nothing in the harness knew what language a question was written in. The synthesiser answered in English unless the message said otherwise, so at the NeuroFly table (10 September) a Persian question typed in Latin letters got an English clarifying question back, a Hungarian question was answered in Hungarian only because it ended "válaszolj magyarul", and "can you reply in persian?" was answered "yes, I can". The Hungarian answer is the reason for the design. Every check behind an answer -- the absence gate, the count repair, the grounding audit, the term and count linkers -- reads English. The Hungarian prose said 327 driver lines above a table that said 392, and carried no links, because nothing could read the sentence the number sat in. So the English pipeline is unchanged and translation is the LAST step: - The planner returns the language the message was written in and any language it asks for; lib/language.mjs turns that into one decision per turn. An explicit request pins the conversation; a typed turn is answered in its own language; a clicked chip inherits the conversation's. Term names in another language are written as their English VFB name by the planner, with a translation rung in the resolver as the backstop. - The English answer is synthesised silently and every gate runs on it. lib/translateAnswer.mjs then renders the finished markdown in the user's language, streamed, and a deterministic check requires every link target, every number (in any Unicode digit script) and every VFB id to survive. One retry with the misses named, then the English answer with a note. An unverified translation never ships. - A bare "reply in X" re-renders the previous answer, chips included, rather than answering "yes". Chip labels are localised; the query behind each stays English. Message bodies get dir="auto". English turns are byte-identical. The battery gains six tasks across Persian (Latin script), Hungarian, Japanese, Chinese, German and the language switch, with script, stopword, link and context checks; all pass against the live gateway. Unit suite 1,373/1,373.
…nectivity zero "what cell types are downstream of KCg?" (#66) answered about one hemibrain cell, KCg-d_R (FlyEM-HB:1003837184). VFB's index ranks hundreds of KCg-* individuals above the class whose symbol is "KCg", so the class never reached the thirty rows the resolver saw and the token-superset guess took the first individual carrying the token. The #59 class lift only fired for names shaped like "<symbol> neurons"; it now also fires for a name that matched no document exactly and has an exact match among classes — exact beats guess, across the search the ranking hid. A name that IS an individual's label or synonym is left alone as before. Once resolved to the class, the answer was still "VFB does not currently hold data on downstream connectivity": the v3-cached edge is serving the count-0 results VFBquery emitted for failed class-connectivity aggregations before v1.22.51, under the MCP's own URL shapes (offset=0&limit=25 and limit=2500), while the plain URL returns 3,886 rows. A class-connectivity count 0 is now retried once with force_refresh on the same per-request budget as a -1, and a second zero is believed. Logged as CLASS CONNECTIVITY ZERO RETRY with the count after and the recompute time. Also register the roll-up classes and the self-row from a class-partner summary, not only the ranked partners, so the names the claim itself uses ("adult neuron", "adult CNS neuron", "adult interneuron") can be linked in the answer. Unit tests for all three; suite 1,378/1,380 (two skips). Verified live: "KCg" now lifts VFB_jrchjw0f -> FBbt_00049828 and answers with 3,370 downstream classes ranked by synapses per connected pair, in 97 s.
…ses exactly "KCg" is the symbol of both "adult gamma Kenyon cell" (FBbt_00049828) and "gamma Kenyon cell" (FBbt_00100247), and exactTermMatchId handed back whichever VFB ranked first. When several class documents match the wording exactly on the same rung, the question decides if it names a stage; failing that the extract model is asked whether the question settles it (a dataset, a qualifier, an earlier mention) and told to answer -1 otherwise; failing that the turn becomes a clarifying question naming the readings, with one chip per reading that re-asks the question about that term's own label. Only classes tie: same-named individuals (five hemibrain cells labelled KCg-d_R) keep the answer-one-and-disclose-the-rest behaviour. Names the harness wrote itself (speculative) are never asked about. A label match still outranks synonym matches, so most names are not ties at all. Live: "what cell types are downstream of KCg?" now asks, with two chips; clicking "adult gamma Kenyon cell" answers with 3,370 downstream classes. "EPG neurons" still resolves without a question. Suite 1,387/1,389.
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.
Closes #66.
Two faults behind the screenshot, plus one linking gap found on the way.
Resolution. "KCg" resolved to KCg-d_R (FlyEM-HB:1003837184), one hemibrain cell, and the answer listed that cell's 221 partners as the cell types downstream of KCg. VFB's index ranks hundreds of
KCg-*individuals above the class whose symbol is "KCg", so the class never reached the thirty rows the resolver saw and the token-superset guess took the first individual carrying the token. The #59 class lift only fired for names shaped like " neurons"; it now also fires for a name that matched no document exactly and has an exact match among classes — exact beats guess, which is the ladder's own first rule, applied across the search the ranking hid. A name that is an individual's label or synonym is left on the individual as before.Tied readings. "KCg" is the symbol of both
adult gamma Kenyon cell(FBbt_00049828) andgamma Kenyon cell(FBbt_00100247), and the resolver used to take whichever VFB ranked first. When several classes match the wording exactly on the same rung, the question decides if it names a stage; failing that the extract model is asked whether the question settles it (a dataset, a qualifier, an earlier mention) and told to answer -1 otherwise; failing that the turn becomes a clarifying question naming the readings, with one chip per reading that re-asks the question about that term's own label. Same-named individuals (five hemibrain cells labelled KCg-d_R) keep the answer-one-and-disclose-the-rest behaviour; names the harness wrote itself are never asked about; a label match still outranks synonym matches, so most names are not ties at all.The query. Once resolved to the class, the answer was still "VFB does not currently hold data on downstream connectivity": v3-cached is serving the count-0 bodies VFBquery emitted for failed class-connectivity aggregations before v1.22.51, under the MCP's own URL shapes (
offset=0&limit=25,offset=0&limit=2500), while the plain URL returns 3,886 rows for FBbt_00100247. A class-connectivitycount: 0is now retried once withforce_refresh, on the same per-request budget as the existing -1 retry; a second zero is believed. New log line:[VFBchat] CLASS CONNECTIVITY ZERO RETRY | query_type= | id= | count_after= | ms=. The poisoned edge slots themselves still want purging on each VFB3-Cache instance (see the issue comment).Linking. The class-partner summary registered only the ranked partners, so the roll-up classes it names in its own claim ("adult neuron", "adult CNS neuron", "adult interneuron") were the one set of names in an answer without a link. Roll-ups and the self-row are registered too.
Verified. Unit tests for all three (the KCg case fails without the lift, passes with); suite 1,387/1,389 (two skips), lint clean. Live against ELM+MCP: "what cell types are downstream of KCg?" lifts VFB_jrchjw0f to the class and asks "'KCg' matches more than one VFB term: adult gamma Kenyon cell or gamma Kenyon cell. Which did you mean?" with two chips; clicking
adult gamma Kenyon cellanswers with 3,370 downstream classes ranked by synapses per connected pair; "strongest downstream partner cell types of EPG neurons" still resolves without a question; "please show me the downstream connections from DNp32 neurons but reply in korean" now links all 13 names, roll-ups included, translation check passing.