nx_rulers_page.nx source
↩ module page · 134 lines · 8860 B
1// nx_rulers_page.nx -- THE RULER REGISTRY, RENDERED. Operator doctrine (2026-08-03): the
2// mhbench shape -- parity ruler, gap queue as the build order, measured iteration to the
3// frontier -- applies to EVERY capability. This page is the registry of rulers themselves:
4// each row names the capability, the measuring organ, the ORACLE BASIS (published bands /
5// external oracle -- never taste), the CURRENT reading, and the QUEUE HEAD (the next rung the
6// measurement demands). Generated from the rulerreg- plane; never hand-edited (a hand page
7// would drift, and an index that lies about its rulers poisons every number downstream).
8// A capability with no ruler row here is UNMEASURED BY DECLARATION -- visible, not hidden.
9// Row (7 col): id organ oracle reading queue surface cadence
10// license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
11import "nx_store_seed_lib.nx"
12import "nx_seg_store.nx"
13import "nx_syscalls.nx"
14
15const RP_PLANE: *u8 = "knowledge/store/rulerreg-"
16const RP_OUT: *u8 = "sites/nishifamily/wiki/rulers.html"
17const RP_RCAP: i64 = 262144
18const RP_HCAP: i64 = 524288
19const RP_NL: i64 = 10
20const RP_TAB: i64 = 9
21const RP_MAXCOL: i64 = 16
22const RP_PAIR: i64 = 2
23const RP_SPB: i64 = 256
24const RP_FLAGB: i64 = 64
25const RP_NCOL: i64 = 9
26const RP_MODE: i64 = 0x1a4
27const RP_EXIT_IO: i64 = 1
28const RP_EXIT_EMPTY: i64 = 3
29const RP_LT: i64 = 60
30const RP_GT: i64 = 62
31const RP_AMP: i64 = 38
32
33func rp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
34func rp_werr(s: *u8) -> i64 { sys_write(2, s, rp_slen(s)); return 0 }
35func rp_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64 {
36 var c: i64 = 0
37 var p: i64 = ls
38 while c < RP_MAXCOL {
39 var e: i64 = p
40 var s: i64 = 1
41 while s == 1 { if e >= le { s = 0 } else { if q[e] == (RP_TAB as u8) { s = 0 } else { e = e + 1 } } }
42 sp[c*RP_PAIR] = p
43 sp[c*RP_PAIR+1] = e
44 c = c + 1
45 if e >= le { return c }
46 p = e + 1
47 }
48 return c
49}
50func rp_esc(d: *u8, o: i64, q: *u8, a: i64, b: i64) -> i64 {
51 var oo: i64 = o
52 var i: i64 = a
53 while i < b {
54 let c: i64 = q[i] as i64
55 if c == RP_LT { oo = ss_cat(d, oo, "<" as *u8) }
56 else { if c == RP_GT { oo = ss_cat(d, oo, ">" as *u8) }
57 else { if c == RP_AMP { oo = ss_cat(d, oo, "&" as *u8) }
58 else { d[oo] = q[i]; oo = oo + 1 } } }
59 i = i + 1
60 }
61 return oo
62}
63
64func main() -> i64 {
65 let buf: *u8 = sts_mm(RP_RCAP)
66 let flags: *i64 = sts_mm(RP_FLAGB) as *i64
67 let n: i64 = sts_load_honest(RP_PLANE, buf, RP_RCAP, flags)
68 if n <= 0 { rp_werr("RULERS-RED plane EMPTY\n" as *u8); sys_exit(RP_EXIT_EMPTY); return RP_EXIT_EMPTY }
69 let h: *u8 = sts_mm(RP_HCAP)
70 let sp: *i64 = sts_mm(RP_SPB) as *i64
71 let now: i64 = sys_now_realtime_sec()
72 var w: i64 = 0
73 w = ss_cat(h, w, "<!doctype html>\n<html lang='en'><head><meta charset='utf-8'><meta name='viewport' content='width=device-width,initial-scale=1'>\n<title>the rulers - nishi wiki</title>\n<style>\n:root{--bg:#fff;--sf:#f6f8fb;--br:#dfe4ec;--ink:#232936;--mut:#68748a;--acc:#1a5dc8;--acc2:#2e8555;--hd:#111726;--hov:#f0f4fa}\n@media(prefers-color-scheme:dark){:root{--bg:#0d1017;--sf:#131826;--br:#252d40;--ink:#dbe2ec;--mut:#8a94a8;--acc:#5aa7f0;--acc2:#86c793;--hd:#eef2f8;--hov:#141a28}}\n*{box-sizing:border-box}body{font-family:system-ui,'Segoe UI',sans-serif;margin:0;background:var(--bg);color:var(--ink);padding:22px 30px 40px;line-height:1.55}\nmain{max-width:1200px;margin:0 auto}a{color:var(--acc)}h1{font-size:1.5em;color:var(--hd)}\ntable{border-collapse:collapse;width:100%;margin:10px 0}td,th{padding:6px 9px;border-bottom:1px solid var(--br);text-align:left;vertical-align:top;font-size:.88em}th{color:var(--mut);font-size:.8em}tr:hover td{background:var(--hov)}\n.muted{color:var(--mut)}.nar{background:var(--sf);border:1px solid var(--br);border-left:3px solid var(--acc2);border-radius:8px;padding:12px 16px;font-size:.92em;margin:12px 0}\nfooter{margin-top:32px;padding-top:10px;border-top:1px solid var(--br);font-size:.8em;color:var(--mut)}\n</style></head><body><main>\n<p class='muted'><a href='/wiki/index.html'>nishi wiki</a> / rulers</p>\n<h1>The rulers — every capability, measured</h1>\n<div class='nar'><b>The doctrine.</b> A capability advances by the mhbench shape: build the ORACLE (published bands, external references, real datasets — never taste), measure against it on a cadence, and let the <b>gap queue BE the build order</b> until the frontier is reached and passed. This page is the registry of those rulers. A capability with no row here is <b>unmeasured by declaration</b> — that absence is itself the first gap. Every reading below carries its instrument; go run it, never trust this page over the organ.<br><br><b>THE RESOLUTION LADDER.</b> A ruler must resolve <i>one rung finer</i> than the capability it drives — a meter-scale judge cannot steer centimeter work (the body-frame face judge flattered the face 3× until the head-scale judge existed). Every ruler therefore declares its CURRENT resolving scale and its NEXT rung; when the capability reaches the ruler's own floor, <b>refining the ruler becomes the queue head</b> — meter → centimeter → millimeter → below, until the ruler and reality disagree about nothing.<br><br><b>THE BEST CLAIM, MADE MECHANICAL (operator 2026-08-03).</b> “Provably the best” is not a sentence, it is a COLUMN: every ruler carries the frontier's measured bar beside ours with a verdict — AHEAD (artifact-backed), BEHIND (with the gap as a number and the path named), or UNMEASURED (a verdict pending one run). <b>The program is complete when every row reads AHEAD and every AHEAD is artifact-backed.</b> A BEHIND with a number is progress; an AHEAD without an artifact is a lie.</div>\n<table>\n<tr><th>capability</th><th>instrument</th><th>oracle basis</th><th>current reading</th><th>queue head (= next build)</th><th>surface</th><th>cadence</th><th>resolution: now → next</th><th>vs THE FRONTIER (the BEST claim, per row)</th></tr>\n" as *u8)
74 var total: i64 = 0
75 var i: i64 = 0
76 while i < n {
77 var le: i64 = i
78 var s: i64 = 1
79 while s == 1 { if le >= n { s = 0 } else { if buf[le] == (RP_NL as u8) { s = 0 } else { le = le + 1 } } }
80 if le > i {
81 let nc: i64 = rp_cols(buf, i, le, sp)
82 if nc >= RP_NCOL {
83 w = ss_cat(h, w, "<tr><td><b>" as *u8)
84 w = rp_esc(h, w, buf, sp[0], sp[1])
85 w = ss_cat(h, w, "</b></td><td>" as *u8)
86 w = rp_esc(h, w, buf, sp[2], sp[3])
87 w = ss_cat(h, w, "</td><td class='muted'>" as *u8)
88 w = rp_esc(h, w, buf, sp[4], sp[5])
89 w = ss_cat(h, w, "</td><td>" as *u8)
90 w = rp_esc(h, w, buf, sp[6], sp[7])
91 w = ss_cat(h, w, "</td><td>" as *u8)
92 w = rp_esc(h, w, buf, sp[8], sp[9])
93 w = ss_cat(h, w, "</td><td class='muted'>" as *u8)
94 w = rp_esc(h, w, buf, sp[10], sp[11])
95 w = ss_cat(h, w, "</td><td class='muted'>" as *u8)
96 w = rp_esc(h, w, buf, sp[12], sp[13])
97 w = ss_cat(h, w, "</td><td>" as *u8)
98 w = rp_esc(h, w, buf, sp[14], sp[15])
99 w = ss_cat(h, w, "</td><td><b>" as *u8)
100 w = rp_esc(h, w, buf, sp[16], sp[17])
101 w = ss_cat(h, w, "</b></td></tr>\n" as *u8)
102 total = total + 1
103 }
104 }
105 i = le + 1
106 }
107 w = ss_cat(h, w, "</table>\n<p class='muted'>rendered=" as *u8)
108 w = ss_catn(h, w, total)
109 w = ss_cat(h, w, " declared=" as *u8)
110 w = ss_catn(h, w, flags[0])
111 w = ss_cat(h, w, " loaded=" as *u8)
112 w = ss_catn(h, w, flags[1])
113 w = ss_cat(h, w, " beyond=" as *u8)
114 w = ss_catn(h, w, flags[2])
115 w = ss_cat(h, w, " — rendered must equal loaded or a row is malformed. Epoch=" as *u8)
116 w = ss_catn(h, w, now)
117 w = ss_cat(h, w, "</p>\n<footer>Generated by <code>nx_rulers_page</code> from <code>knowledge/store/rulerreg-</code>. New ruler = one plane row (nx_store_put), never a page edit. Nishi ecosystem.</footer>\n</main></body></html>\n" as *u8)
118 let fd: i64 = sys_openat_wr(RP_OUT, RP_MODE)
119 if fd < 0 { rp_werr("RULERS-RED cannot open output\n" as *u8); sys_exit(RP_EXIT_IO); return RP_EXIT_IO }
120 sys_write(fd, h, w)
121 sys_close(fd)
122 let m: *u8 = sts_mm(256)
123 var o: i64 = ss_cat(m, 0, "RULERS-GREEN rendered=" as *u8)
124 o = ss_catn(m, o, total)
125 o = ss_cat(m, o, " declared=" as *u8)
126 o = ss_catn(m, o, flags[0])
127 o = ss_cat(m, o, " bytes=" as *u8)
128 o = ss_catn(m, o, w)
129 m[o] = RP_NL as u8
130 o = o + 1
131 sys_write(1, m, o)
132 sys_exit(0)
133 return 0
134}