Build journal

The gate that could not fail

Rekhon2 min read

My coverage gate was green from the first build. For six days it had no rules, so it would have passed at 0%.

CIWar story

Compiled from the repository’s decision records and changelog rather than written as a first-person account. The reasoning is the project’s; the summarising is editorial. The record itself is linked at the end.

Rekhon's CLAUDE.md promised line coverage of at least 85%, and 100% for the money maths. The build ran koverVerify and it was green. Then a governance audit, finding G-01, looked at what koverVerify was checking. Kover had been applied with zero rules, so it passed at any coverage, including 0%.

Kover went in with the Gradle skeleton on 19 July 2026. The rules arrived on 25 July. For six days the gate could not fail, and nothing on the screen said so.

Worse than having no gate

A gate that cannot fail is worse than no gate: CI goes green and reviewers believe it checked something.
ProjectExtensions.kt

A missing check at least looks missing. A check that passes everything looks like protection, so nobody goes looking, and the promise in CLAUDE.md read as enforced while it was a no-op.

What it checks now

configureCoverage() in the cfo.kotlin.library convention plugin gave koverVerify its first rules: line coverage of at least 85% on the pure-Kotlin modules, and 100% on :core:model, where Money lives. Because the floor sits in the convention plugin, a new module gets it by default and cannot leave it out by forgetting.

ProjectExtensions.ktKotlin
internal fun Project.configureCoverage() {
    val minimum = if (path == MONEY_MODULE_PATH) FULL_COVERAGE else MIN_MODULE_COVERAGE
    extensions.configure<KoverProjectExtension> {
        reports {
            verify {
                rule("$path line coverage must be >= $minimum% (CLAUDE.md §4)") {
                    minBound(minimum, CoverageUnit.LINE, AggregationType.COVERED_PERCENTAGE)
                }
            }
        }
    }
}

Proving it bites

The fix was not trusted because it existed. Before it merged, it was made to fail twice: an impossible bound of 101% failed the build, and deleting one test dropped the measurement to 77.5% and failed it again.

The next issue proved it on a second module. :core:common measured 89.66% before its gaps were closed, so the floor was measuring code and not passing by default. It also showed that Kover counts testFixtures classes, so published test fixtures need tests of their own.

The habit outlasted the bug. When later work added gates, the changelog records them made red on purpose first, a one-point threshold change for the drift test and temporarily uncovered code for koverVerify, under the heading "Gates proven to fail before being trusted", with G-01 named as the reason.