code wiki / _hdl_build / nx_legal_blob_gate.nx
nx_legal_blob_gate.nx
buildroot/runtime/_hdl_build/nx_legal_blob_gate.nx
about
nx_legal_blob_gate.nx -- GATE for doc-blob persistence (ls_blob_save/load), ENGINEER verify.
Completes the durability story: the actual document BYTES survive a restart (the
workflow state already did via D7/D8; the blob is the doc itself). Composes
nx_legal_store (blob save/load) + nx_doc_serve (serve byte-exact), each w/ a control:
T1 ROUND-TRIP : a blob with adversarial bytes (CRLFCRLF + NUL) reloads byte-exact
T2 SERVE BYTE-EXACT: serving the RELOADED blob via nx_doc_serve round-trips bit-for-bit
(the served document == the persisted bytes == what was sealed)
T3 TENANT ISOLATION: another tenant's blob path is a different file -> absent; bad tenant rejected
T4 ABSENT + CORRUPT: missing -> -1 ; wrong-magic -> -MAGIC (never silent garbage)
T5 LARGE BLOB : a 1000-byte doc round-trips exactly (not just tiny)
nx_legal_store's record save/load is UNCHANGED (blob funcs are additive) -> no regression.
Evidence -> knowledge/status/legal_blob.log
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_legal_store.nxnx_doc_serve.nxnx_doc_vault.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 21 | const LBLOB_LOG: *u8 = "knowledge/status/legal_blob.log" |
| 22 | const LBLOB_BASE: *u8 = "/tmp/nx_blob_" |
functions
| 24 | func ew(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 25 | func ewn(fd: i64, v: i64) -> i64 |
| 35 | func main() -> i64 |