did-btcr2-js

ADR 084: Publish the Coverage Badge from CI to a Dedicated Branch

Status: Accepted

Date: 2026-07-16

Branch / PR: chore/ci-badge-and-wallet-send

References: ADR 064

Context

ADR 064 introduced FOSS, in-repo coverage reporting: every package’s c8 output is aggregated by scripts/coverage-report.mjs into a self-rendered SVG badge and a COVERAGE.md table, with no third-party coverage service involved. It deliberately made regeneration a human-run step: the badge and report were normal tracked files on main, refreshed by whoever ran pnpm coverage, and CI never committed anything. The accepted consequence was drift: the badge only moved when an author remembered to regenerate it.

That drift turned out to be the norm, not the exception. CI already computes the real number on every push (the coverage:report step feeds the job summary), while the badge on main shows whatever the last manual regeneration happened to capture. A badge that is routinely stale is worse than no badge: it reports a number nobody is maintaining as if it were current. The requirement is now: the badge must reflect every CI run on main, automatically.

The constraints from ADR 064 still stand and are not revisited here: no SaaS coverage service, no badge-rendering service, the badge stays a locally generated SVG, and main’s history stays human-authored (no automated commits interleaved with curated, squash-rebased work).

Decision

CI publishes the badge and report to a dedicated ci-badges branch

What this supersedes, and what stands

This ADR supersedes exactly one element of ADR 064: “regeneration is a committed, human-run step, not a CI push” and the accepted badge-drift consequence that came with it. It does so while honoring the reasons that decision was made: main still contains no automated commits (the bot writes only to a disposable side branch), and the loop-avoidance complexity that ADR 064 declined to take on is addressed by the platform itself plus a one-line guard. Everything else in ADR 064 stands unchanged: the aggregation script, the self-rendered SVG, the no-SaaS constraint, the per-package reporters, report-only coverage with no threshold gate, and the dependency-audit gate.

Consequences

Rejected alternatives