File size: 3,457 Bytes
fd5366a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Certificate format (v1.0)

A certificate is the object an auditor reads instead of a transcript. It is
published as `schemas/certificate.schema.json`, versioned, and validated on every
write; a record that fails validation is never appended to the ledger.

## Shape

```
Cert(a_t) = <G, Fork, E, Bound>
```

| Element | Question it answers |
|---|---|
| `G` | Why this action was scored as it was: the attributed subgraph over admitted features |
| `Fork` | What else could have been done, and what the model said would happen |
| `E` | What evidence was used, whether it was stale, and whether it conflicted |
| `Bound` | How wrong the risk estimate could be, at what confidence, at what cost |

## Fields

### Identity

- `cert_id` — 24 hex characters, derived from item, step, time and process.
- `schema_version` — `"1.0"`.
- `item_id`, `episode_id`, `step` — the decision point in PreAct-Bench.

### Decision

- `decision` — what the agent did: `execute`, `abstain`, `clarify`, `verify`.
- `mode` — which controller mode produced it: `direct`, `simulate`,
  `verify/acquire`, `clarify`, `abstain`.
- `action` — the chosen candidate, as `{name, args}`.

### `G` — attribution

```json
{"method": "feature_ablation_attribution",
 "nodes": [{"id": "f17", "kind": "feature", "label": "...", "weight": 0.42}],
 "edges": [{"src": "f17", "dst": "harm", "weight": 0.42}]}
```

Nodes are admitted features or outcome variables; edges carry the ablation effect.
A certificate without an attribution method is invalid.

### `Fork` — counterfactual

`alternative` (the next-best candidate), `predicted` and `replayed` outcomes
(`success`, `harm`, `irreversible_harm`), `consistent` (boolean) and `divergence`
(scalar). When no replay was performed, `replayed.available` is `false` and the
divergence is not used in the bound.

### `E` — evidence

`claims_used` (ids), `stale` (any claim past its freshness window), `conflict`
(claims disagree across modalities) and `acquired` (evidence fetched at this step).
Evidence is not free: acquisitions appear in `cost.verifications`.

### `Bound` — risk

- `alpha` — target miscoverage.
- `coverage` — empirical coverage on the calibration split.
- `selective_risk_upper` — Clopper–Pearson upper bound at `n` accepted decisions.
- `n` — calibration sample size behind the bound.
- `method` — `clopper_pearson_selective` or `conformal_split`.
- `feasible` — whether the bound is below `alpha` on the calibration split.
- `budget_spent`, `budget_limit`, `components` — tokens charged, split into
  `monitor`, `simulation`, `verification`, `allocator`.

### Ledger

`prev_hash` and `cert_hash` chain records:

```
cert_hash = sha256(prev_hash || canonical_json(record_without_cert_hash))
```

Editing any record breaks verification from that point onward. `verify_chain()`
returns `(ok, message)`; `audit_ledger(path)` returns counts, chain status and
schema status for a file.

## Why these four elements

A safety claim needs to be falsifiable. `G` makes the cause inspectable. `Fork`
makes the alternative explicit. `E` makes the inputs auditable. `Bound` makes the
error quantitative. Remove any one and the claim becomes a narrative.

## Versioning

The schema is additive within a major version. A consumer must reject records with
an unknown `schema_version` rather than guess. `cert_id` is not a hash of the
record (the record contains its own hash chain); it is an identifier.