code wiki / _hdl_build / nx_pub_reconcile.nx

nx_pub_reconcile.nx

buildroot/runtime/_hdl_build/nx_pub_reconcile.nx

10342 B234 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic pub
docsdependenciesstructsconstsfunctions

about

nx_pub_reconcile.nx -- THE PUBLISHING PARTNER (operator 2026-08-05: "as work happens it's just publishing, not a brute-force dump but a partner in the process"). The measured failure it ends: 8+ MANUAL page emits in one session and a forgotten panel -- a derived surface that needs manual regeneration WILL go stale. This organ makes the WRITE the publish trigger: pages stamp their provenance (pubsync slug-rows=N, emitted by nx_asset_page); the reconciler walks a REGISTRY PLANE of watched surfaces, compares each plane's live row count against its page's stamp, and re-emits ONLY what drifted. Publish-on-change, never a dump; one log row per decision = the digital thread. REGISTRY (knowledge/store/pubwatch-, rows are DATA -- watching a new surface is an append): <name> TAB <plane-prefix> TAB <slug> TAB <html-path> TAB <pubprefix> TAB <relpath> nx_pub_reconcile (walk the registry, publish drift, report) nx_pub_reconcile selftest Convergence property IS the gate: a run that publishes is followed by a run that reports CURRENT. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_store_seed_lib.nx nx_pub_reconcile.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_store_seed_lib.nx

imported by: nobody (leaf or entry point)

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

main pr_selftest hw sys_write pr_run sys_mmap sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 ssc_retire_handle sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ss_hget sys_mmap ↻ ss_idx_find ss_r32 ss_len ss_kcmp sts_atoi sts_rowkey ss_catn sys_mmap ↻ sts_emit_row nxr_count nxr_r16 rtv_to_tsv nxr_find rtv_itoa nxr_r64 sys_munmap

structs

none

consts

19const PR_MAGIC_65536: i64 = 65536
21const PR_CAP: i64 = 16777216
22const PR_RCAP: i64 = 262144
23const PR_TAB: i64 = 9
24const PR_NL: i64 = 10

functions

26func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
27func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 2: pr_runpr_selftest calls 2: sys_mmapsys_write
28func pr_pr(b: *u8, a: i64, e: i64) -> i64 { if e > a { sys_write(1, ((b as i64)+a) as *u8, e-a) } return 0 }
called by 1: pr_run calls 1: sys_write
29func pr_refuse(reason: *u8) -> i64 { hw("PUB-RECONCILE REFUSED: " as *u8); hw(reason); hw("\n" as *u8); return 0 }
called by 1: pr_run calls 1: hw
30func pr_eol(b: *u8, n: i64, i: i64) -> i64
called by 2: pr_planerowspr_run
36func pr_cols(b: *u8, ls: i64, le: i64, col: *i64, maxc: i64) -> i64
called by 1: pr_run
52func pr_cstr(b: *u8, a: i64, e: i64) -> *u8
called by 1: pr_run calls 1: sys_mmap
59func pr_readfile(path: *u8, buf: *u8, cap: i64) -> i64
73func pr_planerows(prefix: *u8, slug: *u8) -> i64
called by 1: pr_run calls 3: sys_mmapsts_loadpr_eol
95func pr_stamp(html: *u8) -> i64
125func pr_publish(plane: *u8, slug: *u8, html: *u8, pfx: *u8, rel: *u8) -> i64
called by 1: pr_run calls 2: sys_mmaptr_run_capture
139func pr_run(regprefix: *u8) -> i64
203func pr_selftest() -> i64
226func main(argc: i64, argv: *i64) -> i64