Skip to content

coverfloor: a coverage floor of what CI runs, reading mutate's lane marker - #131

Merged
aledbf merged 1 commit into
mainfrom
coverfloor
Nov 22, 2026
Merged

aledbf merged 1 commit into
mainfrom
coverfloor

Conversation

@aledbf

@aledbf aledbf commented Nov 22, 2026

Copy link
Copy Markdown
Member

Why

Each spin-stack gate should have one definition, not copies that drift. spin-machine's task test holds coverage to a floor with internal/coverfloor, which leaves functions marked mutate-lane: out of the share. It copied mutate's laneMarker, which is internal to go-tools and could not be imported (spin-stack/machine#496).

What

  • cmd/coverfloor, beside mutate: coverfloor FLOOR coverage.out, run from the module root. Exit 0 at or above the floor, 1 below, 2 when it cannot tell. It compares the exact share, since go tool cover -func rounds (spin-machine's 79.96% read as 80.0 and passed a floor of 80).
  • mutate.LaneFunctions(path) is the one place the lane rule is read for both tools. It goes through heldByLane, so a marker that names no test, or a test that is not there, fails the floor as it fails mutate. The copy only looked for the string.
  • go-tools' own task test uses it in place of the awk over -func's rounded total. The stale "today's 61.4%" comment now gives the measured 85.61%. The floor stays 60.
  • Site page coverfloor, its nav entry, a README row, and a pointer from mutate's lane row.

Evidence

  • On spin-machine's coverage.out at origin/main 77a36c8, the copy and this command print the same line byte for byte: coverage: 93.38% of what CI runs (floor 93%); 80.66% with the 1606 statements only a lane runs.
  • Locally, task lint is clean and task mutate reports 49 refused and 0 survived. task test prints coverage: 85.61% of what CI runs (floor 60%); 84.67% with the 88 statements only a lane runs.

Once this is released, spin-machine's Taskfile calls coverfloor from the PATH go tool task sets up and deletes its copy. That needs no go.mod bump, because cmd/task puts the latest release's commands on PATH.

🤖 Generated with Claude Code

…arker

spin-machine held its coverage to a floor with internal/coverfloor, which
leaves functions marked mutate-lane out of the share because only a test
needing root and KVM runs them. It copied mutate's laneMarker, which is
internal here and could not be imported, so the two rules could drift
(spin-stack/machine#496).

coverfloor is that command beside mutate. It asks mutate.LaneFunctions,
which reads each function's doc comment with heldByLane, so a marker
naming no test, or a test that is not there, fails the floor as it fails
mutate. It compares the exact share: go tool cover -func rounds, and read
spin-machine's 79.96% as 80.0.

go-tools' own task test is held to it, replacing the awk over -func's
rounded total. Its output on spin-machine's coverage.out is byte for byte
the copy's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 74157b1 into main Nov 22, 2026
3 checks passed
@aledbf
aledbf deleted the coverfloor branch November 22, 2026 12:56
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.

1 participant