Skip to content

Commit 9f243b9

Browse files
feat(intake): convert-to-fixture.mjs - the green candidate becomes an engine-verified fixture in one command
The converter (renamed from convert.mjs to say what it produces, not what it does) is the intake kit's final leg: a gate-green candidate becomes the ten DDE records plus a re-pinned hashes.json and an engine-verified verdict - exit 0 means ready for submission, nothing else to run. Hardened and completed in this pass: - the success report now prints every engine check verdict (the per-check block names all ten: 9 PASS + E5 CONSENT_BINDING NOT_RUN, honest about the missing adapter, never faked), and quotes the binding boundary verbatim twice - in the header and the closing line; - the self-verification one-liner it prints uses the SDK's fixtureDir entry (the committed verify-fixture.mjs CLI is pinned to its own directory), so the "re-verify any time" instruction actually works on any converted output; - all references updated (both READMEs + the intake contract test), and the contract test now also asserts the report quotes the boundary verbatim and names the E5 NOT_RUN verdict - the report cannot quietly stop being honest. The pipeline is unchanged: GATE GREEN mandatory (exit 1 otherwise, nothing converts), faithful packaging (no field rewriting), pins re-read against disk (mismatch aborts), engine gate on the result. 894/894. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent a02e3c3 commit 9f243b9

4 files changed

Lines changed: 36 additions & 19 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,10 @@ one-page shareable integration summary (drop-in for discussions and social posts
326326
Got a **real** paid transaction with two consenting parties? The
327327
[real-fixture intake kit](examples/real-fixture-intake/) converts it into a
328328
redacted review-ready fixture: bilateral consent with a named disclosure
329-
scope, a removal checklist, a fail-closed pre-publication gate, and the
330-
submission procedure.
329+
scope, a removal checklist, a fail-closed pre-publication gate, and
330+
`convert-to-fixture.mjs` — one command from a gate-green candidate to the
331+
ten records with re-pinned hashes and an engine-verified verdict
332+
(exit 0 ready · 1 gate red/rejected · 2 usage).
331333

332334
## AgentProof — actor provenance
333335

@@ -441,7 +443,7 @@ test/ canonicalization · policy · tamper suites + adversarial runner +
441443
examples/ transfer · swap · multistep · live · vault (Phase-1 reference ladder) (runnable, with READMEs + artifacts)
442444
delivery-fixture/ — DDE/1 bilateral dispute fixture (synthetic, replayable: node examples/delivery-fixture/verify-fixture.mjs)
443445
agent-platform-integration/ — payout gated on DDE: SDK arc + wire-level gate with a criteria-based scenario rejection (runnable)
444-
real-fixture-intake/ — real-case intake: consent + signed disclosure scope → removal gate → convert.mjs → review-ready REAL fixture
446+
real-fixture-intake/ — real-case intake: consent + signed disclosure scope → removal gate → convert-to-fixture.mjs → review-ready REAL fixture
445447
— external integration path (three tiers): delivery-fixture = schema proof · agent-platform-integration = embed the gate · real-fixture-intake = go real
446448
templates/ integration/ — consumer scaffold for create-coreguard-integration
447449
scripts/ anchor-local.ps1/.sh — local fork anchor proof ·

‎examples/real-fixture-intake/README.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ anchors to a real Core Mainnet transaction.
3939
| [`consent-template.json`](./consent-template.json) | Both parties' consent: EIP-712 redaction grants (E5 wire format), disclosure scope, record-closure agreement, declarations |
4040
| [`removal-checklist.json`](./removal-checklist.json) | Pre-publication secret/personal-data removal — machine gates + (HUMAN) judgment items with operator sign-off |
4141
| [`prelude.mjs`](./prelude.mjs) | The machine-checkable gate: secret scan, origin truth, both-party consent replay, pin integrity — fail-closed, `NOT_CHECKED` never faked |
42-
| [`convert.mjs`](./convert.mjs) | Candidate → DDE fixture in one command: green gate mandatory → ten records + pin manifest → engine-verified. Exit `0` ready · `1` gate red/rejected · `2` usage |
42+
| [`convert-to-fixture.mjs`](./convert-to-fixture.mjs) | Candidate → DDE fixture in one command: green gate mandatory → ten records + pin manifest → engine-verified. Exit `0` ready · `1` gate red/rejected · `2` usage |
4343

4444
## The procedure — five steps, no shortcuts
4545

@@ -101,15 +101,15 @@ reported `NOT_CHECKED` — never silently passed.
101101

102102
### 5. Convert + submit
103103

104-
With the gate green, conversion is **one command** — `convert.mjs` runs the
104+
With the gate green, conversion is **one command** — `convert-to-fixture.mjs` runs the
105105
gate again itself (nothing converts without GATE GREEN), packages the ten
106106
records faithfully (JSON, 2-space, LF — no field rewriting: the candidate is
107107
the truth), generates `hashes.json` from the written bytes with a re-read
108108
proof, and runs the engine gate on the result. It never overwrites an
109109
existing output directory and never modifies the candidate:
110110

111111
```bash
112-
node examples/real-fixture-intake/convert.mjs <candidate-dir> <out-dir>
112+
node examples/real-fixture-intake/convert-to-fixture.mjs <candidate-dir> <out-dir>
113113
# exit 0 = out-dir ready: ten records + hashes.json, engine VERIFIED
114114
# exit 1 = gate red, or the engine rejected the converted fixture
115115
# exit 2 = usage error (missing args, candidate missing, out-dir exists)
@@ -121,6 +121,11 @@ Independent re-verification of the output (same gate a reviewer runs):
121121
node -e "import('packages/delivery/sdk.js').then(m => m.verifyFixture({ fixtureDir: '<out-dir>' })).then(r => console.log(r.status, r.decision))"
122122
```
123123

124+
The converter's success report already quotes the decision with every
125+
engine check verdict (E5 `NOT_RUN` is honest, never faked) and the
126+
binding boundary verbatim — *"Execution verification does not decide
127+
delivery conformity."*
128+
124129
Submission paths, in order of preference:
125130

126131
1. **Comment on the public discussion thread** with the fixture attached

examples/real-fixture-intake/convert.mjs renamed to examples/real-fixture-intake/convert-to-fixture.mjs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22
/**
3-
* convert.mjs — candidate → DDE fixture, one command.
3+
* convert-to-fixture.mjs — candidate → DDE fixture, one command.
44
*
55
* Takes an intake candidate that has passed the pre-publication gate
66
* (examples/real-fixture-intake/prelude.mjs → GATE GREEN, exit 0) and
77
* generates the ten DDE records plus the pin manifest, ready for
88
* `verify-fixture.mjs` and submission:
99
*
10-
* node examples/real-fixture-intake/convert.mjs <candidate-dir> <out-dir>
10+
* node examples/real-fixture-intake/convert-to-fixture.mjs <candidate-dir> <out-dir>
1111
* → exit 0 = out-dir ready (records + hashes.json, engine-verified)
1212
* exit 1 = gate RED or a record failed the engine gate after conversion
1313
* exit 2 = usage error (missing args, candidate missing, out-dir exists)
@@ -47,7 +47,7 @@ const RECORDS = [
4747

4848
const argv = process.argv.slice(2);
4949
const usage = (msg) => {
50-
console.error(`usage: convert.mjs <candidate-dir> <out-dir>\n ${msg}\n candidate must have passed the gate: node examples/real-fixture-intake/prelude.mjs <candidate-dir>`);
50+
console.error(`usage: convert-to-fixture.mjs <candidate-dir> <out-dir>\n ${msg}\n candidate must have passed the gate: node examples/real-fixture-intake/prelude.mjs <candidate-dir>`);
5151
process.exit(2);
5252
};
5353
if (argv.length !== 2) usage("exactly two arguments required: <candidate-dir> <out-dir>");
@@ -119,7 +119,7 @@ const fixtureMeta = {
119119
const manifest = {
120120
manifest: {
121121
algorithm: "sha256",
122-
generatedBy: "examples/real-fixture-intake/convert.mjs",
122+
generatedBy: "examples/real-fixture-intake/convert-to-fixture.mjs",
123123
generatedAtUtc: new Date().toISOString(),
124124
selfExcluded: ["hashes.json"],
125125
sourceCandidate: candidateDir,
@@ -154,7 +154,7 @@ const sdkReport = await verifyFixture({ fixtureDir: outDir });
154154
const ok = sdkReport.status === "VERIFIED";
155155

156156
if (!ok) {
157-
console.error(`convert: engine gate REJECTED the converted fixture — ${sdkReport.status}`);
157+
console.error(`convert-to-fixture: engine gate REJECTED the converted fixture — ${sdkReport.status}`);
158158
for (const c of sdkReport.checks ?? []) if (c.result === "FAIL") console.error(` check ${c.id} FAIL — ${(c.mismatches ?? []).join(" · ") || c.name}`);
159159
process.exit(1);
160160
}
@@ -163,16 +163,20 @@ if (!ok) {
163163

164164
const line = "─".repeat(72);
165165
console.log(line);
166-
console.log("convert: candidate → DDE fixture (gate green → records + pins → engine-verified)");
166+
console.log("convert-to-fixture: candidate → DDE fixture (gate green → records + pins → engine-verified)");
167167
console.log(line);
168168
console.log(` candidate : ${candidateDir}`);
169169
console.log(` output : ${outDir}`);
170170
console.log(` records : ${RECORDS.length} + hashes.json (pins re-read and matched against disk)`);
171171
console.log(` origin : ${fixtureMeta.origin} · realDisputeExists: ${fixtureMeta.realDisputeExists} · lifecycle: ${fixtureMeta.lifecycleState}`);
172172
console.log(` engine : ${sdkReport.status} (${sdkReport.summary?.pass ?? "?"}/${sdkReport.summary?.total ?? "?"} PASS)`);
173+
for (const c of sdkReport.checks ?? []) {
174+
const mark = c.result === "PASS" ? "✔" : c.result === "FAIL" ? "✗" : "·";
175+
console.log(` ${mark} ${c.id ?? "?"} ${c.result} — ${c.name ?? ""}${c.result === "NOT_RUN" ? ` (${(c.mismatches ?? [])[0] ?? "no EVM adapter"})` : ""}`);
176+
}
173177
console.log(` decision : ${sdkReport.decision}`);
174178
console.log(line);
175-
console.log("Ready for submission. Re-verify any time:");
176-
console.log(` node examples/delivery-fixture/verify-fixture.mjs (against this directory)`);
179+
console.log("Ready for submission. Re-verify any time (same engine, any directory):");
180+
console.log(" node -e \"import('packages/delivery/sdk.js').then(m => m.verifyFixture({ fixtureDir: process.argv[1] })).then(r => { console.log(r.status, r.decision); process.exit(r.status === 'VERIFIED' ? 0 : 1); })\" -- <out-dir>");
177181
console.log("boundary: Execution verification does not decide delivery conformity.");
178182
process.exit(0);

‎test/delivery/intake.test.js‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { fileURLToPath } from "node:url";
2525
const REPO = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
2626
const FIXTURE_DIR = join(REPO, "examples", "delivery-fixture");
2727
const PRELUDE = join(REPO, "examples", "real-fixture-intake", "prelude.mjs");
28-
const CONVERT = join(REPO, "examples", "real-fixture-intake", "convert.mjs");
28+
const CONVERT = join(REPO, "examples", "real-fixture-intake", "convert-to-fixture.mjs");
2929
const RECORDS = [
3030
"agreement.json", "acceptance-criteria.json", "parties.json", "authorization.json",
3131
"execution-attestation.json", "delivery-manifest.json", "acceptance-record.json",
@@ -157,7 +157,7 @@ test("usage error: missing directory is exit 2, not a gate verdict", () => {
157157
assert.match(r.stderr, /usage:/);
158158
});
159159

160-
test("convert: green candidate → ten records + pins + engine VERIFIED; red candidate refused", async () => {
160+
test("convert-to-fixture: green candidate → ten records + pins + engine VERIFIED; red candidate refused", async () => {
161161
const dir = makeCandidate(mkdtempSync(join(tmpdir(), "dde-conv-ok-")));
162162
const out = join(tmpdir(), "dde-conv-out-" + Date.now() + "-" + Math.random().toString(36).slice(2));
163163
try {
@@ -168,7 +168,7 @@ test("convert: green candidate → ten records + pins + engine VERIFIED; red can
168168
const manifest = JSON.parse(readFileSync(join(out, "hashes.json"), "utf8"));
169169
assert.equal(manifest.fixture.origin, "REAL");
170170
assert.equal(manifest.fixture.realDisputeExists, true);
171-
assert.equal(manifest.manifest.generatedBy, "examples/real-fixture-intake/convert.mjs");
171+
assert.equal(manifest.manifest.generatedBy, "examples/real-fixture-intake/convert-to-fixture.mjs");
172172
for (const name of RECORDS) {
173173
const actual = "0x" + createHash("sha256").update(readFileSync(join(out, name))).digest("hex");
174174
assert.equal(manifest.files[name], actual, `pin mismatch for ${name}`);
@@ -179,19 +179,25 @@ test("convert: green candidate → ten records + pins + engine VERIFIED; red can
179179
assert.equal(report.status, "VERIFIED");
180180
assert.equal(report.hashesManifest, "PRESENT");
181181
assert.equal(report.decision, "EXECUTION_EVIDENCE_ADMISSIBLE — CONFORMITY_UNDECIDED_BY_ENGINE");
182+
// The success report must quote the binding boundary verbatim and name
183+
// every engine check with its verdict (E5 NOT_RUN is honest, never faked).
184+
const outTxt = conv.stdout + (conv.stderr ?? "");
185+
assert.match(outTxt, /Execution verification does not decide delivery conformity/);
186+
assert.match(outTxt, /E5 NOT_RUN — CONSENT_BINDING/);
187+
assert.match(outTxt, /F0 PASS — REQUIRED_RECORDS/);
182188
} finally {
183189
rmSync(dir, { recursive: true, force: true });
184190
rmSync(out, { recursive: true, force: true });
185191
}
186192
});
187193

188-
test("convert: usage errors are exit 2 — out-dir never overwritten", () => {
194+
test("convert-to-fixture: usage errors are exit 2 — out-dir never overwritten", () => {
189195
const conv = spawnSync(process.execPath, [CONVERT], { cwd: REPO, encoding: "utf8" });
190196
assert.equal(conv.status, 2);
191197
assert.match(conv.stderr, /usage:/);
192198
});
193199

194-
test("convert: refuses a candidate that fails the gate — nothing converts without green", () => {
200+
test("convert-to-fixture: refuses a candidate that fails the gate — nothing converts without green", () => {
195201
const empty = mkdtempSync(join(tmpdir(), "dde-conv-red-"));
196202
const out = join(tmpdir(), "dde-conv-out-red-" + Date.now());
197203
try {

0 commit comments

Comments
 (0)