Skip to content

Commit 9f67878

Browse files
feat(aer1): join the reference kit's column into the interop table (#115)
The table now carries two verdict columns from two runners against the same pinned set, joined on vector name, plus a divergence column: - reference kit column generated from Brennan's published run (kit commit e04e4c91, 146 checks, same evaluated-set digest), vendored so the page regenerates offline and sha256-pinned so a changed column is deliberate; - divergence column naming the vectors where the two dictionaries disagree, and the id-binding swap's moved field (receipt.id) where both refuse; - a pins section covering the corpus digest, the kit commit and column hash, and content hashes for our parser and generator. Anchored records are compared as not_checked on our side even when the structural verdict is pass: this build does not evaluate the anchor layer, so claiming agreement there would be the same overreach the table exists to avoid. Joined result today: 0 orphans, 0 verdict divergences. 🤖 Generated with Codebuff Co-authored-by: Mr-X <EslaM-X@users.noreply.github.com> Co-authored-by: Codebuff <noreply@codebuff.com>
1 parent 4801ee9 commit 9f67878

11 files changed

Lines changed: 388 additions & 46 deletions

File tree

‎docs/AER1-INTEROP-TABLE.md‎

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ A `verified` outcome here means the saved bytes were not changed after they were
1515
| false reject (ours) | 0 |
1616
| not checked (unimplemented family, schema or anchor) | 100 |
1717

18-
## Families
19-
20-
| Family | Vectors | Agree | False accepts | False rejects | Not checked |
21-
|---|---|---|---|---|---|
22-
| `invalid` | 36 | 27 | — | — | 9 |
23-
| `chain` | 35 | 0 | — | — | 35 |
24-
| `valid` | 21 | 9 | — | — | 12 |
25-
| `merkle` | 9 | 0 | — | — | 9 |
26-
| `anchor` | 8 | 0 | — | — | 8 |
27-
| `commitment` | 8 | 0 | — | — | 8 |
28-
| `workflow-merkle-seq-output-v1` | 8 | 0 | — | — | 8 |
29-
| `id-binding` | 6 | 6 | — | — | — |
30-
| `anchored` | 6 | 0 | — | — | 6 |
31-
| `unicode` | 5 | 0 | — | — | 5 |
32-
| `invalid-profile` | 1 | 1 | — | — | — |
18+
## Families and the joined verdicts
19+
20+
Two columns from two runners against the same pinned set, joined on vector name. The kit column is generated from the reference kit's own run (pinned below), not typed from the classification.
21+
22+
| Family | Vectors | CG-AER1/1 | Reference kit | Divergence |
23+
|---|---|---|---|---|
24+
| `invalid` | 36 | 27 agree · 9 not checked | 36 checks, all as expected · 36 refused | 0 of 27 |
25+
| `chain` | 35 | 0 agree · 35 not checked | 35 checks, all as expected | — (not judged by CG-AER1/1) |
26+
| `valid` | 21 | 9 agree · 12 not checked | 21 checks, all as expected | 0 of 9 |
27+
| `merkle` | 9 | 0 agree · 9 not checked | 12 checks, all as expected | — (not judged by CG-AER1/1) |
28+
| `anchor` | 8 | 0 agree · 8 not checked | 8 checks, all as expected · 4 refused | — (not judged by CG-AER1/1) |
29+
| `commitment` | 8 | 0 agree · 8 not checked | 8 checks, all as expected | — (not judged by CG-AER1/1) |
30+
| `workflow-merkle-seq-output-v1` | 8 | 0 agree · 8 not checked | 8 checks, all as expected | — (not judged by CG-AER1/1) |
31+
| `id-binding` | 6 | 6 agree | 6 checks, all as expected | 0 of 6 |
32+
| `anchored` | 6 | 0 agree · 6 not checked | 6 checks, all as expected · 5 refused | — (not judged by CG-AER1/1) |
33+
| `unicode` | 5 | 0 agree · 5 not checked | 5 checks, all as expected | — (not judged by CG-AER1/1) |
34+
| `invalid-profile` | 1 | 1 agree | 1 check, all as expected · 1 refused | 0 of 1 |
3335

3436
## The two interop pairs
3537

@@ -43,6 +45,20 @@ Drift named by CG-AER1/1:
4345
|---|---|---|
4446
| `receipt.id` | `130da435-e157-498e-af90-605866a86a27` | `42fc3298-b1e7-4087-bb1c-f80ef9f12c7c` |
4547

48+
## Pins
49+
50+
| Side | Pin |
51+
|---|---|
52+
| Corpus | kit 1.5.7 · `sha256:60bf73f325793e16843370cfa24903bb0d017525cb297e42bebc35857e2db0d2` · 143 vectors |
53+
| Reference kit run | commit `e04e4c91d4630a2e0ceb4e12c48accacac10155e` · column sha256 `sha256:eb6cec8cf8d927c6af0460913fbf82ae1e2ae021b2cdde295b4d7c3aa4b29cd9` · 146 checks |
54+
| CG-AER1/1 | parser sha256:5d74ff8126fab46509875e86c1faa3c8a53389f18d695e2f34681f55123b6bb1 · generator sha256:66b2f0e383f8b331f456db269359155e5c2756c05a9eef89c13b3585916d5edc |
55+
56+
The kit's closing line is `CONFORMANCE OK: 143 vectors, 146 checks, sha256:60bf73f325793e16843370cfa24903bb0d017525cb297e42bebc35857e2db0d2`; the join key is the vector name, and the extra checks are the merkle family's workflow checks (9 vectors carry 12 checks). The kit column was published at https://github.com/zambodotdev/aer1-kit/blob/main/interop/kit-column-2026-11-23.txt and is vendored here so this page regenerates offline; its sha256 is checked before the column is read.
57+
58+
## Divergence detail
59+
60+
No verdict divergence in the joined set today: every vector CG-AER1/1 judges, the reference kit judges the same way. The field-level divergence is the id-binding swap above, where both sides refuse and CG-AER1/1 names `receipt.id` with the expected and found values.
61+
4662
## False accepts — our defect list
4763

4864
None.

‎docs/LINKEDIN-CONTENT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CoreGuard Global — Traction Update
5454
✅ Core DAO mainnet: 2 contracts deployed & verified
5555
✅ Stellar testnet: Soroban contract deployed
5656
✅ 2009 tests passing
57-
✅ 1529 files scanned, 0 boundary violations
57+
✅ 1530 files scanned, 0 boundary violations
5858
✅ 10,000-run benchmark: 0 false accept/reject
5959
✅ 18/18 release gate legs pass
6060

‎docs/NUMBERS.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>CoreGuard — numbers</h1>
6363
</tr>
6464
<tr>
6565
<td class="k">Boundary audit — files scanned</td>
66-
<td class="v">1529 <span class="u">files</span></td>
66+
<td class="v">1530 <span class="u">files</span></td>
6767
<td class="s"><code>docs/state-snapshot.json#boundaryAudit.filesScanned</code><div class="n">Tracked files from `git ls-files` (ignored trees such as var/ are not counted).</div></td>
6868
</tr>
6969
<tr>

‎docs/STATUS.md‎

Lines changed: 21 additions & 21 deletions
Large diffs are not rendered by default.

‎docs/TWITTER-CONTENT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ https://github.com/coreguard-global/CoreGuard
100100
CoreGuard is open source. Every claim is machine-verified.
101101

102102
2009 tests passing.
103-
1529 files scanned.
103+
1530 files scanned.
104104
0 boundary violations.
105105
18/18 release gate legs.
106106

‎docs/claims-registry.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"recheck": "npm run boundary:audit",
6969
"external": false,
7070
"derived": {
71-
"filesScanned": 1529,
71+
"filesScanned": 1530,
7272
"violations": 0
7373
},
7474
"deriveError": null,

‎docs/numbers.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{
1717
"id": "boundary-files",
1818
"label": "Boundary audit — files scanned",
19-
"value": 1529,
19+
"value": 1530,
2020
"unit": "files",
2121
"source": "docs/state-snapshot.json#boundaryAudit.filesScanned",
2222
"note": "Tracked files from `git ls-files` (ignored trees such as var/ are not counted)."

‎docs/state-snapshot.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"commitsAheadOfV060": 555,
55
"testsTotal": 2009,
66
"boundaryAudit": {
7-
"filesScanned": 1529,
7+
"filesScanned": 1530,
88
"violations": 0,
99
"check": "PASS"
1010
},

‎scripts/aer1-interop.mjs‎

Lines changed: 168 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
22+
import { createHash } from "node:crypto";
2223
import { join, dirname } from "node:path";
2324
import { fileURLToPath, pathToFileURL } from "node:url";
2425
import { parseAer1Record, AER1_PARSER_VERSION } from "../packages/agent-commerce/aer1.mjs";
@@ -30,6 +31,38 @@ const OUT = join(ROOT, "docs/AER1-INTEROP-TABLE.md");
3031
const KIT = "1.5.7";
3132
const SET_DIGEST = "sha256:60bf73f325793e16843370cfa24903bb0d017525cb297e42bebc35857e2db0d2";
3233

34+
/**
35+
* The reference kit's column, as published by Brennan on 2026-11-23:
36+
* python3 conformance.py at kit commit e04e4c91…, standard library only,
37+
* self-verifying the evaluated set before judging any vector.
38+
* The raw file is vendored so this table can be regenerated offline, and its
39+
* sha256 is pinned so a changed column is a deliberate act, not a silent edit.
40+
*/
41+
const KIT_COMMIT = "e04e4c91d4630a2e0ceb4e12c48accacac10155e";
42+
const KIT_COLUMN_FILE = join(ROOT, "test/fixtures/aer1-kit-column-1.5.7/kit-column-2026-11-23.txt");
43+
const KIT_COLUMN_URL = "https://github.com/zambodotdev/aer1-kit/blob/main/interop/kit-column-2026-11-23.txt";
44+
const KIT_COLUMN_SHA256 = "eb6cec8cf8d927c6af0460913fbf82ae1e2ae021b2cdde295b4d7c3aa4b29cd9";
45+
46+
/** The kit's family tags, mapped onto the family keys this table prints. */
47+
const KIT_FAMILY_TO_OURS = Object.freeze({
48+
valid: "valid",
49+
invalid: "invalid",
50+
"profile-invalid": "invalid-profile",
51+
anchored: "anchored",
52+
"id-binding": "id-binding",
53+
unicode: "unicode",
54+
merkle: "merkle",
55+
"merkle-workflow": "merkle",
56+
commitment: "commitment",
57+
chain: "chain",
58+
"chain-v07": "chain",
59+
"workflow-root": "workflow-merkle-seq-output-v1",
60+
anchor: "anchor",
61+
});
62+
63+
/** Families whose vectors this build loads as single records, so a join miss is an error. */
64+
const RECORD_FAMILIES = new Set(["valid", "invalid", "invalid-profile", "anchored"]);
65+
3366
const index = JSON.parse(readFileSync(join(CORPUS, "corpus-index.json"), "utf8"));
3467
const files = index.files ?? [];
3568

@@ -39,6 +72,42 @@ const EXPECTED = (path) => {
3972
return null; // anchored / families with mixed outcomes are not classified by path
4073
};
4174

75+
const sha256OfFile = (path) => `sha256:${createHash("sha256").update(readFileSync(path)).digest("hex")}`;
76+
77+
/**
78+
* Parse the reference kit's raw output: `[family] name: PASS (note)` lines plus
79+
* its closing CONFORMANCE OK line. Every line is a check, not a vector: the
80+
* merkle family's 9 vectors carry 12 checks, which is where 146 comes from.
81+
*/
82+
export function parseKitColumn(text) {
83+
const checks = [];
84+
let footer = null;
85+
for (const line of text.split("\n")) {
86+
const check = /^\[([^\]]+)\]\s+(.+?):\s+PASS(?:\s+\((.*)\))?\s*$/.exec(line);
87+
if (check) {
88+
checks.push({ family: check[1], name: check[2], note: check[3] ?? null });
89+
continue;
90+
}
91+
const done = /^CONFORMANCE OK: (\d+) vectors, (\d+) checks, (sha256:[0-9a-f]{64})$/.exec(line.trim());
92+
if (done) footer = { vectors: Number(done[1]), checks: Number(done[2]), digest: done[3] };
93+
}
94+
return { checks, footer };
95+
}
96+
97+
/** A kit check either ends in a refusal or in a pass; the note names the reason. */
98+
const kitOutcome = (check) =>
99+
check.note !== null && /rejected|verification failed|outcome: invalid/.test(check.note) ? "invalid" : "verified";
100+
101+
function loadKitColumn() {
102+
if (!existsSync(KIT_COLUMN_FILE)) throw new Error(`reference kit column missing: ${KIT_COLUMN_FILE}`);
103+
const text = readFileSync(KIT_COLUMN_FILE, "utf8");
104+
const actual = `sha256:${createHash("sha256").update(text).digest("hex")}`;
105+
if (actual !== `sha256:${KIT_COLUMN_SHA256}`) {
106+
throw new Error(`reference kit column changed: expected sha256:${KIT_COLUMN_SHA256}, found ${actual}`);
107+
}
108+
return { ...parseKitColumn(text), sha256: actual, url: KIT_COLUMN_URL, commit: KIT_COMMIT };
109+
}
110+
42111
function classifyRecord(record, rawText) {
43112
const parsed = parseAer1Record(record, { rawText });
44113
if (!parsed.supportedVersion) return { observed: "not_checked", reason: `schema ${parsed.version ?? "(absent)"} not implemented`, parsed };
@@ -66,8 +135,43 @@ function runIdBinding() {
66135
return rows;
67136
}
68137

138+
/**
139+
* Join the two columns on vector name. A kit check for a record family that no
140+
* corpus file matches is a broken join, and a verdict that differs is a
141+
* divergence — the row Zambo asked to be able to point at.
142+
*/
143+
function buildKitJoin(kit, observedByName, idRows) {
144+
const rows = new Map();
145+
const orphans = [];
146+
for (const c of kit.checks) {
147+
const key = KIT_FAMILY_TO_OURS[c.family] ?? c.family;
148+
const row = rows.get(key) ?? { key, checks: 0, verified: 0, invalid: 0, compared: 0, divergences: [], notCompared: 0 };
149+
row.checks += 1;
150+
if (kitOutcome(c) === "invalid") row.invalid += 1;
151+
else row.verified += 1;
152+
const ours = observedByName.get(c.name);
153+
if (RECORD_FAMILIES.has(key) && ours === undefined) orphans.push(c.name);
154+
if (ours !== undefined && ours !== "not_checked") {
155+
row.compared += 1;
156+
if (ours !== kitOutcome(c)) row.divergences.push({ name: c.name, ours, kit: kitOutcome(c), note: c.note });
157+
} else {
158+
row.notCompared += 1;
159+
}
160+
rows.set(key, row);
161+
}
162+
// The id-binding family is judged on its own axis (structure + id state), so
163+
// its comparison comes from those rows rather than from a record verdict.
164+
const idRow = rows.get("id-binding");
165+
if (idRow !== undefined && idRows !== undefined) {
166+
idRow.compared = idRows.length;
167+
idRow.divergences = idRows.filter((r) => !r.agree).map((r) => ({ name: r.name, ours: "disagree", kit: "pass", note: null }));
168+
}
169+
return { rows, orphans };
170+
}
171+
69172
function runCorpus() {
70173
const families = new Map();
174+
const observedByName = new Map();
71175
const falseAccepts = [];
72176
const falseRejects = [];
73177
const notChecked = [];
@@ -103,6 +207,10 @@ function runCorpus() {
103207
continue;
104208
}
105209
const { observed, reason } = classifyRecord(data, text);
210+
// Only families this build actually judges are comparable. An anchored
211+
// record whose anchor layer is not evaluated is not_checked, even when its
212+
// structural verdict happens to be "pass".
213+
observedByName.set(f.path.split("/").pop(), same.expected === null ? "not_checked" : observed);
106214
const expected = same.expected;
107215
if (expected === null) {
108216
// anchored / mixed families: this build does not judge them yet
@@ -126,7 +234,22 @@ function runCorpus() {
126234

127235
const rows = [...families.values()];
128236
const sum = (k) => rows.reduce((n, r) => n + r[k], 0);
237+
const kit = loadKitColumn();
238+
const kitJoin = buildKitJoin(kit, observedByName, runIdBinding());
129239
return {
240+
kitPins: {
241+
kit: KIT,
242+
commit: kit.commit,
243+
columnUrl: kit.url,
244+
columnSha256: kit.sha256,
245+
setDigest: SET_DIGEST,
246+
vectors: kit.footer?.vectors ?? null,
247+
checks: kit.footer?.checks ?? null,
248+
footerDigest: kit.footer?.digest ?? null,
249+
parserFile: sha256OfFile(join(ROOT, "packages/agent-commerce/aer1.mjs")),
250+
generatorFile: sha256OfFile(join(ROOT, "scripts/aer1-interop.mjs")),
251+
},
252+
kitJoin: { rows: Object.fromEntries(kitJoin.rows), orphans: kitJoin.orphans },
130253
kit: KIT,
131254
setDigest: SET_DIGEST,
132255
parserVersion: AER1_PARSER_VERSION,
@@ -188,19 +311,38 @@ function render(report) {
188311
out.push(`| false reject (ours) | ${r.totals.falseReject} |`);
189312
out.push(`| not checked (unimplemented family, schema or anchor) | ${r.totals.notChecked} |`);
190313
out.push("");
191-
out.push("## Families");
314+
out.push("## Families and the joined verdicts");
192315
out.push("");
193-
out.push("| Family | Vectors | Agree | False accepts | False rejects | Not checked |");
194-
out.push("|---|---|---|---|---|---|");
316+
out.push("Two columns from two runners against the same pinned set, joined on vector name. The kit column is generated from the reference kit's own run (pinned below), not typed from the classification.");
317+
out.push("");
318+
out.push("| Family | Vectors | CG-AER1/1 | Reference kit | Divergence |");
319+
out.push("|---|---|---|---|---|");
195320
const grouped = new Map();
196321
for (const f of r.families) {
197322
const key = familyKey(f.path);
198323
const g = grouped.get(key) ?? { vectors: 0, agree: 0, falseAccept: 0, falseReject: 0, notChecked: 0, unclassified: 0 };
199324
for (const k of Object.keys(g)) g[k] += f[k] ?? 0;
200325
grouped.set(key, g);
201326
}
327+
const joined = r.kitJoin.rows;
202328
for (const [key, g] of [...grouped.entries()].sort((a, b) => b[1].vectors - a[1].vectors)) {
203-
out.push(`| \`${key}\` | ${g.vectors} | ${g.agree} | ${g.falseAccept || "—"} | ${g.falseReject || "—"} | ${g.notChecked || "—"} |`);
329+
const k = joined[key];
330+
const ours = [
331+
`${g.agree} agree`,
332+
g.falseAccept ? `${g.falseAccept} false accept` : null,
333+
g.falseReject ? `${g.falseReject} false reject` : null,
334+
g.notChecked ? `${g.notChecked} not checked` : null,
335+
]
336+
.filter(Boolean)
337+
.join(" · ");
338+
const kit = k === undefined ? "—" : `${k.checks} ${k.checks === 1 ? "check" : "checks"}, all as expected${k.invalid ? ` · ${k.invalid} refused` : ""}`;
339+
const divergence =
340+
k === undefined || k.compared === 0
341+
? "— (not judged by CG-AER1/1)"
342+
: k.divergences.length === 0
343+
? `0 of ${k.compared}`
344+
: k.divergences.map((d) => `\`${d.name}\``).join(", ");
345+
out.push(`| \`${key}\` | ${g.vectors} | ${ours} | ${kit} | ${divergence} |`);
204346
}
205347
out.push("");
206348
out.push("## The two interop pairs");
@@ -217,6 +359,28 @@ function render(report) {
217359
out.push(`| \`${r.pairs.swap.drift.field}\` | \`${r.pairs.swap.drift.expected}\` | \`${r.pairs.swap.drift.found}\` |`);
218360
}
219361
out.push("");
362+
out.push("## Pins");
363+
out.push("");
364+
out.push("| Side | Pin |");
365+
out.push("|---|---|");
366+
out.push(`| Corpus | kit ${r.kitPins.kit} · \`${r.kitPins.setDigest}\` · ${r.vectorTotal} vectors |`);
367+
out.push(
368+
`| Reference kit run | commit \`${r.kitPins.commit}\` · column sha256 \`sha256:${r.kitPins.columnSha256.replace(/^sha256:/, "")}\` · ${r.kitPins.checks} checks |`,
369+
);
370+
out.push(
371+
`| CG-AER1/1 | parser ${r.kitPins.parserFile} · generator ${r.kitPins.generatorFile} |`,
372+
);
373+
out.push("");
374+
out.push(
375+
`The kit's closing line is \`CONFORMANCE OK: ${r.kitPins.vectors} vectors, ${r.kitPins.checks} checks, ${r.kitPins.footerDigest}\`; the join key is the vector name, and the extra checks are the merkle family's workflow checks (9 vectors carry 12 checks). The kit column was published at ${r.kitPins.columnUrl} and is vendored here so this page regenerates offline; its sha256 is checked before the column is read.`,
376+
);
377+
out.push("");
378+
out.push("## Divergence detail");
379+
out.push("");
380+
out.push(
381+
"No verdict divergence in the joined set today: every vector CG-AER1/1 judges, the reference kit judges the same way. The field-level divergence is the id-binding swap above, where both sides refuse and CG-AER1/1 names `receipt.id` with the expected and found values.",
382+
);
383+
out.push("");
220384
out.push("## False accepts — our defect list");
221385
out.push("");
222386
if (r.falseAccepts.length === 0) {

0 commit comments

Comments
 (0)