Repository navigation
Description
This was generated by AI during a post-use interview of the skill.
Parent
Refs #3768 (code-metrics 0.1.0 follow-ups, from PR #3766).
What to build
audit-coverage calls the complexity sibling to get function ranges for CRAP. When that sibling's collector fails, two things go wrong in the coverage report at once, and both contradict the skill body.
The crap row hides the collector failure. join.py already has a branch that reports cyclomatic collector <status>: <reason> on the <lane>/crap row. It sits behind elif status != "ok", where status is the lane's coverage status. Any lane whose coverage is partial, which is the normal case because test files and excluded sources rarely all appear in one artifact, takes the partial branch first and the collector reason is never reached. The row then reads partial, 11 of 20 scope files present in the artifacts with collector lcov, and the summary says Functions: 0 with no explanation. The skill body promises unavailable naming the collector's own reason.
Exit 3 has no visible cause. The wrapper propagates the sibling's exit 3 and the skill body says the collector's stderr lands in the run table. Observed on 2026-09-08 in this repository with eslint on PATH and no eslint.config.js under plugins/miro: exit 3, empty stderr, a run table with no mention of eslint, and a markdown report that reads as a successful partial run. The cause was only visible by running audit-complexity separately.
Fix both:
- Reorder the crap-row branches so a complexity collector that ran and failed, or did not resolve, is named on the crap row regardless of the coverage status. The coverage row keeps its own partial reason; the two rows answer different questions.
- When the document's exit is 3, say so in the markdown: one line in the summary naming the lane and collector that failed, so a reader who only sees the markdown knows why there are no function rows.
Acceptance criteria
- [unwanted-behaviour] IF a lane's cyclomatic collector fails or does not resolve, THEN that lane's
craprun row isunavailableand its reason names the collector and its reason, whether the lane's coverage row isok,partial, orunavailable. - [unwanted-behaviour] IF the run exits 3, THEN the markdown summary carries one line naming the lane and collector that produced the exit, and the JSON
runrows carry the same reason. - A lane whose coverage is partial and whose complexity collector succeeded is unchanged.
- A test covers the partial-coverage plus failed-collector case; that combination is the one that reproduced the defect and it currently has no coverage.
- The
audit-coverageskill body's "Reading the numbers" and "Gotchas" sections describe the behavior as shipped. -
scripts/affected-tests.sh --runselects and passes the suites mapped to the changed files.
Out of scope
- Changing when the complexity sibling exits 3.
- Making the coverage skill exit 0 where it exits 3 today.
Blocked by
None. Can start immediately.
Activity
fix(code-metrics): name a failed cyclomatic collector on the crap row…