commit c846c7b325eaa870480f6bcf61b1cf7b701a89fc
parent 460f323f22a2b2b8f737a48134a6d3475cdb8257
Author: triesap <tyson@radroots.org>
Date: Sun, 11 Oct 2026 13:47:00 +0000
test: qualify the complete public contract matrix (HCP-129)
- Replay sixteen additional browser templates through actual pinned Rust.
- Verify precise values, raw markers and incompatible head ordering.
- Retain actual malformed-template refusals and public runtime checks.
- Preserve shared fixtures, native inputs and full qualification limits.
Diffstat:
4 files changed, 741 insertions(+), 4 deletions(-)
diff --git a/web/tests/conformance/food-qualified-matrix.test.ts b/web/tests/conformance/food-qualified-matrix.test.ts
@@ -0,0 +1,200 @@
+import assert from 'node:assert/strict';
+import { readFile } from 'node:fs/promises';
+import { after, test } from 'node:test';
+import { finalizeEvent } from 'applesauce-core/helpers';
+import {
+ qualifiedDrafts,
+ qualifiedTemplates
+} from './food-qualified-matrix.ts';
+import { checkFoodReplay } from './food-bidirectional.ts';
+import { readFoodEvent } from '../../src/lib/contracts/food-availability-v1/read.ts';
+import { verifyEnvelope } from '../../src/lib/nostr/verified-envelope.ts';
+import {
+ createPublicHeadCandidate,
+ selectPublicHead,
+ publicHeadSnapshot
+} from '../../src/lib/catalog/heads.ts';
+
+const root = new URL(
+ '../../../contracts/interop/food_availability/',
+ import.meta.url
+);
+const inputs = await Promise.all(
+ [
+ 'corpus.v1.json',
+ 'source_profile.v1.json',
+ 'provenance.v1.json',
+ 'oracle/src/main.rs'
+ ].map(async (name) => [name, await readFile(new URL(name, root))] as const)
+);
+const receipt: unknown = JSON.parse(
+ await readFile(
+ new URL('./food-qualified-writer-rust.v1.json', import.meta.url),
+ 'utf8'
+ )
+);
+const secret = crypto.getRandomValues(new Uint8Array(32));
+after(() => secret.fill(0));
+const signed = (
+ tags: readonly (readonly string[])[],
+ created_at: number,
+ content: string
+) =>
+ JSON.stringify(
+ finalizeEvent(
+ { kind: 30402, tags: tags.map((row) => [...row]), created_at, content },
+ secret
+ )
+ );
+function head(raw: string) {
+ const proof = verifyEnvelope(raw);
+ assert.equal(proof.ok, true);
+ if (!proof.ok) throw new Error('Invalid signed test event');
+ const candidate = createPublicHeadCandidate(proof.value);
+ assert.ok(candidate);
+ return candidate;
+}
+
+void test('separate sixteen boundary recipes replay actual pinned Rust consumption without changing original shared fixtures', () => {
+ checkFoodReplay(receipt, qualifiedTemplates, inputs);
+ assert.equal(qualifiedTemplates.length, 16);
+ assert.notEqual(
+ qualifiedDrafts[9].identifier,
+ qualifiedDrafts[10].identifier
+ );
+ assert.equal(
+ qualifiedDrafts[9].identifier.normalize('NFC'),
+ qualifiedDrafts[10].identifier.normalize('NFC')
+ );
+});
+
+void test('actual SDK signed boundary templates preserve exact decimals, Unicode, timestamps and unknown quantity in the reader', () => {
+ for (const [index, row] of qualifiedTemplates.entries()) {
+ const result = readFoodEvent(
+ signed(row.wire_parts.tags, row.created_at, row.wire_parts.content)
+ );
+ assert.equal(result.outcome, 'admitted', row.id);
+ if (result.outcome !== 'admitted') throw new Error(row.id);
+ const draft = qualifiedDrafts[index];
+ assert.equal(result.projection.identifier, draft.identifier);
+ assert.equal(result.projection.title, draft.title);
+ assert.equal(result.projection.location, draft.location);
+ assert.equal(result.projection.content, row.wire_parts.content);
+ assert.equal(result.projection.published_at, draft.published_at);
+ assert.equal(result.projection.price.amount, draft.amount);
+ assert.equal(result.projection.status, draft.status);
+ assert.deepEqual(
+ result.projection.quantity,
+ draft.quantity === undefined
+ ? null
+ : { amount: draft.quantity, unit: draft.unit }
+ );
+ }
+});
+
+void test('complete raw marker intersections remain ambiguous before shape checks and incompatible newer heads suppress older food in both arrival orders', () => {
+ const base = qualifiedTemplates[0];
+ const core = base.wire_parts.tags.filter(
+ (row) => !['radroots:price_unit', 'radroots:quantity'].includes(row[0])
+ );
+ const oldRaw = signed(
+ base.wire_parts.tags,
+ base.created_at,
+ base.wire_parts.content
+ );
+ assert.equal(readFoodEvent(oldRaw).outcome, 'admitted');
+ const old = head(oldRaw);
+ let combinations = 0;
+ for (const focused of ['radroots:price_unit', 'radroots:quantity'])
+ for (const operational of [
+ 'radroots:primary_bin',
+ 'radroots:bin',
+ 'radroots:price'
+ ])
+ for (const focusedArity of [1, 2, 3])
+ for (const operationalArity of [1, 2, 3]) {
+ const marker = (name: string, length: number) =>
+ [name, 'kg', 'extra'].slice(0, length);
+ const raw = signed(
+ [
+ ...core,
+ marker(focused, focusedArity),
+ marker(operational, operationalArity)
+ ],
+ base.created_at + 1,
+ base.wire_parts.content
+ );
+ const read = readFoodEvent(raw);
+ assert.equal(read.outcome, 'rejected');
+ if (read.outcome !== 'rejected')
+ throw new Error('Mixed marker admitted');
+ assert.equal(read.error.code, 'food_profile_ambiguous');
+ const incompatible = head(raw);
+ assert.equal(selectPublicHead(old, incompatible).head, incompatible);
+ assert.equal(selectPublicHead(incompatible, old).head, incompatible);
+ assert.equal(
+ publicHeadSnapshot(incompatible).created_at,
+ base.created_at + 1
+ );
+ combinations++;
+ }
+ assert.equal(combinations, 54);
+});
+
+void test('equal-time incompatible replacements use the lower actual event ID and never resurrect an older food view', () => {
+ const base = qualifiedTemplates[0];
+ const old = head(
+ signed(base.wire_parts.tags, base.created_at, base.wire_parts.content)
+ );
+ const aRaw = signed(
+ [...base.wire_parts.tags, ['radroots:bin']],
+ base.created_at + 1,
+ 'First incompatible head'
+ );
+ const bRaw = signed(
+ [...base.wire_parts.tags, ['radroots:primary_bin']],
+ base.created_at + 1,
+ 'Second incompatible head'
+ );
+ for (const raw of [aRaw, bRaw])
+ assert.notEqual(readFoodEvent(raw).outcome, 'admitted');
+ const a = head(aRaw),
+ b = head(bRaw);
+ const winner = publicHeadSnapshot(a).id < publicHeadSnapshot(b).id ? a : b;
+ for (const order of [
+ [old, a, b],
+ [b, old, a],
+ [a, b, old]
+ ]) {
+ let current = order[0];
+ for (const candidate of order.slice(1))
+ current = selectPublicHead(current, candidate).head;
+ assert.equal(current, winner);
+ }
+});
+
+void test('maximum-safe signed envelope cannot launder fractional numeric source spelling through JSON rounding', () => {
+ const base = qualifiedTemplates[5];
+ const raw = signed(
+ base.wire_parts.tags,
+ base.created_at,
+ base.wire_parts.content
+ );
+ assert.equal(verifyEnvelope(raw).ok, true);
+ for (const spelling of [
+ '9007199254740991.0',
+ '9007199254740991.0000000001',
+ '9.007199254740991e15'
+ ]) {
+ const altered = raw.replace(
+ '"created_at":9007199254740991',
+ `"created_at":${spelling}`
+ );
+ assert.notEqual(altered, raw);
+ assert.equal(
+ (JSON.parse(altered) as { created_at: number }).created_at,
+ base.created_at
+ );
+ assert.equal(verifyEnvelope(altered).ok, false, spelling);
+ }
+});
diff --git a/web/tests/conformance/food-qualified-matrix.ts b/web/tests/conformance/food-qualified-matrix.ts
@@ -0,0 +1,96 @@
+import {
+ buildFoodTemplate,
+ type FoodDraft
+} from '../../src/lib/contracts/food-availability-v1/write.ts';
+
+// Browser-owned boundary recipes, separate from the original shared manifest.
+// Actual Rust consumes these unsigned templates; no signature or key is stored.
+const base: FoodDraft = {
+ identifier: 'qualified-base',
+ title: 'Fresh food',
+ description: 'Food available locally.',
+ location: 'Victoria',
+ published_at: 1700000000,
+ created_at: 1700000060,
+ amount: '1',
+ currency: 'CAD',
+ unit: 'kg',
+ quantity: '1',
+ status: 'active'
+};
+const minimum = '0.' + '0'.repeat(26) + '1';
+export const qualifiedDrafts: readonly FoodDraft[] = [
+ { ...base, identifier: 'qualified-smallest-price', amount: minimum },
+ {
+ ...base,
+ identifier: 'qualified-mixed-price',
+ amount: '12345678901234.56789012345678'
+ },
+ {
+ ...base,
+ identifier: 'qualified-largest-quantity',
+ quantity: '9999999999999999999999999999'
+ },
+ { ...base, identifier: 'qualified-smallest-quantity', quantity: minimum },
+ {
+ ...base,
+ identifier: 'qualified-free-unknown-quantity',
+ amount: '0',
+ quantity: undefined
+ },
+ {
+ ...base,
+ identifier: 'qualified-max-safe-clock',
+ created_at: Number.MAX_SAFE_INTEGER,
+ published_at: Number.MAX_SAFE_INTEGER
+ },
+ { ...base, identifier: 'qualified-unicode-title', title: 'š„'.repeat(160) },
+ {
+ ...base,
+ identifier: 'qualified-unicode-location',
+ location: 'ę¼¢'.repeat(160)
+ },
+ {
+ ...base,
+ identifier: 'qualified-unicode-content',
+ description: 'š„'.repeat(4096)
+ },
+ { ...base, identifier: 'qualified-Ć©' },
+ { ...base, identifier: 'qualified-e\u0301' },
+ { ...base, identifier: 'Qualified:Case:ID' },
+ {
+ ...base,
+ identifier: 'qualified-sold-unknown-quantity',
+ status: 'sold',
+ quantity: undefined
+ },
+ {
+ ...base,
+ identifier: 'qualified-normalized-lines',
+ description: ' Fresh š„\r\nAvailable today.\rLocally. '
+ },
+ {
+ ...base,
+ identifier: 'qualified-earliest-clock',
+ published_at: 1,
+ created_at: 1
+ },
+ {
+ ...base,
+ identifier: 'qualified-largest-price-mixed-quantity',
+ amount: '9999999999999999999999999999',
+ quantity: '12345678901234.56789012345678',
+ unit: 'basket',
+ status: 'sold'
+ }
+];
+export const qualifiedTemplates = qualifiedDrafts.map((draft, index) => {
+ const built = buildFoodTemplate(draft);
+ if (!built.ok) throw new Error(`${draft.identifier}: ${built.error.code}`);
+ return {
+ id: `qualified_writer_${index.toString().padStart(3, '0')}`,
+ created_at: draft.created_at,
+ wire_parts: built.wire_parts,
+ summary: built.summary
+ };
+});
diff --git a/web/tests/conformance/food-qualified-writer-rust.v1.json b/web/tests/conformance/food-qualified-writer-rust.v1.json
@@ -0,0 +1,331 @@
+{
+ "schema_version": 1,
+ "revision": "189c49b74b4bafc142b00b76b296477931139e72",
+ "qualification": "FIXTURE_ONLY_NOT_DEPLOYED_TERA",
+ "signing": "NOT_RUN_NO_KEYS",
+ "web_input_sha256": "0cbcc57c1a6d29014c769dacdcb7f37081a96d486a8751eccebd2bc6fdaa81ab",
+ "inputs": {
+ "corpus.v1.json": "a8d23bf128facbb0752c8b78c826ff765ac033d66ab9d29609aba9940ad7b682",
+ "source_profile.v1.json": "dede1eb1f682ecd548e8cd3ccb251d298762e504e2588a73528e5f7a5b9eff21",
+ "provenance.v1.json": "ae0ee1ff898a6cc9da3a89fd56d2340bff54297995e5c6add2b9e0f5d20e3f0d",
+ "oracle/src/main.rs": "fd2ea8f79c72c17a682e9f27fe020e91933475c2a7218937da60fbb2d42e2432"
+ },
+ "result": {
+ "revision": "189c49b74b4bafc142b00b76b296477931139e72",
+ "signing": "NOT_RUN_NO_KEYS",
+ "source": "actual_public_food_constructors_and_unsigned_codec",
+ "templates": [
+ {
+ "id": "qualified_writer_000",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-smallest-price"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "0.000000000000000000000000001", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_001",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-mixed-price"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "12345678901234.56789012345678", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_002",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-largest-quantity"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "9999999999999999999999999999", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_003",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-smallest-quantity"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "0.000000000000000000000000001", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_004",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-free-unknown-quantity"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "0", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_005",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-max-safe-clock"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "9007199254740991"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_006",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-unicode-title"],
+ [
+ "title",
+ "š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„"
+ ],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_007",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-unicode-location"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ [
+ "location",
+ "漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢漢"
+ ],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_008",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-unicode-content"],
+ ["title", "Fresh food"],
+ [
+ "summary",
+ "š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„š„"
+ ],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_009",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-Ć©"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_010",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-eĢ"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_011",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "Qualified:Case:ID"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_012",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-sold-unknown-quantity"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["status", "sold"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_013",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Fresh š„\nAvailable today.\nLocally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-normalized-lines"],
+ ["title", "Fresh food"],
+ ["summary", "Fresh š„ Available today. Locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_014",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-earliest-clock"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1"],
+ ["location", "Victoria"],
+ ["price", "1", "CAD"],
+ ["radroots:price_unit", "kg"],
+ ["radroots:quantity", "1", "kg"],
+ ["status", "active"]
+ ]
+ }
+ },
+ {
+ "id": "qualified_writer_015",
+ "result": "accepted",
+ "wire_parts": {
+ "content": "Food available locally.",
+ "kind": 30402,
+ "tags": [
+ ["d", "qualified-largest-price-mixed-quantity"],
+ ["title", "Fresh food"],
+ ["summary", "Food available locally."],
+ ["published_at", "1700000000"],
+ ["location", "Victoria"],
+ ["price", "9999999999999999999999999999", "CAD"],
+ ["radroots:price_unit", "basket"],
+ ["radroots:quantity", "12345678901234.56789012345678", "basket"],
+ ["status", "sold"]
+ ]
+ }
+ }
+ ]
+ }
+}
diff --git a/web/tools/check-food-interop.mjs b/web/tools/check-food-interop.mjs
@@ -14,6 +14,7 @@ import { spawnSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { format, resolveConfig } from 'prettier';
import { webTemplates } from '../tests/conformance/food-writer-cases.ts';
+import { qualifiedTemplates } from '../tests/conformance/food-qualified-matrix.ts';
import { createFoodReplay } from '../tests/conformance/food-bidirectional.ts';
const web = fileURLToPath(new URL('../', import.meta.url));
@@ -22,10 +23,15 @@ const fixture = new URL(
'../tests/conformance/food-writer-rust.v1.json',
import.meta.url
);
+const qualifiedFixture = new URL(
+ '../tests/conformance/food-qualified-writer-rust.v1.json',
+ import.meta.url
+);
const args = process.argv.slice(2);
assert.ok(
- args.length === 0 || (args.length === 1 && args[0] === '--write'),
- 'expected no arguments or explicit --write'
+ args.length === 0 ||
+ (args.length === 1 && ['--write', '--write-qualified'].includes(args[0])),
+ 'expected no arguments, --write or browser-only --write-qualified'
);
assert.equal(process.versions.node, '24.21.0');
const run = (command, argv, cwd = root) => {
@@ -117,6 +123,15 @@ try {
rejected.stderr.includes('website template rejected:'),
rejected.stderr
);
+ console.log(
+ JSON.stringify({
+ direction: 'WEB_TO_RUST_NEGATIVE',
+ batch: 'original',
+ mutation,
+ exit_code: rejected.status,
+ actual_stderr: rejected.stderr
+ })
+ );
}
if (args[0] === '--write') {
// Refresh producer provenance only after actual Rust corpus equality,
@@ -179,6 +194,98 @@ try {
receipt,
'checked website/Rust replay is stale; regenerate explicitly with --write'
);
+ // Qualify a separate browser-owned boundary batch. The original sixteen
+ // recipes/shared manifest remain byte-exact and are still checked above.
+ await writeFile(
+ candidate,
+ JSON.stringify(qualifiedTemplates, null, 2) + '\n'
+ );
+ const qualifiedActual = JSON.parse(
+ success('cargo', [...cargo, '--consume-web', candidate])
+ );
+ const qualifiedControls = [
+ 'amount-digits',
+ 'fraction-digits',
+ 'quantity-zero',
+ 'quantity-unit',
+ 'published-unsafe',
+ 'created-unsafe',
+ 'text-format',
+ 'identifier-space',
+ 'operational-marker',
+ 'price-frequency'
+ ];
+ for (const mutation of qualifiedControls) {
+ const altered = qualifiedTemplates.map((row) => ({
+ ...row,
+ wire_parts: {
+ ...row.wire_parts,
+ tags: row.wire_parts.tags.map((tag) => [...tag])
+ }
+ }));
+ const row = altered[0];
+ const tag = (name) => {
+ const found = row.wire_parts.tags.find((value) => value[0] === name);
+ assert.ok(found, `missing qualified ${name}`);
+ return found;
+ };
+ if (mutation === 'amount-digits') tag('price')[1] = '1'.repeat(29);
+ else if (mutation === 'fraction-digits')
+ tag('price')[1] = '0.' + '0'.repeat(27) + '1';
+ else if (mutation === 'quantity-zero') tag('radroots:quantity')[1] = '0';
+ else if (mutation === 'quantity-unit') tag('radroots:quantity')[2] = 'lb';
+ else if (mutation === 'published-unsafe')
+ tag('published_at')[1] = '9007199254740992';
+ else if (mutation === 'created-unsafe') row.created_at = 9007199254740992;
+ else if (mutation === 'text-format') tag('title')[1] = 'Food\u200d';
+ else if (mutation === 'identifier-space')
+ tag('d')[1] = 'invalid identifier';
+ else if (mutation === 'operational-marker')
+ tag('radroots:quantity')[0] = 'radroots:bin';
+ else tag('price').push('weekly');
+ await writeFile(candidate, JSON.stringify(altered, null, 2) + '\n');
+ const rejected = run('cargo', [...cargo, '--consume-web', candidate]);
+ assert.equal(
+ rejected.status,
+ 101,
+ `actual Rust accepted qualified ${mutation} or did not execute`
+ );
+ assert.ok(
+ rejected.stderr.includes('website template rejected:'),
+ rejected.stderr
+ );
+ console.log(
+ JSON.stringify({
+ direction: 'WEB_TO_RUST_NEGATIVE',
+ batch: 'qualified',
+ mutation,
+ exit_code: rejected.status,
+ actual_stderr: rejected.stderr
+ })
+ );
+ }
+ const qualifiedReceipt = createFoodReplay(
+ qualifiedActual,
+ qualifiedTemplates,
+ await readInputs()
+ );
+ if (['--write', '--write-qualified'].includes(args[0])) {
+ // Browser-only mode writes only this replay. Native/shared producer and
+ // original fixture/manifest outputs are checked without regeneration.
+ const filepath = fileURLToPath(qualifiedFixture);
+ await writeFile(
+ qualifiedFixture,
+ await format(JSON.stringify(qualifiedReceipt), {
+ ...(await resolveConfig(filepath)),
+ filepath
+ })
+ );
+ } else
+ assert.deepEqual(
+ JSON.parse(await readFile(qualifiedFixture, 'utf8')),
+ qualifiedReceipt,
+ 'qualified browser/Rust replay is stale; regenerate explicitly with --write-qualified'
+ );
// The shared consumer manifest binds these exact provenance/replay bytes.
success(
process.execPath,
@@ -198,7 +305,8 @@ try {
'food-reader.test.ts',
'food-writer.test.ts',
'food-corpus.test.ts',
- 'food-bidirectional.test.ts'
+ 'food-bidirectional.test.ts',
+ 'food-qualified-matrix.test.ts'
])
assert.ok(
tests.includes(required),
@@ -220,7 +328,9 @@ try {
revision: receipt.revision,
reader_cases: readerCases,
writer_cases: webTemplates.length,
- deliberate_mutations_rejected_by_actual_rust: 2,
+ qualified_writer_cases: qualifiedTemplates.length,
+ deliberate_mutations_rejected_by_actual_rust:
+ 2 + qualifiedControls.length,
signing: 'NOT_RUN_NO_KEYS'
})
);