code wiki / (root) / nx_comparestale.nx

nx_comparestale.nx

buildroot/runtime/nx_comparestale.nx

8517 B191 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tooltopic comparestale
docsdependenciesstructsconstsfunctions

about

nx_comparestale.nx -- IS EVERY PUBLISHED COMPARE PAGE STILL TRUE TO ITS SOURCE? WHY THIS EXISTS. /compare/doctor sat a MONTH stale, publishing "THE root blocker: emitted ELFs carry no line mapping" long after that stopped being true -- with a perfectly valid generated_unix. Nothing could see it, because nothing compared the page to the thing it was generated from. A TIMESTAMP TELLS YOU WHEN A PAGE WAS MADE, NEVER WHETHER IT IS CURRENT. HOW. Both generators now stamp "source_hash" = djb2-48 over the .matrix/.sota they read. This organ recomputes that hash from the source on disk and compares it to the published page. Deliberately CLOCK-FREE: mtimes lie across copies (this tree has TWO knowledge/compare directories and I lost an edit to exactly that) and clocks lie across machines. Content does not. VERDICTS, and the distinction is the point: FRESH page hash == source hash STALE page exists and disagrees with its source -> the source of truth moved, publish did not UNPUBLISHED source exists, no page -> never generated, or gate-refused NOSTAMP page predates the provenance stamp -> republish once and it becomes decidable Exit 1 if any STALE. UNPUBLISHED does NOT fail the gate: a domain whose matrix gate legitimately refuses (legal, present>=5) must not be reported as drift -- CONFLATING "REFUSED" WITH "DRIFTED" IS THE SAME DEFECT THIS ESTATE KEEPS PAYING FOR. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_comparestale_lib.nx nx_comparestale.nx

imports: nx_syscalls.nxnx_comparestale_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main cd_equal cd_command cd_buffer_command cd_puts cd_len cd_hash_valid cd_len ↻ cd_len ↻ cd_file_init cd_scan_buffer cd_file_init ↻ sha256_workspace_bytes sha256_context_aligned_byt cd_len ↻ sha256_init_workspace sha256_workspace_bytes ↻ sha256_context_aligned_byt ↻ sha256_seed_allocated sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ cd_prefix cd_scan cd_file_init ↻ sha256_workspace_bytes ↻ cd_len ↻ fio_region_init sha256_init_workspace ↻ fio_region_open fio_region_init ↻ fio_region_fail fio_region_close

structs

none

consts

24const CS_MAGIC_5381: i64 = 5381
25const CS_MAGIC_8192: i64 = 8192
26const CS_MAGIC_1024: i64 = 1024
27const CS_MAGIC_8000: i64 = 8000
29const CS_CAP: i64 = 262144

functions

31func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: wnmain calls 1: sys_write
32func wn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
45func cs_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
57func cs_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
64func cs_hash(b: *u8, n: i64) -> i64
called by 1: main
71func cs_find(b: *u8, n: i64, pat: *u8) -> i64
called by 1: main
84func cs_int_at(b: *u8, n: i64, off: i64) -> i64
called by 1: main
97func main(argc: i64, argv: *i64) -> i64