code wiki / _hdl_build / nx_provstmt_lib.nx

nx_provstmt_lib.nx

buildroot/runtime/_hdl_build/nx_provstmt_lib.nx

7004 B136 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_provstmt_lib.nx -- CR3 of /compare/capregistry: BUILD PROVENANCE AS AN in-toto STATEMENT, pure core. THE FINDING THIS SERIALISES, measured 2026-08-29: every /api/build response already returns src_sha256, src_stable and closure_sha256, and /api/promote returns the live artifact sha256 after the rename. Those fields ARE SLSA build provenance -- what source produced this artifact, the digest of its whole transitive input closure, and the digest of what actually went live -- and every caller discards them at the end of the HTTP response. A CAPABILITY THAT IS COMPUTED, RETURNED, AND DISCARDED BY EVERY CALLER IS DARK IN THE MOST EXPENSIVE WAY: THE ESTATE PAYS FOR IT ON EVERY BUILD AND OWNS IT ON NONE. This rung is therefore a SERIALISATION, not a measurement: nothing new is measured, only bound to a subject and written down. WHY THIS IS NOT AN EXTENSION OF nx_coe_intoto, read before deciding: that exporter's predicate is entirely chain-of-evidence specific (frameHash, pillars, a Merkle inclusion proof) and its ed25519 publicKey is a hardcoded literal. Extending it would fork one predicate across two unrelated subjects. Only the ITE-6 Statement SHAPE is shared, and a JSON scaffold is not a ruler. PURE BY CONSTRUCTION: no filesystem, no syscalls beyond the caller's buffers. The organ owns the re-hash-and-refuse policy; this lib owns validation and serialisation, so the gate reaches every rule in-process and a mutation cannot hide behind a fork boundary.

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_provstmt_lib.nx nx_provstmt.nx nx_provstmt_gate.nx

imports: nx_syscalls.nx

imported by: nx_provstmt.nxnx_provstmt_gate.nx

structs

none

consts

22const PV_HEX_LEN: i64 = 64 // sha256 = 32 bytes = 64 hex chars, a DEFINITION not a tunable
23const PV_STMT_CAP: i64 = 4096 // the statement is ~700 B; 4096 leaves 5x headroom and pv_build REFUSES

functions

30func pv_hex_ok(s: *u8) -> i64
called by 3: mainmainpv_build
47func pv_hex_eq(a: *u8, b: *u8) -> i64
called by 2: mainmain
59func pv_hex_of(dig: *u8, out: *u8) -> i64
called by 2: mainmain
77func pv_cat(d: *u8, o: i64, s: *u8) -> i64
called by 2: pv_cqpv_build
84func pv_q(d: *u8, o: i64) -> i64 { d[o] = 34 as u8; return o + 1 }
called by 1: pv_cq
86func pv_cq(d: *u8, o: i64, s: *u8) -> i64
called by 1: pv_build calls 2: pv_qpv_cat
97func pv_build(J: *u8, target: *u8, art_sha: *u8, src_sha: *u8, closure_sha: *u8) -> i64
called by 2: mainmain calls 3: pv_hex_okpv_catpv_cq