code wiki / _hdl_build / nx_legal_blob_gate.nx

nx_legal_blob_gate.nx

buildroot/runtime/_hdl_build/nx_legal_blob_gate.nx

5212 B126 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic legal
docsdependenciesstructsconstsfunctions

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

nx_legal_store.nx nx_doc_serve.nx nx_doc_vault.nx nx_syscalls.nx nx_legal_blob_gate.nx

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

main sys_mmap ls_path nx_vault_valid_tid ls_cat ls_blob_save sys_openat_wr sys_mmap ↻ sys_write sys_close ls_blob_load sys_openat_rd sys_mmap ↻ sys_read sys_close ↻ nx_doc_serve_response ds_cat nx_doc_content_type ds_num sys_mmap ↻ nx_doc_serve_roundtrip_ok ds_body_off sys_openat_wr ↻ sys_write ↻ sys_close ↻ ew sys_write ↻ ewn sys_mmap ↻ sys_write ↻ sys_openat_append

structs

none

consts

21const LBLOB_LOG: *u8 = "knowledge/status/legal_blob.log"
22const LBLOB_BASE: *u8 = "/tmp/nx_blob_"

functions

24func 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 }
called by 1: main calls 1: sys_write
25func ewn(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
35func main() -> i64