code wiki / _hdl_build / nx_pub_desk.nx

nx_pub_desk.nx

buildroot/runtime/_hdl_build/nx_pub_desk.nx

46664 B993 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind tooltopic pub
docsdependenciesstructsconstsfunctions

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

nx_sovjson_lib.nx nx_store_seed_lib.nx nx_seg_store.nx nx_gate_verdict.nx nx_syscalls.nx nx_html_head.nx nx_pub_desk.nx

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

main pd_werr sj_werr sys_write sys_exit pd_lit_eq pd_vlen sj_vlen pd_argnum sys_mmap pd_census sys_mmap ↻ pd_scan sys_openat_rd sys_mmap ↻ sys_getdents64 pd_ends pd_vlen ↻ sys_close sys_munmap sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_cat ↻ ss_loadfile ss_load_aux2 ssl_total_keys ssl_pow2 ssl_build ss_r32 ssl_lookup

structs

none

consts

27const PD_CAP: i64 = 1048576
28const PD_LCAP: i64 = 262144
29const PD_NAMES: i64 = 262144
30const PD_MAXN: i64 = 4096
31const PD_SECMAX: i64 = 64
32const PD_TAB: i64 = 9
33const PD_NL: i64 = 10
34const PD_SLASH: i64 = 47
35const PD_EXIT_USAGE: i64 = 2
36const PD_EXIT_REFUSED: i64 = 3
37const PD_MODE: i64 = 420
38const PD_DIRMODE: i64 = 493
39const PD_DT_DIR: i64 = 4
40const PD_STDERR: i64 = 2
41const PD_SPAN: i64 = 16
42const PD_DBUF: i64 = 65536
43const PD_PATHCAP: i64 = 512
44const PD_NUMCAP: i64 = 28
45const PD_SMALLCAP: i64 = 64
46const PD_FIXCAP: i64 = 4096
47const PD_FIXSCAP: i64 = 1024
48const PD_I64B: i64 = 8
49const PD_BYTE: i64 = 256
50const PD_ZERO: i64 = 48
51const PD_BASE: i64 = 10
52const PD_QUOTE: i64 = 34
53const PD_APOS: i64 = 39
54const PD_BSLASH: i64 = 92
55const PD_LT: i64 = 60
56const PD_GT: i64 = 62
57const PD_AMP: i64 = 38
58const PD_DOT: i64 = 46
59const PD_SPACE: i64 = 32
60const PD_DE_RLO: i64 = 16
61const PD_DE_RHI: i64 = 17
62const PD_DE_TYPE: i64 = 18
63const PD_DE_NAME: i64 = 19
64const PD_SCALE_N: i64 = 250
65const PD_FIXA_LEN: i64 = 10
66const PD_FIXC_LEN: i64 = 5
67const PD_FIXP_LEN: i64 = 3
68const PD_FIX_ROWS: i64 = 3
69const PD_C_TITLE: i64 = 1
70const PD_C_OWNER: i64 = 2
71const PD_C_STATUS: i64 = 3
72const PD_C_SECTION: i64 = 4
73const PD_C_PATH: i64 = 5
74const PD_C_NOTE: i64 = 6
75const PD_S_PROP: i64 = 1
76const PD_S_GRADE: i64 = 2
77const PD_S_EVID: i64 = 3
78const PD_S_NOTE: i64 = 4
79const PD_NAME_PAD: i64 = 2
80const PD_ARG_A: i64 = 2
81const PD_ARG_B: i64 = 3
82const PD_ARG_C: i64 = 4
83const PD_ARG_D: i64 = 5
84const PD_ARG_E: i64 = 6
85const PD_STATB: i64 = 144
86const PD_MT_OFF: i64 = 88
87const PD_DAY: i64 = 86400
88const PD_BACKDATE_D: i64 = 200
89const PD_STALE_FIX: i64 = 90
91const PD_EPOCH_SHIFT: i64 = 719468
92const PD_ERA_DAYS: i64 = 146097
93const PD_CENT_DAYS: i64 = 36524
94const PD_QUAD_DAYS: i64 = 1460
95const PD_YEAR_DAYS: i64 = 365
96const PD_ERA_YEARS: i64 = 400
97const PD_LEAP4: i64 = 4
98const PD_LEAP100: i64 = 100
99const PD_MONTH_SLOPE: i64 = 153
100const PD_MP_BIAS: i64 = 2
101const PD_MP_SCALE: i64 = 5
102const PD_MP_CUT: i64 = 10
103const PD_MAR_OFF: i64 = 3
104const PD_DEC_WRAP: i64 = 9
105const PD_TWO_DIG: i64 = 10
106const PD_DASH: i64 = 45
107const PD_HTML_EXT: i64 = 5

functions

109func pd_puts(s: *u8) -> i64 { return sj_puts(s) }
called by 2: pd_boardmain calls 1: sj_puts
110func pd_werr(s: *u8) -> i64 { return sj_werr(s) }
called by 1: main calls 1: sj_werr
111func pd_vlen(s: *u8) -> i64 { return sj_vlen(s) }
112func pd_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) }
113func pd_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) }
called by 3: pd_isopd_censuspd_board calls 1: sj_catn
115func pd_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64
called by 2: pd_censuspd_board
131func 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 }
132func pd_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
148func pd_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
154func pd_span_eq(a: *u8, s1: i64, e1: i64, b: *u8, s2: i64, e2: i64) -> i64
160func pd_ends(q: *u8, s: i64, n: i64, suf: *u8) -> i64
called by 2: pd_scanpd_is_page calls 1: pd_vlen
167func 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
168func pd_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: pd_sitemap calls 1: pd_vlen
181func pd_wfile(path: *u8, buf: *u8, n: i64) -> i64
189func pd_rfile(path: *u8, buf: *u8, cap: i64) -> i64
201func pd_mtime(docroot: *u8, name: *u8) -> i64
214func pd_iso(d: *u8, o: i64, epoch: i64) -> i64
calls 1: pd_catn
241func pd_scan(docroot: *u8, arena: *u8, offs: *i64, envp: *i64) -> i64
285func 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 }
called by 2: pd_censuspd_board calls 1: pd_vlen
286func 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) }
called by 2: pd_censuspd_board calls 2: pd_vlenpd_ends
288func pd_reg_has(reg: *u8, rn: i64, arena: *u8, off: i64) -> i64
300func pd_disk_has(arena: *u8, offs: *i64, cnt: i64, reg: *u8, s: i64, e: i64) -> i64
called by 2: pd_censuspd_board calls 2: pd_vlenpd_span_eq
313func pd_census(docroot: *u8, pubprefix: *u8, out: *u8, cap: i64, stale_days: i64) -> i64
449func pd_status_class(reg: *u8, s: i64, e: i64) -> *u8
called by 1: pd_board calls 1: pd_lit_eq
457func pd_grade_class(q: *u8, s: i64, e: i64) -> *u8
called by 1: pd_board calls 1: pd_lit_eq
462func pd_board(docroot: *u8, pubprefix: *u8, sotaprefix: *u8, outpath: *u8, stale_days: i64) -> i64
716func pd_sitemap(docroot: *u8, pubprefix: *u8, baseurl: *u8, outpath: *u8) -> i64
778func pd_check(relpath: *u8, pubprefix: *u8) -> i64
827func 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 }
828func pd_selftest(tmpdir: *u8) -> i64
929func main(argc: i64, argv: *i64) -> i64