The standard
How the CAI is computed.
The Code Assurance Index is one number between 0 and 100. It is built from ten lenses, each a broad view of a codebase such as how the code reads, how it is put together, or how it is secured. Every lens carries a score of its own, and this page sets out how those ten become the headline. The rules doing that work are the rubric, and every score names the version of the rubric it was worked out under.
The roll-up
Every step of the roll-up is visible.
A lens score is built from the individual measurements taken inside that lens, and the headline is built from the lens scores that were actually measured. Both stages use settings printed in the rubric version in force, so somebody holding the same evidence can follow it through both stages and reach the same number.
The weights are published
The lenses do not count equally, and no lens has a fixed share. They are ranked from weakest to strongest, and each step up the ranking carries 0.55 of the weight of the step below it, so the weakest lens counts most: with six lenses measured it carries about 46% of the headline. The rubric prints that setting, so the arithmetic that turned the lens scores into one can be read in full.
Core always counts
Five lenses are always on: Code Health, Architecture, Maturity, Readiness, and Security and Compliance. They apply to every codebase, whatever it does and however it is built, and they contribute to every headline, with one exception. Architecture grades how a codebase is put together, so where there is no project to analyse it is left out rather than scored, and where there is only one small project, under 1,500 lines of production code, it can score no higher than 69.
Five more apply only where they fit
Domain Modelling, Event-Driven, Event Sourcing, Accessibility and Performance count only where the architecture calls for them. Where one does not apply, it is left out of the ranking and the weights are worked out over the lenses that do apply (they re-normalise), so a codebase is never marked down for a lens that was never relevant to it.
The presentation bands
Five bands, cut at 25 / 50 / 70 / 90.
Every score renders on the same five bands, running from Critical through Weak, Adequate and Strong to Exemplary, with a pin at the exact number. The pin is the reading. The band it lands in is a label for that reading, put there so a number can be talked about in a sentence, and which band a score falls in never changes the number underneath it. The headline is always cut at 25 / 50 / 70 / 90. A lens's cutlines move with the quality bar the codebase declares: lower for a prototype, higher for a mission-critical service.
Bounds on the headline
The weakest area pulls the headline down.
The cap
A critical reading caps a band, not the number.
A single measurement inside a lens scoring below 4 out of 10 holds that lens's band at Adequate, however well the rest of the lens reads, and the result names the measurement that did it. Advisory readings do not trigger it. Separately, the headline band is never more than one band above the weakest category. Neither rule changes a number: the headline puts the most weight on the weakest lens, so strength elsewhere still shows in it, but the place that is failing pulls it down the most.
The floor
A contract floor breaks down into its parts.
Writing CAI at 80 or above into an agreement is not a threshold either side has to take on trust. It resolves to something both of them can check: because the weakest lens carries the most weight, a headline of 80 cannot be reached with any lens below about 55, so no lens reads Critical. It does not mean every lens reads Strong; an agreement that needs that should set a minimum for each lens beside the headline floor. The meaning is fixed when the contract is written.
The firewall
Only four things move the number.
A score can move for four reasons: the code changed, the rules changed, a newly published security advisory changed a finding, or the tool that takes the measurements changed. Nothing else reaches the arithmetic. An opinion, a declaration, a suppressed finding or a contract term can change what a report says, and none of them can change what the number is.
Deterministic vs advisory
The AI only ever advises.
Most of the measurements are taken by deterministic tools reading the code. Sixteen of the 165 are read by an AI model that explains in plain English what it sees. Those readings are marked advisory, and the scorer leaves every advisory reading out of the number. They are there to explain a score.
A correction in progress. In three measurements — README accuracy (M4), mutation idempotency (ED5) and personal data in an event store (ES3) — a model's verdict has been counted in published scores. That is being corrected: what a model decides becomes advisory, and only their deterministic parts (a missing README, unambiguous personal-data fields) count. Since rubric-2026.10.3 the rubric itself enforces the advisory rule for the other thirteen.
Declarations and contracts
Paperwork cannot move a score.
Compliance declarations, suppressed findings and contract profiles change what a report says, never what the CAI is. Two parties can agree between themselves how a finding should be presented, and the number they are both looking at stays where the evidence put it.
The behavioural dimensions
Five dimensions are read from git history.
Five of the measurements behind a lens score come from the repository's history rather than from the code as it stands today. They are scored the same way as everything else, and they say things about a codebase that reading the current files cannot. Four are described below. The fifth, Secrets (history), counts toward Security and Compliance: it looks for credentials committed at any point in the history, including ones that have since been deleted.
Hotspots
Where change concentrates. A file that is both edited constantly and complicated to read is the one most likely to hurt next.
Bus factor
How concentrated the knowledge is. Which parts of the codebase rest on one contributor, and whose leaving would orphan the most important code.
Knowledge freshness
Code that everyone who understood it has gone quiet on. The knowledge is decaying in place, and the files themselves look no different.
Change coupling
Files that keep being changed together without any declared dependency between them. That is structure the code has but does not admit to.
The normative text lives in the repository.
This page explains the standard. The standard itself is the set of normative documents in its repository — the specification, the rubric catalogs and the qualification scheme — published under CC BY 4.0. Where this page and those documents disagree, the documents win, and the disagreement is a defect to report. Changes to them go through a public RFC process.
Read what gets measured, then check a number against it.
How the rules change, one numbered version at a time → rubric versions