Skip to content

v3.12.0

Latest

Choose a tag to compare

@carlos-alm carlos-alm released this 10 Jun 07:37
· 25 commits to main since this release
c09bd21

Phase 8 Analysis Depth lands in full, plus a 30-technique JavaScript/TypeScript resolution sweep. Sub-phases 8.1 through 8.6 are now complete, with 8.3 substantially complete (one stretch-goal item — full allocation-site abstraction with fixed-point iteration — deferred to a future release): TypeScript compiler API type resolution (typescriptResolver opt-in in .codegraphrc.json) upgrades confidence-0.7 heuristic edges to compiler-verified 1.0; inter-procedural return-type propagation resolves method chains and factory patterns up to 3 hops; field-based points-to analysis (Phases 8.3 through 8.3f) covers callbacks, event handlers, parameter flows, object property writes, and object destructuring rest parameters in both WASM and native engines; barrel re-export chain resolution traces symbols through index.ts re-exports to their actual declaration files; CHA+RTA dynamic dispatch resolves interface method calls to all instantiated concrete implementations; and Phase 8.6 adds a byTechnique breakdown to codegraph stats --json showing edges attributed to each resolver technique. Beyond the Phase 8 work, a parallel accuracy sweep adds resolution for prototype-based method calls, Object.defineProperty accessor this-dispatch, super.method() dispatch via class expressions and static blocks, .call/.apply/.bind receiver rebinding, for-of/Set/Array.from iteration callbacks, inline-array spread call edges, and constructor-assigned property types. C# call graphs improve with same-class bare static call resolution and var-typed local type inference. Six native engine parity issues in the incremental rebuild path are fixed. Caller coverage for real-world TypeScript projects is substantially higher after this release. Note: most resolver improvements appear under Bug Fixes below — they used fix: commit prefixes because they corrected missing edges in existing resolution logic rather than introducing entirely new CLI capabilities.

Features

  • stats: add byTechnique breakdown to codegraph statscodegraph stats --json now includes caller_coverage.byTechnique with edge counts per resolution technique (ts-native, points-to); displayed in human-readable stats output under the caller coverage line; DB migration v17 adds technique column to edges table (#1303)
  • config: new typescriptResolver option in .codegraphrc.json — set "build": { "typescriptResolver": true } to enable the TypeScript compiler API enrichment pass; compiler-verified edges (confidence 1.0) replace heuristic typeMap values for factory calls, generic constructors, and other patterns tree-sitter can't resolve alone (#1278)

Bug Fixes

  • resolver: TypeScript-native type resolution via ts.createProgram + type checker (Phase 8.1) — upgrades heuristic typeMap entries to compiler-verified confidence 1.0 for .ts/.tsx files; resolves container.get<MyService>()MyService.doThing() class of edges that tree-sitter cannot see (#1278)
  • resolver: inter-procedural return-type propagation (Phase 8.2) — const x = createUser() propagates return type to x for downstream method-call resolution; chain propagation up to 3 hops with confidence decay (1.0 → 0.9 → 0.8 → 0.7); analysis.typePropagationDepth config knob (#1279)
  • resolver: field-based points-to analysis for higher-order calls (Phase 8.3) — tracks callback assignments, event-handler registrations, and strategy-pattern wiring; resolves app.use(handler) and events.on('click', handler) call edges (#1289)
  • resolver: cross-module points-to propagation (Phase 8.3 + 8.3b) — WASM + native parity; inter-module flows through import edges now propagate type bindings across file boundaries (#1296)
  • resolver: parameter-flow tracking in points-to analysis (Phase 8.3c) — function parameters tracked through the call graph; typed parameters seed the receiver typeMap for downstream method resolution (#1294, #1308)
  • resolver: object property write tracking in points-to analysis (Phase 8.3d) — obj.handler = fn assignments tracked so obj.handler() resolves to the assigned function (#1295)
  • resolver: constructor-assigned property types for receiver-typed resolution (JS/TS) — this.svc = new Service() in constructors seeds the typeMap so this.svc.call() resolves to Service.call (#1314)
  • resolver: object destructuring rest parameter resolution (Phase 8.3f) — const { a, ...rest } = obj; rest.method() now resolves method via the rest binding's source type; WASM + native parity (#1355)
  • resolver: barrel re-export chain resolution — imports via components/index.ts barrel files now trace to the actual declaration file rather than mapping to the barrel; both WASM buildImportedNamesMap and buildBarrelEdges updated (Phase 8.4) (#1298, #1302)
  • resolver: CHA + RTA enhanced dynamic dispatch (Phase 8.5) — interface method calls emit edges to all instantiated concrete implementations; new X() calls tracked for RTA filtering; this.method() resolved through the class's own method table and parent hierarchy (#1302)
  • resolver: prototype-based method calls, func-prop this-dispatch, and spread/iteration callback resolution — Dog.prototype.bark = function() definitions extracted; fn.method = function(){ this.other() } this-dispatch wired; object-rest param dispatch (#1331)
  • resolver: Object.defineProperty accessor this-dispatch — this.method() calls inside defineProperty getter/setter callbacks resolve through the enclosing class (#1346, #1351)
  • resolver: calls through Object.defineProperty / defineProperties / Object.create — accessor definitions emit call edges to the object's own prototype chain (#1328)
  • resolver: generator functions extracted as definitions (JS/TS) — function* gen() and async function* gen() now emit definition nodes so callers that iterate them appear in the call graph (#1333)
  • resolver: super.method() dispatch via class expression, static block, and field def — super.f() in class bodies, class Foo extends Bar { static { super.f() } }, and field-level assignments now resolve to the parent class method (#1399)
  • resolver: .call()/.apply() this-rebinding — fn.call(obj, ...) and fn.apply(obj, [...]) patterns now resolve the call to fn with obj's type as receiver (#1405)
  • resolver: Function.bind/call/apply receiver-typed resolution — bound = fn.bind(obj) seeds the typeMap so bound() resolves as a method call on obj's type (#1330)
  • resolver: for-of, Set, and Array.from iteration-callback edges — for (const x of items) x.method() and new Set([...]).forEach(item => item.method()) patterns emit call edges (#1397)
  • resolver: inline-array spread call edges — fn(...[a, b, c]) unwraps the spread array and emits call edges to each element's method (#1394)
  • extractor: inline-new expression recognized as receiver type in extractReceiverName(new Dog()).bark() directly infers Dog as the receiver type without a prior assignment (#1415)
  • resolver: this.prop typeMap key scoped to enclosing class — prevents false edges in multi-class files where two classes define a property of the same name (#1382)
  • parity: C# same-class bare static calls resolved + confidence filter for static receiver fallback — MyClass.StaticMethod() from within the same class now resolves; heuristic static-receiver fallback gated on confidence ≥ 0.75 to reduce false positives (#1417, #1427)
  • parity: C# var-typed local types inferred from new-expression initializers — var svc = new MyService() now seeds the typeMap with MyService for downstream method-call resolution (#1424)
  • parity: C# static receiver calls in WASM engine — static method resolution aligned with the native engine for same-class and qualified receiver patterns (#1395)
  • native: extract parameters for prototype method definitions — Dog.prototype.bark = function(name) {} now emits name as a parameter node in the native engine (#1345)
  • native: complexity/CFG computed for prototype method definitions — Rust engine now calculates cyclomatic complexity and control-flow graph for prototype-assigned functions (#1347)
  • native: persist this/super dispatch via hybrid WASM post-pass — when native engine cannot persist this/super typeMap entries inline, a WASM supplementary pass writes them to the DB (#1337)
  • native: return-type and call-assignment extraction in Rust engine — returnTypeMap and callAssignments now extracted by the Rust extractor, closing the parity gap with WASM for inter-procedural type propagation (#1283)
  • native: prefer local dev binary over npm package in load order — CODEGRAPH_NATIVE_PATH env var and local codegraph-core.node are now checked before falling back to the npm optional package (#1389)
  • incremental: seed callee::restName typeMap keys and pass callerName in buildCallEdges — aligns incremental call resolver with the full-build authoritative path for Phase 8.3f rest-param dispatch (#1404)
  • incremental: port same-class this.method() and defineProperty fallbacks into buildCallEdges — incremental rebuilds now match full-build resolution for this.-dispatch and Object.defineProperty accessor patterns (#1401)
  • resolver: qualified callerName mismatch in class-scoped typeMap lookup — ClassName.method keys now match consistently across full and incremental build paths (#1403)
  • resolver: callerName parity + func-prop cross-file edges + O(n) Phase 8.3f algorithm — fixes qualified callerName dispatch on native path and makes rest-param post-pass linear-time (#1383)
  • resolver: Phase 8.3f typeMap key scoped by callee to avoid same-name rest-param collision — two different rest parameters in the same file with the same property name no longer share the same typeMap key (#1368)
  • edge_builder: same-file this-dispatch fallback restricted to caller's own class — prevents false this.method() edges being emitted to methods of other classes defined in the same file (#1343)
  • wasm-worker: wire paramBindings, returnTypeMap, callAssignments through worker boundary — new SerializedExtractorOutput fields propagate through the WASM worker thread protocol so type-propagation data isn't silently dropped (#1352)
  • extractor: narrow .call/.apply/.bind skip in extractCallbackReferenceCalls — only skip the bound function itself, not call-sites inside its body (#1420)

Refactors

  • extractor: align typeMapWalk currentClass reset with returnTypeMapWalk — removes a latent divergence between the two AST walkers that could cause stale class context in multi-class files (#1408)

Chores

  • deps-dev: bump vitest from 4.1.7 to 4.1.8 (#1367, #1366)
  • deps-dev: bump tree-sitter-erlang from 0.0.0 to 0.19 (#1365)
  • deps-dev: bump tree-sitter-gleam (#1364)
  • deps: bump anthropics/claude-code-action from 0.0.63 to 1.0.139 (#1363)