Repository navigation
Connect TS barrel files and generic supertypes in the graph - #726
Conversation
🌱 graft blast radiusNothing outside this diff depends on it. 1 area changed; no indexed dependents at depth 2. Who knows this code — 2 people across 1 area
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no Test signal per changed area — 1 ✗Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Ported from upstream PR #726. Co-authored-by: anirudhkumar-nanonets <[email protected]>
The issue: in TypeScript, a barrel file (
export { X } from "./x",export * from "./x") had no links out, sotrail askandtrail callersstopped at it;implements Router<T>lost its link too.Why: the extractor made
importslinks only fromimportstatements, and took a supertype only when it was a bare identifier, so a generic one likeRouter<T>was dropped.The fix: a re-export with a
fromnow makes animportslink, and supertype names lose their type arguments (Router<T>→Router,ns.Base→Base), like the PHP and Swift paths.Moves:
graft_active, people who ran a trail query in the last 7 days (PostHog, Metabase DB 11,event = 'query'; card 17628 is the daily view). 10,338 on 2026-10-29. This makes TypeScript answers better; it won't visibly move the number.This is the one part of the stale branch
wip/jev-askworth keeping; the rest of it, and draft #553, are left out (below).What changes
src/graph/extract.ts, fromwip/jev-ask(b1be58d), ported onto today's main:export { X } from "./x"andexport * from "./x"now produce animportslink to./x. A barrel file used to have no links out, sotrail askandtrail callersstopped there. A plainexport const x = 1(nofrom) is untouched, and the walk still descends into it.implements Router<T>puts ageneric_typein the heritage clause; only a bare identifier was accepted, so the link was dropped. Type arguments are now erased (Router<T>→Router) andns.Basereduces toBase, like the PHP and Swift paths.Measured with main's extractor vs this one over each repo's tracked TS/JS files:
Calls, contains and references counts are identical before and after in all three, so nothing is lost.
Left out on purpose
graft trail pushandsrc/brain/, which b92c22e deleted on 14 Oct.trail ask --jev/--loop(1,018 lines insrc/ask/jev-*.ts): a model picks seeds, walks the call graph and prunes. It needs an API key on the agent's busiest command and nothing measured shows it beats plainask. Still recoverable from b1be58d.X-Graft-Watchheader (fe30ead): the file it edits was deleted in b92c22e.Checks
test/graph-bindings.test.ts: 21/21 pass. 5 of the 7 new tests fail on main's extractor; the other 2 guard what must not change (plain exports, a generic base class that already worked).npm testwith a scratch HOME: 4,125 pass, 8 fail. The 8 are in graft-to-trail, hosts-trail, skills-* and upkeep-hooks tests; none import the graph code, they fail the same way with main'sextract.tsswapped in, and the set changes run to run (machine load ~70 from parallel sessions).trail check: no conflicts.src/graph/); CI green on 2f11ea1;test/graph-bindings.test.ts21/21 again.src/graph/but notextract.ts; on the merged code the 42 graph and extract test files pass 413/413 andtscis clean.For the reviewer
graft trail pushandsrc/brain/signup.tson 14 Oct; learnings are now shared through a committed.trail/."wip/jev-askandfeat/trail-signup-new-onboarding.🤖 Generated with Claude Code