Skip to content

import_graph_accuracy: measure matlab imports (Part of #3641) - #6663

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/3641-20261025T1902Z
Oct 25, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/3641-20261025T1902Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Part of #3641, step 2 (coverage sweep), imports half for matlab. Fortran was already measured on main (fortran-lang/fpm, 92.9% precision / 44.4% recall); this slice adds the remaining language of the pair.

Checklist: partial [c:bf495ed4] -- imports still unmeasured: apex, ada, css, html, dockerfile; matlab is measured but its engine recall is 0%

What

  • import_graph_accuracy.py: parser-side rule matlab_imports. Files are indexed by package and name (+a/+b/C.m = a.b.C, @C/C.m = class C; method files and private/ name nothing importable). import a.b.C is that file, import C.m the owner's file, import a.b.* a package (contract C7: no edge) unless a.b is a class (its file); several arguments per line scored; % and %{ %} comments blanked.
  • Corpus: petercorke/robotics-toolbox-matlab. Baseline row, graph comparison ledger shape and coverage chart regenerated; workflow subset IG1 gets matlab (the subsets test requires each language exactly once).
  • Tests: one rule test (package function, class folder, package vs class wildcard, member, multi-arg, external, comments, important = / import = decoys) plus the plan test rows.

Measured (real scan)

language repo resolvable imports engine edges precision recall
matlab robotics-toolbox-matlab 9 0 n/a 0.0% (9 FN)

The 9 are import ETS2.* / import ETS3.* in the unit tests (class static-member imports). The engine captures the token ETS2.* (raw_imports shows it) but resolves no edge. Open ledger shape, no verdict yet: not a claim. Matlab imports are rare in open source: of 12 MATLAB repos sampled (chebfun, nnv, llms-with-matlab, matlab-azure-services, MATLAB-Language-Server, statistics, climatedatastore, ...) this was the only one with an import that names a repo file; the rest import matlab.unittest.* / java.* (external) or repo packages by wildcard (no edge). n=9 is thin; hub overlap@10 0.80.

Needs the owner

.github/workflows/graph-accuracy-audit.yml (one word: matlab added to the IG1 subset) was edited without allow_workflows on the queue item. It cannot be dropped on its own: test_the_import_graph_subsets_cover_every_language_exactly_once fails unless every language in LANGS sits in exactly one subset. Owner: approve that one-line edit, or tell me to drop matlab from LANGS (which discards the slice).

Class / Sibling gaps

Class: import-graph coverage for tree-sitter-comparable languages not yet measured. Covered: powershell, tcl (#6527), groovy, fortran (already on main), matlab (here). Not covered, each needing its own rule, corpus repo and truth (no burned mainframe program touches any): apex, ada, css, html, dockerfile. Engine gaps found: (1) matlab import Class.* (class static-member import) gives no edge though the token is captured (all 9 FNs; engine resolver in network_risk_sensor/import resolution, needs @C/C.m and C.m class lookup, and +pkg function lookup for import pkg.f); (2) from #6527 and still open: tcl package require X -> package provide X file, powershell dot-source after assignment, extensionless tcl scripts. The matlab truth is small (9 statements, 2 distinct edges); a second corpus repo with in-repo import pkg.Class would firm it up and is a corpus-only follow-up.

Gates

pr_gates --fast 7/7. Graph tool tests, test_source_reads, test_sweep_plan, test_change_classifier pass (246). import_graph_accuracy.py matlab --ci OK. --ratchets not run: no engine, golden or ground-truth input changed. Baseline row, ledger shape and chart were produced from a single-language run merged in place (a full --regenerate needs every pinned repo fetched; other rows unchanged). Local ruff 0.17.1 wants to reflow two pre-existing lines on main (_cargo, a rust test); left untouched.

Lessons for agents

  • import_graph_accuracy.py --regenerate / --ledger refuse a language list: for one new language, run <lang> --buckets 5 --json F and merge the row with iga.BASELINE + iga.gl.merge(results, "import"); set IMPORT_GRAPH_CORPUS_PATH to a scratch dir and --fetch-only <lang> first.

🤖 Generated with Claude Code

Parser-side rule by package and name (+a/+b/C.m, @C/C.m), corpus
petercorke/robotics-toolbox-matlab, baseline, ledger and chart rows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 25, 2026 19:13
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 25, 2026 19:15
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot merged commit 7724ba3 into main Oct 25, 2026
74 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/3641-20261025T1902Z branch October 25, 2026 19:37
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