Repository navigation
Description
Summary
code-tidying:audit-dead-code 0.23.2 can report a clean result when some source files were covered
by no lane. A run over melodic-software/.github (3 .sh files, 2 standalone .mjs files, no
package.json) ended with Summary total: files=0 T1=0 T2=0 T3=0 and the Note "no candidates from
the lanes that ran". The playbooks:repo-sweep consumer recorded that as "no findings". The two
.mjs files appear on no output line, not even as a count. That breaks SKILL.md:70-71 (Lane lines
make a clean report "a claim rather than an absence") and SKILL.md:86 (a scan of nothing is labeled
as one).
Goal: every tracked source file is accounted for on every run, either covered by a lane that ran or
listed as uncovered with the reason. A report reads clean only when nothing is uncovered.
scan: is scripts/dead-code-scan.sh, lib: is scripts/lib/dead-code-shapes.sh.
Fix
- Files routed to a skipped lane are not counted.
lib:64classifies.js/.mjs/.cjsas
ts, andscan:222queues them for knip. With nopackage.jsonroot,scan:351-354emits
state=skippedwith a hard-codedfiles=0. The gopls lane does the same atscan:513-515. Files
in theotherclass are dropped without a count (lib:69,scan:226). The grep lane's skip path
already reports its real input count (scan:616). Report real input counts on every lane line. - The "scan of nothing" Note depends only on whether any lane ran (
scan:778-783,
lanes_ran == 0). One lane running on 3.shfiles hid the 2 uncovered.mjsfiles, while
--lane knip .github/scriptsover the same files printed "a scan of nothing". Choose the Note
from the uncovered count too. - Add
Summary coverage: covered=N uncovered=Mand aNote:listing each uncovered source file
with its reason: no lane for the language, no manifest root, or tool not installed. files=means files scanned on Lane lines and files with findings onSummary total:
(scan:751). Rename the summary key tofiles-with-findings=.- SKILL.md:82 defines
skippedas a binary problem, but the no-manifest paths (scan:353,
scan:514) also use it. Either widen the definition or add a distinct state. - Test: add a
dead-code-scan.test.shcase with.sh+.mjsand nopackage.json. Every
existing knip fixture ships apackage.json. Add a second case with apackage.jsonroot plus a
standalone.mjsoutside it. That case was read fromscan:272-312andscan:356-366, not
reproduced.
Verification
- The scan re-ran read-only on the same worktree and printed byte-identical output.
- Two separate readers checked every citation above against the 0.23.2 source, and all matched.
- Done when the no-
package.jsonfixture reportsuncovered=2, lists both files, and does not
print the clean-result Note.
Related
- Found in a
playbooks:repo-sweephygiene sweep ofmelodic-software/.github(PR chore(skill-quality): harden static checker + record terminal retrofit scope #153, step
dead-code). - Sibling issues from the same audit: JS/TS outside a package.json root, language-agnostic
unreferenced-file detection, missing-tool path, doc accuracy.
Activity
feat(code-tidying): detect unreferenced source files in audit-dead-co…
kyle-sexton commentedon Sep 29, 2026
This comes from the 2026-09-29 audit of the Cursor agent run.
The follow-up that PR #5072 disclosed is delivered in PR #5327 (draft, not yet merged;
Closes #4521). A degraded lane's files are now listed uncovered with the reasonlane degraded, and the clean-result note cannot print while any lane degraded oruncoveredis above zero. The fixture "degraded-mixed" has a degraded knip root beside a grep lane that ran: it printsSummary coverage: covered=1 uncovered=1,Note: uncovered ts-orphan.ts — lane degraded, and noNote: no candidates from the lanes that ran. This issue is already closed; no reopen needed.fix(code-tidying): account for every source file, scan standalone JS/…