nx_comparestale_dependency_t138.nx
buildroot/runtime/nx_comparestale_dependency_t138.nx
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 4 imports · 3 importers
imports: nx_syscalls.nxnx_fio.nxnx_sha256.nxjson_emit.nx
imported by: nx_comparestale_canonical_cli_gate_t138.nxnx_comparestale_dependency_cli_t138.nxnx_comparestale_dependency_gate_t138.nx
structs
| 207 | struct CsDependencyFile |
consts
| 24 | const CS_MAGIC_5381: i64 = 5381 |
| 25 | const CS_MAGIC_8192: i64 = 8192 |
| 26 | const CS_MAGIC_1024: i64 = 1024 |
| 27 | const CS_MAGIC_8000: i64 = 8000 |
| 29 | const CS_CAP: i64 = 262144 |
| 198 | const CD_ABI_WORD_BYTES: i64=8 |
| 199 | const CD_REGION_BYTES: i64=9*CD_ABI_WORD_BYTES |
| 200 | const CD_FILE_BYTES: i64=6*CD_ABI_WORD_BYTES |
| 201 | const CD_WRITER_BYTES: i64=5*CD_ABI_WORD_BYTES |
| 202 | const CD_HASH_CHARS: i64=64 |
| 203 | const CD_I64_MAX: i64=9223372036854775807 |
| 204 | const CD_SCHEMA_FIELDS: i64=32 |
| 205 | const CD_JSON_INTEGER_CHARS: i64=21 |
| 206 | const CD_JSON_ESCAPE_EXPANSION: i64=6 |
functions
| 31 | func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 32 | func wn(v: i64) -> i64 |
| 45 | func cs_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 57 | func cs_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 64 | func cs_hash(b: *u8, n: i64) -> i64 called by 1: cs_legacy_main |
| 71 | func cs_find(b: *u8, n: i64, pat: *u8) -> i64 |
| 84 | func cs_int_at(b: *u8, n: i64, off: i64) -> i64 called by 1: cs_legacy_main |
| 97 | func cs_legacy_main(argc: i64, argv: *i64) -> i64 |
| 211 | func cd_len(s: *u8) -> i64 { var n: i64=0;while s[n]!=(0 as u8){n=n+1};return n } |
| 212 | func cd_equal(a: *u8,b: *u8) -> i64 { var i: i64=0;while a[i]==b[i]{if a[i]==(0 as u8){return 1};i=i+1};return 0 } |
| 213 | func cd_hash_valid(s: *u8) -> i64 |
| 217 | func cd_file_init(o: *CsDependencyFile,hex: *u8) -> i64 |
| 221 | func cd_prefix(token: *u8,n: i64,pi: *i64) -> i64 called by 1: cd_scan |
| 225 | func cd_scan(path: *u8,token: *u8,o: *CsDependencyFile) -> i64 called by 3: mainmaincd_command calls 14: cd_file_initsha256_workspace_bytescd_lensys_mmap_sharedsys_munmapfio_region_init+8 |
| 269 | func cd_file_state(o: *CsDependencyFile,expected: *u8) -> *u8 |
| 276 | func cd_pair(j: *JsonWriter,key: *u8,value: *u8) -> i64 |
| 279 | func cd_num(j: *JsonWriter,key: *u8,value: i64) -> i64 |
| 282 | func cd_file_json(j: *JsonWriter,key: *u8,path: *u8,expected: *u8,o: *CsDependencyFile) -> i64 |
| 290 | func cd_report(cp: *u8,ch: *u8,dp: *u8,dh: *u8,token: *u8,c: *CsDependencyFile,d: *CsDependencyFile,buffer: *u8,capacity: i64,j: *JsonWriter,prior: *u8) -> i64 called by 2: maincd_command calls 8: cd_equalcd_file_statejson_begin_objectcd_paircd_numsys_now_realtime_sec+2 |
| 318 | func cd_command(argc: i64,argv: *i64) -> i64 |