Repository navigation
plugin/typescript: index adapter and resolver rules for typescript, what the parser names differently and what the frontend must absorb #636
Description
Part of #634. Correct this language's entry in the adapter table (A[<lang>] in skills/axiomcode/scripts/axiomcode-index, header names, filters, kind mapping; data, not code) and add the resolver rules it needs in scripts/axiomcode and fill §5 of skills/axiomcode/DESIGN.md for this language. Acceptance: axiomcode find|uses|callers|impact answer the 20 names in the probe list on the first try; a nested member displays as Outer.Inner.member; every printed path is repo-relative; symbols.kind uses the fixed vocabulary (function|method|constructor|class|interface|enum|enum_member|type|namespace|const|variable|field|module).
Port bench/dogfood/tools/augment.py (TypeScript-only today) into the adapter; it already builds refs/literals/comments/variables/fields for this language.
What the IR gives (verified on bench/dogfood/work/_probe, the parser repo, 114k LOC)
- references:
all-typescript-expressions.csvkindIDENTIFIER_REFERENCE/PROPERTY_ACCESS, name = last segment ofpotentialQualifiedName, file viatsModuleLinkHash→all-typescript-modules.csv - string literals: kind
LITERAL,literalType=STRING; comments:all-typescript-comments.csv - module consts:
all-typescript-variables.csvscopeKind=MODULE_SCOPE,isConst,isExported; fields:all-typescript-fields.csv; enum members:all-typescript-enum-members.csv
What the resolver must absorb
- 2 154 methods are named
<arrow>(of 7 798 client methods); 236 of the 238 variables withboundFunctionLinkHashpoint at an anonymous one.find fooforconst foo = () => …must resolve through the variable to the method;callers foolikewise. Check whether class-property arrows (fields.initializerExpressionLinkHash) need the same. qualified_nameissrc/dir/file#Class.method; agents writeClass.method, suffix match on the display name.symbols.kind='function'forowner_type_id IS NULLcallables; the r1-sql view had every callable asmethod, which produced several of the empty queries in plugin: a query frontend agents can use without knowing the schema, find/uses/show/callers/callees/path/impact over one resolver, all languages #634.- One language per run:
.mjs/.jsfiles are not in a typescript graph (src/test/javascript-gates/*.mjscost several empty queries). Readskipped-typescript-files.csvinto the index sofindcan say "exists, not indexed in this language" instead of nothing. - Tiers
ambient_terminalandintrinsic_terminalare RESOLVED in TypeScript (bundle note), the "sound" filter must not be a hardcoded(known_edge, multi_inferred).
Probe list (fill in): the 20 most-queried names from the r1 transcripts (work/*/r1-*/repo/.axiomcode/queries.jsonl), including the ones that came back empty.
Plugin, not a bare skill (2026-09-16). This work now lives in plugins/axiomcode/ on skill/query-frontend: an agent plugin, carrying the skill under skills/axiomcode/ and an MCP layer (.mcp.json -> mcp/server.py) that exposes the entry's subcommands as typed tools, axiomcode_index, axiomcode_path, axiomcode_impact and axiomcode_graph, each a thin shell-out to scripts/axiomcode, so an agent gets the CLI's verified output through a tool call instead of a Bash command it may never issue (in two harness runs a Bash-described tool was never called; loaded as a plugin, a Bash-less agent called axiomcode_path and answered for $0.23). Load it with the host CLI's --plugin-dir plugins/axiomcode; note that its --strict-mcp-config flag hides plugin MCP servers. The current surface is index · graph · path · impact; search/pack/brief/the gate hook were removed after the dogfood transcripts showed they added context instead of replacing it.
Activity
[-]skill/typescript: index adapter and resolver rules for typescript — what the parser names differently and what the frontend must absorb[/-][+]plugin/typescript: index adapter and resolver rules for typescript — what the parser names differently and what the frontend must absorb[/+]swapnilpaliwal-sd commentedon Sep 17, 2026
A measurement of what item 1 ("2,154 methods are named
<arrow>") costs a by-name lookup, from #827.On a TypeScript subject of 9,669 methods / 38,889 call sites, only 372 methods have a real name. The rest are placeholders:
<arrow>8,306,<function-type>482,<module>311,<call-signature>139,<constructor>47,<function-expression>10.The consequence is not just that
find foomisses — a name that looks unique among recorded names frequently has a second, hidden declaration behind<arrow>, so a lookup keyed onmethods.namesilently answers with the wrong declaration. Classifying every site written with a unique name against whatcall_edgesresolved:methods.namesymbols.nameEvery disagreement I hand-checked was the engine being right: e.g. a call resolving to the local
const createRequest = (…) => {…}in its own file, while themethods.namemap pointed at a same-namedcreateRequest(…)method in a different adapter, because the local one is recorded as<arrow>.The useful part:
symbolsalready recovers the binding name. The declaration thatmethods.namecalls<arrow>appears insymbolsunder its real name withkind='function'and amethod_idback to the methods row. So a resolver that keys onsymbols.namerather thanmethods.namegets 3.8x the coverage and drops the error rate by ~60x today, without waiting for the parser-side fix. That looks like the cheapest form of "resolve through the variable to the method" this issue asks for.(#638 is the JavaScript twin: same placeholders — 8,069
<arrow>+ 2,204<function-expression>of 20,790 methods — but re-keying onsymbolsdoes not rescue JavaScript there; it stays at ~6% wrong. See #829.)[-]plugin/typescript: index adapter and resolver rules for typescript — what the parser names differently and what the frontend must absorb[/-][+]plugin/typescript: index adapter and resolver rules for typescript, what the parser names differently and what the frontend must absorb[/+]swapnilpaliwal-sd commentedon Sep 29, 2026
Fixed by #1787 (merged into 0.1.9).
swapnilpaliwal-sd commentedon Sep 29, 2026
Fixed by #1787 (merged into 0.1.9).