code wiki / _hdl_build / nx_wiki_hub.nx
nx_wiki_hub.nx source
↩ module page · 50 lines · 3389 B
1// nx_wiki_hub.nx -- the navigable FRONT DOOR (index.html) on the shared design skin. Maps everything
2// and makes FORWARD (next) / BACKWARD (history) obvious. Sovereign: nx_syscalls + nx_wiki_skin_lib.
3// Emits /tmp/nx_wiki_hub.html + nx_aw_push specs for .../wiki/index.html. license_tier: ORIGINAL
4import "nx_syscalls.nx"
5import "nx_wiki_skin_lib.nx"
6const WH_MAGIC_262144: i64 = 262144
7
8const WH_OUT: *u8 = "/tmp/nx_wiki_hub.html"
9const WH_SRC: *u8 = "/tmp/nx_wiki_hub.src"
10const WH_DST: *u8 = "/tmp/nx_wiki_hub.dst"
11const WH_SRCVAL: *u8 = "/tmp/nx_wiki_hub.html\n"
12const WH_DSTVAL: *u8 = "cat > /volume1/homes/elderwesto/nishihost/sites/nishifamily/wiki/index.html\n"
13
14func wh_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
15func wh_write(path: *u8, content: *u8) -> i64 {
16 let fd: i64 = sys_openat_wr(path, 420)
17 if fd < 0 { return 0 - 1 }
18 sys_write(fd, content, wh_slen(content)); sys_close(fd); return 0
19}
20
21func main(argc: i64, argv: *i64) -> i64 {
22 let h: *u8 = sys_mmap(WH_MAGIC_262144)
23 var w: i64 = 0
24 w = skin_open(h, w, "Map" as *u8, "home" as *u8)
25 w = sk_cat(h, w, "<h1>nishifamily.com/wiki</h1>\n<p class=\"sub\">One front door. Go <b>▶ forward</b> to what’s next, <b>◀ backward</b> through what happened — the Work Board walks both.</p>\n" as *u8)
26
27 w = sk_cat(h, w, "<a class=\"card\" href=\"board.html\"><b>▶◀ Open the Work Board</b><span>Delegation · the full backlog (every workstream) · live feed · predicted next-work. The single surface you navigate forward and backward.</span></a>\n" as *u8)
28
29 w = sk_cat(h, w, "<h2>How to move</h2>\n" as *u8)
30 w = sk_cat(h, w, "<p><b>▶ Forward — what’s next:</b> Board → <i>Future</i> (adjacent-possible rungs whose prerequisites are done) + the Delegation next-actions per owner.</p>\n" as *u8)
31 w = sk_cat(h, w, "<p><b>◀ Backward — what happened:</b> Board → <i>Present</i> feed (newest actions, crash-proof) → the per-workstream records.</p>\n" as *u8)
32
33 w = sk_cat(h, w, "<h2>Sitemap</h2>\n" as *u8)
34 w = sk_cat(h, w, "<a class=\"card\" href=\"board.html\"><b>Work Board</b><span>now / next / history / delegation — the navigable surface (operator-gated)</span></a>\n" as *u8)
35 w = sk_cat(h, w, "<a class=\"card\" href=\"start.html\"><b>AI front door</b><span>give this link to any AI to resume any work</span></a>\n" as *u8)
36 w = sk_cat(h, w, "<a class=\"card\" href=\"charter.html\"><b>Charter & telos</b><span>the doctrine and north-star the whole tree grows toward</span></a>\n" as *u8)
37
38 w = sk_cat(h, w, "<h2>Three readers, one door</h2>\n<p class=\"sub\">The <b>operator</b> steers, an <b>AI</b> resumes, the <b>Nishi PM</b> plans — all on the same surface, triangulating the next hardware-up rung, no floaters.</p>\n" as *u8)
39
40 w = skin_close(h, w, sys_now_realtime_sec())
41
42 let fd: i64 = sys_openat_wr(WH_OUT, 420)
43 if fd < 0 { sys_write(2, "HUB-FAIL\n" as *u8, 9); sys_exit(1); return 1 }
44 sys_write(fd, h, w); sys_close(fd)
45 wh_write(WH_SRC, WH_SRCVAL); wh_write(WH_DST, WH_DSTVAL)
46 let r: *u8 = sys_mmap(128); var ro: i64 = 0
47 ro = sk_cat(r, ro, "WIKI-HUB-OK bytes=" as *u8); ro = sk_catn(r, ro, w); ro = sk_cat(r, ro, "\n" as *u8)
48 sys_write(1, r, ro)
49 sys_exit(0); return 0
50}