code wiki / (root) / nx_comparestale_dependency_t138.nx

nx_comparestale_dependency_t138.nx

buildroot/runtime/nx_comparestale_dependency_t138.nx

18189 B352 linesdepth 6pulls 7 transitivereach 3 importersview sourcekind librarytopic 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 4 imports · 3 importers

nx_syscalls.nx nx_fio.nx nx_sha256.nx json_emit.nx nx_comparestale_dependency_t13 nx_comparestale_canonical_cli_gate nx_comparestale_dependency_cli_t13 nx_comparestale_dependency_gate_t1

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

207struct CsDependencyFile

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
198const CD_ABI_WORD_BYTES: i64=8
199const CD_REGION_BYTES: i64=9*CD_ABI_WORD_BYTES
200const CD_FILE_BYTES: i64=6*CD_ABI_WORD_BYTES
201const CD_WRITER_BYTES: i64=5*CD_ABI_WORD_BYTES
202const CD_HASH_CHARS: i64=64
203const CD_I64_MAX: i64=9223372036854775807
204const CD_SCHEMA_FIELDS: i64=32
205const CD_JSON_INTEGER_CHARS: i64=21
206const CD_JSON_ESCAPE_EXPANSION: i64=6

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 }
32func wn(v: i64) -> i64
45func cs_read(path: *u8, buf: *u8, cap: i64) -> i64
57func cs_cat(dst: *u8, off: i64, s: *u8) -> i64
64func cs_hash(b: *u8, n: i64) -> i64
called by 1: cs_legacy_main
71func cs_find(b: *u8, n: i64, pat: *u8) -> i64
84func cs_int_at(b: *u8, n: i64, off: i64) -> i64
called by 1: cs_legacy_main
97func cs_legacy_main(argc: i64, argv: *i64) -> i64
211func cd_len(s: *u8) -> i64 { var n: i64=0;while s[n]!=(0 as u8){n=n+1};return n }
212func 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 }
213func cd_hash_valid(s: *u8) -> i64
called by 2: maincd_command calls 1: cd_len
217func cd_file_init(o: *CsDependencyFile,hex: *u8) -> i64
221func cd_prefix(token: *u8,n: i64,pi: *i64) -> i64
called by 1: cd_scan
225func cd_scan(path: *u8,token: *u8,o: *CsDependencyFile) -> i64
269func cd_file_state(o: *CsDependencyFile,expected: *u8) -> *u8
276func cd_pair(j: *JsonWriter,key: *u8,value: *u8) -> i64
279func cd_num(j: *JsonWriter,key: *u8,value: i64) -> i64
282func cd_file_json(j: *JsonWriter,key: *u8,path: *u8,expected: *u8,o: *CsDependencyFile) -> i64
290func 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
318func cd_command(argc: i64,argv: *i64) -> i64