Skip to content

Graph comparison: imports join the ledger — causes by layer, validated numbers (#3641) - #3661

Merged
squid-protocol merged 1 commit into
mainfrom
claude/festive-fermat-kojuy7
Sep 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
claude/festive-fermat-kojuy7

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3641. Follows #3647, which put calls in the ledger; this puts imports into the same ledger and process.

What changes

  • tests/tools/graph_ledger.py: the ledger plumbing is now shared by call_graph_accuracy.py and import_graph_accuracy.py (shapes, credit-geometry validated numbers, rendering).

    • merge(results, symbol_type) refreshes one symbol type only. Otherwise tri_comparison_ledger.merge_and_save would mark every other entry of the language stale, including the call shapes when imports run.
  • import_graph_accuracy --buckets / --ledger: each disagreement gets a cause naming the layer that disagrees, using the engine's raw import tokens (file_data.raw_imports):

    • capture: capture-missed, capture-none-in-file;
    • resolution: token-unresolved, declaration-unresolved, same-name-other-path, target-not-imported;
    • truth side: truth-names-several-files, truth-sees-no-import-in-file.

    Raw and validated numbers are printed side by side. The --ci gate and baseline are unchanged.

  • graph-comparison-history.yml now also refreshes imports after merge. It fetches the pinned repos the same way graph-accuracy-audit.yml does, with the same 45-minute timeout. Its first run on main, for Graph comparison: reconcile calls like the tri-comparison — ledger, validated numbers, C8 (#3641) #3647, succeeded.

Ledger: 23 import shapes, 4 validated by reading source

All four are GitGalaxy faults, filed as #3660:

lang shape n verdict
dart capture-missed 35 missed: conditional-import alternatives if (dart.library.io) 'io_client.dart' (all 35 in the repo)
objective-c truth-names-several-files 18 missed: include/SDWebImage/*.h are symlinks to Core/*.h; the resolver sees two candidates and draws no edge
kotlin declaration-unresolved 17 missed: the imports name extension properties, which declared-name resolution doesn't index
solidity truth-sees-no-import-in-file 24 wrong: ../patched/…sol names a build-generated directory that isn't in the repo; the engine guesses a same-named file

Left open: Scala's 410 truth-names-several-files. These are wildcard and package imports (import io.circe._), where the parser's answer is a whole package. That needs a contract ruling on what edge such an import should draw.

With these verdicts, 9 of the 20 languages carry no *: 7 have no disagreements at all, and Objective-C and Dart are fully validated.

Verification

  • tests/tools/test_graph_ledger.py, new: import cause layers; the credit geometry moving validated numbers in both directions; one symbol type's merge never staling the other. With the existing tool tests, 29 pass.
  • Writing the tests caught a token-parser bug (..a.foo read foo as a file extension). It's fixed with an explicit list of source suffixes; after re-merging, no validated entry went stale.
  • import_graph_accuracy --ci OK (20 languages); call numbers are identical after the refactor.
  • ruff, format and dead-key audits clean; the workflow YAML parses.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q


Generated by Claude Code

…ed numbers (#3641)

- tests/tools/graph_ledger.py: the ledger plumbing, shared by
  call_graph_accuracy.py and import_graph_accuracy.py (shape groups,
  credit-geometry validated numbers, render). `merge(results, symbol_type)`
  refreshes one symbol type and restores the other's entries, which
  tri_comparison_ledger.merge_and_save would otherwise mark stale.
- import_graph_accuracy --buckets / --ledger: each FP/FN gets a cause naming
  the layer that disagrees -- capture (`capture-missed`), resolution
  (`token-unresolved`, `declaration-unresolved`, `same-name-other-path`),
  or the truth side (`truth-names-several-files`) -- using the engine's raw
  import tokens (file_data.raw_imports). Raw and validated numbers printed;
  the --ci gate and baseline are unchanged.
- Ledger: 23 import shapes, 4 validated by reading source, filed as #3660:
  dart conditional-import alternatives (35, capture), objective-c symlinked
  headers read as a second candidate (18), kotlin extension properties not
  indexed as declarations (17), solidity `../patched/` imports guessed onto
  a same-named file (24). Scala's 410 `truth-names-several-files` (wildcard
  and package imports) is left open for a contract ruling.
- graph-comparison-history.yml also refreshes imports (pinned repos fetched
  like graph-accuracy-audit.yml; 45 min like it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 4b1c74a into main Sep 25, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the claude/festive-fermat-kojuy7 branch September 25, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants