Skip to content

CMBF Metrics

A verification number is only worth what its reproducibility is worth. So the four CMBF instruments ship as pure, versioned functions (cmbf-metric/v1 in packages/core/src/cmbf/metrics.ts) with a committed golden file diffed in CI: same inputs produce byte-identical output, or the build fails. This page states the math; the repo states the implementation; the harness states the truth.

Terminal window
ctxbrew cmbf score <project> --format json
Metric Question it answers Formula (v1) Scale
drift-score How true is the brewed knowledge right now? Σ (wᵢ/Σw)·sᵢ over ran signals; weights evidence 0.35, freshness 0.25, cbt 0.15, validators 0.15, ledger 0.10 0–100
completeness-ratio How much of the model is claimed and verified? mean(req, agg, story); zero-total sub-ratios excluded 0–1
coverage-closure Does every claimed spec node have its test? synced/(synced+ghosts); orphans counted, not subtracted (v1) 0–1
gate-pass-rate Do the live-state gates hold? gates_passed/gates_evaluated, policy blockOn=[error] 0–1

Overall = unweighted mean of the available instruments, 0–100: green ≥ 80 · amber ≥ 50 · red below · unknown when nothing ran.

The rules that make the numbers mean something

Section titled “The rules that make the numbers mean something”
  • Missing input → null + a named warning. Never a guess. An instrument that cannot run reports exactly that, in order, in the scorecard’s warnings array. A score would rather say nothing than manufacture a number — the same posture as the Drift Score’s “no signal”.
  • Versioned or it didn’t happen. Formulas are stamped cmbf-metric/v1, the output shape cmbf-scorecard/v1. Math changes re-version; nothing drifts silently under an old stamp.
  • Delegation, not duplication. Each instrument delegates to the canonical implementation it scores (drift/score.ts, completeness/tracker.ts, traceability/coverage-closure.ts, drift/live-state/run.ts) — one source of truth per instrument.
  • Pure functions. No I/O, no clock, no model calls inside the math. Sweep timestamps never enter the output, which is why --format json is byte-deterministic.

The committed fixture project (3 aggregates, 4 requirements, 2 generated tests, 1 ghost, 1 orphan, 2 passing gates) scores 81.2/100 · green. That exact JSON lives in the repo as a golden file and is rediffed on every pipeline run — the CI badge artifact reads CMBF | 81.2/100 · green only while the math still reproduces.

Threats to validity — proxies, not pass/fail truth; the missing-input asymmetry in the mean; judgment-pinned weights and grade cuts; dogfood status — are documented in the methodology paper (docs/research/2026-09-cmbf-methodology.md). Where measurement does not exist, the scorecard says null.