code wiki / _hdl_build / nx_wiki_ai_start_page.nx
nx_wiki_ai_start_page.nx source
↩ module page · 160 lines · 12463 B
1// nx_wiki_ai_start_page.nx -- the live "AI START HERE" capstone, built through the sovereign page
2// builder (nx_wiki_shell) so it is itself S-class (measured by nx_wiki_exceed). Ties together, live +
3// evidence-cited: genealogy (computed via el_analyze) + laws + how-to-operate + task streams + team +
4// products + docs. Emits web_assets/ai_start.html -> nishifamily.com/wiki/start.html. license_tier: ORIGINAL
5
6import "nx_syscalls.nx"
7import "nx_evolution_ladder.nx"
8import "nx_wiki_shell.nx"
9
10const AS_OUT: *u8 = "web_assets/ai_start.html"
11const AS_LADDER: *u8 = "knowledge/registry/evolution_ladder.tsv"
12const AS_GATE_GEN: *u8 = "knowledge/status/genesis_trace_gate.log"
13const AS_GATE_EL: *u8 = "knowledge/status/evolution_ladder_gate.log"
14const AS_GATE_WE: *u8 = "knowledge/status/wiki_exceed_gate.log"
15const AS_CAP: i64 = 262144
16
17func as_cat_esc(dst: *u8, off: i64, s: *u8) -> i64 {
18 var o: i64 = off; var i: i64 = 0
19 while s[i] != 0 as u8 {
20 let c: u8 = s[i]
21 if c == 60 as u8 { o = sh_cat(dst, o, "<" as *u8) }
22 else { if c == 62 as u8 { o = sh_cat(dst, o, ">" as *u8) }
23 else { if c == 38 as u8 { o = sh_cat(dst, o, "&" as *u8) }
24 else { dst[o] = c; o = o + 1 } } }
25 i = i + 1
26 }
27 return o
28}
29func as_find_last(hay: *u8, n: i64, needle: *u8) -> i64 {
30 let nl: i64 = sh_slen(needle)
31 if nl == 0 { return 0 - 1 }
32 var last: i64 = 0 - 1
33 var i: i64 = 0
34 while i + nl <= n {
35 var j: i64 = 0; var ok: i64 = 1
36 while j < nl { if hay[i + j] != needle[j] { ok = 0; j = nl } else { j = j + 1 } }
37 if ok == 1 { last = i }
38 i = i + 1
39 }
40 return last
41}
42func as_cite_verdict(dst: *u8, off: i64, path: *u8) -> i64 {
43 let lenbox: *i64 = sys_mmap(16) as *i64; lenbox[0] = 0
44 let data: *u8 = sys_read_file(path, lenbox)
45 if (data as i64) == 0 { return sh_cat(dst, off, "(no log on disk yet)" as *u8) }
46 let n: i64 = lenbox[0]
47 let at: i64 = as_find_last(data, n, "verdict=" as *u8)
48 if at < 0 { return sh_cat(dst, off, "(no verdict line yet)" as *u8) }
49 var ls: i64 = at
50 var goa: i64 = 1
51 while goa == 1 { if ls <= 0 { goa = 0 } else { if data[ls - 1] == 10 as u8 { goa = 0 } else { ls = ls - 1 } } }
52 var le: i64 = at
53 var gob: i64 = 1
54 while gob == 1 { if le >= n { gob = 0 } else { if data[le] == 10 as u8 { gob = 0 } else { le = le + 1 } } }
55 var o: i64 = off; var i: i64 = ls
56 while i < le { dst[o] = data[i]; o = o + 1; i = i + 1 }
57 return o
58}
59
60func main() -> i64 {
61 let outs: *i64 = sys_mmap(256) as *i64
62 if el_analyze(AS_LADDER, outs) != 0 { sys_write(2, "FATAL: ladder unreadable\n" as *u8, 25); sys_exit(1); return 1 }
63 let now: i64 = sys_now_realtime_sec()
64 let h: *u8 = sys_mmap(AS_CAP)
65 var w: i64 = 0
66
67 let wl: *NxWikiLinks = sys_mmap(128) as *NxWikiLinks
68 sh_links_load(wl, "knowledge/registry/wiki_links.tsv" as *u8)
69 let store: *NxWikiDocStore = sh_corpus_store()
70
71 w = sh_head(h, w, "AI Start Here" as *u8, "start" as *u8)
72 w = sh_nav(h, w, "start" as *u8)
73 w = sh_walk_furniture(h, w, wl, store, "start" as *u8)
74
75 w = sh_cat(h, w, "<h1>Nishi Ecosystem — AI START HERE</h1>\n" as *u8)
76 w = sh_cat(h, w, "<p class=\"fresh\">⟳ Capstone generated LIVE by <code>nx_wiki_ai_start_page</code> at epoch=" as *u8)
77 w = sh_catn(h, w, now)
78 w = sh_cat(h, w, " — genealogy is COMPUTED from ground truth; everything else CITES its source. regenerate to refresh.</p>\n" as *u8)
79 w = sh_cat(h, w, "<p class=\"lede\">If you are an <strong>LLM</strong> (Claude or the local model) handed this link: <strong>start here, then act.</strong> This is the single entry point tying together — live + evidence-cited — the <strong>genealogy</strong>, <strong>task streams</strong>, the <strong>Nishi team</strong>, the <strong>products</strong>, and the <strong>documentation</strong>, so you pick up ANY work without re-canning context.</p>\n" as *u8)
80
81 w = sh_infobox_open(h, w, "AI Start Here (capstone)" as *u8)
82 w = sh_infobox_row(h, w, "Role" as *u8, "Single AI front door" as *u8)
83 w = sh_infobox_row(h, w, "Built by" as *u8, "nx_wiki_ai_start_page" as *u8)
84 w = sh_infobox_row(h, w, "Genealogy" as *u8, "computed live (el_analyze)" as *u8)
85 w = sh_infobox_row(h, w, "Gates" as *u8, "genesis 9/9 + ladder 6/6 + wiki 4/4" as *u8)
86 w = sh_infobox_row(h, w, "URL" as *u8, "nishifamily.com/wiki/start.html" as *u8)
87 w = sh_infobox_close(h, w)
88
89 w = sh_toc_open(h, w)
90 w = sh_toc_item(h, w, "operate" as *u8, "How to operate" as *u8)
91 w = sh_toc_item(h, w, "laws" as *u8, "The laws" as *u8)
92 w = sh_toc_item(h, w, "genealogy" as *u8, "The genealogy (live)" as *u8)
93 w = sh_toc_item(h, w, "tasks" as *u8, "Task streams (resume any work)" as *u8)
94 w = sh_toc_item(h, w, "team" as *u8, "The Nishi team" as *u8)
95 w = sh_toc_item(h, w, "products" as *u8, "The products" as *u8)
96 w = sh_toc_item(h, w, "docs" as *u8, "The documentation map" as *u8)
97 w = sh_toc_item(h, w, "refs" as *u8, "Evidence & provenance" as *u8)
98 w = sh_toc_close(h, w)
99
100 w = sh_section(h, w, "operate" as *u8, "How to operate (read first)" as *u8)
101 w = sh_cat(h, w, "<p>You are resuming work on a <strong>sovereign</strong> stack: every tool is a Nishi <code>.nx</code> organ built by the WOMB (no gcc, no third-party runtime). Build/verify any organ:</p>\n<pre>wsl --cd /mnt/c/Users/elder/nishi-core/nxc2 -- ./_offc/nx_sov_build_run.elf <basename></pre>\n<p>Work in <strong>one gated rung at a time</strong> (~10s build+gate); read the verdict before the next step; every gate has a negative control; never fabricate a green.</p>\n" as *u8)
102
103 w = sh_section(h, w, "laws" as *u8, "The laws (non-negotiable)" as *u8)
104 w = sh_cat(h, w, "<ul><li><strong>Measured exceed, no overclaim.</strong> “S-class” = MEASURED, per-feature, head-to-head vs a named incumbent, raw artifact shown.</li>" as *u8)
105 w = sh_cat(h, w, "<li><strong>Author by organ.</strong> The TEAM gains the capability; never hand-fake a deliverable/census/grade.</li>" as *u8)
106 w = sh_cat(h, w, "<li><strong>Never brick (Rule 26).</strong> No capability may ever brick hardware; proven mechanically.</li>" as *u8)
107 w = sh_cat(h, w, "<li><strong>Sovereign only.</strong> Nishi runs everything; third-party = a named yardstick or last-mile render only.</li>" as *u8)
108 w = sh_cat(h, w, "<li><strong>Evidence & science, always.</strong> The wiki publishes live with freshness + citations that resolve.</li></ul>\n" as *u8)
109
110 w = sh_section(h, w, "genealogy" as *u8, "The genealogy (capstone) — live" as *u8)
111 w = sh_cat(h, w, "<p><strong>Genesis (god → IO endpoint):</strong> god = origination (ANY hardware); adam=1/eve=0; fragmentation axes are vendor-lock points; unification layers span them; the endpoint is the app⇄IO loop with a human. Data <code>genesis_lineage.tsv</code>, tracer <code>nx_genesis_trace</code> (gated GREEN, see Evidence).</p>\n<p><strong>The evolution ladder (where we are) — computed now:</strong></p>\n<table><tr><th>Layer</th><th>Verified rung</th><th>What it is</th></tr>\n" as *u8)
112 var i: i64 = 0
113 let nlayers: i64 = el_count()
114 while i < nlayers {
115 w = sh_cat(h, w, "<tr><td><code>" as *u8); w = as_cat_esc(h, w, el_id(i))
116 w = sh_cat(h, w, "</code></td><td><strong>" as *u8); w = as_cat_esc(h, w, el_rung_name(el_verified_rung(i)))
117 w = sh_cat(h, w, "</strong></td><td>" as *u8); w = as_cat_esc(h, w, el_label(i)); w = sh_cat(h, w, "</td></tr>\n" as *u8)
118 i = i + 1
119 }
120 w = sh_cat(h, w, "</table>\n<p class=\"why\"><strong>Census:</strong> " as *u8)
121 w = sh_catn(h, w, outs[0]); w = sh_cat(h, w, " layers — SPEC'D=" as *u8); w = sh_catn(h, w, outs[7])
122 w = sh_cat(h, w, " BUILT=" as *u8); w = sh_catn(h, w, outs[8]); w = sh_cat(h, w, " GATED=" as *u8); w = sh_catn(h, w, outs[9])
123 w = sh_cat(h, w, " EXCEEDS=" as *u8); w = sh_catn(h, w, outs[11]); w = sh_cat(h, w, ". 0 measured head-to-head wins on the tree yet — NOT S-class there, and we say so. Doctrine: <a href=\"/wiki/charter.html\">/wiki/charter.html</a>.</p>\n" as *u8)
124
125 w = sh_section(h, w, "tasks" as *u8, "Task streams (pick up ANY work)" as *u8)
126 w = sh_cat(h, w, "<p>Machine SSOT of all work = the <strong>WMS registry</strong> (<code>nx_workstream_store</code>) — ~1265 streams across 12 empires (open the live board below for the current rollup). Human restart MENU = the resume manifest.</p>\n" as *u8)
127 w = sh_cat(h, w, "<p><strong><a href=\"/wiki/board.html\">▸ Open the LIVE WMS task board →</a></strong> — per-empire done / active / blocked rollup, emitted bits-up from the registry by <code>nx_ws_board_html</code> (the wheeler-flip: Nishi is the truth, the HTML is a verified output).</p>\n" as *u8)
128 w = sh_cat(h, w, "<p><strong><a href=\"/wiki/devlog.html\">▸ Recent sessions — the live devlog →</a></strong> — each work session banked with freshness + gate-cited evidence (emitted by <code>nx_wiki_devlog</code>, fetch-verified by <code>nx_url_get</code> over our own TLS-1.3 stack).</p>\n" as *u8)
129 w = sh_cat(h, w, "<p class=\"why\"><strong>Resume procedure:</strong> (1) open the live board above (or read the resume manifest); (2) run <code>nx_ws_board</code> for the NAMED active/blocked streams + liveness; (3) pick a stream; (4) run its resume action (usually <code>./_offc/nx_sov_build_run.elf <gate></code>); (5) read the verdict; (6) take the next gated rung.</p>\n" as *u8)
130
131 w = sh_section(h, w, "team" as *u8, "The Nishi team" as *u8)
132 w = sh_cat(h, w, "<p>Capabilities are owned by ROLE CHAINS (no orphans): <code>knowledge/registry/orchestra.tsv</code> (Engineer > Doctor > Builder > Examiner > reconcile) + roster <code>knowledge/TEAM_ROSTER.md</code>. A chain step with no organ is a NAMED GAP.</p>\n" as *u8)
133
134 w = sh_section(h, w, "products" as *u8, "The products" as *u8)
135 w = sh_cat(h, w, "<p>Catalog: <code>knowledge/registry/product_catalog.tsv</code>. Live/named: sovereign CMS, family video (<a href=\"/video\">/video</a>), reader, writer, torrent, games (<a href=\"/voxelworld\">/voxelworld</a>), media-studio, neural-MT. Honest state per product = its census/gate.</p>\n" as *u8)
136
137 w = sh_section(h, w, "docs" as *u8, "The documentation map (the 10 homes)" as *u8)
138 w = sh_cat(h, w, "<p>Everything has ONE home: <code>knowledge/ai_wiki/WIKI_STRUCTURE.md</code> orders the ten — (0) START-HERE, (1) GENESIS, (2) THE-ENGINE, (3) CAPABILITY-MAP, (4) HARDWARE-CLIMATES, (5) REGISTRIES, (6) DOCTRINE, (7) EVIDENCE, (8) THE-WORK, (9) THE-LIBRARY. Briefing <code>STARTUP_BRIEFING.md</code>; genesis map <code>BOOTSTRAP_MAP.md</code>; specs <code>knowledge/specs/</code>; data <code>knowledge/registry/*.tsv</code>; evidence <code>knowledge/status/*.log</code>.</p>\n" as *u8)
139 w = sh_cat(h, w, "<p><strong>Reference pages (Diataxis):</strong> <a href=\"/wiki/nist_stem.html\">NIST STEM Capability Scorecard</a> — each STEM domain graded vs its NIST yardstick, with live gates.</p>\n" as *u8)
140
141 w = sh_refs_open(h, w)
142 w = sh_cat(h, w, "<li>Genesis-lineage gate: <span class=\"ev\">" as *u8); w = as_cite_verdict(h, w, AS_GATE_GEN); w = sh_cat(h, w, "</span></li>\n" as *u8)
143 w = sh_cat(h, w, "<li>Evolution-ladder gate: <span class=\"ev\">" as *u8); w = as_cite_verdict(h, w, AS_GATE_EL); w = sh_cat(h, w, "</span></li>\n" as *u8)
144 w = sh_cat(h, w, "<li>Wiki feature-census gate (this page family vs MediaWiki): <span class=\"ev\">" as *u8); w = as_cite_verdict(h, w, AS_GATE_WE); w = sh_cat(h, w, "</span></li>\n" as *u8)
145 w = sh_refs_close(h, w)
146
147 w = sh_footer_wl(h, w, wl, "start" as *u8, now)
148
149 let fd: i64 = sys_openat_wr(AS_OUT, 0x1a4)
150 if fd < 0 { sys_write(2, "FATAL: cannot open ai_start.html\n" as *u8, 33); sys_exit(2); return 2 }
151 sys_write(fd, h, w)
152 sys_close(fd)
153 sys_write(1, "[nx_wiki_ai_start_page] wrote ai_start.html bytes=" as *u8, 50)
154 let nb: *u8 = sys_mmap(28); var k2: i64 = 0; var m2: i64 = w
155 if m2 == 0 { nb[0] = 48 as u8; k2 = 1 }
156 while m2 > 0 { nb[k2] = (48 + (m2 % 10)) as u8; m2 = m2 / 10; k2 = k2 + 1 }
157 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 }
158 sys_write(1, "\n" as *u8, 1)
159 sys_exit(0); return 0
160}