code wiki / _hdl_build / nx_pub_desk.nx
nx_pub_desk.nx
buildroot/runtime/_hdl_build/nx_pub_desk.nx
about
nx_pub_desk.nx -- THE PUBLISHING DESK organ (F762, publishing lane 2026-07-19).
The operator's diagnosis: "lots of random published pages without really a full publishing
system like an elite company". Research (news-org + docs-as-code sweeps, banked): the keystone
of every elite publisher (NYT Scoop/Gateway, Guardian Facia, GitLab docs, Backstage TechDocs)
is ONE machine-readable REGISTRY per published page (owner/section/status) from which every
hub/index is DERIVED -- never hand-curated -- and publishing flows only through a gate that
maintains it. This organ is that derivation engine for the sovereign sites docroot:
nx_pub_desk census <docroot> <pubprefix> (JSON: registry vs disk join --
registered / orphans / missing / debris / prev-artifacts; envelope DECLARED, no silent caps)
nx_pub_desk board <docroot> <pubprefix> <sotaprefix> <out> (emit the /publishing hub HTML,
sections + rows FROM THE REGISTRY ONLY; orphans/missing/debris rendered honestly in red;
SOTA checklist from the pubsota- plane; atomic tmp+rename write)
nx_pub_desk selftest <tmpdir> (gate: fixtures + scale tooth)
Registry plane pub- : id title owner status section path note (status@col3 = the
ecosystem convention; vocabulary live|asset|draft|withdrawn|redirect|debris)
SOTA plane pubsota- : id property grade(HAVE|PARTIAL|GAP) evidence note
Writes = nx_store_put on the planes (provenanced hist- = the corrections ledger); page bytes
land only via nx_site_publish (atomic, .prev). This organ never publishes site content itself.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 6 imports · 0 importers
imports: nx_sovjson_lib.nxnx_store_seed_lib.nxnx_seg_store.nxnx_gate_verdict.nxnx_syscalls.nxnx_html_head.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
| 27 | const PD_CAP: i64 = 1048576 |
| 28 | const PD_LCAP: i64 = 262144 |
| 29 | const PD_NAMES: i64 = 262144 |
| 30 | const PD_MAXN: i64 = 4096 |
| 31 | const PD_SECMAX: i64 = 64 |
| 32 | const PD_TAB: i64 = 9 |
| 33 | const PD_NL: i64 = 10 |
| 34 | const PD_SLASH: i64 = 47 |
| 35 | const PD_EXIT_USAGE: i64 = 2 |
| 36 | const PD_EXIT_REFUSED: i64 = 3 |
| 37 | const PD_MODE: i64 = 420 |
| 38 | const PD_DIRMODE: i64 = 493 |
| 39 | const PD_DT_DIR: i64 = 4 |
| 40 | const PD_STDERR: i64 = 2 |
| 41 | const PD_SPAN: i64 = 16 |
| 42 | const PD_DBUF: i64 = 65536 |
| 43 | const PD_PATHCAP: i64 = 512 |
| 44 | const PD_NUMCAP: i64 = 28 |
| 45 | const PD_SMALLCAP: i64 = 64 |
| 46 | const PD_FIXCAP: i64 = 4096 |
| 47 | const PD_FIXSCAP: i64 = 1024 |
| 48 | const PD_I64B: i64 = 8 |
| 49 | const PD_BYTE: i64 = 256 |
| 50 | const PD_ZERO: i64 = 48 |
| 51 | const PD_BASE: i64 = 10 |
| 52 | const PD_QUOTE: i64 = 34 |
| 53 | const PD_APOS: i64 = 39 |
| 54 | const PD_BSLASH: i64 = 92 |
| 55 | const PD_LT: i64 = 60 |
| 56 | const PD_GT: i64 = 62 |
| 57 | const PD_AMP: i64 = 38 |
| 58 | const PD_DOT: i64 = 46 |
| 59 | const PD_SPACE: i64 = 32 |
| 60 | const PD_DE_RLO: i64 = 16 |
| 61 | const PD_DE_RHI: i64 = 17 |
| 62 | const PD_DE_TYPE: i64 = 18 |
| 63 | const PD_DE_NAME: i64 = 19 |
| 64 | const PD_SCALE_N: i64 = 250 |
| 65 | const PD_FIXA_LEN: i64 = 10 |
| 66 | const PD_FIXC_LEN: i64 = 5 |
| 67 | const PD_FIXP_LEN: i64 = 3 |
| 68 | const PD_FIX_ROWS: i64 = 3 |
| 69 | const PD_C_TITLE: i64 = 1 |
| 70 | const PD_C_OWNER: i64 = 2 |
| 71 | const PD_C_STATUS: i64 = 3 |
| 72 | const PD_C_SECTION: i64 = 4 |
| 73 | const PD_C_PATH: i64 = 5 |
| 74 | const PD_C_NOTE: i64 = 6 |
| 75 | const PD_S_PROP: i64 = 1 |
| 76 | const PD_S_GRADE: i64 = 2 |
| 77 | const PD_S_EVID: i64 = 3 |
| 78 | const PD_S_NOTE: i64 = 4 |
| 79 | const PD_NAME_PAD: i64 = 2 |
| 80 | const PD_ARG_A: i64 = 2 |
| 81 | const PD_ARG_B: i64 = 3 |
| 82 | const PD_ARG_C: i64 = 4 |
| 83 | const PD_ARG_D: i64 = 5 |
| 84 | const PD_ARG_E: i64 = 6 |
| 85 | const PD_STATB: i64 = 144 |
| 86 | const PD_MT_OFF: i64 = 88 |
| 87 | const PD_DAY: i64 = 86400 |
| 88 | const PD_BACKDATE_D: i64 = 200 |
| 89 | const PD_STALE_FIX: i64 = 90 |
| 91 | const PD_EPOCH_SHIFT: i64 = 719468 |
| 92 | const PD_ERA_DAYS: i64 = 146097 |
| 93 | const PD_CENT_DAYS: i64 = 36524 |
| 94 | const PD_QUAD_DAYS: i64 = 1460 |
| 95 | const PD_YEAR_DAYS: i64 = 365 |
| 96 | const PD_ERA_YEARS: i64 = 400 |
| 97 | const PD_LEAP4: i64 = 4 |
| 98 | const PD_LEAP100: i64 = 100 |
| 99 | const PD_MONTH_SLOPE: i64 = 153 |
| 100 | const PD_MP_BIAS: i64 = 2 |
| 101 | const PD_MP_SCALE: i64 = 5 |
| 102 | const PD_MP_CUT: i64 = 10 |
| 103 | const PD_MAR_OFF: i64 = 3 |
| 104 | const PD_DEC_WRAP: i64 = 9 |
| 105 | const PD_TWO_DIG: i64 = 10 |
| 106 | const PD_DASH: i64 = 45 |
| 107 | const PD_HTML_EXT: i64 = 5 |
functions
| 109 | func pd_puts(s: *u8) -> i64 { return sj_puts(s) } |
| 110 | func pd_werr(s: *u8) -> i64 { return sj_werr(s) } |
| 111 | func pd_vlen(s: *u8) -> i64 { return sj_vlen(s) } |
| 112 | func pd_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) } |
| 113 | func pd_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) } |
| 115 | func pd_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64 |
| 131 | func pd_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (PD_NL as u8) { s = 0 } else { e = e + 1 } } } return e } |
| 132 | func pd_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 |
| 148 | func pd_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 154 | func pd_span_eq(a: *u8, s1: i64, e1: i64, b: *u8, s2: i64, e2: i64) -> i64 |
| 160 | func pd_ends(q: *u8, s: i64, n: i64, suf: *u8) -> i64 |
| 167 | func pd_argnum(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c >= PD_ZERO { if c <= PD_ZERO + PD_BASE - 1 { v = v * PD_BASE + (c - PD_ZERO) } } i = i + 1 } return v } called by 1: main |
| 168 | func pd_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 181 | func pd_wfile(path: *u8, buf: *u8, n: i64) -> i64 |
| 189 | func pd_rfile(path: *u8, buf: *u8, cap: i64) -> i64 |
| 201 | func pd_mtime(docroot: *u8, name: *u8) -> i64 |
| 214 | func pd_iso(d: *u8, o: i64, epoch: i64) -> i64 calls 1: pd_catn |
| 241 | func pd_scan(docroot: *u8, arena: *u8, offs: *i64, envp: *i64) -> i64 called by 2: pd_censuspd_board calls 6: sys_openat_rdsys_mmapsys_getdents64pd_endssys_closesys_munmap |
| 285 | func pd_is_dirname(arena: *u8, off: i64) -> i64 { let n: i64 = pd_vlen(((arena as i64) + off) as *u8); if n < 1 { return 0 } if arena[off + n - 1] == (PD_SLASH as u8) { return 1 } return 0 } |
| 286 | func pd_is_page(arena: *u8, off: i64) -> i64 { let n: i64 = pd_vlen(((arena as i64) + off) as *u8); return pd_ends(arena, off, n, ".html" as *u8) } |
| 288 | func pd_reg_has(reg: *u8, rn: i64, arena: *u8, off: i64) -> i64 |
| 300 | func pd_disk_has(arena: *u8, offs: *i64, cnt: i64, reg: *u8, s: i64, e: i64) -> i64 |
| 313 | func pd_census(docroot: *u8, pubprefix: *u8, out: *u8, cap: i64, stale_days: i64) -> i64 |
| 449 | func pd_status_class(reg: *u8, s: i64, e: i64) -> *u8 |
| 457 | func pd_grade_class(q: *u8, s: i64, e: i64) -> *u8 |
| 462 | func pd_board(docroot: *u8, pubprefix: *u8, sotaprefix: *u8, outpath: *u8, stale_days: i64) -> i64 |
| 716 | func pd_sitemap(docroot: *u8, pubprefix: *u8, baseurl: *u8, outpath: *u8) -> i64 |
| 778 | func pd_check(relpath: *u8, pubprefix: *u8) -> i64 |
| 827 | func pd_mkpath(d: *u8, a: *u8, b: *u8) -> i64 { var o: i64 = pd_cat(d, 0, a); o = pd_cat(d, o, b); d[o] = 0 as u8; return o } |
| 828 | func pd_selftest(tmpdir: *u8) -> i64 |
| 929 | func main(argc: i64, argv: *i64) -> i64 |