Skip to content

fix(coverage): record a fully-carried baseline when a main run measures nothing#21

Merged
pedromvgomes merged 1 commit into
mainfrom
feature/vulture-inselberg
Jul 14, 2026
Merged

fix(coverage): record a fully-carried baseline when a main run measures nothing#21
pedromvgomes merged 1 commit into
mainfrom
feature/vulture-inselberg

Conversation

@pedromvgomes

Copy link
Copy Markdown
Contributor

Problem

wardnet/wardnet#899 showed [NEW] rust / [NEW] typescript (no baseline yet) — the gate enforcing nothing. Root cause: its merge-base (f9b30226) is a docs-only main commit. On such a push nothing is measured, and bulwark coverage early-returned no coverage measured before the record path, so that main commit got no baseline at all. Every PR based on it then hits a cache miss, recomputes nothing in the bare worktree, and reports everything [NEW] — an open door for PRs to skip the gate. (On wardnet the whole Coverage workflow is skipped for docs-only pushes, so the PR-side cache-miss carry-forward from #20 is the healing mechanism there; this PR closes the remaining bulwark-side hole for consumers where the main run does execute but measures nothing.)

Fix

The record-on-main path now runs before the empty-report bailout. A main run that measured nothing records a fully-carried baseline (every detected language filled from the nearest prior baseline via PriorBaselines); no coverage measured is only printed when there is truly nothing to record — nothing measured and no priors to carry. Merge-base/HEAD resolution is lenient so repos without an origin/main still get the friendly message instead of a merge-base error.

Testing

Test-first: TestCoverageOnMainRecordsFullyCarriedBaselineWhenNothingMeasured — a full end-to-end git fixture (origin with main + bulwark-state, docs-only HEAD == origin/main, --tests=skip with no reports) that failed on the old code with exactly #899's output ("no coverage measured", nothing recorded) and now asserts the carried baseline lands on bulwark-state. Full go test -race ./..., go vet, gofmt, golangci-lint clean.

Merge Commit Message

fix(coverage): record a fully-carried baseline when a main run measures nothing (docs-only merges no longer leave baseline-less main commits)

https://claude.ai/code/session_01QMTWVM4pUB4xy6F6P9wWYA

…es nothing

A docs-only merge to main measures nothing: every coverage producer is
path-filtered away, and --tests=skip finds no reports. The old code
early-returned "no coverage measured" before the record path, leaving
that main commit with no baseline at all — so the first PR against it
recomputed nothing in the bare worktree, reported every language as
[NEW], and gated on nothing (wardnet/wardnet#899).

The record-on-main path now runs before the empty-report bailout: the
carry-forward fills every detected language from the nearest prior
baseline, so a nothing-measured main run still records a full baseline.
"no coverage measured" is only printed when there is truly nothing to
record — nothing measured and no priors to carry. Merge-base/HEAD
resolution is now lenient so a repo with no origin/main still gets the
message instead of a merge-base error.

Claude-Session: https://claude.ai/code/session_01QMTWVM4pUB4xy6F6P9wWYA
@pedromvgomes
pedromvgomes force-pushed the feature/vulture-inselberg branch from 486c5dd to ddc0cb8 Compare July 14, 2026 13:27
@pedromvgomes
pedromvgomes merged commit c2e4999 into main Jul 14, 2026
4 checks passed
@pedromvgomes
pedromvgomes deleted the feature/vulture-inselberg branch July 14, 2026 13:32
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