code wiki / (root) / nx_swcompare_matrix_ladder_test_20260907.nx

nx_swcompare_matrix_ladder_test_20260907.nx source

↩ module page · 1634 lines · 129951 B

1// nx_swcompare_matrix.nx -- GENERIC, data-driven, liar-killed SoftwareCompare MATRIX generator. Reads 2// knowledge/compare/<domain>.matrix (label|organ|symbol|exceed|ONE CELL PER @cols ENTRY|note + @title/@sub/@cols directives), 3// MEASURES each Nishi cell by requiring the implementing symbol to EXIST in the real organ source on disk (no 4// self-grading), and emits a head-to-head SoftwareCompare page (Nishi + N named competitors, N = the @cols count, bounded only by SWC_ROW_STRIDE). Retires the 5// per-domain bespoke nx_swcompare_<domain> matrix organs: a new comparison = one .matrix data file, ZERO code. 6// Two modes: no html arg = console census + liar-kill gate (exit 0/1); "html" = emit the page to stdout. 7// NOTE: no '#' or '!' in string literals (nx_cc lexer trap) -> rgb() colors + DOCTYPE '!' emitted as a byte. 8// license_tier: ORIGINAL expect_exit: 0 9import "nx_syscalls.nx" 10import "nx_tool_run.nx" 11// CT-ADOPT (2026-09-04): the compare data tree is RESOLVED, never assumed. A bare 12// "knowledge/compare/" literal is CWD-RELATIVE, so this generator rendered only when its caller 13// had already chdir'd into buildroot and refused "MATRIX FILE MISSING" under every other launcher. 14// MEASURED that day: forking the PROMOTED elf from the serving root with ["procgen","html"] returned 15// MATRIX FILE MISSING for a domain whose .matrix is 45,033 bytes -- present, just in the other tree. 16// This is the estate's FIFTH rediscovery of that class; nx_comparetree_lib exists to end it. 17// 18// SCOPE DECLARED, BECAUSE THE HALF-FIX IS THE DANGEROUS ONE. Only the .matrix READ is resolved here. 19// FIVE sibling sites still carry the bare literal (.rank, .refs, .gallery, .plan, .gates) and each 20// treats absence as a byte-identical emit, so from a NON-buildroot CWD this generator now renders a 21// page that is missing those sections instead of refusing outright. A LOUD FATAL TURNED INTO A QUIET 22// DEGRADATION IS WORSE THAN THE FATAL, so it is fenced by declaration rather than left implicit: 23// ==> A RENDER PRODUCED FROM ANY CWD OTHER THAN buildroot IS A DIAGNOSTIC ARTIFACT AND MUST NOT BE 24// PUBLISHED. The publishing path is nx_compare_regen, which chdirs to buildroot first. 25// UNDER THAT PRODUCTION PATH THIS CHANGE IS A PROVABLE NO-OP: probe 1 is buildroot/buildroot/... which 26// can never resolve, and probe 2 is exactly the file the old bare literal read. One extra failed 27// openat per domain buys the CWD independence. 28// KNOWN BEHAVIOUR CHANGE, NOT HIDDEN: from CWD=nishihost the ~45 domains whose .matrix exists in BOTH 29// trees now grade the buildroot twin rather than the nishihost one. That is the correct direction -- 30// .matrix is buildroot-owned -- but the twins differ (lang.matrix measured 9,532 B knowledge vs 31// 58,330 B buildroot, a superseded generation), so it is a different document, not the same one. 32// OWED: the five sibling sites, and .gates in particular CANNOT use this resolver -- its authored 33// order probes knowledge/ then buildroot/knowledge/, and from CWD=buildroot neither reaches 34// nishihost/knowledge/compare/ where the 54 .gates files actually live. That one needs da_read_2dir. 35import "nx_comparetree_lib.nx" 36const K_MAGIC_5381: i64 = 5381 37// GALLERY ARTIFACT PROBES (2026-08-18, operator: cards must DO something on the page): a .gallery row's 38// optional 5th field names an organ + verb; at EVERY emit the generator forks it against the row's own 39// docroot artifact and embeds the captured output under the figure -- measured at emit, refreshed on 40// every beat, the same law as the matrix cells (never seat-typed prose). rc!=0 or empty output is shown 41// honestly; output filling the reserve announces its truncation. 42const GAL_PROBE_CAP: i64 = 16384 // a probe's stdout reserve (kkfacts decode measures ~1.5KB); brim announces 43const GAL_PROBE_AV: i64 = 6 // elf + up to 3 spec tokens + artifact path + NUL 44const K_MAGIC_262144: i64 = 262144 45const K_MAGIC_20480: i64 = 20480 46const K_MAGIC_20479: i64 = 20479 47// COLUMN CAPACITY DERIVED FROM THE ROW SLOT WIDTH, NEVER GUESSED (2026-08-27, synthroom's seventh rival). 48// A parsed row is stored in SWC_ROW_STRIDE i64 slots: label|organ|symbol|exceed, ONE CELL PER DECLARED 49// @cols ENTRY, then the note -- so the column cap is the stride minus those five fixed fields, computed 50// in main() as max_cols. The literal 6 this replaces silently truncated a seven-entry @cols line to six 51// and then REFUSED every data row as an over-count (schema 11 against 12 fields): the generator's own 52// stray-pipe guard convicting a correct file, with no message naming the real cause. 53const SWC_ROW_STRIDE: i64 = 16 54const SWC_ROW_FIXED: i64 = 5 55 56 57import "nx_compare_ladder_isolated_lib.nx" 58// CE2 (2026-08-23): the estate's adoption ladder, ONE classifier shared with nx_catalog and nx_compare_rank 59import "nx_catalog_lib.nx" 60// ONE ASSEMBLER FOR EVERY DOMAIN (2026-09-02): the SOTA field (the N-peer grade grid, its measured bindings and 61// its census) is a lib pass composed here whenever knowledge/compare/<dom>.sota exists -- absent file = 62// byte-identical, the refs/gallery/bench precedent. Before this the sota-class pages were emitted by a 63// second generator with a second shape and lacked four of this page's sections (measured live 2026-09-02). 64import "nx_swcompare_sota_lib.nx" 65// ---- EC10 (2026-09-01, ecosystem rung): THE ADOPTION LADDER REACHES THE PAGE WHOLE ---- 66// clb_classify computes a ten-state ladder per row and this generator collapsed it to FULL/PARTIAL before 67// any field, so DARK, UNPROMOTED, UNREGISTERED and SOURCE-ONLY -- the four classes the operator named -- 68// were computed on every row and discarded. The histogram below buckets rows by the class TOKEN the 69// classifier itself returned, DATA-DRIVEN: no hardcoded token list to drift when the lib grows a verdict, 70// and no UNKNOWN bucket is possible because every token is its own bucket. Gate tokens embed a per-organ 71// trial count after a space (GATE:LIVE trial=3), so bucketing compares only up to the first space -- 72// otherwise every gate would fragment into its own class and the histogram would be a row list wearing a 73// summary's name. 74const MXH_MAX: i64 = 64 // distinct class tokens; the ladder has 10 verdicts plus GATE: variants, and an overflow is COUNTED, never silent 75func mx_tokclass_len(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { if s[i] == (32 as u8) { return i } i = i + 1 } return i } 76func mx_tokclass_eq(a: *u8, b: *u8) -> i64 { 77 let la: i64 = mx_tokclass_len(a) 78 if la != mx_tokclass_len(b) { return 0 } 79 var i: i64 = 0 80 while i < la { if a[i] != b[i] { return 0 } i = i + 1 } 81 return 1 82} 83// c_has / c_file_has (bare substring over the organ) were REMOVED 2026-08-23: presence is measured by 84// nx_symdecl_lib sd_declared (one ruler, shared with the ranker, the sota watch section and the 85// comparewatch plane). A substring rewarded a comment or a call site with a LANDED cell. 86func atoi(s: *u8) -> i64 { 87 var v: i64 = 0; var i: i64 = 0 88 while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c < 48 { break } if c > 57 { break } v = v * 10 + (c - 48); i = i + 1 } 89 return v 90} 91 92// PROVENANCE HASH (2026-08-07). The published artifact declares a content hash of the .matrix it was 93// generated FROM, so a consumer can decide staleness WITHOUT clocks: hash the current matrix, compare 94// to the published source_hash, and a mismatch means the page no longer reflects its source. 95// WHY NOT TIMESTAMPS: mtimes lie across copies (this tree has TWO knowledge/compare directories) and 96// clocks lie across machines. Content does not. A page that carries generated_unix alone can only tell 97// you WHEN it was made, never WHETHER it is current -- and /compare/doctor sat a month stale asserting 98// a sentence that had stopped being true, with a perfectly valid timestamp. 99// WHY djb2 AND NOT SHA-256: this detects DRIFT, not tampering, and it needs no crypto dependency in a 100// generator that has none. It catches the SAME-SIZE edit that a byte-count comparison is structurally 101// blind to, which is the case that actually bites. Masked to 48 bits so it is always a positive 102// JSON integer (i64 wraps silently here, so the raw accumulator can go negative). 103func swc_src_hash(b: *u8, n: i64) -> i64 { 104 var h: i64 = K_MAGIC_5381 105 var i: i64 = 0 106 while i < n { h = h * 33 + (b[i] as i64); i = i + 1 } 107 if h < 0 { h = 0 - h } 108 return h & 0xFFFFFFFFFFFF 109} 110 111// STATE MARK (2026-08-13, the blessed register): shape-first glyphs -- not words, not coloured chips. 112// Shape carries the state, so the matrix stays readable in the e-ink profile where colour carries nothing. 113// The entity is assembled with wc(35) because a literal '#' inside a string is an nx_cc lexer trap. 114func mark(fd: i64, code: i64) -> i64 { 115 w(fd, "<span class='g" as *u8) 116 if code == 0 { w(fd, " off" as *u8) } 117 if code == 3 { w(fd, " half" as *u8) } 118 w(fd, "'>&" as *u8); wc(fd, 35) 119 if code == 2 { w(fd, "9673;" as *u8) } else { if code == 1 { w(fd, "9679;" as *u8) } else { if code == 3 { w(fd, "9680;" as *u8) } else { w(fd, "9675;" as *u8) } } } 120 w(fd, "</span>" as *u8) 121 return 0 122} 123// one matrix cell: the mark plus the word in the title attr, so hover and screen readers get prose 124// while the grid stays scannable. 125func mark_td(fd: i64, name: *u8, code: i64, nishi: i64) -> i64 { 126 if nishi == 1 { w(fd, "<td class='ni' title='" as *u8) } else { w(fd, "<td title='" as *u8) } 127 w(fd, name); w(fd, ": " as *u8) 128 if code == 2 { w(fd, "leads" as *u8) } else { if code == 1 { w(fd, "present" as *u8) } else { if code == 3 { w(fd, "partial" as *u8) } else { w(fd, "absent" as *u8) } } } 129 w(fd, "'>" as *u8) 130 mark(fd, code) 131 w(fd, "</td>" as *u8) 132 return 0 133} 134// ---- PROS / CONS STRIP, DERIVED (2026-09-05; operator: "make the compare more intelligent, pros vs cons, 135// instead of single shaping everything"). Every row used to render as a glyph strip plus a raw adoption 136// token styled like a badge: a human could not read it, and a PARTIAL adoption read as a positive. This 137// strip is DERIVED from the same data the cells are drawn from -- nothing typed by a seat -- and it signs 138// every fact: what Nishi has, whom it is ahead of, whom it is behind, whether the contract is still open, 139// and the catalog lib's own remedy phrase where adoption is partial. Rival marks are documented presence, 140// so a row Nishi holds over every rival says "no measured con", never a victory claim. 141func pc_pts(code: i64) -> i64 { if code == 2 { return 3 } if code == 1 { return 2 } if code == 3 { return 1 } return 0 } 142func pc_strip(fd: i64, nishi: i64, exceed: i64, iswatch: i64, adopt: i64, rem: *u8, cf: *i64, ncol: i64, rf: *i64, rr: i64) -> i64 { 143 let np: i64 = pc_pts(nishi) 144 w(fd, "<div class='pc'><span class='pro'><b>Pros</b> " as *u8) 145 var pros: i64 = 0 146 if nishi == 2 { w(fd, "Nishi leads, a measured exceed" as *u8); pros = pros + 1 } 147 if nishi == 1 { w(fd, "Nishi has it, measured on disk" as *u8); pros = pros + 1 } 148 if nishi == 3 { w(fd, "Nishi has it in part" as *u8); pros = pros + 1 } 149 var ahead: i64 = 0 150 var cj: i64 = 0 151 while cj < ncol { 152 let rp: i64 = pc_pts(atoi(rf[rr*SWC_ROW_STRIDE + 4 + cj] as *u8)) 153 if np > rp { 154 if ahead == 0 { if pros > 0 { w(fd, "; " as *u8) } w(fd, "ahead of " as *u8) } else { w(fd, ", " as *u8) } 155 w(fd, cf[cj] as *u8) 156 ahead = ahead + 1 157 } 158 cj = cj + 1 159 } 160 if ahead > 0 { pros = pros + 1 } 161 if adopt == CLB_FULL { if pros > 0 { w(fd, "; " as *u8) } w(fd, "fully adopted on the estate ladder" as *u8); pros = pros + 1 } 162 if pros == 0 { w(fd, "none measured yet" as *u8) } 163 w(fd, "</span><span class='con'><b>Cons</b> " as *u8) 164 var cons: i64 = 0 165 var behind: i64 = 0 166 cj = 0 167 while cj < ncol { 168 let rp2: i64 = pc_pts(atoi(rf[rr*SWC_ROW_STRIDE + 4 + cj] as *u8)) 169 if rp2 > np { 170 if behind == 0 { w(fd, "behind " as *u8) } else { w(fd, ", " as *u8) } 171 w(fd, cf[cj] as *u8) 172 if rp2 == 3 { w(fd, " (leads)" as *u8) } 173 behind = behind + 1 174 } 175 cj = cj + 1 176 } 177 if behind > 0 { cons = cons + 1 } 178 if iswatch == 1 { 179 if cons > 0 { w(fd, "; " as *u8) } 180 w(fd, "open contract, nothing on disk yet" as *u8) 181 cons = cons + 1 182 } else { 183 if nishi == 0 { if cons > 0 { w(fd, "; " as *u8) } w(fd, "no implementing organ measured" as *u8); cons = cons + 1 } 184 } 185 if adopt == CLB_PARTIAL { if cons > 0 { w(fd, "; " as *u8) } w(fd, "not adopted yet: " as *u8); w(fd, rem); cons = cons + 1 } 186 if cons == 0 { w(fd, "none on the measured axes (rival marks are documented presence, not depth)" as *u8) } 187 w(fd, "</span></div>" as *u8) 188 return 0 189} 190// ---- ROADMAP LAYERS, FROM DATA (2026-08-13) ------------------------------------------------------- 191// knowledge/compare/<dom>.plan carries the executive answer and the dependency-ordered path as ROWS: 192// pos|.. goal|.. unit|.. answer|<label>|<figure>|<text> bar|<name>|<url>|<measures>|<theirs>|<ours> 193// rung|<id>|<title>|<contract>|<done-rule>|<executor>|<est>|<deps> ms|<id>|<label>|<cum>|<rungs> 194// A domain WITHOUT the file emits the matrix alone, byte-for-byte as before -- the other 39 domains are 195// untouched by construction, so this ships without a fleet-wide risk. 196// The file is RE-READ per phase because splitpipe NUL-terminates in place and would eat a second pass. 197// Print what the DEBT PLANE says about an id: open, eaten, or not filed there at all. The state file is 198// `id<TAB>state` per line, refreshed by the regen before any page is emitted. 199// dstate LIFTED to nx_swcompare_lib.nx 2026-08-22 (DG5) -- the base class owns it now so plan_pass can 200// reach it from either generator. This body is the pre-lift copy, kept ONLY until the byte-compare below 201// is banked; it is unreachable (nothing calls this name). 202func dstate_REMOVED_SEE_LIB(fd: i64, id: *u8, ds: *u8, dn: i64) -> i64 { 203 if dn <= 0 { return 0 } 204 var i: i64 = 0 205 while i < dn { 206 var e: i64 = i 207 while e < dn { if ds[e] == (10 as u8) { break } e = e + 1 } 208 var k: i64 = 0 209 var ok: i64 = 1 210 var stop: i64 = 0 211 while stop == 0 { 212 if i + k >= e { stop = 1 } else { 213 let c: i64 = ds[i+k] as i64 214 if c == 9 { stop = 1 } else { 215 let ic: i64 = id[k] as i64 216 if ic == 0 { ok = 0; stop = 1 } else { if ic != c { ok = 0; stop = 1 } else { k = k + 1 } } 217 } 218 } 219 } 220 if ok == 1 { if (id[k] as i64) == 0 { 221 var s: i64 = i + k 222 if s < e { if ds[s] == (9 as u8) { s = s + 1 } } 223 w(fd, "<span class='pstate'>" as *u8) 224 var q: i64 = s 225 while q < e { wc(fd, ds[q] as i64); q = q + 1 } 226 w(fd, "</span>" as *u8) 227 return 1 228 } } 229 i = e + 1 230 } 231 // ⚠NOT "not filed". The lookup is scoped to THIS domain, so a debt filed under another scope (the 232 // decode-path row lives under graphics) is absent here while being perfectly real in the plane. 233 // Saying "not filed" would have published a false negative about a colleague's open work. 234 w(fd, "<span class='pstate note'>not in this scope</span>" as *u8) 235 return 0 236} 237// CITATIONS AS DATA (2026-08-17, operator: the /compare publish should carry a true research paper's 238// citations in a beyond-arxiv way). knowledge/compare/<dom>.refs rows: 239// ref|<key>|<citation prose>|<url>|<library mirror or ->|<content pin or ->|<accessed or ->|<evidence class>|<grounds> 240// BEYOND ARXIV = every reference resolves TWICE: the publisher's copy AND the estate's non-rottable 241// library mirror with a content pin, plus the evidence class and the exact claim it grounds -- a dead 242// publisher link cannot rot the reference, and a reader grades the evidence without leaving the page. 243// A domain without a .refs file emits BYTE-IDENTICALLY (the plan_pass neutrality pattern); inline 244// [@key] marks in notes render as keyed cites, and no pre-existing note carries that token. 245// PUBLISH-THEN-LINK (2026-08-17, operator: "i cant click on the links to the papers to read them in our 246// library"). knowledge/library has NO public route -- /library is the login-gated book reader -- so a 247// mirror path rendered as text was provenance without a door. The emitter now PUBLISHES each cited mirror 248// file into the domain's own docroot (refs/<basename>, static visitor content, atomic tmp+rename via 249// sys_read_file which sizes from the file and cannot short-read) and links THERE. Fail-safe direction: a 250// mirror it cannot read or fully write renders as plain text -- a dead link is never emitted. 251// The References preamble is the ONE thing this generator and nx_swcompare_sota did not share in rp_html 252// (h2 class + the phrase naming the notes). It is a per-generator DATUM now, so the row-emit body is 253// byte-identical across both and nx_oo_extract can move it to the shared lib. 254const RP_HDR: *u8 = "<h2 id='refs'>References</h2>\n<div class='meth'><b>Beyond a link list.</b> Every reference below resolves twice &mdash; the publisher's copy and, where banked, the estate's own <b>non-rottable library mirror</b> with a <b>content pin</b> &mdash; and carries its <b>evidence class</b> plus the exact claim on this page it grounds. Keyed marks like <span class='cite'>[key]</span> in the matrix notes jump here. A dash means honestly absent, never assumed.</div>\n<ol class='refs'>\n" as *u8 255// rp_html lives in nx_swcompare_lib.nx since 2026-08-23 (one copy; header passed as RP_HDR). 256// ---- RENDERED-EVIDENCE GALLERY (2026-08-18, operator: the turntable and renders must ride the 257// emit, never a hand page). knowledge/compare/<dom>.gallery rows img|<file>|<caption>|<producer> 258// become an evidence strip. PUBLISH-THEN-LINK, the refs_pass law: each file is probed IN THE DOMAIN 259// DOCROOT at emit time -- present emits the figure with its measured byte size; absent emits a NAMED 260// absence and never a dead link. A domain without a .gallery file emits byte-identically. 261func gp_probe(dom: *u8, file: *u8) -> i64 { 262 let p: *u8 = sys_mmap(700) 263 var o: i64 = scopy(p, 0, "../sites/nishifamily/compare/" as *u8) 264 o = scopy(p, o, dom); o = scopy(p, o, "/" as *u8); o = scopy(p, o, file); p[o] = 0 as u8 265 let ln: *i64 = sys_mmap(16) as *i64 266 let b: *u8 = sys_read_file(p, ln) 267 if (b as i64) == 0 { return 0 - 1 } 268 let sz: i64 = ln[0] 269 sys_free_file(b, sz) 270 return sz 271} 272// html-escape n bytes while writing (probe output is untrusted bytes, never raw-embedded) 273func wesc(fd: i64, b: *u8, n: i64) -> i64 { 274 var i: i64 = 0 275 while i < n { 276 let c: i64 = b[i] as i64 277 if c == 60 { w(fd, "&lt;" as *u8) } else { if c == 62 { w(fd, "&gt;" as *u8) } else { if c == 38 { w(fd, "&amp;" as *u8) } else { wc(fd, c) } } } 278 i = i + 1 279 } 280 return 0 281} 282// fork the row's probe against its docroot artifact; returns rc, output in pbuf/plen. 283// The spec string is split IN PLACE (each gal_pass call re-reads the data file, so per-row once). 284func gal_probe_run(probe: *u8, dom: *u8, file: *u8, pbuf: *u8, plen: *i64) -> i64 { 285 let av: *i64 = sys_mmap(GAL_PROBE_AV * 8) as *i64 286 var an: i64 = 0 287 var ps: i64 = 0 288 while probe[ps] != (0 as u8) { 289 if an >= GAL_PROBE_AV - 2 { break } 290 av[an] = (probe as i64) + ps 291 an = an + 1 292 while probe[ps] != (0 as u8) { if probe[ps] == (32 as u8) { break } ps = ps + 1 } 293 if probe[ps] == (32 as u8) { probe[ps] = 0 as u8; ps = ps + 1 } 294 } 295 let fpath: *u8 = sys_mmap(700) 296 var fo: i64 = scopy(fpath, 0, "../sites/nishifamily/compare/" as *u8) 297 fo = scopy(fpath, fo, dom); fo = scopy(fpath, fo, "/" as *u8); fo = scopy(fpath, fo, file) 298 fpath[fo] = 0 as u8 299 av[an] = fpath as i64 300 an = an + 1 301 av[an] = 0 302 return tr_run_capture(av[0] as *u8, av, pbuf, GAL_PROBE_CAP, plen) 303} 304// ---- EVIDENCE MEDIA KINDS (2026-09-02, operator: "real reproducible evidence that's human evaluatable ... 305// visuals to click open (in case some are nsfw) ... images or video or text or gif or audio"). A .gallery row's 306// first field was the literal `img`; it is now a KIND with an optional gate prefix: 307// img | gif | video | audio | text inline media (gif is an img), each probed on disk at emit 308// nsfw:<kind> GATED: nothing is rendered inline -- the reader clicks to open 309// The four evidence facts every row already carries (the artifact path, its caption, the producing organ, the 310// bytes on disk at emit, and the optional probe re-run at emit) are what make the evidence REPRODUCIBLE; the 311// gate only changes whether the media is shown before a click. A kind this table does not know is REFUSED 312// by name (the row is skipped and announced), never guessed into an <img>. 313const GAL_KIND_IMG: i64 = 1 314const GAL_KIND_VIDEO: i64 = 2 315const GAL_KIND_AUDIO: i64 = 3 316const GAL_KIND_TEXT: i64 = 4 317const GAL_TEXT_PREVIEW: i64 = 2048 // bytes of a text artifact shown inline; the whole file stays one click away 318const GAL_NSFW_PREFIX: *u8 = "nsfw:" as *u8 319func gal_kind_code(k: *u8) -> i64 { 320 if streq(k, "img" as *u8) == 1 { return GAL_KIND_IMG } 321 if streq(k, "gif" as *u8) == 1 { return GAL_KIND_IMG } 322 if streq(k, "video" as *u8) == 1 { return GAL_KIND_VIDEO } 323 if streq(k, "audio" as *u8) == 1 { return GAL_KIND_AUDIO } 324 if streq(k, "text" as *u8) == 1 { return GAL_KIND_TEXT } 325 return 0 326} 327func gal_kind_name(c: i64) -> *u8 { 328 if c == GAL_KIND_IMG { return "image" as *u8 } 329 if c == GAL_KIND_VIDEO { return "video" as *u8 } 330 if c == GAL_KIND_AUDIO { return "audio" as *u8 } 331 if c == GAL_KIND_TEXT { return "text" as *u8 } 332 return "unknown" as *u8 333} 334// attribute-safe write: the src of a video/audio/text link is built from DATA (domain + file name), and a 335// quote inside it would end the attribute -- the same hole ia_img_emit closed for img alt on 2026-08-26. 336func gal_attr(fd: i64, s: *u8) -> i64 { 337 var i: i64 = 0 338 while s[i] != (0 as u8) { 339 let c: i64 = s[i] as i64 340 if c == 39 { w(fd, "&#39;" as *u8) } else { if c == 34 { w(fd, "&quot;" as *u8) } else { 341 if c == 60 { w(fd, "&lt;" as *u8) } else { if c == 62 { w(fd, "&gt;" as *u8) } else { 342 if c == 38 { w(fd, "&amp;" as *u8) } else { wc(fd, c) } } } } } 343 i = i + 1 344 } 345 return 0 346} 347// the first GAL_TEXT_PREVIEW bytes of a text artifact, escaped; announces when the file is longer 348func gal_text_preview(fd: i64, dom: *u8, file: *u8) -> i64 { 349 let p: *u8 = sys_mmap(700) 350 var o: i64 = scopy(p, 0, "../sites/nishifamily/compare/" as *u8) 351 o = scopy(p, o, dom); o = scopy(p, o, "/" as *u8); o = scopy(p, o, file); p[o] = 0 as u8 352 let ln: *i64 = sys_mmap(16) as *i64 353 let b: *u8 = sys_read_file(p, ln) 354 if (b as i64) == 0 { w(fd, "(unreadable at emit)" as *u8); return 0 } 355 let sz: i64 = ln[0] 356 var show: i64 = sz 357 if show > GAL_TEXT_PREVIEW { show = GAL_TEXT_PREVIEW } 358 wesc(fd, b, show) 359 if sz > show { w(fd, "\n[preview: first " as *u8); wn(fd, show); w(fd, " of " as *u8); wn(fd, sz); w(fd, " bytes -- open the artifact for the whole file]" as *u8) } 360 sys_free_file(b, sz) 361 return 0 362} 363// The extra attributes on a gallery img are the GENERATOR'S OWN markup, never data, so they are 364// passed to ia_img_emit as literal bytes and deliberately not escaped. 365const GAL_IMG_EXTRA: *u8 = "loading='lazy'" as *u8 366 367// figcaption and the producer note are TEXT, not attribute values. The two contexts have different 368// rules -- escaping a quote in text puts a visible entity on the page -- so this routes through the 369// TEXT half of the one escaper rather than reusing the attribute half. Sized from the string itself, 370// so there is no ceiling here to guess and none to truncate. 371func gal_text(fd: i64, s: *u8) -> i64 { 372 let need: i64 = ia_slen(s) * IA_MAX_EXPANSION + IA_SEP_AND_NUL 373 let b: *u8 = sys_mmap(need) 374 let tr: *i64 = sys_mmap(IA_SLOT_BYTES) as *i64 375 ia_esc_text(b, 0, s, need, tr) 376 w(fd, b) 377 return 0 378} 379 380func gal_html(fld: *i64, count: i64, dom: *u8, probe: *u8, kind: i64, gated: i64) -> i64 { 381 if count == 0 { 382 w(1, "<h2 id='renders'>Rendered evidence</h2>\n" as *u8) 383 w(1, "<div class='meth'><b>These are the artifacts, not illustrations.</b> Every image, video, audio clip or text artifact below was probed <b>on disk at emit time</b> and carries its measured byte size plus the organ that regenerates it; a row marked gated renders nothing until you click it open; an absent file is named as absent and never linked. Re-run the producer and the page inherits the fresh render on the next compare beat.</div>\n<div class='gal'>\n" as *u8) 384 } 385 if kind == 0 { 386 w(1, "<div class='galmiss' data-t='refused'>row refused: unknown media kind <code>" as *u8); gal_text(1, fld[0] as *u8); w(1, "</code> for <code>" as *u8); gal_text(1, fld[1] as *u8); w(1, "</code> (img gif video audio text, optionally nsfw:kind) -- nothing is linked for a row the emitter cannot classify.</div> 387" as *u8) 388 return 0 389 } 390 let sz: i64 = gp_probe(dom, fld[1] as *u8) 391 if sz >= 0 { 392 // src MUST be site-absolute: the page serves at an extensionless URL with NO trailing slash 393 // (/compare/<dom>), so a relative src resolves against /compare/ and 404s -- the hand pages 394 // used absolute paths for exactly this reason. ../.. rows normalize client-side (/world/...). 395 // THE TAG IS BUILT BY nx_imgattr_lib, NOT CONCATENATED HERE (2026-08-26). The caption is DATA, 396 // and a row live on /compare/koikatsu carries an apostrophe: written raw into a single-quoted 397 // attribute it ended alt at the two words -The card- and turned the rest of the sentence into 398 // attribute names, so the accessible name of that image was two words and loading='lazy' was 399 // consumed with it. ia_img_emit escapes both quote characters whatever delimiter is used and 400 // REFUSES to write a tag with no usable alt, so this call site cannot re-open the hole. 401 let srcneed: i64 = ia_slen("/compare/" as *u8) + ia_slen(dom) + ia_slen(fld[1] as *u8) + IA_SEP_AND_NUL 402 let gsrc: *u8 = sys_mmap(srcneed) 403 var gso: i64 = scopy(gsrc, 0, "/compare/" as *u8) 404 gso = scopy(gsrc, gso, dom); gso = scopy(gsrc, gso, "/" as *u8); gso = scopy(gsrc, gso, fld[1] as *u8) 405 gsrc[gso] = 0 as u8 406 let altcap: i64 = ia_alt_cap_for(fld[2] as *u8, fld[1] as *u8) 407 let galt: *u8 = sys_mmap(altcap) 408 ia_alt_derive(fld[2] as *u8, fld[1] as *u8, galt, altcap) 409 let tagcap: i64 = ia_img_cap_for(gsrc, galt, GAL_IMG_EXTRA) 410 let gtag: *u8 = sys_mmap(tagcap) 411 let gtw: i64 = ia_img_emit(gtag, 0, tagcap, gsrc, galt, GAL_IMG_EXTRA) 412 w(1, "<figure class='galf' data-t='" as *u8); wlow(1, fld[2] as *u8); wc(1, 32); wlow(1, fld[3] as *u8) 413 w(1, "' data-kind='" as *u8); w(1, gal_kind_name(kind)); w(1, "'>" as *u8) 414 // GATED EVIDENCE: nothing is rendered before the click. The summary names the kind and the size so a 415 // reader decides with the facts; the media inside is exactly what an ungated row would have shown. 416 if gated == 1 { w(1, "<details class='galgate'><summary>gated evidence &mdash; click to open (" as *u8); w(1, gal_kind_name(kind)); w(1, ", " as *u8); wn(1, sz); w(1, " bytes on disk, may be NSFW)</summary>" as *u8) } 417 if kind == GAL_KIND_IMG { 418 if gtw > 0 { w(1, gtag) } 419 if gtw == 0 { w(1, "<div class='galmiss'>no alt could be derived from this row, so no image is emitted: an image no reader can have described is not published here. Give the row a caption.</div>" as *u8) } 420 } 421 if kind == GAL_KIND_VIDEO { w(1, "<video class='galv' controls preload='none' src='" as *u8); gal_attr(1, gsrc); w(1, "'>your browser cannot play this video; <a href='" as *u8); gal_attr(1, gsrc); w(1, "'>open the artifact</a></video>" as *u8) } 422 if kind == GAL_KIND_AUDIO { w(1, "<audio class='gala' controls preload='none' src='" as *u8); gal_attr(1, gsrc); w(1, "'>your browser cannot play this audio; <a href='" as *u8); gal_attr(1, gsrc); w(1, "'>open the artifact</a></audio>" as *u8) } 423 if kind == GAL_KIND_TEXT { w(1, "<p class='galt'><a href='" as *u8); gal_attr(1, gsrc); w(1, "'>open the text artifact</a></p><pre class='galpre'>" as *u8); gal_text_preview(1, dom, fld[1] as *u8); w(1, "</pre>" as *u8) } 424 if gated == 1 { w(1, "</details>" as *u8) } 425 w(1, "<figcaption>" as *u8); gal_text(1, fld[2] as *u8) 426 w(1, "<span class='galp'>" as *u8); gal_text(1, fld[3] as *u8); w(1, " &middot; " as *u8); wn(1, sz); w(1, " bytes on disk at emit</span></figcaption>" as *u8) 427 if (probe as i64) != 0 { 428 let pbuf: *u8 = sys_mmap(GAL_PROBE_CAP) 429 let plen: *i64 = sys_mmap(16) as *i64 430 let prc: i64 = gal_probe_run(probe, dom, fld[1] as *u8, pbuf, plen) 431 w(1, "<details class='galprobe'><summary>measured at emit</summary><pre>" as *u8) 432 if prc == 0 { if plen[0] > 0 { wesc(1, pbuf, plen[0]) } else { w(1, "probe returned no output" as *u8) } } else { w(1, "probe refused rc=" as *u8); wn(1, prc) } 433 if plen[0] >= GAL_PROBE_CAP { w(1, "[probe output filled its reserve -- view truncated, announced]" as *u8) } 434 w(1, "</pre></details>" as *u8) 435 } 436 w(1, "</figure>\n" as *u8) 437 } else { 438 w(1, "<div class='galmiss' data-t='" as *u8); wlow(1, fld[2] as *u8); wc(1, 32); wlow(1, fld[3] as *u8) 439 w(1, "'>absent from the docroot at emit: <code>" as *u8); gal_text(1, fld[1] as *u8) 440 w(1, "</code> &mdash; regenerate with <code>" as *u8); gal_text(1, fld[3] as *u8); w(1, "</code>; nothing is linked while it is absent.</div>\n" as *u8) 441 } 442 return 0 443} 444func gal_json(fld: *i64, count: i64, dom: *u8, probe: *u8, kind: i64, gated: i64) -> i64 { 445 if count == 0 { wc(1, 44); wq(1); w(1, "gallery" as *u8); wq(1); wc(1, 58); wc(1, 91) } else { wc(1, 44) } 446 wc(1, 123) 447 if kind == 0 { kv_s(1, "kind" as *u8, "unknown" as *u8); wc(1, 44); kv_s(1, "refused" as *u8, fld[0] as *u8); wc(1, 44); kv_s(1, "file" as *u8, fld[1] as *u8); wc(1, 125); return 0 } 448 kv_s(1, "kind" as *u8, gal_kind_name(kind)); wc(1, 44) 449 kv_n(1, "gated" as *u8, gated); wc(1, 44) 450 kv_s(1, "file" as *u8, fld[1] as *u8); wc(1, 44) 451 kv_s(1, "caption" as *u8, fld[2] as *u8); wc(1, 44) 452 kv_s(1, "producer" as *u8, fld[3] as *u8); wc(1, 44) 453 kv_n(1, "bytes" as *u8, gp_probe(dom, fld[1] as *u8)) 454 if (probe as i64) != 0 { 455 let pbuf: *u8 = sys_mmap(GAL_PROBE_CAP) 456 let plen: *i64 = sys_mmap(16) as *i64 457 let prc: i64 = gal_probe_run(probe, dom, fld[1] as *u8, pbuf, plen) 458 wc(1, 44); kv_n(1, "probe_rc" as *u8, prc) 459 var pn: i64 = plen[0] 460 if pn >= GAL_PROBE_CAP { pn = GAL_PROBE_CAP - 1 } 461 pbuf[pn] = 0 as u8 462 wc(1, 44); kv_s(1, "probe_output" as *u8, pbuf) 463 } 464 wc(1, 125) 465 return 0 466} 467func gal_pass(path: *u8, buf: *u8, cap: i64, mode: i64, dom: *u8) -> i64 { 468 let n: i64 = c_read(path, buf, cap) 469 if n <= 0 { return 0 } 470 buf[n] = 0 as u8 471 let fld: *i64 = sys_mmap(200) as *i64 472 var count: i64 = 0 473 var p: i64 = 0 474 while p < n { 475 var e: i64 = p 476 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 477 buf[e] = 0 as u8 478 let line: *u8 = (buf as i64 + p) as *u8 479 p = e + 1 480 var skip: i64 = 0 481 if line[0] == (0 as u8) { skip = 1 } 482 if line[0] == (35 as u8) { skip = 1 } 483 if skip == 0 { 484 let nf: i64 = splitpipe(line, fld, 8) 485 var ktok: *u8 = fld[0] as *u8 486 var gated: i64 = 0 487 if starts(ktok, GAL_NSFW_PREFIX) == 1 { gated = 1; ktok = (ktok as i64 + 5) as *u8 } 488 let kind: i64 = gal_kind_code(ktok) 489 if kind == 0 { if nf >= 4 { if mode == 0 { w(1, " GALLERY ROW REFUSED: unknown media kind '" as *u8); w(1, ktok); w(1, "' (img gif video audio text, optionally nsfw:<kind>)\n" as *u8) } } } 490 if nf >= 4 { 491 var probe: *u8 = 0 as *u8 492 if nf >= 5 { probe = fld[4] as *u8 } 493 if mode == 1 { gal_html(fld, count, dom, probe, kind, gated) } 494 if mode == 2 { gal_json(fld, count, dom, probe, kind, gated) } 495 count = count + 1 496 } 497 } 498 } 499 if count > 0 { if mode == 1 { w(1, "</div>\n" as *u8) } else { if mode == 2 { wc(1, 93) } } } 500 return count 501} 502// plan_pass, dstate and wlow LIFTED to nx_swcompare_lib.nx 2026-08-22 (rung DG5). They lived HERE, which 503// is why a domain rendered by the SOTA generator had its .plan admitted as data and then NEVER DRAWN -- 504// the tool plane's own build order was invisible on its own page. The base class owns them now and BOTH 505// generators call the one copy, so the two surfaces cannot drift into two plan dialects. The pre-lift 506// body below is the PRE-LIFT COPY and is UNREACHABLE -- nothing calls this name, and nx_cc now refuses 507// two definitions of one name outright, so it cannot shadow the base class copy either. 508// IT IS RETAINED DELIBERATELY: deleting an 85-line body by exact-match over a transport that is 503ing 509// risks corrupting the generator that emits EVERY /compare page, and removing dead code does not justify 510// that risk. Delete it on a calm transport, or via nx_oo_extract which owns removal with a byte proof. 511func plan_pass_PRELIFT_UNREACHABLE(path: *u8, buf: *u8, cap: i64, phase: i64) -> i64 { 512 let n: i64 = c_read(path, buf, cap) 513 if n <= 0 { return 0 } 514 buf[n] = 0 as u8 515 let fld: *i64 = sys_mmap(200) as *i64 516 let dsbuf: *u8 = sys_mmap(K_MAGIC_20480) 517 var dsn: i64 = 0 518 if phase == 3 { 519 let dsp: *u8 = sys_mmap(600) 520 var dq: i64 = 0 521 while path[dq] != (0 as u8) { dsp[dq] = path[dq]; dq = dq + 1 } 522 var cut: i64 = dq 523 while cut > 0 { if dsp[cut] == (46 as u8) { break } cut = cut - 1 } 524 if cut > 0 { dq = cut } 525 dq = scopy(dsp, dq, ".debtstate" as *u8) 526 dsp[dq] = 0 as u8 527 dsn = c_read(dsp, dsbuf, K_MAGIC_20479) 528 if dsn < 0 { dsn = 0 } 529 } 530 var in_rung: i64 = 0 531 var in_ms: i64 = 0 532 var in_biz: i64 = 0 533 var p: i64 = 0 534 while p < n { 535 var e: i64 = p 536 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 537 buf[e] = 0 as u8 538 let line: *u8 = (buf as i64 + p) as *u8 539 p = e + 1 540 var skip: i64 = 0 541 if line[0] == (0 as u8) { skip = 1 } 542 if line[0] == (35 as u8) { skip = 1 } 543 if skip == 0 { 544 let nf: i64 = splitpipe(line, fld, 20) 545 let kind: *u8 = fld[0] as *u8 546 if phase == 1 { 547 if streq(kind, "pos" as *u8) == 1 { if nf >= 2 { w(1, "<p class='lead'><b>Where we are.</b> " as *u8); wnote(1, fld[1] as *u8); w(1, "</p>\n" as *u8) } } 548 if streq(kind, "goal" as *u8) == 1 { if nf >= 2 { w(1, "<p class='lead'><b>Where we need to go.</b> " as *u8); wnote(1, fld[1] as *u8); w(1, "</p>\n" as *u8) } } 549 if streq(kind, "answer" as *u8) == 1 { if nf >= 4 { 550 w(1, "<div class='answer'><b>" as *u8); w(1, fld[1] as *u8); w(1, ": " as *u8); w(1, fld[2] as *u8); w(1, ".</b> " as *u8); wnote(1, fld[3] as *u8); w(1, "</div>\n" as *u8) } } 551 if streq(kind, "bar" as *u8) == 1 { if nf >= 6 { 552 w(1, "<p class='lead'><b>Research bar.</b> <a href='" as *u8); w(1, fld[2] as *u8); w(1, "'>" as *u8); w(1, fld[1] as *u8); w(1, "</a> is measured on " as *u8); w(1, fld[3] as *u8) 553 w(1, ". Theirs: <b>" as *u8); w(1, fld[4] as *u8); w(1, "</b>. Ours: " as *u8); w(1, fld[5] as *u8); w(1, ".</p>\n" as *u8) } } 554 if streq(kind, "unit" as *u8) == 1 { if nf >= 2 { w(1, "<div class='meth'><b>The unit.</b> " as *u8); w(1, fld[1] as *u8); w(1, "</div>\n" as *u8) } } 555 // biz|axis|position|figures|decision -- the BUSINESS CASE row kind (investment, opportunity 556 // cost, market, competitive position, go-to-market, buy-vs-build). Rendered as one table in 557 // the executive layer; biz rows belong LAST in a plan's phase-1 block so the table closes clean. 558 if streq(kind, "biz" as *u8) == 1 { if nf >= 5 { 559 if in_biz == 0 { w(1, "<h2>Business case</h2>\n<table class='pl'><thead><tr><th>Axis</th><th>Position</th><th>Figures</th><th>Decision</th></tr></thead><tbody>\n" as *u8); in_biz = 1 } 560 w(1, "<tr><td><b>" as *u8); w(1, fld[1] as *u8); w(1, "</b></td><td>" as *u8); wnote(1, fld[2] as *u8) 561 w(1, "</td><td class='ct'>" as *u8); wnote(1, fld[3] as *u8); w(1, "</td><td>" as *u8); wnote(1, fld[4] as *u8); w(1, "</td></tr>\n" as *u8) } } 562 } 563 if phase == 3 { 564 if streq(kind, "debt" as *u8) == 1 { if nf >= 5 { 565 if in_rung == 0 { w(1, "<h2>Debt register</h2>\n<table class='pl'><thead><tr><th>Id</th><th class='r'>Sev</th><th>What it is</th><th>Unblock</th></tr></thead><tbody>\n" as *u8); in_rung = 1 } 566 w(1, "<tr><td class='ct'>" as *u8); w(1, fld[1] as *u8) 567 // STATE COMES FROM THE PLANE, NEVER FROM THIS ROW. An id the plane does not know is a 568 // page-local note wearing the shape of a filed debt, and saying so is the honest move. 569 dstate(1, fld[1] as *u8, dsbuf, dsn) 570 w(1, "</td><td class='r'>" as *u8); w(1, fld[2] as *u8) 571 w(1, "</td><td>" as *u8); w(1, fld[3] as *u8); w(1, "</td><td>" as *u8); w(1, fld[4] as *u8); w(1, "</td></tr>\n" as *u8) } } 572 if streq(kind, "risk" as *u8) == 1 { if nf >= 4 { 573 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8); in_rung = 0 } 574 if in_ms == 0 { w(1, "<h2>Risk register</h2>\n<table class='pl'><thead><tr><th>Risk</th><th>Likelihood x impact</th><th>Mitigation</th></tr></thead><tbody>\n" as *u8); in_ms = 1 } 575 w(1, "<tr><td>" as *u8); w(1, fld[1] as *u8); w(1, "</td><td class='ct'>" as *u8); w(1, fld[2] as *u8) 576 w(1, "</td><td>" as *u8); w(1, fld[3] as *u8); w(1, "</td></tr>\n" as *u8) } } 577 } 578 if phase == 2 { 579 if streq(kind, "rung" as *u8) == 1 { if nf >= 8 { 580 if in_rung == 0 { w(1, "<table class='pl'><thead><tr><th>Rung</th><th>Closes with</th><th>Definition of done (pre-declared)</th><th>Executor</th><th class='r'>Est.</th></tr></thead><tbody>\n" as *u8); in_rung = 1 } 581 w(1, "<tr id='" as *u8); wlow(1, fld[1] as *u8); w(1, "'><td><b>" as *u8); w(1, fld[2] as *u8); w(1, "</b> (" as *u8); w(1, fld[1] as *u8); w(1, ")" as *u8) 582 if streq(fld[7] as *u8, "-" as *u8) == 0 { w(1, "<br><span class='ct'>after " as *u8); w(1, fld[7] as *u8); w(1, "</span>" as *u8) } 583 w(1, "</td><td class='ct'>" as *u8); w(1, fld[3] as *u8); w(1, "</td><td>" as *u8); w(1, fld[4] as *u8) 584 w(1, "</td><td><span class='ex'>" as *u8); w(1, fld[5] as *u8); w(1, "</span></td><td class='r'>" as *u8); w(1, fld[6] as *u8); w(1, " u</td></tr>\n" as *u8) } } 585 if streq(kind, "ms" as *u8) == 1 { if nf >= 5 { 586 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8); in_rung = 0 } 587 if in_ms == 0 { w(1, "<h2>Milestones</h2>\n<table class='pl'><thead><tr><th>Milestone</th><th>Rungs</th><th class='r'>Cumulative</th></tr></thead><tbody>\n" as *u8); in_ms = 1 } 588 w(1, "<tr><td><b>" as *u8); w(1, fld[1] as *u8); w(1, "</b> &middot; " as *u8); w(1, fld[2] as *u8); w(1, "</td><td class='ct'>" as *u8); w(1, fld[4] as *u8) 589 w(1, "</td><td class='r'>" as *u8); w(1, fld[3] as *u8); w(1, " u</td></tr>\n" as *u8) } } 590 } 591 } 592 } 593 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8) } 594 if in_ms == 1 { w(1, "</tbody></table>\n" as *u8) } 595 if in_biz == 1 { w(1, "</tbody></table>\n" as *u8) } 596 return 1 597} 598// wlow LIFTED to nx_swcompare_lib.nx 2026-08-22 (DG5) -- ONE renderer in the base, both generators call 599// it. Left as a duplicate it would still COMPILE (nx_cc accepts duplicate definitions silently, debt 600// 1785447657), which is exactly how one copy gets fixed and the other does not. 601func con_row(label: *u8, ns: i64) -> i64 { 602 w(1, " [" as *u8) 603 if ns == 2 { w(1, "EXCEEDS" as *u8) } else { if ns == 1 { w(1, "PRESENT" as *u8) } else { if ns == 3 { w(1, "PARTIAL" as *u8) } else { w(1, "ABSENT " as *u8) } } } 604 w(1, "] " as *u8); w(1, label); w(1, "\n" as *u8); return 0 605} 606 607// ---- CE2: THE ADOPTION LADDER PER ROW (2026-08-23, operator: "fully wired fully adopted... you deploy partially constantly") ---- 608// A Nishi mark used to be ONE bit: the implementing symbol exists in a source file -- rung one of the estate's 609// seven, so a gate compiled and never promoted, an organ promoted and never registered, a library imported only 610// by its own gate, all read identically to LIVE. Every MEASURED row now also carries WHERE ON ITS LADDER the organ 611// stands. The classifier is nx_catalog_lib's clb_classify (one composition of three rulers by organ kind: 612// program = the catalogue ladder, library = importer reach minus validation importers, gate = the 613// execution-surface census), shared with nx_compare_rank so the page and the ranker cannot disagree. 614// FULL = the top of its ladder; anything short is PARTIAL and NAMED with its remedy; every census source prints 615// its own asof= stamp. The flip law still holds: presence is necessary, adoption is necessary, the gate-proven 616// done-rule is the bar. 617// RANK_ROW_CAP: the ranked-order artefact (<dom>.rank, written by nx_compare_rank) is one line per rung, so its 618// byte size is bounded by the plan that produced it; this is the read reserve, announced if it ever fills. 619const RANK_READ_CAP: i64 = 65536 620 621// ---- CE6: render knowledge/compare/<dom>.rank (nx_compare_rank's stamped order) ---- 622// rows: finish|id|title|sym|state|remedy . rank|n|stage|id|priority|v|m|c|title|sym . last line # asof=... (position-anchored) 623func rank_pass(dom: *u8, cap: i64) -> i64 { 624 // its OWN buffer, sized by the declared reserve -- the plan buffer handed around here is 20 KB and a 625 // reserve larger than the buffer it fills is an overrun wearing a constant 626 let buf: *u8 = sys_mmap(cap) 627 let rp: *u8 = sys_mmap(600) 628 var o: i64 = scopy(rp, 0, "knowledge/compare/" as *u8) 629 o = scopy(rp, o, dom); o = scopy(rp, o, ".rank" as *u8); rp[o] = 0 as u8 630 let n: i64 = c_read(rp, buf, cap - 1) 631 if n <= 0 { 632 w(1, "<h2>Do this next</h2>\n<div class='meth'>No ranked order is published for this domain yet: run <code>nx_compare_rank " as *u8); w(1, dom); w(1, "</code> and this section fills itself on the next beat.</div>\n" as *u8) 633 return 0 634 } 635 if n >= cap - 1 { w(1, "<div class='meth'>rank artefact READ-CAPPED at " as *u8); wn(1, cap); w(1, " bytes -- the order below is a PREFIX</div>\n" as *u8) } 636 buf[n] = 0 as u8 637 // the stamp is the LAST line: read it before the parser NUL-splits anything 638 var ls: i64 = n - 1 639 if buf[ls] == (10 as u8) { ls = ls - 1 } 640 while ls > 0 { if buf[ls - 1] == (10 as u8) { break } ls = ls - 1 } 641 let stamp: *u8 = (buf as i64 + ls) as *u8 642 var se: i64 = ls 643 while se < n { if buf[se] == (10 as u8) { break } se = se + 1 } 644 buf[se] = 0 as u8 645 let fld: *i64 = sys_mmap(24 * 8) as *i64 646 w(1, "<h2>Do this next &mdash; computed by the ranker, never chosen by a seat</h2>\n" as *u8) 647 w(1, "<p class='lead'>Order from <code>nx_compare_rank</code> (nx_dr_ocm: (deficit + cost-of-delay + option + enables) x sponsor x self-sufficiency x momentum / cost). <b>FINISH</b> rows are rungs whose symbol is present but whose organ is short of full adoption: the cheapest closures on this board, listed before any new work. Stamp: <code>" as *u8); w(1, stamp); w(1, "</code></p>\n" as *u8) 648 w(1, "<table class='pl'><thead><tr><th>#</th><th>Stage</th><th>Rung</th><th class='r'>Priority</th><th>Derivation</th></tr></thead><tbody>\n" as *u8) 649 var rows: i64 = 0 650 var p: i64 = 0 651 while p < ls { 652 var e: i64 = p 653 while e < ls { if buf[e] == (10 as u8) { break } e = e + 1 } 654 buf[e] = 0 as u8 655 let line: *u8 = (buf as i64 + p) as *u8 656 p = e + 1 657 if line[0] != (35 as u8) { if line[0] != (0 as u8) { 658 let nf: i64 = splitpipe(line, fld, 24) 659 let kind: *u8 = fld[0] as *u8 660 if streq(kind, "finish" as *u8) == 1 { if nf >= 6 { 661 rows = rows + 1 662 w(1, "<tr><td class='ct'>F</td><td><span class='ex'>FINISH</span></td><td><b>" as *u8); w(1, fld[2] as *u8); w(1, "</b> (" as *u8); w(1, fld[1] as *u8); w(1, ") <span class='ct'>" as *u8); w(1, fld[3] as *u8) 663 w(1, "</span></td><td class='r ct'>" as *u8); w(1, fld[4] as *u8); w(1, "</td><td>" as *u8); wnote(1, fld[5] as *u8); w(1, "</td></tr>\n" as *u8) 664 } } 665 if streq(kind, "rank" as *u8) == 1 { if nf >= 10 { 666 rows = rows + 1 667 w(1, "<tr><td class='ct'>#" as *u8); w(1, fld[1] as *u8); w(1, "</td><td><span class='ex'>" as *u8); w(1, fld[2] as *u8); w(1, "</span></td><td><b>" as *u8); w(1, fld[8] as *u8); w(1, "</b> (" as *u8); w(1, fld[3] as *u8); w(1, ") <span class='ct'>" as *u8); w(1, fld[9] as *u8) 668 w(1, "</span></td><td class='r'>" as *u8); w(1, fld[4] as *u8); w(1, "</td><td class='ct'>v=" as *u8); w(1, fld[5] as *u8); w(1, " m=" as *u8); w(1, fld[6] as *u8); w(1, " c=" as *u8); w(1, fld[7] as *u8); w(1, "</td></tr>\n" as *u8) 669 } } 670 } } 671 } 672 w(1, "</tbody></table>\n" as *u8) 673 if rows == 0 { w(1, "<div class='meth'>The rank artefact carries no rows: nothing open, or the ranker refused -- read its stamp above.</div>\n" as *u8) } 674 return rows 675} 676 677// ---- CE7: THE EVIDENCE PROFILE BAND -- the referee gap profile, ON THE PUBLISHED PAGE (2026-08-31) ---- 678// nx_swcompare_evidence has computed the whole gap profile of every domain since 2026-08-31 and stamps 679// it to knowledge/status/evstamp_<dom>.verdict; nx_evprofile_lib is its ONE reader and nx_pm_board 680// consumes it. MEASURED THE SAME DAY (nx_shelltool grep evstamp_ over buildroot/runtime: 18 matches, 681// 23,410 files, coverage_complete=1 corpus_complete=1): NOT ONE GENERATOR READ IT. The profile reached 682// the PM board and never reached a single published board, so every /compare page could say RED and none 683// could say WHY. A measurement the organisation is paying for and not collecting is this estate own 684// named defect, and the operator ask is that the boards gaps be visible ON /compare. This is that half. 685// 686// THE ROOT TRAP, AND WHY THIS COMPOSES evp_load RATHER THAN OPENING A PATH ITSELF. nx_compare_regen runs 687// with CWD=buildroot (proven by its own RG_PUBJRNL of ../knowledge/status/...), and buildroot/knowledge/ 688// status holds ZERO evstamp files. A BARE RELATIVE READ FROM THIS GENERATOR WOULD RESOLVE INTO AN EMPTY 689// TREE AND RENDER no-evidence FOR ALL 96 DOMAINS, CONFIDENTLY -- a wrong answer wearing the shape of a 690// complete one. evp_load composes ep_artifact_path (CWD -> ../ -> estate root, fail-closed) and REFUSES 691// when two different files answer to one name, so this band can never publish another board numbers. 692// 693// ABSTAIN, NEVER ACQUIT. A stamp written before the profile shipped carries none of these keys and 694// evp_parse leaves every slot -1. That renders as UNKNOWN with NOT ONE numeric field printed. A 695// zero-filled profile is a fabricated constant wearing the shape of a measurement, and it fails in the 696// flattering direction, which is the direction nobody audits. 697// 698// NO SCALAR GRADE IS COMPUTED, STORED OR RENDERED HERE. Every number below is a count printed with its 699// denominator, and the gap classes are SEPARATE predicates never merged into one not-honest score: 700// CLAIM-ONLY needs a gate WRITTEN and GATE-FAILING needs a gate FIXED, and one merged number sends a 701// seat at the wrong work. A bucket named for how the reader failed merges a real failure with a pass. 702import "nx_evprofile_lib.nx" 703 704// The read reserve is EVP_STAMP_CAP -- the lib that owns the wire owns its size, so there is exactly one 705// copy of that number and this band cannot drift from the reader that defines it. 706const EVB_PATH_CAP: i64 = 512 707const EVB_SECS_PER_DAY: i64 = 86400 708const EVB_SECS_PER_HOUR: i64 = 3600 709// Wide data scrolls in ITS OWN container: the page body must never scroll horizontally. 710const EVB_SCROLL_OPEN: *u8 = "<div style='overflow-x:auto'>" 711 712// One gap class, rendered only when it FIRES, and always beside the work it names. A count without a 713// worklist is not actionable, and a worklist without its reason is still one step short. 714func evb_remedy(fired: i64, name: *u8, remedy: *u8) -> i64 { 715 if fired != 1 { return 0 } 716 w(1, "<tr><td><b>" as *u8); w(1, name); w(1, "</b></td><td>" as *u8); w(1, remedy); w(1, "</td></tr>\n" as *u8) 717 return 1 718} 719 720// a count and its denominator, never one without the other 721func evb_pair(label: *u8, a: i64, b: i64) -> i64 { 722 w(1, "<span class='sep'>|</span>" as *u8); w(1, label); w(1, " <b>" as *u8); wn(1, a); w(1, "</b>/<b>" as *u8); wn(1, b); w(1, "</b>" as *u8) 723 return 0 724} 725 726func evb_one(label: *u8, a: i64) -> i64 { 727 w(1, "<span class='sep'>|</span>" as *u8); w(1, label); w(1, " <b>" as *u8); wn(1, a); w(1, "</b>" as *u8) 728 return 0 729} 730 731// A label whose value is a WORD, not a number. It exists so an abstention can be PRINTED in the same 732// row as the counts instead of being rounded down into one: -1 means UNKNOWN in this dialect, and a 733// reader that renders UNKNOWN as 0 publishes the one wrong answer nobody would question. 734func evb_word(label: *u8, word: *u8) -> i64 { 735 w(1, "<span class='sep'>|</span>" as *u8); w(1, label); w(1, " <b>" as *u8); w(1, word); w(1, "</b>" as *u8) 736 return 0 737} 738 739// ---- NON-VACUITY, FINALLY RENDERED WHERE A HUMAN LOOKS. ---- 740// `vacuous` on this band is the WEAK word: it counts gates that printed GREEN on a ZERO denominator. 741// Clause 4 of the evidence law means something strictly stronger by non-vacuity -- "each gate has a 742// RECORDED RED observation; a gate never observed failing measures nothing" -- and THAT number has been 743// measured by ev_bite_fold, stamped as redseen= and parsed into EVP_F_REDSEEN since the bite ledger 744// shipped, while reaching only api.json. SAME WORD, TWO MEANINGS, AND THE WEAKER ONE WAS THE ONE ON THE 745// PAGE: softbody published "gates green 11/11 | gates vacuous 0" over eleven gates the ledger records as 746// never bitten. So the weak count is renamed for exactly what it counts and the strong one prints beside 747// it, as a count WITH ITS DENOMINATOR and its complement, never as a score. 748// 749// THREE STATES, BECAUSE ZERO IS NOT A SAFE DEFAULT HERE. "never bitten 0" reads as "every gate has been 750// shown able to fail" -- the flattering direction, which is the direction nobody audits. A stamp that 751// cannot answer must SAY so. 752func evb_bite(f: *i64) -> i64 { 753 let ran: i64 = f[EVP_F_RAN] 754 let red: i64 = f[EVP_F_REDSEEN] 755 // The stamp did not carry the key (a stamp older than the bite ledger, or a capped read). ABSTAIN. 756 if ran < 0 { evb_word("proven able to fail" as *u8, "UNKNOWN" as *u8); return 0 } 757 if red < 0 { evb_word("proven able to fail" as *u8, "UNKNOWN" as *u8); return 0 } 758 // No gate ran, so there is no population that could have been bitten. A 0/0 printed here would read 759 // as a clean board; the honest answer is that the question has no subject on this board yet. 760 if ran == 0 { evb_word("proven able to fail" as *u8, "n/a &mdash; no gate ran" as *u8); return 0 } 761 // redseen is folded over the SAME rows that increment ran, one call each, so red > ran cannot happen 762 // from a run of the referee. It can only come from a hand-edited stamp, and the right answer to that 763 // is a refusal -- not a negative complement dressed up as good news. 764 if red > ran { evb_word("proven able to fail" as *u8, "INCOHERENT &mdash; redseen exceeds gates run" as *u8); return 0 } 765 evb_pair("proven able to fail" as *u8, red, ran) 766 evb_one("never bitten" as *u8, ran - red) 767 return 0 768} 769 770func ev_pass(dom: *u8) -> i64 { 771 let buf: *u8 = sys_mmap(EVP_STAMP_CAP) 772 let pathout: *u8 = sys_mmap(EVB_PATH_CAP) 773 let flags: *i64 = sys_mmap(8 * EVP_NFLAG) as *i64 774 let n: i64 = evp_load(dom, buf, EVP_STAMP_CAP, pathout, flags) 775 776 w(1, "<h2>Evidence profile &mdash; what the gaps on this board actually are</h2>\n" as *u8) 777 778 // Two different files answering to one name is REFUSED, not silently decided. ep_open_rd probes the 779 // caller CWD first on purpose, so a stray copy beside the generator would WIN, and win silently. 780 if n == EVP_RC_AMBIGUOUS { 781 w(1, "<div class='meth'><b>REFUSED &mdash; two different files answer to one name.</b> A stamp exists both under this generator working directory and at the estate root, and their bytes differ. No reader may pick one, so this band publishes nothing rather than publish another board numbers. Resolve the duplicate at <code>" as *u8); w(1, pathout); w(1, "</code>.</div>\n" as *u8) 782 return 0 783 } 784 if n < 0 { 785 w(1, "<div class='meth'><b>Unstamped.</b> No evidence profile is published for this domain yet: run <code>nx_swcompare_evidence " as *u8); w(1, dom) 786 w(1, "</code> and this section fills itself on the next beat. <b>No numbers are shown, deliberately</b> &mdash; a zero-filled profile would read as a board with no gaps, which is the one wrong answer nobody would question.</div>\n" as *u8) 787 return 0 788 } 789 if flags[EVP_FL_BRIM] == 1 { 790 w(1, "<div class='meth'>stamp READ-CAPPED at " as *u8); wn(1, EVP_STAMP_CAP); w(1, " bytes &mdash; the profile below is a PREFIX of its own measurement</div>\n" as *u8) 791 } 792 793 let f: *i64 = sys_mmap(8 * EVP_NF) as *i64 794 evp_parse(buf, n, f) 795 796 // The version is DERIVED FROM THE WIRE, never declared on it: a v1 stamp simply has no profile keys. 797 if f[EVP_F_V] < 2 { 798 w(1, "<div class='meth'><b>UNKNOWN, not zero.</b> This domain stamp predates the gap profile, so it carries none of these keys and the reader abstains rather than acquit. Re-stamp with <code>nx_swcompare_evidence " as *u8); w(1, dom) 799 w(1, "</code>. Read from <code>" as *u8); w(1, pathout); w(1, "</code>.</div>\n" as *u8) 800 return 0 801 } 802 803 let rec: i64 = evp_reconciles(f) 804 let cjf: i64 = evp_conj_fail(f) 805 let now: i64 = sys_now_realtime_sec() 806 let ttl: i64 = evp_ttl_sec() 807 let stale: i64 = evp_stale(f, now, ttl) 808 var age: i64 = now - f[EVP_F_EPOCH] 809 if age < 0 { age = 0 } 810 811 w(1, "<p class='lead'>Measured by <code>nx_swcompare_evidence</code>, read back by <code>nx_evprofile_lib</code>. Every figure is a <b>count with its denominator</b> &mdash; there is deliberately no score, no grade and no percentage anywhere in this band, because a stored scalar is a field a seat can edit and a counted partition is not.</p>\n" as *u8) 812 813 w(1, "<p class='stats'>evidence" as *u8) 814 evb_pair("grounded" as *u8, f[EVP_F_GROUNDED], f[EVP_F_PRESENT]) 815 evb_one("unsupported" as *u8, f[EVP_F_UNGROUND]) 816 evb_pair("gates green" as *u8, f[EVP_F_GREEN], f[EVP_F_RAN]) 817 evb_bite(f) 818 evb_one("green at 0/0" as *u8, f[EVP_F_VACUOUS]) 819 evb_one("open gaps" as *u8, f[EVP_F_ABSENT]) 820 evb_one("of them unnamed" as *u8, f[EVP_F_ABSBARE]) 821 evb_one("of them proof withheld" as *u8, f[EVP_F_WITHHELD]) 822 evb_one("flips ready" as *u8, f[EVP_F_LANDED]) 823 w(1, "</p>\n" as *u8) 824 825 // The two gate-honesty figures above are DIFFERENT CLAIMS, and the page now says so in its own words: 826 // one word carried the weaker of the two meanings while sounding like the stronger one. 827 w(1, "<p class='legend'><b>proven able to fail</b> counts the gates that have a RECORDED RED &mdash; <code>nx_gate_bite</code> mutated the gate subject, rebuilt it, watched the gate go red, and that record is inside the shared TTL. <b>never bitten</b> is its complement over the same denominator: those gates ran and were green, and nothing has ever shown them able to detect anything, so their green is a statement about this run and not about the gate. <b>green at 0/0</b> is a separate and much weaker observation &mdash; the gate printed GREEN on a zero denominator, so its own tooth counter says it examined nothing. A gate can be green, non-zero, and still never bitten; that is the common case and it is now visible instead of implied.</p>\n" as *u8) 828 829 // A PARTITION IS A CLAIM: CHECK THAT THE PARTS SUM, AND PRINT THE SUM. Three states, because a 830 // partition we could not check and one that leaked are different facts and only one is a defect. 831 w(1, "<p class='legend'>partition: grounded + unsupported = " as *u8); wn(1, f[EVP_F_GROUNDED] + f[EVP_F_UNGROUND]) 832 w(1, " vs present " as *u8); wn(1, f[EVP_F_PRESENT]) 833 w(1, " &middot; named + unnamed + withheld = " as *u8); wn(1, f[EVP_F_ABSNAMED] + f[EVP_F_ABSBARE] + f[EVP_F_WITHHELD]) 834 w(1, " vs open " as *u8); wn(1, f[EVP_F_ABSENT]); w(1, " &middot; " as *u8) 835 if rec == 1 { w(1, "<b>both reconcile</b>" as *u8) } 836 if rec == 0 { w(1, "<b>LEAK &mdash; these do not sum, and an unexplained residual is a defect in this instrument, not in the board</b>" as *u8) } 837 if rec < 0 { w(1, "<b>not measurable from this stamp</b>" as *u8) } 838 w(1, "</p>\n" as *u8) 839 840 // THE FAILING CONJUNCT, NAMED. The verdict line alone is a bare disjunction and the reader always 841 // guesses the alarming third; GPqN and gPQN are the same word and opposite work. 842 w(1, "<p class='legend'>liar-kill <code>conj=" as *u8) 843 if f[EVP_F_CJ_G] == 1 { w(1, "G" as *u8) } else { w(1, "g" as *u8) } 844 if f[EVP_F_CJ_P] == 1 { w(1, "P" as *u8) } else { w(1, "p" as *u8) } 845 if f[EVP_F_CJ_Q] == 1 { w(1, "Q" as *u8) } else { w(1, "q" as *u8) } 846 if f[EVP_F_CJ_N] == 1 { w(1, "N" as *u8) } else { w(1, "n" as *u8) } 847 w(1, "</code> &middot; " as *u8) 848 if cjf < 0 { w(1, "all four conjuncts held" as *u8) } else { 849 w(1, "first failing conjunct: <b>" as *u8); w(1, evp_conj_name(cjf)); w(1, "</b>" as *u8) 850 } 851 w(1, "</p>\n" as *u8) 852 853 // WHICH DOCUMENT WAS GRADED. A verdict that cannot name its subject document is not a verdict about 854 // the published board -- and there are two knowledge trees whose copies of a matrix differ. 855 w(1, "<p class='legend'>graded document: <b>" as *u8); w(1, evp_tree_name(f[EVP_F_MROOT])) 856 w(1, "</b> tree, " as *u8); wn(1, f[EVP_F_MBYTES]); w(1, " bytes" as *u8) 857 if f[EVP_F_MCAPPED] == 1 { w(1, " <b>(READ-CAPPED: the referee graded a PREFIX of this document)</b>" as *u8) } 858 w(1, " &middot; gates map: <b>" as *u8); w(1, evp_tree_name(f[EVP_F_GATESROOT])) 859 w(1, "</b> &middot; stamped " as *u8); wn(1, age / EVB_SECS_PER_DAY); w(1, "d " as *u8) 860 wn(1, (age - (age / EVB_SECS_PER_DAY) * EVB_SECS_PER_DAY) / EVB_SECS_PER_HOUR); w(1, "h ago" as *u8) 861 if stale == 1 { w(1, " &middot; <b>STALE against the shared TTL of " as *u8); wn(1, ttl); w(1, "s &mdash; this is evidence about a build nobody can vouch for now</b>" as *u8) } 862 w(1, " &middot; source <code>" as *u8); w(1, pathout); w(1, "</code></p>\n" as *u8) 863 864 w(1, EVB_SCROLL_OPEN) 865 w(1, "<table class='pl'><thead><tr><th>Gap class</th><th>What it is, and the work it names</th></tr></thead><tbody>\n" as *u8) 866 var fired: i64 = 0 867 fired = fired + evb_remedy(evp_claim_only(f), "CLAIM-ONLY" as *u8, 868 "No declared gate ran for this board, so every capability mark here rests on a symbol existing in source and on nothing executing. The remedy is to WRITE a <code>.gates</code> map naming gates that already run &mdash; authoring, not research." as *u8) 869 fired = fired + evb_remedy(evp_gate_failing(f), "GATE-FAILING" as *u8, 870 "A declared gate ran and was not GREEN. The remedy is to FIX the gate it names. This is deliberately NOT merged with CLAIM-ONLY: one needs a gate written and the other needs a gate repaired, and a single merged number sends a seat at the wrong work." as *u8) 871 fired = fired + evb_remedy(evp_fabricated(f), "UNSUPPORTED-CLAIM" as *u8, 872 "A row published as measured names a symbol that is NOT in the organ file it cites. This is the one class worse than an open gap, because it is a published claim carrying a source line beside it as apparent proof." as *u8) 873 fired = fired + evb_remedy(evp_flip_ready(f), "FLIP-READY" as *u8, 874 "A watch contract symbol is now present in the organ it named: the cell can flip on a pure data edit with no new code. These are the cheapest closures on this board and they belong before any new work." as *u8) 875 fired = fired + evb_remedy(evp_unnamed_gap(f), "UNNAMED-GAP" as *u8, 876 "A gap row carries a bare <code>_ABSENT_</code> with no symbol after it, so it names no build contract and no seat can pick it up. Give it an <code>_ABSENT_:&lt;symbol&gt;</code> and it becomes work somebody can do." as *u8) 877 fired = fired + evb_remedy(evp_withheld(f), "PROOF-WITHHELD" as *u8, 878 "The mechanism SHIPPED and its symbol really is in the organ it names, but the CLAIM this row makes rests on a <b>named precondition nobody has met</b>, so the row stays OPEN and is counted among the gaps. It is deliberately NOT a flip and no data edit closes it: meet the precondition the row names, then re-adjudicate. Before this class existed, the only way to withdraw such a claim was to write it as an absence &mdash; which this referee then resolved, FOUND, and filed as LANDED, so the retraction instructed its own reversal." as *u8) 879 fired = fired + evb_remedy(evp_withheld_refused(f), "WITHHELD-REFUSED" as *u8, 880 "A row claims withheld proof that the referee would not grant: either the precondition file it names now <b>holds data</b>, so the excuse has expired, or its symbol is not in the organ at all, so there is no shipped mechanism whose proof could be withheld. This is the tooth that stops the withheld form being a silence button, and the offending rows are named one by one by <code>nx_swcompare_evidence</code> itself." as *u8) 881 fired = fired + evb_remedy(evp_vacuous_gate(f), "VACUOUS-GATE" as *u8, 882 "A gate reported GREEN on a ZERO denominator. A gate with real teeth and a broken counter, and a gate with no teeth at all, are indistinguishable from outside; that indistinguishability is the finding, so it is reported here and never convicted." as *u8) 883 fired = fired + evb_remedy(stale, "STALE" as *u8, 884 "This profile is older than the shared TTL, or its clock ran backwards. It is reported as unusable rather than as fresh, because being wrong in the direction of refusing is the safe direction." as *u8) 885 if fired == 0 { 886 w(1, "<tr><td><b>NONE</b></td><td>No gap class fires on this board: every published claim is grounded, the declared gates ran and were green, no watch contract is unnamed or already landed, and the stamp is inside its TTL. That is a statement about <b>evidence</b>, not about depth, scale or polish.</td></tr>\n" as *u8) 887 } 888 w(1, "</tbody></table></div>\n" as *u8) 889 w(1, "<div class='meth'>This band reports the referee <b>counts</b>. The per-axis worklist rows &mdash; which axis is unsupported, which watch is ready to flip, which gap is unnamed &mdash; are printed by <code>nx_swcompare_evidence " as *u8); w(1, dom) 890 w(1, "</code> itself and are not carried on the stamp, so this page names the classes and the producer names the rows. That split is stated rather than hidden: a count without a worklist is not actionable, and this band is honest about which half of that it is.</div>\n" as *u8) 891 return fired 892} 893 894func main(argc: i64, argv: *i64) -> i64 { 895 if argc < 2 { w(1, "usage: nx_swcompare_matrix <domain> [html]\n" as *u8); sys_exit(1); return 1 } 896 let domain: *u8 = argv[1] as *u8 897 let cap: i64 = K_MAGIC_262144 898 let buf: *u8 = sys_mmap(cap) 899 let buf2: *u8 = sys_mmap(cap) 900 let pathb: *u8 = sys_mmap(512) 901 var o: i64 = scopy(pathb, 0, "knowledge/compare/" as *u8) 902 o = scopy(pathb, o, domain); o = scopy(pathb, o, ".matrix" as *u8); pathb[o] = 0 as u8 903 // RESOLVE, don't assume. ct_compare_read_published probes the PUBLISHING tree first and the 904 // authored tree second, and its wrapper applies ct_swap_tree so `mwhich` is a TRUE TREE token 905 // rather than a POSITION token -- stamping the raw position would label every buildroot read 906 // PRIMARY and misname the very document it just graded correctly. 907 // The pathb build above is DELIBERATELY KEPT: lines below still print it as a diagnostic. 908 let mwhich: *i64 = sys_mmap(16) as *i64 909 mwhich[0] = CT_TREE_NONE 910 let n: i64 = ct_compare_read_published(domain, ".matrix" as *u8, buf, cap, mwhich) 911 // cdir = the tree that actually answered, so the sibling .refs and .plan reads below cannot 912 // silently come from a DIFFERENT generation than the .matrix they annotate. 913 var cdir: *u8 = ct_first_published() 914 if mwhich[0] == CT_TREE_PRIMARY { cdir = ct_second_published() } 915 // A domain with a .sota and no .matrix renders through THIS generator too: zero capability rows, the SOTA 916 // field section, and every shared pass. The refusal fires only when NEITHER data class exists. 917 let sst: *SotaState = sl_new() 918 let have_sota: i64 = sl_load(domain, sst) 919 var have_matrix: i64 = 1 920 if n <= 0 { have_matrix = 0 } 921 // THE REFUSAL NAMES BOTH TREES IT PROBED. The old text printed ONE hand-built path, which under a 922 // resolver is not necessarily a path anyone looked at -- a refusal that names the wrong subject 923 // costs the reader the investigation it was written to save them. 924 if have_matrix == 0 { if have_sota != 1 { w(1, "MATRIX FILE MISSING: " as *u8); w(1, domain); w(1, ".matrix absent from BOTH " as *u8); w(1, ct_first_published()); w(1, " and " as *u8); w(1, ct_second_published()); w(1, " (and no .sota beside it)\n" as *u8); sys_exit(1); return 1 } } 925 // HASH BEFORE THE PARSER TOUCHES IT. splitpipe NUL-terminates fields IN PLACE, so by JSON-emit 926 // time buf is no longer the file -- hashing it there produced a value no consumer could 927 // reproduce from disk, and nx_comparestale reported all 46 pages stale minutes after they were 928 // published. A COMPARATOR AND A WRITER THAT DISAGREE ON CANONICAL FORM NEVER CONVERGE; the 929 // canonical form here is THE BYTES AS READ. 930 var src_hash: i64 = swc_src_hash(buf, n) 931 // AND DECLARE WHICH FILE THAT WAS. A consumer must never have to infer it from an extension 932 // precedence rule: llm and lang each have BOTH a .matrix and a .sota, so "try .matrix first" 933 // hashed the wrong file and called two perfectly current pages STALE. 934 let src_base: *u8 = sys_mmap(256) 935 var sbo: i64 = scopy(src_base, 0, domain); sbo = scopy(src_base, sbo, ".matrix" as *u8); src_base[sbo] = 0 as u8 936 // a sota-only domain declares the .sota as the source it was generated from (the staleness contract) 937 if have_matrix == 0 { src_hash = sst.src_hash; sbo = scopy(src_base, 0, domain); sbo = scopy(src_base, sbo, ".sota" as *u8); src_base[sbo] = 0 as u8 } 938 // citations register (research-paper references as data); absent file = byte-identical emit 939 let refspath: *u8 = sys_mmap(600) 940 var rpo: i64 = scopy(refspath, 0, "knowledge/compare/" as *u8) 941 rpo = scopy(refspath, rpo, domain); rpo = scopy(refspath, rpo, ".refs" as *u8); refspath[rpo] = 0 as u8 942 // rendered-evidence register (images as data); absent file = byte-identical emit 943 let galpath: *u8 = sys_mmap(600) 944 var gpo: i64 = scopy(galpath, 0, "knowledge/compare/" as *u8) 945 gpo = scopy(galpath, gpo, domain); gpo = scopy(galpath, gpo, ".gallery" as *u8); galpath[gpo] = 0 as u8 946 947 // ROW CAPACITY DERIVED FROM THE FILE, NOT GUESSED (2026-08-18). A data row costs at least one 948 // newline, so rows <= lines + 1 -- an invariant, not a knob. The fixed 64 this replaces silently 949 // DROPPED rows 65+ (measured live on browser.matrix: 66 rows authored, 64 rendered, the last two 950 // vanished under a healthy stats line -- the no-silent-caps law violated inside the very organ 951 // whose job is honest counts; debt 1787077715). The guard at the append site is kept as the 952 // fail-loud floor and now REFUSES instead of skipping. 953 var maxr_lines: i64 = 1 954 var maxr_i: i64 = 0 955 while maxr_i < n { if buf[maxr_i] == (10 as u8) { maxr_lines = maxr_lines + 1 } maxr_i = maxr_i + 1 } 956 let MAXR: i64 = maxr_lines + 1 957 let rf: *i64 = sys_mmap(MAXR * SWC_ROW_STRIDE * 8) as *i64 958 let rl: *i64 = sys_mmap(16) as *i64 // the rule the one ruler applied to the last row measured 959 let rnishi: *i64 = sys_mmap(MAXR * 8) as *i64 960 let rexceed: *i64 = sys_mmap(MAXR * 8) as *i64 961 // DARK CONTRACT per row (2026-09-06, operator: a permanent fix, we do not build and lose capability to darkness): 962 // 1 when a watch row's organ file EXISTS and was read but does not declare the contracted symbol -- something 963 // shipped at that path under another name. mmap-zeroed, so every non-watch row reads 0 without a write. 964 let rdark: *i64 = sys_mmap(MAXR * 8) as *i64 965 let max_cols: i64 = SWC_ROW_STRIDE - SWC_ROW_FIXED 966 let cf: *i64 = sys_mmap(max_cols * 8) as *i64 967 let fld: *i64 = sys_mmap(24 * 8) as *i64 968 var ncol: i64 = 0 969 var title: *u8 = "Comparison" as *u8 970 var sub: *u8 = 0 as *u8 971 var verdict: *u8 = 0 as *u8 972 var rown: i64 = 0 973 var rule_subonly: i64 = 0 974 975 var p: i64 = 0 976 while p < n { 977 var e: i64 = p 978 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 979 buf[e] = 0 as u8 980 let line: *u8 = (buf as i64 + p) as *u8 981 p = e + 1 982 if line[0] == (0 as u8) { } else { if line[0] == (35 as u8) { } else { 983 if line[0] == (64 as u8) { 984 if starts(line, "@title " as *u8) == 1 { title = (line as i64 + 7) as *u8 } else { 985 if starts(line, "@sub " as *u8) == 1 { sub = (line as i64 + 5) as *u8 } else { 986 if starts(line, "@verdict " as *u8) == 1 { verdict = (line as i64 + 9) as *u8 } else { 987 if starts(line, "@cols " as *u8) == 1 { ncol = splitpipe((line as i64 + 6) as *u8, cf, max_cols) } } } } 988 } else { 989 let cnt: i64 = splitpipe(line, fld, 24) 990 // SCHEMA v2: a row is label|organ|symbol|exceed then ONE CELL PER DECLARED COLUMN then the note, 991 // so its width is 5 + ncol rather than a fixed 9. Four-column domains still compute 9 and parse 992 // byte-identically; a fifth column (the research bar) now costs a data row, not a code change. 993 let roww: i64 = SWC_ROW_FIXED + ncol 994 // AN OVER-COUNT ROW IS A LIE WEARING THE SHAPE OF A NOTE (2026-08-18). A stray pipe inside 995 // prose (a sibling wrote the math with vertical bars; another used ' | reuse: ' as a 996 // separator) shears the note at that pipe, and '>=' below published the PREFIX as the whole 997 // note with a healthy byte count -- 6 rows across 48 matrices, one of them 2.7KB short across 998 // three regens, invisible to every reader. REFUSE the domain, name the row, and show the text 999 // that begins each surplus field so the author sees exactly where the pipe is. 1000 if cnt > roww { 1001 w(1, "MATRIX ROW REFUSED: " as *u8); w(1, pathb); w(1, " row-index " as *u8); wn(1, rown) 1002 w(1, " has " as *u8); wn(1, cnt); w(1, " fields, schema is " as *u8); wn(1, roww) 1003 w(1, " -- a stray '|' inside the note; surplus fields begin: " as *u8) 1004 var sf: i64 = roww 1005 while sf < cnt { w(1, "[" as *u8); w(1, fld[sf] as *u8); w(1, "] " as *u8); sf = sf + 1 } 1006 w(1, "\n" as *u8) 1007 sys_exit(1); return 1 1008 } 1009 if cnt == roww { if rown >= MAXR { 1010 w(1, "MATRIX ROWS EXCEED DERIVED CAPACITY -- impossible by derivation (rows <= file lines); refusing rather than silently dropping. file=" as *u8) 1011 w(1, pathb); w(1, " rown=" as *u8); wn(1, rown) 1012 w(1, " 1013" as *u8) 1014 sys_exit(1); return 1 1015 } } 1016 if cnt == roww { if rown >= MAXR { 1017 w(1, "MATRIX ROWS EXCEED DERIVED CAPACITY -- impossible by derivation (rows <= file lines); refusing rather than silently dropping. file=" as *u8) 1018 w(1, pathb); w(1, " rown=" as *u8); wn(1, rown) 1019 w(1, " 1020" as *u8) 1021 sys_exit(1); return 1 1022 } } 1023 if cnt == roww { if rown < MAXR { 1024 var k: i64 = 0 1025 while k < roww { rf[rown*SWC_ROW_STRIDE + k] = fld[k]; k = k + 1 } 1026 let organ: *u8 = fld[1] as *u8 1027 let sym: *u8 = fld[2] as *u8 1028 var present: i64 = 0 1029 if streq(sym, "_ABSENT_" as *u8) == 1 { present = 0 } else { 1030 if starts(sym, "_ABSENT_:" as *u8) == 1 { 1031 // WATCH ROW (2026-08-13, operator: pages must INHERIT workstream ships, never be 1032 // re-authored): the expectation is named in data as _ABSENT_:<future_symbol>; it is 1033 // MEASURED here on every emit with the same ruler as present rows, so the moment a 1034 // workstream ships the organ+symbol, the next beat flips the cell -- and if the organ 1035 // is later retired the cell reverts. Bidirectional, fail-safe, zero hand edits. 1036 let wsym: *u8 = (sym as i64 + 9) as *u8 1037 // ONE RULER (2026-08-23): a top-level DECLARATION in the organ, never a substring -- 1038 // nx_symdecl_lib is what the ranker and the comparewatch plane measure with too. 1039 present = 0 1040 let wst: i64 = sd_present(organ, wsym, rl) 1041 if wst == 1 { present = 1 } 1042 // DARK CONTRACT (2026-09-06): the ruler returns -1 for an organ it could not read and 0 for one it 1043 // READ whose symbol is not declared; a watch row in the second state names a path where something 1044 // shipped under another name (measured twice this week: DC16 amesh_run, motion mr_rig and 1045 // mo_body_index -- each read as 0 of N done for days). The JS rule's abstention is folded to 0 by 1046 // sd_present, so a JSDECL rule is excluded here: a cell the ruler cannot judge is OPEN, never DARK. 1047 if wst == 0 { if rl[0] != SD_RULE_JSDECL { rdark[rown] = 1 } } 1048 if present == 1 { rf[rown*SWC_ROW_STRIDE + 2] = wsym as i64 } 1049 } else { present = 0; if sd_present(organ, sym, rl) == 1 { present = 1 } } 1050 } 1051 // TWO SYMBOL RULERS, MEASURED (2026-08-23): this page tests a SUBSTRING, the ranker tests a 1052 // top-level DECLARATION (cl_symbol_declared), and a sibling seat caught a rung reading LANDED here 1053 // and OPEN there at once. Before the page switches rulers fleet-wide, COUNT the cells that would 1054 // flip: a row present by substring but not declared is a mention (comment, string, tooth name), 1055 // not an implementation. Published as rule_substring_only; the switch is a measured decision. 1056 if present == 1 { 1057 var dsym: *u8 = sym 1058 if starts(sym, "_ABSENT_:" as *u8) == 1 { dsym = (sym as i64 + 9) as *u8 } 1059 if cl_symbol_declared(organ, dsym) == 0 { rule_subonly = rule_subonly + 1 } 1060 } 1061 let exc: i64 = atoi(fld[3] as *u8) 1062 var nish: i64 = 0 1063 if present == 1 { if exc == 1 { nish = 2 } else { nish = 1 } } else { nish = 0 } 1064 rnishi[rown] = nish; rexceed[rown] = exc; rown = rown + 1 1065 } } 1066 } } } 1067 } 1068 1069 // DARK CONTRACT COUNT (2026-09-06): summed from the per-row facts, so the receipt and the page cannot disagree. 1070 var dark_c: i64 = 0 1071 var dki: i64 = 0 1072 while dki < rown { dark_c = dark_c + rdark[dki]; dki = dki + 1 } 1073 1074 // ---- CE2: adoption per measured row, one classification per distinct organ (memoised) ---- 1075 // every source the classifier reads, loaded ONCE, estate-anchored (the regen forks this organ from 1076 // buildroot/, where relative reads miss or hit stale twins -- measured on the first live emit) 1077 let ads: *i64 = sys_mmap(CLB_N * 8) as *i64 1078 clb_load(ads) 1079 // each census stamps itself; the page prints the stamp, never a trust it did not measure 1080 let imp_asof: i64 = ads[CLB_IMP_ASOF] 1081 let ga_asof: i64 = ads[CLB_GA_ASOF] 1082 let radopt: *i64 = sys_mmap(MAXR * 8) as *i64 1083 let rtok: *i64 = sys_mmap(MAXR * 8) as *i64 1084 let rrem: *i64 = sys_mmap(MAXR * 8) as *i64 1085 let mname: *i64 = sys_mmap(MAXR * 8) as *i64 1086 let mtok: *i64 = sys_mmap(MAXR * 8) as *i64 1087 let mful: *i64 = sys_mmap(MAXR * 8) as *i64 1088 let mrem: *i64 = sys_mmap(MAXR * 8) as *i64 1089 var mc: i64 = 0 1090 var adopt_full: i64 = 0 1091 var adopt_partial: i64 = 0 1092 var ra: i64 = 0 1093 while ra < rown { 1094 radopt[ra] = CLB_NA 1095 rtok[ra] = "" as *u8 as i64 1096 rrem[ra] = "" as *u8 as i64 1097 if rnishi[ra] > 0 { 1098 let oname: *u8 = sys_mmap(CLB_TOK_CAP) 1099 cl_name_of_path(rf[ra*SWC_ROW_STRIDE + 1] as *u8, oname, CLB_TOK_CAP) 1100 var hit: i64 = 0 - 1 1101 var mi: i64 = 0 1102 while mi < mc { if streq(mname[mi] as *u8, oname) == 1 { hit = mi; mi = mc } mi = mi + 1 } 1103 if hit < 0 { 1104 let tokb: *u8 = sys_mmap(CLB_TOK_CAP) 1105 let remp: *i64 = sys_mmap(8) as *i64 1106 let ful: i64 = clb_classify(oname, ads, tokb, remp) 1107 mname[mc] = oname as i64; mtok[mc] = tokb as i64; mful[mc] = ful; mrem[mc] = remp[0] 1108 hit = mc 1109 mc = mc + 1 1110 } 1111 radopt[ra] = mful[hit] 1112 rtok[ra] = mtok[hit] 1113 rrem[ra] = mrem[hit] 1114 if mful[hit] == CLB_FULL { adopt_full = adopt_full + 1 } else { adopt_partial = adopt_partial + 1 } 1115 } 1116 ra = ra + 1 1117 } 1118 1119 // EC10: histogram of the classifier's OWN tokens over the measured rows. rtok is empty for a row that 1120 // was never classified (no organ measured), so those rows contribute nothing here and the histogram's 1121 // population is exactly the FULL+PARTIAL tally above -- a partition the console line asserts by summing. 1122 let mxh_tok: *i64 = sys_mmap(MXH_MAX * 8) as *i64 1123 let mxh_cnt: *i64 = sys_mmap(MXH_MAX * 8) as *i64 1124 var mxh_n: i64 = 0 1125 var mxh_ovf: i64 = 0 1126 var mxh_i: i64 = 0 1127 while mxh_i < rown { 1128 let mxh_t: *u8 = rtok[mxh_i] as *u8 1129 if mxh_t[0] != (0 as u8) { 1130 var mxh_hit: i64 = 0 - 1 1131 var mxh_j: i64 = 0 1132 while mxh_j < mxh_n { if mx_tokclass_eq(mxh_tok[mxh_j] as *u8, mxh_t) == 1 { mxh_hit = mxh_j; mxh_j = mxh_n } mxh_j = mxh_j + 1 } 1133 if mxh_hit >= 0 { mxh_cnt[mxh_hit] = mxh_cnt[mxh_hit] + 1 } else { 1134 if mxh_n < MXH_MAX { mxh_tok[mxh_n] = mxh_t as i64; mxh_cnt[mxh_n] = 1; mxh_n = mxh_n + 1 } else { mxh_ovf = mxh_ovf + 1 } 1135 } 1136 } 1137 mxh_i = mxh_i + 1 1138 } 1139 1140 var present_c: i64 = 0; var exceeds_c: i64 = 0; var absent_c: i64 = 0; var exflags: i64 = 0 1141 var r: i64 = 0 1142 while r < rown { 1143 if rexceed[r] == 1 { exflags = exflags + 1 } 1144 if rnishi[r] == 2 { exceeds_c = exceeds_c + 1 } else { if rnishi[r] == 1 { present_c = present_c + 1 } else { absent_c = absent_c + 1 } } 1145 r = r + 1 1146 } 1147 let total: i64 = rown 1148 // RIVAL-CLAIM PROVENANCE (2026-09-05): rows whose rival columns assert Yes, Best or Part, split by whether the 1149 // note cites a reference mark. Computed ONCE here so the JSON tally and the HTML band cannot disagree. 1150 var rv_rows: i64 = 0; var rv_cited: i64 = 0; var rv_uncited: i64 = 0 1151 var rvr: i64 = 0 1152 while rvr < rown { 1153 let rvc0: i64 = rv_class(rf[rvr*SWC_ROW_STRIDE + 4 + ncol] as *u8, rf, rvr, SWC_ROW_STRIDE, ncol) 1154 if rvc0 != RV_NONE { rv_rows = rv_rows + 1 } 1155 if rvc0 == RV_CITED { rv_cited = rv_cited + 1 } 1156 if rvc0 == RV_UNCITED { rv_uncited = rv_uncited + 1 } 1157 rvr = rvr + 1 1158 } 1159 var coverage: i64 = 0 1160 if total > 0 { coverage = ((present_c + exceeds_c) * 1000) / total } 1161 var neg: i64 = 0 1162 if rown > 0 { if sd_present(rf[1] as *u8, "zzznope_symbol_xyz" as *u8, rl) == 1 { neg = 1 } } 1163 1164 var html: i64 = 0 1165 var jsonmode: i64 = 0 1166 if argc >= 3 { if streq(argv[2] as *u8, "html" as *u8) == 1 { html = 1 } } 1167 if argc >= 3 { if streq(argv[2] as *u8, "json" as *u8) == 1 { jsonmode = 1 } } 1168 1169 var ladder_model: *SgPlan = 0 as *SgPlan 1170 if html + jsonmode > 0 { ladder_model = sg_load(domain) } 1171 if jsonmode == 1 { 1172 wc(1, 123) 1173 kv_n(1, "v" as *u8, 1); wc(1, 44) 1174 kv_s(1, "api" as *u8, "nishi-compare" as *u8); wc(1, 44) 1175 kv_n(1, "generated_unix" as *u8, sys_now_realtime_sec()); wc(1, 44) 1176 // The page carries the hash of the SOURCE it was generated from -- staleness becomes decidable 1177 // by a consumer with no clock and no filesystem access to this machine. 1178 kv_s(1, "source_file" as *u8, src_base); wc(1, 44); kv_n(1, "source_hash" as *u8, src_hash); wc(1, 44) 1179 kv_s(1, "domain" as *u8, domain); wc(1, 44) 1180 kv_s(1, "kind" as *u8, "matrix" as *u8); wc(1, 44) 1181 kv_s(1, "title" as *u8, title); wc(1, 44) 1182 if (sub as i64) != 0 { kv_s(1, "subtitle" as *u8, sub); wc(1, 44) } 1183 wq(1); w(1, "competitors" as *u8); wq(1); wc(1, 58); wc(1, 91) 1184 var cj: i64 = 0 1185 while cj < ncol { if cj > 0 { wc(1, 44) } wq(1); wj(1, cf[cj] as *u8); wq(1); cj = cj + 1 } 1186 wc(1, 93); wc(1, 44) 1187 wq(1); w(1, "axes" as *u8); wq(1); wc(1, 58); wc(1, 91) 1188 var rj: i64 = 0 1189 while rj < rown { 1190 if rj > 0 { wc(1, 44) } 1191 wc(1, 123) 1192 kv_s(1, "label" as *u8, rf[rj*SWC_ROW_STRIDE + 0] as *u8); wc(1, 44) 1193 kv_n(1, "nishi" as *u8, rnishi[rj]); wc(1, 44) 1194 kv_n(1, "exceed" as *u8, rexceed[rj]); wc(1, 44) 1195 // CE2: the ladder state and a 0/1/2 adopted flag (2 = not applicable: the axis is open) 1196 kv_s(1, "adopt" as *u8, rtok[rj] as *u8); wc(1, 44) 1197 kv_n(1, "adopted" as *u8, radopt[rj]); wc(1, 44) 1198 wq(1); w(1, "cells" as *u8); wq(1); wc(1, 58); wc(1, 91) 1199 // SCHEMA v2 COMPLETED 2026-08-15. The JSON half of this emitter was left on the fixed 1200 // four-cell layout when the parser (roww = 5 + ncol) and the HTML half both moved to 1201 // one-cell-per-declared-column. On a five-column domain it therefore emitted cells[4] and 1202 // published the FIFTH CODE as the note, dropping every prose note with it -- mangagen's 1203 // DiffSensei research bar has been unpublished this way since 2026-08-13, and the page 1204 // looked entirely healthy the whole time. 1205 // TWO HALVES OF ONE EMITTER ARE TWO READERS, AND AN UPGRADE APPLIED TO ONLY ONE OF THEM 1206 // IS A WIRE DISAGREEMENT THAT SHIPS LOOKING CORRECT. 1207 // NEUTRALITY IS EXACT, NOT ASSERTED: for ncol == 4 these expressions reduce to the old 1208 // literals (4 and 4+4), so every four-column domain emits byte-identical JSON. 1209 var ij: i64 = 0 1210 while ij < ncol { if ij > 0 { wc(1, 44) } wn(1, atoi(rf[rj*SWC_ROW_STRIDE + 4 + ij] as *u8)); ij = ij + 1 } 1211 wc(1, 93); wc(1, 44) 1212 kv_s(1, "note" as *u8, rf[rj*SWC_ROW_STRIDE + 4 + ncol] as *u8) 1213 wc(1, 125) 1214 rj = rj + 1 1215 } 1216 wc(1, 93); wc(1, 44) 1217 wq(1); w(1, "tally" as *u8); wq(1); wc(1, 58); wc(1, 123) 1218 kv_n(1, "coverage" as *u8, coverage); wc(1, 44); kv_n(1, "exceeds" as *u8, exceeds_c); wc(1, 44) 1219 kv_n(1, "present" as *u8, present_c); wc(1, 44); kv_n(1, "absent" as *u8, absent_c); wc(1, 44); kv_n(1, "total" as *u8, total); wc(1, 44) 1220 kv_n(1, "adopted_full" as *u8, adopt_full); wc(1, 44); kv_n(1, "adopted_partial" as *u8, adopt_partial); wc(1, 44) 1221 kv_n(1, "rival_rows" as *u8, rv_rows); wc(1, 44); kv_n(1, "rival_cited" as *u8, rv_cited); wc(1, 44); kv_n(1, "rival_uncited" as *u8, rv_uncited); wc(1, 44) 1222 // EC10: the whole ladder, machine-readable. Keys are "state"/"rows" (not "class"/"count") so no 1223 // flat-searching consumer of this document can collide with them. 1224 wq(1); w(1, "adopt_classes" as *u8); wq(1); wc(1, 58); wc(1, 91) 1225 var mxh_e: i64 = 0 1226 while mxh_e < mxh_n { 1227 if mxh_e > 0 { wc(1, 44) } 1228 wc(1, 123); wq(1); w(1, "state" as *u8); wq(1); wc(1, 58); wq(1) 1229 sys_write(1, mxh_tok[mxh_e] as *u8, mx_tokclass_len(mxh_tok[mxh_e] as *u8)) 1230 wq(1); wc(1, 44); wq(1); w(1, "rows" as *u8); wq(1); wc(1, 58); wn(1, mxh_cnt[mxh_e]); wc(1, 125) 1231 mxh_e = mxh_e + 1 1232 } 1233 wc(1, 93); wc(1, 44) 1234 kv_n(1, "adopt_classes_overflow" as *u8, mxh_ovf); wc(1, 44) 1235 kv_n(1, "rule_substring_only" as *u8, rule_subonly); wc(1, 44) 1236 kv_n(1, "dark_contracts" as *u8, dark_c) 1237 wc(1, 125); wc(1, 44) 1238 wq(1); w(1, "adoption_sources" as *u8); wq(1); wc(1, 58); wc(1, 123) 1239 kv_n(1, "importers_asof" as *u8, imp_asof); wc(1, 44); kv_n(1, "gateadjudicate_asof" as *u8, ga_asof); wc(1, 44) 1240 kv_s(1, "rule" as *u8, "program: nx_catalog ladder; library: importer reach minus validation importers; gate: execution-surface census; FULL only at the top of its ladder" as *u8) 1241 wc(1, 125); wc(1, 44) 1242 kv_s(1, "codes" as *u8, "0=No 1=Yes 2=Best 3=Part; adopted 1=full 0=partial 2=n/a" as *u8); wc(1, 44) 1243 kv_s(1, "measurement" as *u8, "nishi cells verified by implementing-symbol on disk; competitor cells are documented capability presence" as *u8) 1244 // THE SOTA FIELD, MACHINE-READABLE (2026-09-02): the same field names the sota generator published 1245 if have_sota == 1 { sl_json(sst, domain, 1) } 1246 wc(1, 44); wq(1); w(1, "ppp" as *u8); wq(1); wc(1, 58); ppp_pass(domain, 1, 2) 1247 refs_pass(refspath, buf2, cap, 2, domain, RP_HDR) 1248 gal_pass(galpath, buf2, cap, 2, domain) 1249 // THE EVIDENCE PROFILE, MACHINE-READABLE (F1208). The HTML band above (ev_pass) and this object 1250 // read THE SAME stamp through THE SAME reader, so the page and api.json cannot disagree about 1251 // this board's gaps. evj_pass lives in nx_swcompare_lib so the SOTA generator emits the same 1252 // dialect from one renderer -- the refs_pass/plan_pass precedent, not a second copy here. 1253 evj_pass(domain) 1254 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): <dom>.bench rides in api.json through the one reader; absent file = no key 1255 bench_pass(domain, 1, 2) 1256 // MINED INTELLIGENCE (intelmine IM3): <dom>.proposed rides in api.json through the one reader; absent file = no key 1257 prop_pass(domain, 1, 2) 1258 // THE DISCOVERED FIELD (fieldwatch FW1, 2026-09-05): <dom>.field rides in api.json through the one reader with the @cols coverage; absent file = no key 1259 field_pass(domain, 1, 2, cf, ncol) 1260 // GAUGE HEARTBEATS (codeeffectiveness CE9, 2026-09-06): <dom>.gauge rides in api.json through the one ruler; a stale gauge carries no value key 1261 gauge_pass(domain, 1, 2) 1262 gaps_pass(domain, 1, 2) 1263 sg_json(ladder_model, 1) 1264 wc(1, 125); wc(1, 10) 1265 sys_exit(0); return 0 1266 } 1267 1268 if html == 1 { 1269 // shared site chrome (nav + footer) from nx_site_chrome; graceful fallback to minimal nav if absent. 1270 let hdrbuf: *u8 = sys_mmap(K_MAGIC_20480) 1271 var hdn: i64 = c_read("knowledge/site/chrome_header.html" as *u8, hdrbuf, K_MAGIC_20479) 1272 if hdn < 0 { hdn = 0 } 1273 hdrbuf[hdn] = 0 as u8 1274 let ftbuf: *u8 = sys_mmap(K_MAGIC_20480) 1275 var ftn: i64 = c_read("knowledge/site/chrome_footer.html" as *u8, ftbuf, K_MAGIC_20479) 1276 if ftn < 0 { ftn = 0 } 1277 ftbuf[ftn] = 0 as u8 1278 w(1, "<" as *u8); wc(1, 33); w(1, "DOCTYPE html>\n<html lang=\"en\"><head><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1'>\n" as *u8) 1279 w(1, "<title>" as *u8); w(1, title); w(1, " -- Nishi Compare</title>\n<style>\n" as *u8) 1280 // THREE THEMES AS TOKENS (2026-08-13, operator: white ground hurts legibility + honor the e-ink lane). 1281 // PAPER = low-glare default. INK = the e-ink profile: tones taken from the incumbent nx_eink_tone CIE L* 1282 // ladder (white / L*67 ~ rgb(168) / L*33 ~ rgb(78) / black) -- no mid-greys, accent collapses to black, and 1283 // the state marks are SHAPE-distinct so the matrix survives monochrome. DARK = the charcoal register. 1284 // PALETTE + THEME + BREAKPOINTS now come from sc_theme_pass in nx_swcompare_lib.nx, which 1285 // emits them from the estate's token SSOT (nx_brand_tokens). This replaced the light :root 1286 // AND the html[data-theme='dark'] literal that used to sit here: the dark values are now 1287 // declared ONCE as data and emitted TWICE -- under the chip selector and under 1288 // @media(prefers-color-scheme:dark){:root:not([data-theme]){...}} -- so the chip theme and 1289 // the OS-preference theme CANNOT drift apart. The guard on that media block is load-bearing; 1290 // sc_theme_pass documents why (paper is the bare :root default and sett() sets data-theme for 1291 // it, so an unguarded block would repaint an explicit Paper choice on an OS-dark machine). 1292 sc_theme_pass(1) 1293 // INK stays a literal HERE, deliberately: it is a THIRD theme and nx_brand_tokens' format 1294 // expresses exactly two keywords (token|/dark|). Bending the SSOT to carry a third register 1295 // for one page would be a schema change driven by a single caller. It now overrides the 1296 // --nx-color-* SSOT names rather than the short names, because the short names became 1297 // var() ALIASES in sc_theme_pass -- overriding an alias would be overriding the pointer 1298 // instead of the value, and ink would silently stop working for every aliased token. 1299 w(1, "html[data-theme='ink']{--nx-color-bg:rgb(255,255,255);--nx-color-fg:rgb(0,0,0);--nx-color-accent:rgb(0,0,0);--nx-color-panel:rgb(255,255,255);--nx-color-soft:rgb(255,255,255);--nx-color-tint:rgb(255,255,255);--nx-color-line:rgb(168,168,168);--nx-color-mut:rgb(78,78,78);--nx-color-faint:rgb(78,78,78);--nx-color-gk:rgb(0,0,0);--nx-color-goff:rgb(168,168,168);--nx-color-ghalf:rgb(78,78,78);--nx-color-codebg:rgb(255,255,255)}\n" as *u8) 1300 w(1, ".tchip{font-size:10.5px;letter-spacing:.06em;padding:4px 10px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--mut);cursor:pointer;font-weight:600;text-transform:uppercase;margin-left:6px}.tchip.on{background:var(--fg);border-color:var(--fg);color:var(--bg)}.tgroup{margin-left:auto}\n" as *u8) 1301 // ONE LAYOUT EMITTER (2026-08-31). This body rule was byte-identical in intent to the one in 1302 // nx_swcompare_sota and five other generators, and the family had already drifted to SIX page 1303 // widths -- so it moved into sc_layout_pass. This page's OWN rendering is unchanged by the move 1304 // (it already read both layout tokens); what it GAINS is the min-width:0 guard that stops a wide 1305 // table forcing horizontal scroll onto the document, and overflow-wrap on the long monospace 1306 // identifiers that are the only real width bombs in a .pl table. 1307 sc_layout_pass(1) 1308 sg_css(1) 1309 if have_sota == 1 { sl_css(1) } 1310 w(1, ".eyebrow{letter-spacing:.14em;text-transform:uppercase;font-size:.72rem;color:var(--mut);margin:22px 0 6px}.eyebrow b{color:var(--ac);font-weight:600}h1{font-size:clamp(1.7rem,4vw,2.3rem);line-height:1.15;margin:0 0 8px;color:var(--fg);text-wrap:balance}.sub{color:var(--mut);font-size:clamp(.93rem,2vw,1.02rem);margin:0 0 8px;max-width:74ch}.crumb{font-size:.82rem;margin:14px 0 2px;color:var(--mut)}a{color:var(--ac)}\n" as *u8) 1311 w(1, ".skip-link{position:absolute;left:-999px;top:0;background:var(--ac);color:var(--nx-color-bg);padding:12px 16px;z-index:9;border-radius:0 0 8px 0}.skip-link:focus{left:0}\n" as *u8) 1312 w(1, ".hd{border-bottom:1px solid var(--line);margin:0 0 8px}.hd nav{display:flex;gap:6px;flex-wrap:wrap;padding:10px 0}.hd a{color:var(--fg);text-decoration:none;padding:8px 12px;border-radius:8px;font-weight:600;min-height:44px;display:inline-flex;align-items:center}.hd a:hover{background:var(--soft)}\n" as *u8) 1313 // MEASURE CAP (2026-08-25): .meth and .verdict were the only prose blocks on the page with NO 1314 // max-width, so they inherited body's 1100px and set ~140-145 characters per line -- about 1.8x the 1315 // WCAG 1.4.8 (AAA) 80-character ceiling, and nearly 2x the 45-75 range typography practice uses for 1316 // body copy. They are bordered prose callouts, exactly the shape .answer already is, and .answer was 1317 // ALREADY capped at 72ch three rules away -- so this makes them consistent with their own sibling 1318 // rather than introducing a new value. text-wrap:pretty additionally suppresses orphaned last words 1319 // and is ignored by engines that do not implement it, so it degrades to today's rendering. 1320 w(1, ".meth{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin:16px 0;font-size:.88rem;color:var(--mut);max-width:var(--nx-layout-measure);text-wrap:pretty}.meth b{color:var(--fg)}\n" as *u8) 1321 w(1, ".legend{font-size:12.5px;color:var(--mut);margin:10px 0}.legend .m{margin-right:15px;white-space:nowrap}.legend .g{font-size:15px;vertical-align:-1px;margin-right:5px}\n" as *u8) 1322 w(1, ".stats{font-size:13.5px;color:var(--mut);margin:0 0 10px}.stats b{color:var(--fg);font-weight:600;font-variant-numeric:tabular-nums}.stats .sep{margin:0 10px;color:var(--line)}\n" as *u8) 1323 w(1, "table{width:100%;border-collapse:collapse;margin:4px 0}th{font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--mut);font-weight:600;text-align:center;padding:9px 8px;border-bottom:1px solid var(--fg)}th:first-child{text-align:left;padding-left:0}th.ni{color:var(--ac)}\n" as *u8) 1324 w(1, "td{border-bottom:1px solid var(--line);padding:11px 6px;text-align:center;font-size:16px;line-height:1.3}td:first-child{text-align:left;padding-left:0;font-size:13.5px;font-weight:500;max-width:360px}td.ni{background:var(--tint);color:var(--ac);font-size:17px}\n" as *u8) 1325 w(1, ".g{color:var(--gk)}.g.off{color:var(--goff)}.g.half{color:var(--ghalf)}td.ni .g{color:var(--ac)}td.ni .g.off{color:var(--goff)}\n" as *u8) 1326 w(1, "tr.grp td{padding:24px 0 6px;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--faint);font-weight:600;text-align:left;background:none;border-bottom:1px solid var(--line)}\n" as *u8) 1327 w(1, "details{display:inline}details summary{cursor:pointer;list-style:none;display:inline}details summary::-webkit-details-marker{display:none}details summary:hover{color:var(--ac)}details summary::after{content:' >';color:var(--faint);font-weight:400}details[open] summary::after{content:' <'}\n" as *u8) 1328 w(1, ".ev{display:block;margin:8px 0 4px;padding:10px 12px;background:var(--tint);border-left:2px solid var(--ac);font-size:12.5px;line-height:1.7;color:var(--mut);font-weight:400;text-align:left}.ev code{font-family:var(--mono);font-size:11.5px;color:var(--fg);background:var(--codebg);padding:1px 5px;border-radius:4px}.ev a{color:var(--ac)}\n" as *u8) 1329 w(1, ".fbar{position:sticky;top:0;background:var(--bg);padding:11px 0 9px;border-bottom:1px solid var(--line);display:flex;gap:8px;flex-wrap:wrap;align-items:center;z-index:5}.fbar input{flex:1 1 220px;min-width:170px;padding:8px 12px;font-size:14px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--fg)}\n" as *u8) 1330 w(1, ".fchip{font-size:12px;padding:6px 12px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--mut);cursor:pointer;font-weight:500}.fchip.on{background:var(--ac);border-color:var(--ac);color:var(--bg)}.cnt{font-size:12px;color:var(--faint);margin-left:auto;font-variant-numeric:tabular-nums}\n" as *u8) 1331 w(1, ".ghead{letter-spacing:.13em;text-transform:uppercase;font-size:.72rem;color:var(--ac);margin:28px 0 2px;font-weight:650;border-bottom:1px solid var(--line);padding-bottom:6px}\n" as *u8) 1332 w(1, ".watch{display:block;font:11px/1.7 var(--mono);color:var(--mut);font-weight:400}.watch b{color:var(--ac);font-weight:500}\n" as *u8) 1333 w(1, ".pstate{display:block;font:10px/1.8 var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--y)}.pstate.note{color:var(--mut)}\n" as *u8) 1334 w(1, ".layer{font-size:10.5px;letter-spacing:.2em;text-transform:uppercase;color:var(--bg);background:var(--ac);display:inline-block;padding:3px 10px;border-radius:4px;font-weight:700;margin:42px 0 2px}\n" as *u8) 1335 w(1, ".lnav{border-bottom:1px solid var(--line);padding:9px 0;margin:2px 0 14px;font-size:11px}.lnav a{color:var(--mut);text-decoration:none;margin-right:16px;letter-spacing:.06em;text-transform:uppercase;font-weight:600}.lnav a:hover{color:var(--ac)}\n" as *u8) 1336 w(1, ".lead{font-size:inherit;line-height:1.65;max-width:var(--nx-layout-measure);margin:10px 0;color:var(--mut)}.lead b{color:var(--fg)}.lead a{color:var(--ac)}\n" as *u8) 1337 w(1, ".answer{border-left:3px solid var(--ac);background:var(--tint);padding:12px 18px;margin:12px 0;font-size:inherit;line-height:1.6;max-width:var(--nx-layout-measure);color:var(--mut)}.answer b{color:var(--fg)}\n" as *u8) 1338 w(1, ".pl{width:100%;border-collapse:collapse;margin:8px 0}.pl th{font-size:10.5px;text-align:left;padding:8px 10px 8px 0;border-bottom:1px solid var(--fg);color:var(--mut);text-transform:uppercase;letter-spacing:.09em}.pl td{border-bottom:1px solid var(--line);padding:10px 10px 10px 0;font-size:13px;line-height:1.5;vertical-align:top;text-align:left;max-width:none}.pl td.r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.pl .ct{font-family:var(--mono);font-size:11.5px;color:var(--ac)}.pl .ex{font-size:10px;text-transform:uppercase;letter-spacing:.06em;border:1px solid var(--line);border-radius:4px;padding:2px 7px;color:var(--mut);white-space:nowrap}\n" as *u8) 1339 w(1, "h2{letter-spacing:.12em;text-transform:uppercase;font-size:.78rem;color:var(--mut);margin:34px 0 6px;font-weight:600}@media(max-width:700px){td:first-child{max-width:none;font-size:12.5px}th,td{padding:9px 3px}}\n" as *u8) 1340 w(1, ".refs{margin:6px 0 0;padding-left:0;list-style:none}.refs li{border-bottom:1px solid var(--line);padding:10px 0;font-size:13px;line-height:1.6;max-width:86ch}.rkey{font-family:var(--mono);font-size:11.5px;color:var(--ac);margin-right:6px}.rlinks{color:var(--mut);font-size:12px}.rlinks code{font-family:var(--mono);font-size:11px;background:var(--codebg);padding:1px 5px;border-radius:4px;color:var(--fg)}.rgrade{font-size:10px;text-transform:uppercase;letter-spacing:.06em;border:1px solid var(--line);border-radius:4px;padding:1px 6px;color:var(--mut);white-space:nowrap}.rg{display:block;font-size:12px;color:var(--faint);margin-top:3px}.cite{font-family:var(--mono);font-size:11px;text-decoration:none}\n" as *u8) 1341 w(1, ".verdict{background:var(--panel);border:1px solid var(--line);border-left:4px solid var(--ac);padding:13px 18px;border-radius:0 12px 12px 0;margin:18px 0;font-size:.92rem;color:var(--mut);max-width:var(--nx-layout-measure);text-wrap:pretty}.verdict b{color:var(--fg)}.foot{margin-top:30px;color:var(--mut);font-size:.76rem;border-top:1px solid var(--line);padding-top:14px;font-family:ui-monospace,Consolas,monospace}\n" as *u8) 1342 w(1, ":focus-visible{outline:3px solid var(--ac);outline-offset:2px}main>*{animation:rise .45s ease both}main>*:nth-child(2){animation-delay:.04s}main>*:nth-child(3){animation-delay:.08s}main>*:nth-child(4){animation-delay:.12s}@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){main>*{animation:none}}\n" as *u8) 1343 let galcss_fd: i64 = sys_openat_rd(galpath) 1344 if galcss_fd >= 0 { sys_close(galcss_fd) 1345 w(1, ".galgate summary{cursor:pointer;font-size:.82rem;color:var(--ac);padding:10px 12px;background:var(--tint);border-left:2px solid var(--ac)}.galgate[open] summary{margin-bottom:6px}.galv,.gala{width:100%;display:block;background:var(--soft)}.galpre{font:11.5px/1.5 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere;max-height:14em;overflow:auto;background:var(--tint);padding:8px 10px;margin:0}.galt{margin:6px 0}\n" as *u8) 1346 } 1347 w(1, ".gal{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin:12px 0}.galf{margin:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel)}.galf img{width:100%;height:auto;display:block}.galf figcaption{padding:10px 12px;font-size:12.5px;line-height:1.55;color:var(--mut)}.galp{display:block;font:10.5px/1.7 var(--mono);color:var(--faint);margin-top:4px}.galmiss{border:1px dashed var(--line);border-radius:10px;padding:10px 12px;font-size:12.5px;color:var(--mut)}.galmiss code{font-family:var(--mono);font-size:11px;background:var(--codebg);padding:1px 5px;border-radius:4px;color:var(--fg)}.galprobe{margin:6px 12px 10px}.galprobe summary{font:10.5px/1.7 var(--mono);color:var(--ac);cursor:pointer}.galprobe pre{white-space:pre-wrap;word-break:break-all;font:10.5px/1.6 var(--mono);background:var(--codebg);padding:8px 10px;border-radius:8px;max-height:220px;overflow:auto;margin:4px 0 0}\n" as *u8) 1348 w(1, ".pc{font-size:12px;line-height:1.5;margin-top:5px;color:var(--mut)}.pc span{display:block}.pc .pro b{color:var(--y);margin-right:4px}.pc .con b{color:var(--n);margin-right:4px}.watch.con{border-color:var(--n);color:var(--n)}\n" as *u8) 1349 w(1, ".cnt,.rg,.galp,tr.grp td{color:var(--mut)}\n" as *u8) 1350 w(1, "</style>\n" as *u8) 1351 // theme applied BEFORE first paint so a chosen ground never flashes the default one 1352 w(1, "<script>(function(){var t;try{t=localStorage.getItem('nx-theme')}catch(e){}if(t){document.documentElement.setAttribute('data-theme',t)}})()</script>\n" as *u8) 1353 w(1, "</head><body>\n" as *u8) 1354 w(1, "<a class='skip-link' href='" as *u8); wc(1, 35); w(1, "main'>Skip to content</a>\n" as *u8) 1355 if hdn > 0 { w(1, hdrbuf) } else { w(1, "<header class='hd'><nav><a href='/'>Nishi Family</a><a href='/compare'>Compare</a></nav></header>" as *u8) } 1356 w(1, "<main id='main'>\n" as *u8) 1357 w(1, "<p class='crumb'><a href='/'>Nishi Family</a> &rsaquo; <a href='/compare'>Compare</a> &rsaquo; " as *u8); w(1, title); w(1, "</p>\n" as *u8) 1358 w(1, "<div style='display:flex;align-items:center;flex-wrap:wrap;gap:6px'><p class='eyebrow'><b>Nishi Compare</b> &middot; measured, not asserted</p>" as *u8) 1359 w(1, "<span class='tgroup'><button class='tchip on' data-th='paper'>Paper</button><button class='tchip' data-th='ink'>Ink</button><button class='tchip' data-th='dark'>Dark</button></span></div>\n" as *u8) 1360 w(1, "<h1>" as *u8); w(1, title); w(1, "</h1>\n<p class='sub'>Nishi vs the field &mdash; every Nishi cell is measured against real organ source at emit time; each gap names the watch contract that will close it.</p>\n" as *u8) 1361 if (sub as i64) != 0 { w(1, "<p class='sub' style='font-size:.88rem'>" as *u8); w(1, sub); w(1, "</p>\n" as *u8) } 1362 // A domain that declares knowledge/compare/<dom>.plan leads with the executive answer and the 1363 // dependency-ordered path; the matrix then becomes Layer 3, the evidence behind both. 1364 let planpath: *u8 = sys_mmap(600) 1365 var plo: i64 = scopy(planpath, 0, "knowledge/compare/" as *u8) 1366 plo = scopy(planpath, plo, domain) 1367 plo = scopy(planpath, plo, ".plan" as *u8) 1368 planpath[plo] = 0 as u8 1369 var haveplan: i64 = 0 1370 let plfd: i64 = sys_openat_rd(planpath) 1371 if plfd >= 0 { sys_close(plfd); haveplan = 1 } 1372 let planbuf: *u8 = sys_mmap(K_MAGIC_20480) 1373 if haveplan == 1 { 1374 w(1, "<nav class='lnav'><a href='" as *u8); wc(1, 35); w(1, "exec'>1 &middot; Executive</a><a href='" as *u8); wc(1, 35) 1375 w(1, "roadmap'>2 &middot; Roadmap</a><a href='" as *u8); wc(1, 35); w(1, "eng'>3 &middot; Engineering</a></nav>\n" as *u8) 1376 w(1, "<div class='layer' id='exec'>Layer 1 &middot; Executive</div>\n" as *u8) 1377 plan_pass(planpath, planbuf, K_MAGIC_20479, 1) 1378 } 1379 // PRESENT = measured-plus-exceeds. Reporting present_c alone read as "12 of 24" while 15 rows were 1380 // in fact measured, because the exceeds are counted in their own bucket -- a partition that does 1381 // not sum in the reader's head is a wrong number with an authoritative typeface. 1382 w(1, "<p class='stats'><b>" as *u8); wn(1, present_c + exceeds_c); w(1, "</b> of <b>" as *u8); wn(1, rown); w(1, "</b> capabilities measured<span class='sep'>|</span><b>" as *u8); wn(1, exceeds_c) 1383 w(1, "</b> of them measured exceeds<span class='sep'>|</span><b>" as *u8); wn(1, absent_c); w(1, "</b> open<span class='sep'>|</span>coverage <b>" as *u8); wn(1, coverage); w(1, "</b>/1000" as *u8) 1384 // CE2: adoption beside coverage -- a presence number alone is the partial-deploy blind spot 1385 w(1, "<span class='sep'>|</span>adoption <b>" as *u8); wn(1, adopt_full); w(1, "</b> full / <b>" as *u8); wn(1, adopt_partial); w(1, "</b> partial</p>\n" as *u8) 1386 // CE7: THE GAP PROFILE, FOR EVERY DOMAIN. Placed DELIBERATELY OUTSIDE the haveplan guard. 1387 // Beside rank_pass it would have been skipped for every plan-less board -- and a board with 1388 // no plan is exactly the one whose gaps most need publishing. That skip would have been 1389 // silent, and a silently absent band reads as a board with nothing to report. 1390 ev_pass(domain) 1391 if haveplan == 1 { 1392 w(1, "<div class='layer' id='roadmap'>Layer 2 &middot; Roadmap</div>\n" as *u8) 1393 // CE6 (2026-08-23): THE ORDER, WHERE A HUMAN READS IT. nx_compare_rank computes the priority of every 1394 // open rung from the boards and writes knowledge/compare/<dom>.rank (one line per rung, stamped); 1395 // the roadmap table below this used to render rungs in plan-file declaration order, so "the ranker 1396 // is the order" was a doctrine with no surface. FINISH rows come first: rungs whose symbol is 1397 // present but whose organ is short of full adoption -- the cheapest closures on the board. 1398 rank_pass(domain, RANK_READ_CAP) 1399 w(1, "<h2>Critical path &mdash; contract, done-rule, executor, cost</h2>\n" as *u8) 1400 plan_pass(planpath, planbuf, K_MAGIC_20479, 2) 1401 sg_html(ladder_model, 1) 1402 w(1, "<div class='layer' id='eng'>Layer 3 &middot; Engineering</div>\n" as *u8) 1403 } 1404 w(1, "<div class='meth'><b>How this is scored.</b> Every <b>Nishi</b> mark is <b>measured</b>: the generator reads the real organ source on disk and requires the implementing symbol to exist (no self-grading). A <b>watching</b> tag names the organ and symbol contracted to close a gap &mdash; the mark flips itself on the next compare beat when that workstream ships, and the <code>comparewatch-</code> plane row flips with it. A <b>dark</b> tag means the organ file EXISTS but does not declare the contracted symbol: something shipped there under another name, and until the contract is repointed to the real entry point (the plan rung and this row) or the function is renamed, that capability is invisible to this board &mdash; a build lost to darkness, named so it is not. <b>The flip is necessary, not sufficient:</b> it proves the symbol exists, never that the capability is good. The bar is the rung's pre-declared done-rule, proven by its gate &mdash; a symbol shipped without the behaviour behind it is a defect, and the flip is exactly what makes that defect visible instead of quiet. Competitor marks record <b>documented capability presence</b> &mdash; presence, not depth or scale. <b>Adoption is measured too:</b> every measured row carries where its organ stands on the estate's ladder (source &rarr; built &rarr; promoted &rarr; registered &rarr; invoked; libraries by importer reach minus validation importers; gates by the execution surfaces that run them). A row is <b>fully adopted</b> only at the top of its ladder; anything short is tagged <b>partial</b> with the exact remedy, so a build nobody promoted can no longer read as shipped. Census stamps: importers asof " as *u8); wn(1, imp_asof); w(1, ", gate census asof " as *u8); wn(1, ga_asof); w(1, " (unix seconds; -1 = census absent).</div>\n" as *u8) 1405 w(1, "<h2>Capability matrix &mdash; measured against source</h2>\n" as *u8) 1406 w(1, "<p class='legend'><span class='m'>" as *u8); mark(1, 2); w(1, " leads / measured exceed</span><span class='m'>" as *u8); mark(1, 1) 1407 w(1, " present</span><span class='m'>" as *u8); mark(1, 3); w(1, " partial</span><span class='m'>" as *u8); mark(1, 0) 1408 w(1, " absent</span> &middot; click any capability for its evidence</p>\n" as *u8) 1409 w(1, "<div class='fbar'><input id='q' type='search' placeholder='Search capabilities, organs, symbols...' aria-label='Search capabilities'>" as *u8) 1410 w(1, "<button class='fchip on' data-f='all'>All</button><button class='fchip' data-f='me'>Measured</button><button class='fchip' data-f='ex'>Exceeds</button><button class='fchip' data-f='wa'>Watching</button><button class='fchip' data-f='dk'>Dark</button><button class='fchip' data-f='pa'>Partial</button><button class='fchip' data-f='ab'>Open</button><span class='cnt' id='cnt'></span></div>\n" as *u8) 1411 w(1, "<div class='table-scroll' role='region' aria-label='Capability comparison' tabindex='0'><table><thead><tr><th>Capability</th><th class='ni'>Nishi</th>" as *u8) 1412 var ci: i64 = 0 1413 while ci < ncol { w(1, "<th>" as *u8); w(1, cf[ci] as *u8); w(1, "</th>" as *u8); ci = ci + 1 } 1414 w(1, "</tr></thead><tbody>\n" as *u8) 1415 let pg: *u8 = sys_mmap(32) 1416 pg[0] = 0 as u8 1417 var rr: i64 = 0 1418 while rr < rown { 1419 let lab: *u8 = rf[rr*SWC_ROW_STRIDE + 0] as *u8 1420 // group = label prefix before ':' within the first 14 chars -> section header on change 1421 var g: i64 = 0 1422 var gi2: i64 = 0 1423 var gstop: i64 = 0 1424 while gstop == 0 { 1425 if gi2 >= 14 { gstop = 1 } else { 1426 let lc: i64 = lab[gi2] as i64 1427 if lc == 0 { gstop = 1 } else { if lc == 58 { g = gi2; gstop = 1 } else { gi2 = gi2 + 1 } } 1428 } 1429 } 1430 var nameoff: i64 = 0 1431 if g > 0 { 1432 var same: i64 = 1 1433 var gk: i64 = 0 1434 var gks: i64 = 0 1435 while gks == 0 { if gk >= g { gks = 1 } else { if pg[gk] != lab[gk] { same = 0; gks = 1 } else { gk = gk + 1 } } } 1436 if same == 1 { let pgt: i64 = pg[g] as i64; if pgt != 0 { same = 0 } } 1437 if same == 0 { 1438 w(1, "<tr class='grp'><td colspan='" as *u8); wn(1, ncol + 2); w(1, "'>" as *u8) 1439 var gc: i64 = 0 1440 while gc < g { wc(1, lab[gc] as i64); gc = gc + 1 } 1441 w(1, "</td></tr>\n" as *u8) 1442 gc = 0 1443 while gc < g { pg[gc] = lab[gc]; gc = gc + 1 } 1444 pg[g] = 0 as u8 1445 } 1446 nameoff = g + 1 1447 let sp2: i64 = lab[nameoff] as i64 1448 if sp2 == 32 { nameoff = nameoff + 1 } 1449 } 1450 let rsym: *u8 = rf[rr*SWC_ROW_STRIDE + 2] as *u8 1451 let rorg: *u8 = rf[rr*SWC_ROW_STRIDE + 1] as *u8 1452 // an UNLANDED watch row: the contract is named and still open. A LANDED one has already had 1453 // its symbol normalised past the prefix upstream, so it reads as an ordinary measured row. 1454 var iswatch: i64 = 0 1455 if starts(rsym, "_ABSENT_:" as *u8) == 1 { iswatch = 1 } 1456 w(1, "<tr class='cx' data-s='" as *u8) 1457 if rnishi[rr] == 2 { w(1, "ex" as *u8) } else { 1458 if rnishi[rr] == 1 { w(1, "me" as *u8) } else { 1459 if iswatch == 1 { if rdark[rr] == 1 { w(1, "dk" as *u8) } else { w(1, "wa" as *u8) } } else { w(1, "ab" as *u8) } } } 1460 w(1, "' data-a='" as *u8) 1461 if radopt[rr] == CLB_FULL { w(1, "full" as *u8) } else { if radopt[rr] == CLB_PARTIAL { w(1, "partial" as *u8) } else { w(1, "na" as *u8) } } 1462 w(1, "' data-t='" as *u8); wlow(1, lab); wc(1, 32); wlow(1, rorg); wc(1, 32); wlow(1, rsym); wc(1, 32); wlow(1, rtok[rr] as *u8); w(1, "'>" as *u8) 1463 w(1, "<td><details><summary>" as *u8); w(1, (lab as i64 + nameoff) as *u8); w(1, "</summary><span class='ev'>" as *u8) 1464 // EVIDENCE, DERIVED -- never prose typed by a seat: what was measured, in which organ, by which rule. 1465 if rnishi[rr] == 2 { 1466 w(1, "Measured exceed: <code>" as *u8); w(1, rsym); w(1, "</code> in <code>" as *u8); w(1, rorg); w(1, "</code>, verified at emit. " as *u8) 1467 } else { 1468 if rnishi[rr] == 1 { 1469 w(1, "Measured: <code>" as *u8); w(1, rsym); w(1, "</code> exists in <code>" as *u8); w(1, rorg); w(1, "</code>, verified at emit. " as *u8) 1470 } else { 1471 if iswatch == 1 { 1472 if rdark[rr] == 1 { 1473 w(1, "DARK &mdash; <code>" as *u8); w(1, rorg); w(1, "</code> EXISTS but does not declare <code>" as *u8); w(1, (rsym as i64 + 9) as *u8) 1474 w(1, "</code>: something shipped at this path under another name, and this mark would read open forever. Repoint the contract to the real entry point (the plan rung AND this row) or rename the function; the flip follows on the next beat, and the <code>comparewatch-</code> plane row reads DARK until then. " as *u8) 1475 } else { 1476 w(1, "Open &mdash; watching <code>" as *u8); w(1, rorg); w(1, "</code> : <code>" as *u8); w(1, (rsym as i64 + 9) as *u8) 1477 w(1, "</code>, re-measured on every compare beat. Ship that symbol and this mark flips itself; the <code>comparewatch-</code> plane row flips with it. " as *u8) 1478 } 1479 } else { 1480 w(1, "Open &mdash; no implementing organ is measured for this axis yet. " as *u8) 1481 } } } 1482 wnote(1, rf[rr*SWC_ROW_STRIDE + 4 + ncol] as *u8) 1483 // RIVAL-CLAIM PROVENANCE (2026-09-05): a row that grades a rival with no reference mark says so in its own evidence 1484 let rvc: i64 = rv_class(rf[rr*SWC_ROW_STRIDE + 4 + ncol] as *u8, rf, rr, SWC_ROW_STRIDE, ncol) 1485 if rvc == RV_UNCITED { w(1, " <span class='watch con'>rival marks uncited &mdash; the Yes, Best or Part codes on this row are an observation read with no reference mark behind them</span>" as *u8) } 1486 // CE2: the ladder state, in the evidence for every measured row 1487 if radopt[rr] != CLB_NA { 1488 w(1, " <b>Adoption:</b> <code>" as *u8); w(1, rtok[rr] as *u8); w(1, "</code>" as *u8) 1489 if radopt[rr] == CLB_FULL { w(1, " &mdash; fully adopted (top of its ladder)." as *u8) } else { w(1, " &mdash; PARTIAL: " as *u8); w(1, rrem[rr] as *u8); w(1, "." as *u8) } 1490 } 1491 w(1, "</span></details>" as *u8) 1492 if iswatch == 1 { w(1, "<span class='watch'>watching <b>" as *u8); w(1, (rsym as i64 + 9) as *u8); w(1, "</b></span>" as *u8) } 1493 if radopt[rr] == CLB_PARTIAL { w(1, "<span class='watch con' title='" as *u8); w(1, rtok[rr] as *u8); w(1, "'>not adopted: " as *u8); w(1, rrem[rr] as *u8); w(1, "</span>" as *u8) } 1494 pc_strip(1, rnishi[rr], rexceed[rr], iswatch, radopt[rr], rrem[rr] as *u8, cf, ncol, rf, rr) 1495 w(1, "</td>" as *u8) 1496 mark_td(1, "Nishi" as *u8, rnishi[rr], 1) 1497 var cj: i64 = 0 1498 while cj < ncol { 1499 let cn2: *u8 = cf[cj] as *u8 1500 mark_td(1, cn2, atoi(rf[rr*SWC_ROW_STRIDE + 4 + cj] as *u8), 0) 1501 cj = cj + 1 1502 } 1503 w(1, "</tr>\n" as *u8) 1504 rr = rr + 1 1505 } 1506 w(1, "</tbody></table></div>\n" as *u8) 1507 // RIVAL-CLAIM PROVENANCE (2026-09-05): the page's own count of rival claims and how many carry a reference mark 1508 w(1, "<div class='meth' id='rivalprov'><b>Rival-claim provenance.</b> Every Yes, Best or Part mark in a rival column is a claim about someone else's product. rows with rival marks " as *u8); wn(1, rv_rows) 1509 w(1, " &middot; cited " as *u8); wn(1, rv_cited); w(1, " &middot; uncited " as *u8); wn(1, rv_uncited) 1510 w(1, ". A cited row carries a reference mark that resolves to a pinned mirror (the refs gate measures that); an uncited row is an observation read and is badged in its evidence until a reference lands. The badge is the receipt, never the proof: a mark proves a mirror exists, not that the mirror supports the code.</div>\n" as *u8) 1511 if haveplan == 1 { 1512 plan_pass(planpath, planbuf, K_MAGIC_20479, 3) 1513 w(1, "<div class='meth'><b>On these two registers.</b> Rows are declared in the domain's plan file and carry the <b>debt id</b>, which is the join key back to the sovereign debt plane &mdash; that plane, not this page, is the authority on state. Reconciling them automatically (the regen reading the plane and refreshing these rows) is a named, owed rung; until it lands, treat an id here as a pointer to look up, not a status to trust.</div>\n" as *u8) 1514 } 1515 // THE SOTA FIELD (2026-09-02): the grade grid with measured bindings, one pass, only when a .sota exists 1516 if have_sota == 1 { sl_html(sst, domain, 1) } 1517 // rendered evidence: only when knowledge/compare/<domain>.gallery exists (publish-then-link, gal_pass) 1518 gal_pass(galpath, planbuf, K_MAGIC_20479, 1, domain) 1519 // evidence affordance: only when knowledge/compare/<domain>.gates exists (this domain has executable proofs) 1520 let gpath: *u8 = sys_mmap(256) 1521 var go: i64 = 0 1522 let gp1: *u8 = "knowledge/compare/" 1523 var gi: i64 = 0 1524 while gp1[gi] != (0 as u8) { gpath[go] = gp1[gi]; go = go + 1; gi = gi + 1 } 1525 var gd: i64 = 0 1526 while domain[gd] != (0 as u8) { gpath[go] = domain[gd]; go = go + 1; gd = gd + 1 } 1527 let gp2: *u8 = ".gates" 1528 var gj: i64 = 0 1529 while gp2[gj] != (0 as u8) { gpath[go] = gp2[gj]; go = go + 1; gj = gj + 1 } 1530 gpath[go] = 0 as u8 1531 let gfd: i64 = sys_openat_rd(gpath) 1532 if gfd >= 0 { 1533 sys_close(gfd) 1534 w(1, "<div class='meth' style='border-left:4px solid var(--y)'><b>Evidence for every claim.</b> This is not an opinion matrix: each capability we mark present is <b>grounded in real source</b> and proven by a <b>live-forked gate</b>. See the autonomously-generated <a href='/compare/" as *u8); w(1, domain); w(1, "/evidence'><b>evidence page &rarr;</b></a> (per-axis source lines + executed self-test verdicts) or the machine-readable <a href='/compare/" as *u8); w(1, domain); w(1, "/evidence.json'>evidence.json</a>.</div>\n" as *u8) 1535 } 1536 if (verdict as i64) != 0 { 1537 w(1, "<div class='verdict'><b>Honest verdict.</b> " as *u8); wnote(1, verdict); w(1, "</div>\n" as *u8) 1538 } else { 1539 w(1, "<div class='verdict'><b>Honest verdict.</b> The coverage above is capability <b>presence measured against source</b> &mdash; not depth, scale, or polish, where mature rivals may lead. Exceeds are claimed only where a mechanism backs them. Every open gap is a <b>watch contract</b>: it names the organ and symbol that closes it, and this page flips the cell itself when that workstream ships.</div>\n" as *u8) 1540 } 1541 // the paper ends with its references; a domain without a .refs file emits byte-identically here 1542 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): rendered by the base for both generators; absent file = no section 1543 bench_pass(domain, 1, 1) 1544 ppp_pass(domain, 1, 1) 1545 // MINED INTELLIGENCE (intelmine IM3, 2026-09-05): <dom>.proposed rows from nx_intelmine_propose, rendered by the base for both generators; absent file = no section 1546 prop_pass(domain, 1, 1) 1547 // THE DISCOVERED FIELD (fieldwatch FW1, 2026-09-05): <dom>.field rendered by the base for both generators, with this matrix's @cols measured as a subset of it; absent file = no section 1548 field_pass(domain, 1, 1, cf, ncol) 1549 // GAUGE HEARTBEATS (codeeffectiveness CE9, 2026-09-06): <dom>.gauge rendered by the base for both generators; a stale gauge reads STALE, never zero; absent file = no section 1550 gauge_pass(domain, 1, 1) 1551 gaps_pass(domain, 1, 1) 1552 refs_pass(refspath, planbuf, K_MAGIC_20479, 1, domain, RP_HDR) 1553 w(1, "<p class='foot'>generated by nx_swcompare_matrix (sovereign NishiLang organ) from knowledge/compare/" as *u8); w(1, domain); w(1, ".matrix &middot; every Nishi cell verified against organ source at emit time &middot; watch cells re-measured on every compare beat &middot; zero JS, zero trackers</p>\n" as *u8) 1554 // PRESENTATION SHIM ONLY (the JS-interop law): theme selection + row filtering. No comparison 1555 // logic lives here -- every mark was decided by the organ before a byte of this page was written. 1556 w(1, "<script>\n" as *u8) 1557 w(1, "var tc=[].slice.call(document.querySelectorAll('.tchip'));function sett(n){document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('nx-theme',n)}catch(e){}for(var i=0;i<tc.length;i=i+1){if(tc[i].getAttribute('data-th')===n){tc[i].className='tchip on'}else{tc[i].className='tchip'}}}\n" as *u8) 1558 w(1, "for(var j=0;j<tc.length;j=j+1){tc[j].addEventListener('click',(function(c){return function(){sett(c.getAttribute('data-th'))}})(tc[j]))}\n" as *u8) 1559 w(1, "(function(){var t;try{t=localStorage.getItem('nx-theme')}catch(e){}if(t){for(var k=0;k<tc.length;k=k+1){if(tc[k].getAttribute('data-th')===t){tc[k].className='tchip on'}else{tc[k].className='tchip'}}}})();\n" as *u8) 1560 w(1, "var q=document.getElementById('q'),ch=[].slice.call(document.querySelectorAll('.fchip')),rows=[].slice.call(document.querySelectorAll('tr.cx')),st='all';\n" as *u8) 1561 w(1, "function ap(){if(q==null){return}var t=(q.value||'').toLowerCase(),n=0;rows.forEach(function(r){var s=r.getAttribute('data-s'),m=(st==='all')||(s===st)||((st==='pa')&&(r.getAttribute('data-a')==='partial')),h=(t==='')||((r.getAttribute('data-t')+' '+r.textContent.toLowerCase()).indexOf(t)>=0),ok=m&&h;r.style.display=ok?'':'none';if(ok){n=n+1}});[].slice.call(document.querySelectorAll('.galf,.galmiss')).forEach(function(g){var gh=(t==='')||((g.getAttribute('data-t')||'').indexOf(t)>=0);g.style.display=gh?'':'none'});\n" as *u8) 1562 w(1, "[].slice.call(document.querySelectorAll('tr.grp')).forEach(function(g){var e=g.nextElementSibling,any=false;while(e&&(e.className.indexOf('grp')<0)){if((e.className.indexOf('cx')>=0)&&(e.style.display.indexOf('none')<0)){any=true;e=null}else{e=e.nextElementSibling}}g.style.display=any?'':'none'});\n" as *u8) 1563 w(1, "var c=document.getElementById('cnt');if(c){c.textContent=n+' / '+rows.length+' axes'}}\n" as *u8) 1564 w(1, "if(q){q.addEventListener('input',ap);for(var z=0;z<ch.length;z=z+1){ch[z].addEventListener('click',(function(b){return function(){for(var y=0;y<ch.length;y=y+1){ch[y].className='fchip'}b.className='fchip on';st=b.getAttribute('data-f');ap()}})(ch[z]))}ap()}\n" as *u8) 1565 w(1, "</script>\n" as *u8) 1566 w(1, "</main>\n" as *u8) 1567 if ftn > 0 { w(1, ftbuf) } 1568 w(1, "</body></html>\n" as *u8) 1569 sys_exit(0); return 0 1570 } 1571 1572 w(1, "=== NX-SWCOMPARE-MATRIX domain=" as *u8); w(1, domain); w(1, " -- Nishi MEASURED vs 4 competitors ===\n" as *u8) 1573 w(1, " title=" as *u8); w(1, title); w(1, " rows=" as *u8); wn(1, rown); w(1, " cols=" as *u8); wn(1, ncol); w(1, "\n" as *u8) 1574 var rc: i64 = 0 1575 while rc < rown { con_row(rf[rc*SWC_ROW_STRIDE + 0] as *u8, rnishi[rc]); rc = rc + 1 } 1576 w(1, " TALLY: EXCEEDS=" as *u8); wn(1, exceeds_c); w(1, " PRESENT=" as *u8); wn(1, present_c); w(1, " ABSENT=" as *u8); wn(1, absent_c); w(1, " coverage=" as *u8); wn(1, coverage); w(1, "/1000\n" as *u8) 1577 // CE2: the adoption partition of the measured rows, with every partial state named (a count without a worklist is not actionable) 1578 w(1, " ADOPTION: FULL=" as *u8); wn(1, adopt_full); w(1, " PARTIAL=" as *u8); wn(1, adopt_partial); w(1, " of measured=" as *u8); wn(1, present_c + exceeds_c) 1579 w(1, " importers_asof=" as *u8); wn(1, imp_asof); w(1, " gateadjudicate_asof=" as *u8); wn(1, ga_asof) 1580 w(1, " rule_substring_only=" as *u8); wn(1, rule_subonly); w(1, " dark_contracts=" as *u8); wn(1, dark_c); w(1, "\n" as *u8) 1581 // EC10: the histogram, its partition ASSERTED against the tally it must sum to -- a partition is a claim 1582 w(1, " ADOPT-CLASSES:" as *u8) 1583 var mxh_p: i64 = 0 1584 var mxh_sum: i64 = 0 1585 while mxh_p < mxh_n { 1586 w(1, " " as *u8); sys_write(1, mxh_tok[mxh_p] as *u8, mx_tokclass_len(mxh_tok[mxh_p] as *u8)); w(1, "=" as *u8); wn(1, mxh_cnt[mxh_p]) 1587 mxh_sum = mxh_sum + mxh_cnt[mxh_p] 1588 mxh_p = mxh_p + 1 1589 } 1590 w(1, " sum=" as *u8); wn(1, mxh_sum + mxh_ovf); w(1, " of=" as *u8); wn(1, adopt_full + adopt_partial); w(1, " overflow=" as *u8); wn(1, mxh_ovf); w(1, "\n" as *u8) 1591 var rp: i64 = 0 1592 while rp < rown { if radopt[rp] == CLB_PARTIAL { w(1, " PARTIAL " as *u8); w(1, rf[rp*SWC_ROW_STRIDE + 1] as *u8); w(1, " " as *u8); w(1, rtok[rp] as *u8); w(1, " -- " as *u8); w(1, rrem[rp] as *u8); w(1, "\n" as *u8) } rp = rp + 1 } 1593 1594 let liar_corpus: i64 = (rown >= 8) as i64 1595 let liar_neg: i64 = (neg == 0) as i64 1596 // WIDENED, NOT REMOVED (2026-09-05): this is a SIZE floor -- did the board MEASURE enough rows to be a comparison -- 1597 // and an EXCEEDS row is a measured-present row carrying a stronger claim; the ADOPTION denominator above already 1598 // counts present_c + exceeds_c as measured. Counting PRESENT alone refused /compare/observability (13 EXCEEDS, 1599 // 3 PRESENT, 800/1000 coverage) for being too STRONG on every regen, while exceeds<=flags already guards the 1600 // over-claim direction. The printed label names what is counted. 1601 let liar_present: i64 = (present_c + exceeds_c >= 5) as i64 1602 let liar_exbound: i64 = (exceeds_c <= exflags) as i64 1603 // ★WIDENED, NOT REMOVED. The check exists so a domain cannot quietly drop or invent competitor columns; 1604 // pinning it to exactly 4 also forbade comparing against a RESEARCH bar alongside the product field. 1605 // A floor of 4 keeps the original guarantee (no domain thins its field) while allowing a fifth column. 1606 let liar_cols: i64 = (ncol >= 4) as i64 1607 w(1, " LIAR-KILL: rows>=8=" as *u8); wn(1, liar_corpus); w(1, " neg-control-zero=" as *u8); wn(1, liar_neg) 1608 w(1, " measured>=5=" as *u8); wn(1, liar_present); w(1, " exceeds<=flags=" as *u8); wn(1, liar_exbound); w(1, " cols>=4=" as *u8); wn(1, liar_cols); w(1, "\n" as *u8) 1609 // THE FIELD CENSUS (2026-09-02): the sota liar-kill prints its own lines and its verdict folds in here; a 1610 // sota-only domain (no .matrix) is judged by the field alone -- the matrix floors cannot apply to zero rows. 1611 var sota_ok: i64 = 1 1612 if have_sota == 1 { sota_ok = sl_census(sst, domain, 1) } 1613 var ok: i64 = liar_corpus & liar_neg & liar_present & liar_exbound & liar_cols 1614 // A SOTA-BEARING DOMAIN IS JUDGED BY THE FIELD'S OWN LIAR-KILL (2026-09-02, measured on the first unified regen): 1615 // its .matrix is a WATCH REGISTER (foodscience 9 rows / 3 present, water 8 / 3, livingdocs 7 / 2), not the 1616 // comparison, so the matrix size floors (rows>=8, present>=5, cols>=4) refused five domains that the field pass 1617 // had just judged MEASURED-HONEST and their previous pages were kept. The INTEGRITY teeth stay on every domain 1618 // (the neg-control must be zero, exceeds may not exceed their flags); only the SIZE floors move to the field. 1619 if have_sota == 1 { ok = liar_neg & liar_exbound } 1620 if have_matrix == 0 { ok = 1 } 1621 ok = ok & sota_ok 1622 w(1, "NX-SWCOMPARE-MATRIX domain=" as *u8); w(1, domain); w(1, " coverage=" as *u8); wn(1, coverage); w(1, "/1000 verdict=" as *u8) 1623 if ok == 1 { w(1, "MEASURED-HONEST (liar-killed)\n" as *u8); sys_exit(0); return 0 } 1624 // NAME THE FAILING CONJUNCT (2026-09-02): a compound assertion that will not name which part failed sends every 1625 // reader at the alarming third -- regen #7 refused five thin domains and the line said only "a check failed". 1626 w(1, "RED (a check failed:" as *u8) 1627 if liar_corpus == 0 { w(1, " rows<8" as *u8) } 1628 if liar_neg == 0 { w(1, " neg-control-nonzero" as *u8) } 1629 if liar_present == 0 { w(1, " measured<5" as *u8) } 1630 if liar_exbound == 0 { w(1, " exceeds>flags" as *u8) } 1631 if liar_cols == 0 { w(1, " cols<4" as *u8) } 1632 if sota_ok == 0 { w(1, " sota-field" as *u8) } 1633 w(1, " -- the previous page stays published)\n" as *u8); sys_exit(1); return 1 1634}