accuracy(Lua): measure import graph accuracy and close gaps below 90%
Part of #237.
Starting estimate: 50-70% recall. This is an unmeasured guess.
Measure
Run codemap on real Lua repositories at pinned commits and compare it to ground truth.
- Suggested ground truth: Manual sample of require calls.
- Report: recall, precision, and whether the coverage status was honest for each file.
Likely gaps to check
require with package.path, dotted module names.
Done when
- Repositories, commits, method and numbers are recorded here.
- Each miss has a root cause.
- Recall is at or above 90%, or the remaining gap is one codemap cannot close and its coverage status says so.
codemap 4.6.3 import graph accuracy: Lua (#246)
Repos (shallow clones, never executed; only includes lua):
- nvim-telescope/telescope.nvim @ 40aedd8a68c78a656a10a8d62d80c54af59420fb (77 .lua, below the 100 floor, noted)
- Kong/kong @ 21032122ab80c973f368f6bc539f53985e7164e8 (1327 .lua)
Method (lua not installed): SAMPLE of 40 files per repo (seeded shuf over lua/ and kong/). GT = regex over require string literals (both require("m") and require "m") after stripping comments, module dots -> path, resolved to lua/--importers scan (51 files). Kong = --importers only on the 49 GT target files (full scan was too slow), so Kong precision is NOT measured.
| repo | GT edges (sample) | codemap edges from sample | true pos | recall | precision | coverage_status |
|---|---|---|---|---|---|---|
| telescope | 134 | 29 | 25 | 18.7% | 86.2% (4 FP) | complete on 51/51 |
| kong | 86 | 50 (only to GT targets) | 50 | 58.1% | not measured | complete on all queried |
Honesty: all complete, yet 109 of 134 telescope edges and 36 of 86 kong edges are missing. Worst case.
Root causes ranked by edges lost:
- Parenless string-call
require "mod"is not matched. scanner/sg-rules/lua.yml pattern isrequire($$$)only. Example: lua/telescope/actions/history.lua:3local utils = require "telescope.utils". 94 of 109 telescope misses, all 36 Kong misses (kong/api/api_helpers.lua:1,6,7,8). Fix: small (add a function_call pattern with string argument). - 15 telescope misses where
require("x")is present and the raw import is even listed (init.lua:1503require("telescope.actions.generate").refine(...), all inside function bodies or chained), yet no edge. Cause not diagnosed; resolver or dedup suspected (inference). Fix: unknown, medium. - 4 false edges: module
telescopesuffix-matches plugin/telescope.lua (lua/telescope/command.lua, health.lua, builtin/__internal.lua), plus one self-edge pickers.lua. Fix: small to medium (resolve against lua/ root first, drop self). - Coverage honesty:
completethroughout. Fix: small.
Measured with codemap 4.6.3. Sampled numbers are samples, not a census.
Released in v4.6.4. Recall / precision: Kong .995 / .995, telescope .973 / 1.000. These were measured on the previous main; their edge sets did not change in the final fixes.