Skip to content

Commit 0b8ab62

Browse files
author
Alexander Chernov
committed
A detection matrix, and the coverage gap it exposed
The mutant results were a list of "target, caught by" lines. Drawn as a matrix they say two separable things: target detection, which is whether the suite is sensitive to each named violation, and cross-detection, which is whether the assertions overlap. Reporting them as one number would hide both. Drawing it found something the pass/fail output could not. Thirteen mutants covered eleven assertions, so AD-002, AD-009, AD-013 and AD-014 had never been the assertion under test -- they appeared only as redundant detectors of other mutants. Four mutants added; coverage is now 15/15 and the matrix prints the figure so a future gap is visible rather than latent. One of the four is F-011 planted: the toy's original mistake of treating every advertised capability as implemented, kept reproducible instead of surviving only as an anecdote in a findings file. The off-diagonal density stays and is documented as a characterisation rather than a score. 2.2 assertions per mutant is what safety invariants look like when they cover something; AD-005, AD-011 and AD-012 catch only their own mutant, which is a fact worth knowing about those three. CONFORMANCE.md gains a Non-goals section. Passing AD-002 proves consistency within the subject's advertised capability surface; it does not prove the subject disclosed every capability it has. A conformance pass is a claim an implementation makes about itself, made checkable -- not an adversarial audit, and no interface of this shape could be one. The README now leads with the contract rather than with the four runtimes. The runtimes are the experimental variable; the result is that the contract can be expressed as language-neutral vectors and checked without seeing inside.
1 parent e36eb43 commit 0b8ab62

11 files changed

Lines changed: 311 additions & 112 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
with:
4040
python-version: ${{ matrix.python-version }}
4141
- run: pip install -e ".[all]"
42-
- name: portable suite, every subject, plus the mutants
43-
run: python -m agentic_dataset.conformance --mutants
42+
- name: portable suite, every subject, plus the mutation matrix
43+
run: python -m agentic_dataset.conformance --matrix
4444
- name: white-box suite, 8 configurations
4545
run: python -m agentic_dataset.reference_suite
4646
- run: pytest -q

‎CONFORMANCE.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,29 @@ exactly zero. It does not get averaged into a score.
9696

9797
---
9898

99+
## Non-goals
100+
101+
**Conformance is not a security audit.** Passing AD-002 proves consistency
102+
between declared and observable behaviour within the subject's advertised
103+
capability surface; it does not prove that the subject has disclosed every
104+
capability it possesses. `capabilities()` is the implementation's own report of
105+
itself.
106+
107+
So a conformance pass is a claim an implementation makes about itself, made
108+
checkable. Treating it as a guarantee against a hostile implementation misreads
109+
it, and no interface of this shape could provide one — an adversarial audit
110+
needs access to the binary, not to an interface the binary implements.
111+
112+
Three further things this suite does not attempt:
113+
114+
- **Performance.** Latency, throughput, cost and concurrency are unmeasured and
115+
unasserted.
116+
- **Semantic quality.** Whether the right dataset was chosen, or the answer was
117+
any good, is measured statistically elsewhere and deliberately never averaged
118+
into these fifteen.
119+
- **Completeness of the model.** The assertions rule out the failures named in
120+
the table above. They are not a claim that no other governance failure exists.
121+
99122
## Gate shape
100123

101124
```

‎README.md‎

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
11
# agentic-dataset-reference
22

3-
**One governance contract. Four agent runtimes. Two dataset boundaries. And an
4-
independent implementation that shares no code with any of them.**
3+
**A framework-independent behavioural contract for agentic datasets, expressed
4+
as language-neutral executable vectors and evaluated against implementations
5+
without access to their internals.**
56

67
```
7-
15 conformance assertions, all checked through a public interface
8-
9-
9 subjects pass 15/15 4 runtimes x 2 dataset boundaries, plus one
10-
implementation sharing nothing with the reference
11-
13/13 broken variants each caught by its target assertion
12-
0/39 prohibited steps executed, per subject
13-
401 tests passed
14-
15-
Authorized Recall@5
16-
filter after truncation 0.853
17-
filter before truncation 0.960
18-
+0.107 -- plain Recall@5 stays at 0.867
19-
and cannot see the difference
8+
15 normative assertions, 85 language-neutral vector steps
9+
10+
reference architecture 4 runtimes x 2 dataset boundaries 15/15 each
11+
independent implementation shares no code with the above 15/15
12+
mutation analysis 17 targeted violations 17/17 detected
13+
all 15 assertions covered 2.2 assertions
14+
per mutant
15+
defects exposed by the
16+
conversion to vectors F-010, F-011
17+
execution safety 0 / 576 prohibited executions
18+
0 / 24 in the evaluation set
19+
tests 405 passed
20+
21+
Authorized Recall@5 filter after truncation 0.853
22+
filter before truncation 0.960
23+
+0.107
2024
```
2125

22-
Reproduce with `python -m agentic_dataset.conformance --mutants`. Raw output is
23-
in [`docs/runs/`](docs/runs/); the caveats attached to every number are in
24-
[`docs/RESULTS.md`](docs/RESULTS.md).
25-
26-
The conformance harness imports nothing from the implementation it tests — a
27-
constraint a test asserts, because it is what the portability claim rests on.
28-
The assertions, the world and the expectations are JSON in
29-
[`conformance/`](conformance/); Python is one runner.
26+
The four runtimes are the experimental variable, not the product. What is being
27+
tested is whether the contract survives being expressed somewhere else — and
28+
whether a harness that cannot see inside an implementation can still tell a
29+
conforming one from a broken one.
3030

31-
> ## Status: runs, and is not finished.
32-
>
33-
> No deployment, no real data, no model in the loop by default, no latency or
34-
> cost claim. The independent implementation is a 250-line toy written by the
35-
> same person, which is weaker evidence than one written by somebody else —
36-
> that is the experiment still outstanding, and
37-
> [`CONTRIBUTING.md`](CONTRIBUTING.md) says how to run it.
31+
Reproduce with `python -m agentic_dataset.conformance --matrix`. Raw output is
32+
in [`docs/runs/`](docs/runs/); every number's caveats are in
33+
[`docs/RESULTS.md`](docs/RESULTS.md).
3834

3935
---
4036

@@ -137,10 +133,10 @@ from `ok-governed-motion`'s `policy.rs`, and
137133
pip install -e ".[all]" # or ".[dev]" for the core alone
138134

139135
python -m agentic_dataset.conformance # portable suite, every subject
140-
python -m agentic_dataset.conformance --mutants # and the 13 broken variants
136+
python -m agentic_dataset.conformance --matrix # the 17-mutant detection matrix
141137
python -m agentic_dataset.reference_suite # white-box suite, 8 configurations
142138
python conformance/generate.py # regenerate world and vectors
143-
pytest -q # 401 tests
139+
pytest -q # 405 tests
144140

145141
python -m agentic_dataset.authorized_recall # milestone M6, the metric
146142
python evals/evaluate.py # milestone M5, six evaluators
@@ -213,9 +209,9 @@ src/agentic_dataset/
213209
authorized_recall/ the metric, standalone: no dependency on any of the above
214210
datasets/ the synthetic reference dataset family
215211
conformance/ the normative artifact: world, vectors, verbs,
216-
an independent implementation and 13 broken variants
212+
an independent implementation and 17 broken variants
217213
examples/ one runnable script per runtime, plus the MCP boundary
218-
tests/ 401 tests
214+
tests/ 405 tests
219215
evals/ the M5 evaluators and the committed corpus record
220216
docs/ architecture (three ports), results, findings, raw runs
221217
```

‎RELEASE.md‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,27 @@ them is discovered after a DOI has been minted.
2121
three-way split would follow, so this is decidable rather than
2222
hypothetical:
2323

24-
| tier | files | what it has to allow |
25-
|---|---|---|
26-
| specification | `CONFORMANCE.md`, `src/agentic_dataset/conformance/verbs.md`, `docs/PORTABILITY.md` | quoting, reproducing and extending the spec text |
27-
| conformance assets | `conformance/` (world, vectors, `subjects.py`, `generate.py`, `toy_implementation.py`, `mutations.py`) and `src/agentic_dataset/conformance/` (interface + runner) | a third party building and testing an independent implementation, commercially or not |
28-
| reference implementation | the rest of `src/agentic_dataset/`, `evals/`, `examples/` | whatever commercial boundary is wanted |
24+
**Recommended split — not decided.** Five tiers, because the normative
25+
JSON behaves more like data than like software and benefits from less
26+
friction than the runner does:
2927

30-
The middle tier is now real: it imports no implementation, and a test
31-
asserts it. Two consequences to settle:
28+
| tier | files | recommended | why |
29+
|---|---|---|---|
30+
| specification prose | `CONFORMANCE.md`, `src/agentic_dataset/conformance/verbs.md`, `docs/PORTABILITY.md` | CC BY 4.0 | quote, reproduce and extend the spec text |
31+
| normative vectors | `conformance/worlds/`, `conformance/vectors/`, `conformance/generate.py` | CC0 (or CC BY 4.0) | copy them into a Rust repo, ship them with a commercial implementation, transform them into another harness — friction here defeats the purpose |
32+
| conformance runner | `src/agentic_dataset/conformance/`, `conformance/subjects.py`, `toy_implementation.py`, `mutations.py` | Apache-2.0 | a third party must be able to build *and test* an independent implementation, commercially or not |
33+
| Authorized Recall | `src/agentic_dataset/authorized_recall/` | Apache-2.0 | imports nothing else here; the piece most likely to be used by people who never adopt the architecture, and there is no strategic gain in making that hard |
34+
| reference implementation | the rest of `src/agentic_dataset/`, `evals/`, `examples/` | BSL, if the commercial boundary is still wanted | this is the part worth differentiating |
35+
36+
The middle tiers are now real rather than aspirational: they import no
37+
implementation, and a test asserts it. Two consequences to settle:
3238
- CC BY-NC on `CONFORMANCE.md` restricts reuse of the specification
3339
*text*, which works against treating it as an interoperability
3440
specification. (It does not restrict implementing the method —
3541
copyright covers expression, not mechanism.)
3642
- BSL is source-available, not OSI-approved, which forecloses JOSS for as
37-
long as it applies to the software. If the middle tier is permissively
38-
licensed and the reference implementation stays BSL, that question
39-
applies only to the third tier.
40-
- `src/agentic_dataset/authorized_recall/` is a fourth candidate: it
41-
imports nothing else in the repository and is the piece most likely to
42-
be used by people who never adopt the architecture.
43+
long as it applies to the software. Under the split above that question
44+
applies only to the last tier.
4345
- [ ] **Rename** `dk-agentic-dataset-reference` → `ok-agentic-dataset-reference`
4446
under the prefix policy, at the moment it goes public and not before.
4547

@@ -63,6 +65,11 @@ them is discovered after a DOI has been minted.
6365
```
6466
- [ ] Make the repository public **before** tagging, so there is a window for
6567
external scrutiny before an immutable snapshot exists.
68+
- [ ] Invite a second implementation rather than writing one. The toy
69+
establishes independence from the reference *code*; only somebody else's
70+
reading establishes independence from the author's interpretation of the
71+
contract. That is the next validation threshold, and writing a third
72+
implementation here would not cross it.
6673
- [ ] Tag `v0.1.0` and archive that exact tag through the Zenodo GitHub
6774
integration. **Zenodo publication is irreversible** — confirm the record
6875
immediately before minting.

‎conformance/mutations.py‎

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@
99
`tests/test_conformance_vectors.py` asserts every mutant is caught by the
1010
assertion named -- not merely by some assertion.
1111
12-
Mutants often break more than their target. That is expected and is reported,
13-
because the additional failures say something about how the assertions overlap.
12+
Every one of the fifteen assertions has at least one mutant of its own. The
13+
first version of this file had thirteen mutants covering eleven assertions,
14+
which meant AD-002, AD-009, AD-013 and AD-014 were only ever exercised as
15+
cross-detectors -- visible the moment the detection matrix was drawn, and not
16+
before.
17+
18+
Mutants often break more than their target. That is expected and is reported:
19+
`python -m agentic_dataset.conformance --matrix` prints which assertion catches
20+
which mutant, and the off-diagonal entries are a fact about how the assertions
21+
overlap rather than noise. Safety invariants that never overlap are usually
22+
invariants that do not cover much.
1423
"""
1524

1625
from __future__ import annotations
@@ -197,9 +206,68 @@ def _execute(self, grant_id, dataset, capability):
197206
return {"dataset": dataset, "capability": capability, "rows": 2}
198207

199208

209+
class AdvertisedMeansImplemented(ToyImplementation):
210+
"""Every advertised capability is treated as implemented.
211+
212+
This is F-011 -- the mistake the toy actually made on its first run --
213+
planted so it stays reproducible instead of surviving only as an anecdote.
214+
"""
215+
216+
name = "mutant:advertised-means-implemented"
217+
218+
def load_world(self, world):
219+
super().load_world(world)
220+
self._derive = True
221+
222+
def _op_register_descriptor(self, step):
223+
result = super()._op_register_descriptor(step)
224+
self._implemented |= {
225+
(step["descriptor"]["dataset"], c["name"])
226+
for c in step["descriptor"].get("capabilities", ())
227+
}
228+
return result
229+
230+
231+
class EvidenceOmitsPrincipal(ToyImplementation):
232+
"""Evidence cannot say who was acting."""
233+
234+
name = "mutant:evidence-omits-principal"
235+
236+
def _observe(self, *args, **kwargs):
237+
observation = super()._observe(*args, **kwargs)
238+
for row in observation.evidence:
239+
row["principal_class"] = None
240+
return observation
241+
242+
243+
class RemoteDelegationUnchecked(ToyImplementation):
244+
"""The MCP seam stops checking the scope. The A2A seam still does."""
245+
246+
name = "mutant:remote-delegation-unchecked"
247+
_channel = "mcp"
248+
249+
def _op_delegate(self, step):
250+
observation = super()._op_delegate(step)
251+
if step["channel"] == self._channel and observation.errors:
252+
observation.errors = []
253+
calls = [f"{step['channel']}-target:{step['dataset']}.{step['capability']}"]
254+
observation.mcp_calls = calls if step["channel"] == "mcp" else []
255+
observation.a2a_calls = calls if step["channel"] == "a2a" else []
256+
observation.executed_scope = dict(step["scope"])
257+
return observation
258+
259+
260+
class HandoffUnchecked(RemoteDelegationUnchecked):
261+
"""The agent-handoff seam stops checking the scope. The MCP seam still does."""
262+
263+
name = "mutant:handoff-unchecked"
264+
_channel = "a2a"
265+
266+
200267
# mutant class -> the assertion that must catch it
201268
TARGETS: dict[type, str] = {
202269
DescriptorNotValidated: "AD-001",
270+
AdvertisedMeansImplemented: "AD-002",
203271
ExecutesWithoutAGrant: "AD-003",
204272
ExpiredTokensAccepted: "AD-003",
205273
RefusalStillMintsAuthority: "AD-004",
@@ -208,9 +276,12 @@ def _execute(self, grant_id, dataset, capability):
208276
DelegationWidensScope: "AD-007",
209277
CacheIgnoresPrincipal: "AD-008",
210278
CacheIgnoresRevision: "AD-008",
279+
EvidenceOmitsPrincipal: "AD-009",
211280
RefusalLeavesNoEvidence: "AD-010",
212281
EvidenceOmitsRevision: "AD-011",
213282
EvidenceOmitsPolicyVersion: "AD-012",
283+
RemoteDelegationUnchecked: "AD-013",
284+
HandoffUnchecked: "AD-014",
214285
ProhibitionsIgnored: "AD-015",
215286
}
216287

‎docs/PORTABILITY.md‎

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,31 @@ caught that would not have been worth building.
9494

9595
## Mutation results
9696

97-
Thirteen deliberately broken variants, each removing exactly one guarantee.
98-
Every one is caught by the assertion named for it:
97+
Seventeen deliberately broken variants, each removing exactly one guarantee.
98+
The matrix is what `python -m agentic_dataset.conformance --matrix` prints; the
99+
committed run is in [`runs/mutation-matrix.txt`](runs/mutation-matrix.txt).
99100

100101
```
101-
mutant:descriptor-not-validated AD-001 caught by AD-001
102-
mutant:executes-without-a-grant AD-003 caught by AD-002, AD-003, AD-013, AD-014
103-
mutant:expired-tokens-accepted AD-003 caught by AD-003, AD-013, AD-014
104-
mutant:refusal-still-mints-authority AD-004 caught by AD-001, AD-004, AD-006, AD-015
105-
mutant:indeterminate-becomes-refusal AD-005 caught by AD-005
106-
mutant:default-allow AD-006 caught by AD-006
107-
mutant:delegation-widens-scope AD-007 caught by AD-007, AD-013, AD-014
108-
mutant:cache-ignores-principal AD-008 caught by AD-008
109-
mutant:cache-ignores-revision AD-008 caught by AD-008
110-
mutant:refusal-leaves-no-evidence AD-010 caught by AD-009, AD-010
111-
mutant:evidence-omits-revision AD-011 caught by AD-009, AD-010, AD-011
112-
mutant:evidence-omits-policy-version AD-012 caught by AD-009, AD-010, AD-012
113-
mutant:prohibitions-ignored AD-015 caught by AD-004, AD-009, AD-010, AD-015
102+
target detection : 17/17 mutants caught by their intended assertion
103+
cross-detection : 2.2 assertions per mutant on average
104+
coverage : 15/15 assertions have a mutant of their own
114105
```
115106

116-
The over-catching is informative rather than noise. Removing the prohibition
117-
check breaks AD-015 *and* AD-004 *and* the evidence assertions, because a
118-
prohibited action that executes also produces a granted decision where a
119-
refusal was recorded — the assertions are not independent, and the overlap map
120-
is a fact about the contract worth having written down.
107+
**The coverage line is there because it was not always 15/15.** The first
108+
version of this analysis had thirteen mutants covering eleven assertions, which
109+
meant AD-002, AD-009, AD-013 and AD-014 were exercised only as cross-detectors
110+
— never as the assertion under test. Nothing in the pass/fail output showed
111+
that. Drawing the matrix showed it immediately, and four mutants were added.
121112

122-
Reproduce: `python -m agentic_dataset.conformance --mutants`
113+
**The off-diagonal entries are a result, not noise.** They say the fifteen
114+
assertions are not orthogonal, which is what safety invariants ought to look
115+
like: removing the prohibition check breaks AD-015 *and* AD-004 *and* the
116+
evidence assertions, because a prohibited action that executes also records a
117+
grant where a refusal belonged. An assertion whose row contains nothing but its
118+
own `T` is doing work nothing else does — AD-005, AD-011 and AD-012 are those,
119+
and that is worth knowing about them.
120+
121+
The average of 2.2 is therefore a characterisation of the suite rather than a
122+
score. It should not be driven up or down.
123+
124+
Reproduce: `python -m agentic_dataset.conformance --matrix`

0 commit comments

Comments
 (0)