did-btcr2-js

ADR 064: FOSS In-Repo Coverage Reporting and a Dependency-Audit Gate

Status: Accepted

Date: 2026-07-02

Branch / PR: chore/monorepo-hygiene

References: ADR 058, ADR 023

Context

Continuous integration (.github/workflows/ci.yml) linted, built, built tests, and ran tests, but produced no coverage signal and ran no dependency-vulnerability check. Two gaps were worth closing:

  1. Coverage was invisible. Every package already runs c8 (V8 coverage) under its test script via a per-package .c8rc.json, but the reporters were cobertura and text only: the number scrolled past in the test log and nothing aggregated it across the ten packages or surfaced it anywhere durable.
  2. No dependency-audit gate. audit-ci was present as a root dev dependency but wired to nothing.

A hard constraint shapes the coverage decision: no third-party / SaaS coverage service may be used. Codecov, Coveralls, SonarCloud, Codacy and the like are out of scope; coverage data may not be uploaded off the repository. Whatever we build has to be fully FOSS and self-hosted.

A second fact shapes the audit decision. The production dependency tree currently carries a large transitive-vulnerability surface that originates almost entirely from one dependency, helia (the IPFS CAS stack). A pnpm audit of the production tree reports on the order of 28 high and 1 critical advisory, essentially all of them reached through helia > @ipshipyard/libp2p-auto-tls, helia > @libp2p/http-fetch > undici, and helia > @libp2p/webrtc > react-native-webrtc > react-native > react-devtools-core > shell-quote. These live several layers deep in libp2p’s graph; the method code cannot fix them, and no direct version bump resolves them. The single critical (shell-quote command injection, GHSA-w7jw-789q-3m8p) sits on the react-native code path, which is never loaded in this project’s node or browser usage. (This is the same helia weight that dominates the browser bundle; reducing that dependency is tracked separately.)

Decision

Coverage: aggregate c8 output into a committed badge and report, no external service

Dependency audit: gate on new criticals, with a documented baseline allowlist

Consequences

Rejected alternatives