CAI Get a survey →

Compute it yourself

The reference implementation.

The scoring half of CAI is open. cai is the reference scorer in C# (Apache-2.0): it reads an evidence bundle, folds the lenses worst-first into the 0–100 CAI, and bands it — the same arithmetic the standard defines. Because the weights ship in the evidence, anyone can reproduce — or falsify — a published number with no access to the analyzer.

github.com/CanineCC/CAI →

What it is

One small repository, three projects:

  • Cai.Scoring — the library: the bands, the ten lenses, the evidence-bundle format, and the worst-first ordered-weighted fold.
  • Cai.Cli — the cai command-line tool (score and verify).
  • Cai.Tests — determinism, banding, the fold, and verify, so the reference stays honest.

It is the proof engine: Watchdog publishes a signed survey with its evidence → you run cai over that evidence → you get the identical score. The judgment is a service; the number is a fact you can check yourself.

Measuring a codebase into an evidence bundle is the analyzer's job (closed, the product). Scoring the bundle is open — that's this tool.

Run it

It needs only the .NET SDK and a clone of the repo — no keys, no network:

git clone https://github.com/CanineCC/CAI
cd CAI

dotnet test Cai.slnx                                                     # the scorer's own tests
dotnet run --project src/Cai.Cli -- score  examples/evidence.sample.json
dotnet run --project src/Cai.Cli -- verify examples/evidence.sample.json

Builds to a cai binary; the usage below shows it as cai.

Usage

cai score <evidence.json>

Fold an evidence bundle into the CAI + the per-lens roll-up.

$ cai score examples/evidence.sample.json

CAI 70.3 (Strong)  ·  rubric rubric-2026.08.15

  lens                    score band          dims   weight   contrib
  maturity                 65.1 Adequate          2    0.457     29.77
  securityCompliance       72.0 Strong            1    0.251     18.10
  productionReadiness      74.6 Strong            3    0.138     10.31
  architecture             77.3 Strong            1    0.076      5.88
  …

cai verify <evidence.json> [--expect N]

Reproduce a published headline. The bundle carries headlineScore; or pass --expect N to check against a number you were told.

$ cai verify examples/evidence.sample.json
✓ reproduced: CAI 70 (Strong) under rubric rubric-2026.08.15 (claimed 70, Δ0.01)

$ cai verify examples/evidence.sample.json --expect 90
✗ MISMATCH: evidence folds to 70.31 but the bundle claims 90.00 (Δ19.69 > 0.50)

Exit codes

  • 0 — scored, or verified and reproduced.
  • 1 — verify mismatch (the claimed number does not reproduce). Wire it into CI.
  • 2 — usage or I/O error (missing file, unparseable bundle).

Or don't install anything

The same fold runs in your browser — paste a bundle into the calculator (WASM, nothing leaves your machine, no rate limit), or call the JSON API. The algorithm itself is documented on the spec; Verify walks the reproduce-a-published-number flow end to end.

Free to copy, protected to call it CAI: the code is Apache-2.0; only spec-reproducible results may carry the CAI mark (see the badge policy).