code wiki / _hdl_build / nx_pub_reconcile.nx
nx_pub_reconcile.nx
buildroot/runtime/_hdl_build/nx_pub_reconcile.nx
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
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
structs
| none |
consts
| 19 | const PR_MAGIC_65536: i64 = 65536 |
| 21 | const PR_CAP: i64 = 16777216 |
| 22 | const PR_RCAP: i64 = 262144 |
| 23 | const PR_TAB: i64 = 9 |
| 24 | const PR_NL: i64 = 10 |
functions
| 26 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 27 | func 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 } |
| 28 | func 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 } |
| 29 | func pr_refuse(reason: *u8) -> i64 { hw("PUB-RECONCILE REFUSED: " as *u8); hw(reason); hw("\n" as *u8); return 0 } |
| 30 | func pr_eol(b: *u8, n: i64, i: i64) -> i64 |
| 36 | func pr_cols(b: *u8, ls: i64, le: i64, col: *i64, maxc: i64) -> i64 called by 1: pr_run |
| 52 | func pr_cstr(b: *u8, a: i64, e: i64) -> *u8 |
| 59 | func pr_readfile(path: *u8, buf: *u8, cap: i64) -> i64 |
| 73 | func pr_planerows(prefix: *u8, slug: *u8) -> i64 |
| 95 | func pr_stamp(html: *u8) -> i64 |
| 125 | func pr_publish(plane: *u8, slug: *u8, html: *u8, pfx: *u8, rel: *u8) -> i64 |
| 139 | func pr_run(regprefix: *u8) -> i64 |
| 203 | func pr_selftest() -> i64 |
| 226 | func main(argc: i64, argv: *i64) -> i64 |