From 025ebc88d6d708edd3732f5cb68516148719a061 Mon Sep 17 00:00:00 2001 From: Colby Mchenry Date: Sun, 24 May 2026 04:41:04 -0500 Subject: [PATCH 1/2] Release 0.9.4: framework-aware routing + dynamic-dispatch coverage + retrieval improvements (#365) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(resolution): close dynamic-dispatch coverage holes (callback synthesis + django ORM) Static tree-sitter extraction misses calls whose target is computed or indirect, so flows through callbacks, observers, and descriptors were absent from the graph. - callback-synthesizer.ts: whole-graph pass after base resolution. Detects registrar/dispatcher channels (field-backed observers + string-keyed EventEmitters), correlates registration sites, and synthesizes dispatcher->callback `calls` edges (provenance:'heuristic'). Records the registration site (registeredAt) in edge metadata. Precision guards: named handlers only, registrar-name match, event fan-out cap. - frameworks/python.ts + resolution/{index,types}.ts: claimsReference hook + django ORM resolver (_iterable_class -> ModelIterable.__iter__). - extraction/tree-sitter.ts: extract named nested functions so inline named handlers become linkable nodes. trace(mutateElement, triggerRender) and trace(_fetch_all, execute_sql) now connect; node count stable (no explosion). Co-Authored-By: Claude Opus 4.7 (1M context) * feat(mcp): self-sufficient flow output + fix explore budget regression - Surface synthesized-edge evidence in trace, the node trail, and context call paths: a dynamic-dispatch hop now shows "callback via onUpdate @App.tsx:3148" with the registration site inline (and trace inlines each hop's call-site source line) -- the exact glue agents previously Read/Grep'd to reconstruct. - Fix non-monotonic explore output budget: the 500-5000 file tier capped maxCharsPerFile at 2500, BELOW the <500 tier's 3800, so on god-file projects (excalidraw's 415 KB App.tsx) one explore returned <1% of the file and forced a Read. Raised to 6500/file, 28000 total. - Stop explore from inviting Read: truncation/trim notes said "use Read for more"; they now steer to another codegraph_explore and treat returned source as already Read. Measured on excalidraw: best-case flow answer went from 5 reads / 131s to 0 reads / 73s with ~3-4 codegraph calls. Co-Authored-By: Claude Opus 4.7 (1M context) * chore(agent-eval): coverage probes, block-read hook, and design docs Dev-only validation harness for the dynamic-dispatch coverage work: - probe-{trace,node,context,explore}.mjs: drive MCP tools against a built index without a full agent run. - block-read-hook.sh + hook-settings.json: PreToolUse experiment that denies source Reads to measure codegraph sufficiency (forced Read-0). - docs/design/: callback-edge-synthesis + dynamic-dispatch-coverage playbook. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(resolution): bridge React boundaries — re-render + JSX child synthesis Closes the two dynamic-dispatch hops that broke "state mutation -> on-screen render" flows in React apps. Both are call-invisible (React-internal) but the code between them is fully call-connected, so one synthesized edge each makes the whole flow trace end-to-end. - reactRenderEdges: setState(...) re-runs the component's render(). For each class with a render method, link sibling methods calling this.setState -> render. The setState gate keeps it to React class components. - reactJsxChildEdges: a component that returns mounts Child. Link parent -> each capitalized JSX child, resolved to a component/function/class node (the resolution gate drops TS generics like Array). File-oriented, capped per parent. - Surface both in synthEdgeNote (trace + node trail) and context call-paths. Validated on excalidraw: trace(mutateElement, renderStaticScene) now connects in 6 hops across callback -> react-render -> jsx-child; 1 + 46 + 280 synthesized edges, node count stable (no explosion). Partial coverage is worse than none: react-render alone raised agent reads (revealed a hop it then drilled); adding the jsx hop closed the flow and dropped reads to 0-1. Co-Authored-By: Claude Opus 4.7 (1M context) * docs(claude): retrieval performance contract + coverage validation methodology Add a "Retrieval performance & dynamic-dispatch coverage" section so future changes/PRs don't silently regress agent retrieval: - the explore call+output budget table by repo size, with the monotonic-per-file invariant (the bug that started this: <5000 tier's 2500 < <500 tier's 3800). - the "partial coverage is worse than none" principle. - the required validation methodology (small/medium/large x >=3 prompts per language x framework; deterministic probes + agent A/B; pass bar). - the Excalidraw worked example (before/after numbers) as the template to replicate for every language/framework. Co-Authored-By: Claude Opus 4.7 (1M context) * docs(claude): use full n=4 measured range in Excalidraw worked example Best run 0 Read/3 cg/76s; typical ~1 Read/~4 cg; occasional over-drill outlier. Report the range, not a single run — run-to-run variance is large. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(mcp): steer flow questions to codegraph_trace first (tightens variance) codegraph_trace was absent from every steering intent map — all three guidance files routed "how does X reach Y" to context+explore, never to the trace tool. So agents used trace only by chance; when one didn't, it floundered reconstructing the path with search+callers (an 18-call run vs ~6 for trace-users). Add codegraph_trace to the intent map + a "flow" common chain (trace from->to FIRST = the whole path in one call, then ONE explore for bodies) across all three synced files (server-instructions, instructions-template, .cursor rule). Validated on excalidraw (hard "to the screen" Q, n=4 before/after): - call count 3-10 -> 3-4 (over-drill outlier gone) - duration 64-112s -> 51-74s - trace adoption 3/4 -> 4/4; search+callers path-reconstruction -> 0 - fully-clean runs (0 Read, 0 Grep) 0/4 -> 2/4; best 3 cg / 0 / 0 / 51s Co-Authored-By: Claude Opus 4.7 (1M context) * feat(resolution): Vue SFC template coverage (events + kebab components) The .vue extractor only parses