fix(coverage): record a fully-carried baseline when a main run measures nothing#21
Merged
Merged
Conversation
…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
force-pushed
the
feature/vulture-inselberg
branch
from
July 14, 2026 13:27
486c5dd to
ddc0cb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andbulwark coverageearly-returnedno coverage measuredbefore 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 measuredis 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 anorigin/mainstill get the friendly message instead of a merge-base error.Testing
Test-first:
TestCoverageOnMainRecordsFullyCarriedBaselineWhenNothingMeasured— a full end-to-end git fixture (origin withmain+bulwark-state, docs-only HEAD == origin/main,--tests=skipwith 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 onbulwark-state. Fullgo test -race ./...,go vet,gofmt,golangci-lintclean.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