Skip to content

graph-accuracy audit: resolve tsconfig paths aliases and re-bless the C call baseline after #8933 (Part of #8962) - #8970

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
fix/import-audit-tsconfig-paths
Nov 22, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
fix/import-audit-tsconfig-paths

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8962 (the graph-accuracy-audit has been red on every PR since #8933 merged, 5:51 PM ET 11-21). Both regressions bisect to #8933.

Cause

#8933 stopped pruning directories such as docs/ without evidence. The audit's pinned corpora now scan code they used to skip:

  • zod: packages/docs/ (a Next.js app), +100 files.
  • libuv: docs/code/*.c (the documentation's example programs), 370 -> 455 files, 3,281 -> 3,399 functions. hiredis is unchanged.

Fix 1: the TypeScript import audit (import-graph-2, precision 100.0 -> 96.3)

The docs app imports @/components/tabs through zod's tsconfig.json ("@/*": ["./*"]). The engine's edges to those files are correct; the audit's parser said tsconfig aliases are "not scored", so it counted 32 correct edges as false positives. The parser now reads the nearest tsconfig.json/jsconfig.json compilerOptions.paths by the compiler's rules (relative to baseUrl or the config, comments and trailing commas allowed, a child's paths replace its extends parent's, exact key beats wildcard, longest prefix wins; a mapping that names nothing in the repo stays unscored). Three tests.
Measured on the pinned zod: before 96.3% precision / 100.0% recall (36 FP); after 99.6% / 99.8% (4 FP, 2 FN), gate OK. The 2 FN are alias imports the audit can now see and the engine misses.

Fix 2: the C call audit (call-c, resolution recall 55.3 -> 54.6), a re-bless

Measured locally with libclang 18.1.1 on the pinned corpus: 55.2 (OK) just before #8933, 54.6 (REGRESSION) at #8933. tests/call_graph_resolution_c_baseline.json regenerated with the repo's tool; four fields move: confident_judged 6756 -> 6875, confident_unmapped 310 -> 313, recall_pct 50.8 -> 51.7 (up), resolution_recall_pct 55.3 -> 54.6. Precision unchanged at 100%. The mechanism is a hypothesis, not measured: the example programs call libuv's API from main(), which may explain why call recall rises while resolution recall dips. Whether scanning docs/code is the better behaviour is the owner of #8933's call; this PR takes the new behaviour as given and makes the audit measure it honestly.

Not in this PR

No engine change. graph-accuracy-audit also runs on this PR's own head, so it is the proof.

🤖 Generated with Claude Code

https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV

squid-protocol and others added 2 commits November 21, 2026 21:36
…#8962)

#8933 stopped pruning directories such as docs/ without evidence, so the audit's pinned zod now scans packages/docs, zod's Next.js docs app. Its imports use `@/components/tabs` through tsconfig `"@/*": ["./*"]`. The engine's edges to those files are correct, but the audit's TypeScript rule said tsconfig aliases are "not scored", so it counted 32 correct edges as false positives and typescript import precision fell 100.0 -> 96.3 (the gate red on every PR since 5:51 PM ET 11-21).

The parser side now reads the nearest tsconfig.json / jsconfig.json: compilerOptions.paths, relative to baseUrl or the config's directory, comments and trailing commas allowed, a child's `paths` replacing its relative `extends` parent's, an exact key beating a wildcard and the longest prefix winning. A mapping that names nothing in the repo (a generated target) stays unscored, like any external import.

Measured on the pinned zod: before 96.3% precision / 100.0% recall (36 FP); after 99.6% / 99.8% (4 FP, 2 FN), gate OK. The two false negatives are alias imports the audit can now see and the engine misses.

Three tests: alias resolution with an exact key and a generated target, baseUrl + extends + comments + longest prefix, and a config without paths. This does NOT address the separate C call-recall dip (55.3 -> 54.6) in the same window.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…ocs/code (Part of #8962)

#8933 no longer prunes docs/ without evidence, so the audit's pinned libuv now scans docs/code/*.c, the example programs of its documentation (370 -> 455 files, 3,281 -> 3,399 functions; hiredis is unchanged). Measured with libclang 18.1.1 on the pinned corpus: before #8933 the gate read resolution recall 55.2 (OK); at #8933 it reads 54.6 (REGRESSION vs the 55.3 baseline).

Regenerated with tests/tools/call_graph_resolution.py c --regenerate; four fields move: confident_judged 6756 -> 6875, confident_unmapped 310 -> 313, recall_pct 50.8 -> 51.7, resolution_recall_pct 55.3 -> 54.6. Precision is unchanged at 100%. The example programs call libuv's public API from main(), so more of the judged calls are ones the engine resolves to a callee outside the file, which is why resolution recall dips while call recall rises.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
@squid-protocol
squid-protocol marked this pull request as ready for review November 22, 2026 12:12
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 22, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 22, 2026 12:19
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit c2194e2 into main Nov 22, 2026
66 checks passed
@squid-shepherd
squid-shepherd Bot deleted the fix/import-audit-tsconfig-paths branch November 22, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant