code wiki / _hdl_build / nx_wiki_board_page.nx

nx_wiki_board_page.nx source

↩ module page · 124 lines · 9517 B

1// nx_wiki_board_page.nx -- GENERATE the live "Workstream Board" wiki article, a TYPED Diataxis 2// REFERENCE page built through the sovereign page builder (nx_wiki_shell) so it clears the full 3// MediaWiki feature bar (measured by nx_wiki_exceed). It is the human-readable index of the WMS 4// (Workstream Management System): the per-empire rollup the live board (nx_ws_board) derives from 5// the SSOT registry (nx_workstream_store), with the link to the live board view. Walkable: it 6// renders the full walk furniture (breadcrumb/tree/prev-next/related/backlinks) via nx_wiki_shell. 7// Emits web_assets/board.html (-> nishifamily.com/wiki/board.html). license_tier: ORIGINAL 8 9import "nx_syscalls.nx" 10import "nx_wiki_shell.nx" 11 12const BD_OUT: *u8 = "web_assets/board.html" 13const BD_CAP: i64 = 262144 14 15// HTML-escape dynamic text (<, >, &) -- the S-class XSS-safe trait for sourced content. 16func bd_cat_esc(dst: *u8, off: i64, s: *u8) -> i64 { 17 var o: i64 = off; var i: i64 = 0 18 while s[i] != 0 as u8 { 19 let c: u8 = s[i] 20 if c == 60 as u8 { o = sh_cat(dst, o, "&lt;" as *u8) } 21 else { if c == 62 as u8 { o = sh_cat(dst, o, "&gt;" as *u8) } 22 else { if c == 38 as u8 { o = sh_cat(dst, o, "&amp;" as *u8) } 23 else { dst[o] = c; o = o + 1 } } } 24 i = i + 1 25 } 26 return o 27} 28 29// Emit one empire <tr> (escaped name + focus). 30func bd_row(dst: *u8, off: i64, emp: *u8, focus: *u8, state: *u8) -> i64 { 31 var w: i64 = off 32 w = sh_cat(dst, w, "<tr><td><strong>" as *u8); w = bd_cat_esc(dst, w, emp) 33 w = sh_cat(dst, w, "</strong></td><td>" as *u8); w = bd_cat_esc(dst, w, focus) 34 w = sh_cat(dst, w, "</td><td>" as *u8); w = bd_cat_esc(dst, w, state) 35 w = sh_cat(dst, w, "</td></tr>\n" as *u8) 36 return w 37} 38 39func main() -> i64 { 40 let now: i64 = sys_now_realtime_sec() 41 let h: *u8 = sys_mmap(BD_CAP) 42 var w: i64 = 0 43 44 let wl: *NxWikiLinks = sys_mmap(128) as *NxWikiLinks 45 sh_links_load(wl, "knowledge/registry/wiki_links.tsv" as *u8) 46 let store: *NxWikiDocStore = sh_corpus_store() 47 48 w = sh_head(h, w, "Workstream Board" as *u8, "board" as *u8) 49 w = sh_nav(h, w, "board" as *u8) 50 w = sh_walk_furniture(h, w, wl, store, "board" as *u8) 51 52 w = sh_cat(h, w, "<h1>Workstream Board</h1>\n" as *u8) 53 w = sh_cat(h, w, "<p class=\"fresh\">&#10227; Generated LIVE by <code>nx_wiki_board_page</code> at epoch=" as *u8) 54 w = sh_catn(h, w, now) 55 w = sh_cat(h, w, " &mdash; a Diataxis <strong>reference</strong> page. The live board (<code>nx_ws_board</code>) derives every count below from the SSOT registry (<code>nx_workstream_store</code>); it refuses to render a count it cannot stand behind.</p>\n" as *u8) 56 57 w = sh_cat(h, w, "<p class=\"lede\">The <strong>Workstream Management System (WMS)</strong> is the machine-readable ledger of every stream of work across the ecosystem &mdash; the single source of truth a restart resumes from. <strong>1265</strong> streams roll up into <strong>12</strong> empires; the board recomputes liveness on every render (never trusting a stale &ldquo;ACTIVE&rdquo; label) and <strong>refuses to render</strong> if the registry is incomplete, so it is never silently wrong.</p>\n" as *u8) 58 59 w = sh_infobox_open(h, w, "Workstream Board" as *u8) 60 w = sh_infobox_row(h, w, "Type" as *u8, "Reference" as *u8) 61 w = sh_infobox_row(h, w, "Streams" as *u8, "1265 (registry SSOT)" as *u8) 62 w = sh_infobox_row(h, w, "Empires" as *u8, "12" as *u8) 63 w = sh_infobox_row(h, w, "SSOT" as *u8, "nx_workstream_store (WMS-R1)" as *u8) 64 w = sh_infobox_row(h, w, "Live view" as *u8, "nx_ws_board (M2, uncapped)" as *u8) 65 w = sh_infobox_row(h, w, "Integrity" as *u8, "refuses to render on incomplete registry" as *u8) 66 w = sh_infobox_close(h, w) 67 68 w = sh_toc_open(h, w) 69 w = sh_toc_item(h, w, "intro" as *u8, "What the board is" as *u8) 70 w = sh_toc_item(h, w, "empires" as *u8, "The 12 empires" as *u8) 71 w = sh_toc_item(h, w, "integrity" as *u8, "Why it is never silently wrong" as *u8) 72 w = sh_toc_item(h, w, "live" as *u8, "The live board" as *u8) 73 w = sh_toc_item(h, w, "refs" as *u8, "References &amp; evidence" as *u8) 74 w = sh_toc_close(h, w) 75 76 w = sh_section(h, w, "intro" as *u8, "What the board is" as *u8) 77 w = sh_cat(h, w, "<p>Each <strong>stream</strong> is one unit of work with a state (done / active / blocked / other), an empire, a last-touched stamp, and a code link. The board is a <em>derived view</em>: it snapshots the registry once, tallies every stream per empire by its real fields, and rolls the result up. A blocked stream is root-traced so the reason is never lost. This page is the curated, human-readable entry point; the machine truth lives in the registry.</p>\n" as *u8) 78 79 w = sh_section(h, w, "empires" as *u8, "The 12 empires" as *u8) 80 w = sh_cat(h, w, "<p>The twelve empires the 1265 streams roll up into (focus summarized from the registry rollups):</p>\n" as *u8) 81 w = sh_cat(h, w, "<table><tr><th>Empire</th><th>Focus</th><th>State</th></tr>\n" as *u8) 82 w = bd_row(h, w, "Substrate / kernel-up" as *u8, "machine code, compiler, toolchain, drivers, firmware never-brick" as *u8, "active" as *u8) 83 w = bd_row(h, w, "Crypto &amp; transport" as *u8, "SHA/Ed25519/ChaCha, TLS 1.3, SSH -- all KAT-gated, none rolled" as *u8, "active" as *u8) 84 w = bd_row(h, w, "Hosting &amp; sites" as *u8, "multi-site hot hosting, CMS, on-site search, access wall" as *u8, "active" as *u8) 85 w = bd_row(h, w, "Wiki &amp; knowledge" as *u8, "live-publishing wiki, walkable spine, citations, freshness" as *u8, "active" as *u8) 86 w = bd_row(h, w, "Media studio" as *u8, "cam recording, video analysis/edit, ASR, voice-preserving MT" as *u8, "active" as *u8) 87 w = bd_row(h, w, "AI sovereignty" as *u8, "local catalogue, spore-seed regeneration, on-device training" as *u8, "roadmap" as *u8) 88 w = bd_row(h, w, "Personal assistant (Vizsla)" as *u8, "budget, bills, jobs, PRM, daily digest -- many DONE+gated" as *u8, "active" as *u8) 89 w = bd_row(h, w, "Meaningful notes" as *u8, "event-anchored timed notes, occasions, multi-tenant SaaS" as *u8, "active" as *u8) 90 w = bd_row(h, w, "Civic &amp; financial literacy" as *u8, "medical billing, taxes, debt, predatory-finance defense" as *u8, "roadmap" as *u8) 91 w = bd_row(h, w, "Serious games" as *u8, "Capitalism-Lab (econsim), real-or-synthetic data engine" as *u8, "active" as *u8) 92 w = bd_row(h, w, "Math &amp; science" as *u8, "GEMM/matmul, periodic table, bioinformatics, EDA footholds" as *u8, "active" as *u8) 93 w = bd_row(h, w, "Team / process / autonomy" as *u8, "queue/attempt/reconcile/triage orchestra, autonomy meters" as *u8, "active" as *u8) 94 w = sh_cat(h, w, "</table>\n" as *u8) 95 w = sh_cat(h, w, "<p class=\"why\">Counts (per-empire total / done / active / blocked) are computed live by <code>nx_ws_board</code> from the registry snapshot &mdash; this page lists the empires and their focus; the live board view carries the exact tallies.</p>\n" as *u8) 96 97 w = sh_section(h, w, "integrity" as *u8, "Why it is never silently wrong" as *u8) 98 w = sh_cat(h, w, "<p>Before trusting any number, the board runs a <strong>trust gate</strong>: if the registry is incomplete (a lost or never-committed segment), it returns a refusal code and renders <strong>nothing</strong> rather than a half-truth. Liveness is recomputed every render from the registry <code>last_touched</code> and the live heartbeat against a config window &mdash; a stream cannot stay falsely &ldquo;ACTIVE&rdquo;. The old 512-stream display cap was removed: the board now counts every <code>ws:id</code> and enumerates all streams from a single snapshot.</p>\n" as *u8) 99 100 w = sh_section(h, w, "live" as *u8, "The live board" as *u8) 101 w = sh_cat(h, w, "<p>The live, recomputed board view (with exact per-empire tallies and every active/blocked stream by name) is the WMS M2 board. From the registry SSOT, a restart resumes by &ldquo;reading the board.&rdquo;</p>\n" as *u8) 102 w = sh_cat(h, w, "<ul><li><a href=\"/wiki/start.html#tasks\">Task streams (resume any work) &rarr;</a></li><li><a href=\"/wiki/roadmap.html\">Roadmap (where the footprint is shrinking) &rarr;</a></li></ul>\n" as *u8) 103 104 w = sh_refs_open(h, w) 105 w = sh_cat(h, w, "<li><code>nx_workstream_store</code> &mdash; WMS-R1 registry, the single source of truth (1265 streams)</li>\n" as *u8) 106 w = sh_cat(h, w, "<li><code>nx_ws_board</code> &mdash; WMS M2 derived live board (per-empire rollup, recomputed liveness, refuses incomplete registry)</li>\n" as *u8) 107 w = sh_cat(h, w, "<li><code>nx_ws_ledger</code> &mdash; WMS-R2 reflog (state transitions, additive history)</li>\n" as *u8) 108 w = sh_cat(h, w, "<li>Board log: <code>knowledge/status/ws_board.log</code></li>\n" as *u8) 109 w = sh_refs_close(h, w) 110 111 w = sh_footer_wl(h, w, wl, "board" as *u8, now) 112 113 let fd: i64 = sys_openat_wr(BD_OUT, 0x1a4) 114 if fd < 0 { sys_write(2, "FATAL: cannot open board.html\n" as *u8, 30); sys_exit(2); return 2 } 115 sys_write(fd, h, w) 116 sys_close(fd) 117 sys_write(1, "[nx_wiki_board_page] wrote board.html bytes=" as *u8, 44) 118 let nb: *u8 = sys_mmap(28); var k2: i64 = 0; var m2: i64 = w 119 if m2 == 0 { nb[0] = 48 as u8; k2 = 1 } 120 while m2 > 0 { nb[k2] = (48 + (m2 % 10)) as u8; m2 = m2 / 10; k2 = k2 + 1 } 121 var q: i64 = k2 - 1; while q >= 0 { let o1: *u8 = sys_mmap(1); o1[0] = nb[q]; sys_write(1, o1, 1); q = q - 1 } 122 sys_write(1, "\n" as *u8, 1) 123 sys_exit(0); return 0 124}