## 29. Conformance — capabilities, assurance levels, admission (v40)

> v1–v39 govern *where things live* in `.meshkore/` and how agents and the daemon
> behave. §29–§43 (v40, "the engineering method") add *how a project is engineered*:
> how a change is designed, reviewed, built, verified, closed, released and operated.
> They apply through **capabilities** (facts about a component) and **assurance
> levels** (how much evidence a component claims). **Nothing in §29–§43 is mandatory
> for a project that claims no level beyond `L0`**, and every rule ships non-blocking
> (`since: 40`, `required_from: null`) until a later edition activates it after
> pilots (§41.3). The machine-readable registry is `standard.json#method`.
>
> **Levels are not layers.** The assurance levels `L0`–`L4` of this section are
> per component and earned by evidence. They are unrelated to the *adoption layers*
> of §12 (how much MeshKore infrastructure a project uses) and to the *gate layers*
> of §15. Write "level L2" or "layer L2" when the context leaves any doubt.

### 29.0 Principles (normative)
| # | Principle | Rules out |
|---|---|---|
| P1 | **One fact, one home.** Other places link to it or are generated from it. | Hand-kept copies of tables, taxonomies, diagrams. |
| P2 | **Data before prose** for anything a machine can check; prose explains why. | Architecture that exists only in paragraphs and memory. |
| P3 | **Critical checks prove they can fail.** A critical guard, a verdict function, a regression test of a review finding, and every ratchet/gate carry a *negative control*: a passing control plus an expected, specific failure. | Green checks that stay green with the guard removed. |
| P4 | **Debt is identified, baselined and only shrinks.** New debt fails even if old debt was paid. | "We'll clean it later" without a list. |
| P5 | **Authors test their own work. Where independent approval is required, the author cannot grant it.** | Self-approval; approvals that survive later material changes. |
| P6 | **Measured, proposed and not verified are kept apart** in every design, review and report. | Claims about the code the code does not support. |
| P7 | **Acceptance criteria are committed before the data they judge.** | Moving goalposts after seeing results. |
| P8 | **Fix the class, not the case** — after containment. Emergency mitigation is allowed at once, with a named follow-up for the class fix. | Special-case patches as the final state. |
| P9 | **Minimise what is collected and disclosed.** Redaction happens before collection or egress, never only at view. | Raw payloads captured "just in case"; secrets in telemetry. |
| P10 | **Proportionality.** Controls apply by capability and by the risk of the change. | Ceremony on a typo; none on a payment path. |


### 29.1 Subject, capabilities, levels

- **Subject** of a result: `(component, revision or artifact digest, standard edition)`; operational
  claims add `(environment, evidence window)`. There is **no project-wide badge**: a project shows one
  result per component, plus integration results for declared deployable sets.
- **Capabilities** (facts, declared per component; they select rules; an inapplicable rule is
  permanently `not-applicable`, never an exception):
  `operates-service · owns-persistent-data · publishes-package · publishes-public-artifacts ·
  executes-external-effects · multi-tenant · has-user-interface · processes-personal-data ·
  uses-model-providers`.
- **Assurance levels** (per component, cumulative):

| Level | Name | Adds (sections) |
|---|---|---|
| `L0` | Laid out | v39 core exactly (§1–§28). |
| `L1` | Described | Catalog card (§32), context index (§31), criteria (§36.1), generated structural views (§33). |
| `L2` | Verified | Test inventory with tags (§35.1), negative controls on critical guards (§35.3), protected baselines and identified debt (§35.7), trusted evidence for merge (§29.4), security module baseline (§39.1). |
| `L3` | Governed | Risk-based lanes (§30), protected independent approval (§38), decision records (§36.2), disclosure controls if `publishes-public-artifacts` (§37.2), supply chain if `publishes-package` or ships an artifact (§39.2), contracts & data evolution if it exposes a contract or `owns-persistent-data` (§39.3). |
| `L4` | Operated | Only if `operates-service`: telemetry linked to components (§34), SLOs + incident process (§39.5), state-aware release (§37.3), demonstrated restore if `owns-persistent-data`, fleet migration if `multi-tenant` per-instance (§37.4). |

**Level earning is always strict:** every applicable rule of the level must pass, whatever its staging
(§41.3 staging only governs admission blocking, §29.6). Capability declarations are **checked against
evidence** (deployment manifests, package metadata, data-store config, UI build outputs); an omitted
capability is `unknown`, which withholds any level whose applicability depends on it. A component
without `operates-service` is **ineligible** for L4 — never "operated by inapplicability".

Each level has **absolute floors** besides its ratchets (§35.7): a ratchet alone never earns a level.
Example floors — L1: 100 % of shipped code owned by a component with `purpose` and `owner`;
L2: 0 undiscovered shipped tests, 100 % of declared critical guards with a negative control;
L4: every critical journey has an SLI with an alert.

**Named bundles** (informative): *small web product* (L2 + security + contracts/data + operations-lite),
*public library* (L2 + supply chain + contracts, no L4), *agent product* (L3 + effects + model providers),
*multi-tenant service* (L4).

### 29.2 Rule records

Every rule lives in `standard.json#method.rules[]`; prose tables are generated from it.

```json
{ "id": "R-CAT-2", "level": "L1", "applies_if": "true",
  "prerequisites": ["R-CAT-1"], "stage": "merge",
  "evidence": "catalog validation record", "authority": "component owner",
  "since": 40, "required_from": null, "fixtures": "conform_fixtures/R-CAT-2/{pass,fail,na,infra}" }
```

Every rule in v40 carries `required_from: null` (staged, §41.3). Rules also carry `kind` (`level` or
`admission`), `check` (`data`: read from files; `evidence`: read from evidence records only) and the
`section` that states them. `stage` ∈ `local | merge | release | runtime`. A rule whose meaning changes gets a **new id**.
Each rule ships with **conformance fixtures** (passing, failing, not-applicable, infra-error trees) that
the reference evaluator must classify exactly; this is the evaluator's own conformance suite
(WPT/Kubernetes-conformance style).

### 29.3 Result states

`passed · exception (accepted by the rule's authority, with expiry) · not-applicable (by predicate) ·
not-assessed (prerequisite at a higher level, or infra error) · failed`. A diff-only evaluation is
`partial` unless a valid full baseline exists at a named revision. A rule result from a baseline is
reused only if **all its material inputs** (policy, dependencies/lockfiles, schemas, deployment flags,
declared capabilities, the files the rule reads) are unchanged **and** its evidence is still fresh;
otherwise the rule is re-run or reported `partial`. Prerequisites only point
to rules of the same or a lower level. **An applicable, due rule that is `not-assessed` withholds the
level** (shown "Lk incomplete").

### 29.4 Evaluator, runner, authority (separated)

- The **reference evaluator** (`meshkore conform`) is data-only: it reads files and evidence records.
  It never executes project code. The reference implementation ships in the daemon bundle
  (`conform.py`; standalone: `python3 conform.py <root> [--target N] [--json] [--public]`) and backs the
  daemon's `GET /conformance` (claimed vs met per component; `?full=1` for per-rule results). A v40
  daemon runs no project checks at all. File locations it reads are listed in `standard.json#method.files`;
  an evidence record is matched to a rule by its `rule` field, else `check_id` equals the rule id.
- **Project checks** run as untrusted jobs: isolated runner, no secrets, no network by default, no access
  to other projects, no release credentials. The daemon never runs them under its own identity.
- **Evidence record** (produced by a runner):
  `{check_id, check_definition_digest, inputs_digest, subject_digest (integration commit or artifact),
  author_principal, runner_id, result, started_at, finished_at, signature}`. It is **authenticated
  outside the job**: the runner signs it with a key agent sessions cannot read, and the check definition
  is taken from the protected policy **at the base revision**, never from the change under test. A
  "trusted runner" (CI or local) is exactly: a registered runner key + that protected-definition
  binding. Anything else is `self-reported` and never satisfies a merge- or release-stage rule.
  Runtime-stage evidence signs the full subject, including environment and observation window.
- **Changing a check definition:** BASE policy only *authorises* the transition. The candidate
  definition is independently approved, then run and attested against the integration result; BASE
  evidence is never presented as evidence for the candidate. A change of uncertain direction is
  treated as a relaxation (below).
- **Principals:** `author_principal` is the per-member session credential that produced the change
  (recorded by the daemon at delegation, §25.6), not the signature of whoever committed it; approvals
  carry the `approver_principal` (§36.4).
- **Protected acceptance policy:** the files that define verdicts — ratchet baselines, thresholds,
  experiment definitions, test inventory, `conformance.yaml`, disclosure rules — are protected paths.
  **Additive or tightening** updates (a new test, a paid-off item, a stricter threshold) are accepted
  atomically with the change under the normal independent approval. **Relaxations** (removing a test,
  raising a ceiling, loosening a threshold, adding an exclusion) need a separate owner approval recorded
  *before* the change that uses them, and are listed in the next release notes.

### 29.5 Declaration

`.meshkore/conformance.yaml` (private allowed); its **public projection**
`public/conformance.json` (component ids, levels, results; no repo names, commands or exception texts)
is generated. A release without integration evidence for its exact deployable set reports `would deny`
while that admission rule is staged and is denied once it is active.

```yaml
standard: 40
components:
  - id: api
    capabilities: [operates-service, owns-persistent-data, executes-external-effects, uses-model-providers, publishes-public-artifacts]
    target: L3
    checks: {inventory: "…", gate: "…"}        # commands for the untrusted runner
deployables:                 # DERIVED from release/deployment manifests (exact component, config and
  - id: hosted               # schema revisions); listed here only to name the accountable integration owner
    integration_owner: platform-owner
source_roots: [src/]          # what counts as shipped source (R-CAT-2); none → not-assessed
runners:                      # trusted runner keys (§29.4)
  - {id: ci-1, public_key: "<ed25519 public key, hex or base64>"}
exceptions:
  - rule: R-OBS-2
    component: api
    reason: "…"
    approved_by: owner
    expires: 2027-01-31
```

### 29.6 Admission policy (separate from levels)

Two different questions: **may this change merge / be published / be deployed** (admission) and **what
level does this component earn** (claim). Universal admission rules apply at every level, L0 included:
secret and credential checks; disclosure checks (§37.2) for any component with
`publishes-public-artifacts`; supply-chain basics (§39.2) for anything published; integration evidence
for a release's exact deployable set. Levels never switch admission rules off. A rule's `required_from`
(§41.3) decides when it starts **blocking admission**; it never decides whether a level is earned.
While staged, a failing or **unknown-applicability** admission rule reports `would deny`; once active,
it denies. A publication job by itself establishes that publication controls apply. "Non-blocking"
never relaxes an existing v39 gate and never authorises the daemon to take an unsafe action.
