feat(domain): R4.2e OD-3 value cap (400,000), rescue-copy guard, 1 GiB linear ceiling, budget measurements

json_js::MAX_JSON_VALUES from the R4.2e measurements (CAP envelope 39,652 values, 612-leaf
export 23,803; ~100 B of tree per value, a 16 MiB dense document 784 MiB with the cap off,
16 MiB with it); draft.restore refuses an over-budget copy as invalid; --max-memory 1 GiB
proven to trap on the proofs build; cargo pdf_budget prints the value table, the Node
budget suite prints the per-class cost (fresh instance, W4 asserted).
This commit is contained in:
bchanot committed 2026-10-18 16:06:36 +02:00
1 parent f8579bc19a
commit 6ee04c96c5
13 files changed
+599 -14

No files matched your search

+7 -2
View File
@@ -99,11 +99,16 @@ function o8Row(envelope: Envelope): unknown {
}
}
/** O8 cases whose Rust outcome differs on purpose (plan §A.3, OD-4). */
/**
* O8 cases whose Rust outcome differs on purpose (plan §A.3): OD-4, a lone surrogate escape
* in a value a duplicate key overwrote; OD-3, a token-dense document over `MAX_JSON_VALUES`
* (skipped like one nested too deep, so the kind follows the stamp).
*/
const DECLARED: Record<string, unknown> = {
'surrogate-content-overwritten': { ok: false, kind: 'lone_surrogate' },
'surrogate-version-overwritten': { ok: false, kind: 'lone_surrogate' },
'two-files-decoy-first': { ok: false, kind: 'lone_surrogate' },
'values-1m': { ok: false, kind: 'attachment_stripped' },
}
function pdfsUnder(dir: string): string[] {
@@ -150,7 +155,7 @@ describe('R4 PDF import through the shipped module (Node)', () => {
if (c.id in DECLARED) declared += 1
expect(o8Row(envelope), c.id).toEqual(expected)
}
expect(declared).toBe(3)
expect(declared).toBe(4)
expect(runtime.status).toBe('ready')
})