code wiki / (root) / nx_swcompare_preview_matrix_t56.nx

nx_swcompare_preview_matrix_t56.nx source

↩ module page · 1647 lines · 132755 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_swcompare_preview_lib_t56.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_preview_sota_t56.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 = "<h3 id='refs'>References</h3>\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 if sc_preview_projection==1 {plen[0]=0;return -2} 286 let av: *i64 = sys_mmap(GAL_PROBE_AV * 8) as *i64 287 var an: i64 = 0 288 var ps: i64 = 0 289 while probe[ps] != (0 as u8) { 290 if an >= GAL_PROBE_AV - 2 { break } 291 av[an] = (probe as i64) + ps 292 an = an + 1 293 while probe[ps] != (0 as u8) { if probe[ps] == (32 as u8) { break } ps = ps + 1 } 294 if probe[ps] == (32 as u8) { probe[ps] = 0 as u8; ps = ps + 1 } 295 } 296 let fpath: *u8 = sys_mmap(700) 297 var fo: i64 = scopy(fpath, 0, "../sites/nishifamily/compare/" as *u8) 298 fo = scopy(fpath, fo, dom); fo = scopy(fpath, fo, "/" as *u8); fo = scopy(fpath, fo, file) 299 fpath[fo] = 0 as u8 300 av[an] = fpath as i64 301 an = an + 1 302 av[an] = 0 303 return tr_run_capture(av[0] as *u8, av, pbuf, GAL_PROBE_CAP, plen) 304} 305// ---- EVIDENCE MEDIA KINDS (2026-09-02, operator: "real reproducible evidence that's human evaluatable ... 306// visuals to click open (in case some are nsfw) ... images or video or text or gif or audio"). A .gallery row's 307// first field was the literal `img`; it is now a KIND with an optional gate prefix: 308// img | gif | video | audio | text inline media (gif is an img), each probed on disk at emit 309// nsfw:<kind> GATED: nothing is rendered inline -- the reader clicks to open 310// The four evidence facts every row already carries (the artifact path, its caption, the producing organ, the 311// bytes on disk at emit, and the optional probe re-run at emit) are what make the evidence REPRODUCIBLE; the 312// gate only changes whether the media is shown before a click. A kind this table does not know is REFUSED 313// by name (the row is skipped and announced), never guessed into an <img>. 314const GAL_KIND_IMG: i64 = 1 315const GAL_KIND_VIDEO: i64 = 2 316const GAL_KIND_AUDIO: i64 = 3 317const GAL_KIND_TEXT: i64 = 4 318const GAL_TEXT_PREVIEW: i64 = 2048 // bytes of a text artifact shown inline; the whole file stays one click away 319const GAL_NSFW_PREFIX: *u8 = "nsfw:" as *u8 320func gal_kind_code(k: *u8) -> i64 { 321 if streq(k, "img" as *u8) == 1 { return GAL_KIND_IMG } 322 if streq(k, "gif" as *u8) == 1 { return GAL_KIND_IMG } 323 if streq(k, "video" as *u8) == 1 { return GAL_KIND_VIDEO } 324 if streq(k, "audio" as *u8) == 1 { return GAL_KIND_AUDIO } 325 if streq(k, "text" as *u8) == 1 { return GAL_KIND_TEXT } 326 return 0 327} 328func gal_kind_name(c: i64) -> *u8 { 329 if c == GAL_KIND_IMG { return "image" as *u8 } 330 if c == GAL_KIND_VIDEO { return "video" as *u8 } 331 if c == GAL_KIND_AUDIO { return "audio" as *u8 } 332 if c == GAL_KIND_TEXT { return "text" as *u8 } 333 return "unknown" as *u8 334} 335// attribute-safe write: the src of a video/audio/text link is built from DATA (domain + file name), and a 336// quote inside it would end the attribute -- the same hole ia_img_emit closed for img alt on 2026-08-26. 337func gal_attr(fd: i64, s: *u8) -> i64 { 338 var i: i64 = 0 339 while s[i] != (0 as u8) { 340 let c: i64 = s[i] as i64 341 if c == 39 { w(fd, "&#39;" as *u8) } else { if c == 34 { w(fd, "&quot;" as *u8) } else { 342 if c == 60 { w(fd, "&lt;" as *u8) } else { if c == 62 { w(fd, "&gt;" as *u8) } else { 343 if c == 38 { w(fd, "&amp;" as *u8) } else { wc(fd, c) } } } } } 344 i = i + 1 345 } 346 return 0 347} 348// the first GAL_TEXT_PREVIEW bytes of a text artifact, escaped; announces when the file is longer 349func gal_text_preview(fd: i64, dom: *u8, file: *u8) -> i64 { 350 let p: *u8 = sys_mmap(700) 351 var o: i64 = scopy(p, 0, "../sites/nishifamily/compare/" as *u8) 352 o = scopy(p, o, dom); o = scopy(p, o, "/" as *u8); o = scopy(p, o, file); p[o] = 0 as u8 353 let ln: *i64 = sys_mmap(16) as *i64 354 let b: *u8 = sys_read_file(p, ln) 355 if (b as i64) == 0 { w(fd, "(unreadable at emit)" as *u8); return 0 } 356 let sz: i64 = ln[0] 357 var show: i64 = sz 358 if show > GAL_TEXT_PREVIEW { show = GAL_TEXT_PREVIEW } 359 wesc(fd, b, show) 360 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) } 361 sys_free_file(b, sz) 362 return 0 363} 364// The extra attributes on a gallery img are the GENERATOR'S OWN markup, never data, so they are 365// passed to ia_img_emit as literal bytes and deliberately not escaped. 366const GAL_IMG_EXTRA: *u8 = "loading='lazy'" as *u8 367 368// figcaption and the producer note are TEXT, not attribute values. The two contexts have different 369// rules -- escaping a quote in text puts a visible entity on the page -- so this routes through the 370// TEXT half of the one escaper rather than reusing the attribute half. Sized from the string itself, 371// so there is no ceiling here to guess and none to truncate. 372func gal_text(fd: i64, s: *u8) -> i64 { 373 let need: i64 = ia_slen(s) * IA_MAX_EXPANSION + IA_SEP_AND_NUL 374 let b: *u8 = sys_mmap(need) 375 let tr: *i64 = sys_mmap(IA_SLOT_BYTES) as *i64 376 ia_esc_text(b, 0, s, need, tr) 377 w(fd, b) 378 return 0 379} 380 381func gal_html(fld: *i64, count: i64, dom: *u8, probe: *u8, kind: i64, gated: i64) -> i64 { return gal_html_heading(fld, count, dom, probe, kind, gated, 2) } 382func gal_html_heading(fld: *i64, count: i64, dom: *u8, probe: *u8, kind: i64, gated: i64, heading_level: i64) -> i64 { 383 if count == 0 { 384 sc_heading_open(1, heading_level, " id='renders'" as *u8); w(1, "Rendered evidence" as *u8); sc_heading_close(1, heading_level); w(1, "\n" as *u8) 385 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) 386 } 387 if kind == 0 { 388 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> 389" as *u8) 390 return 0 391 } 392 let sz: i64 = gp_probe(dom, fld[1] as *u8) 393 if sz >= 0 { 394 // src MUST be site-absolute: the page serves at an extensionless URL with NO trailing slash 395 // (/compare/<dom>), so a relative src resolves against /compare/ and 404s -- the hand pages 396 // used absolute paths for exactly this reason. ../.. rows normalize client-side (/world/...). 397 // THE TAG IS BUILT BY nx_imgattr_lib, NOT CONCATENATED HERE (2026-08-26). The caption is DATA, 398 // and a row live on /compare/koikatsu carries an apostrophe: written raw into a single-quoted 399 // attribute it ended alt at the two words -The card- and turned the rest of the sentence into 400 // attribute names, so the accessible name of that image was two words and loading='lazy' was 401 // consumed with it. ia_img_emit escapes both quote characters whatever delimiter is used and 402 // REFUSES to write a tag with no usable alt, so this call site cannot re-open the hole. 403 let srcneed: i64 = ia_slen("/compare/" as *u8) + ia_slen(dom) + ia_slen(fld[1] as *u8) + IA_SEP_AND_NUL 404 let gsrc: *u8 = sys_mmap(srcneed) 405 var gso: i64 = scopy(gsrc, 0, "/compare/" as *u8) 406 gso = scopy(gsrc, gso, dom); gso = scopy(gsrc, gso, "/" as *u8); gso = scopy(gsrc, gso, fld[1] as *u8) 407 gsrc[gso] = 0 as u8 408 let altcap: i64 = ia_alt_cap_for(fld[2] as *u8, fld[1] as *u8) 409 let galt: *u8 = sys_mmap(altcap) 410 ia_alt_derive(fld[2] as *u8, fld[1] as *u8, galt, altcap) 411 let tagcap: i64 = ia_img_cap_for(gsrc, galt, GAL_IMG_EXTRA) 412 let gtag: *u8 = sys_mmap(tagcap) 413 let gtw: i64 = ia_img_emit(gtag, 0, tagcap, gsrc, galt, GAL_IMG_EXTRA) 414 w(1, "<figure class='galf' data-t='" as *u8); wlow(1, fld[2] as *u8); wc(1, 32); wlow(1, fld[3] as *u8) 415 w(1, "' data-kind='" as *u8); w(1, gal_kind_name(kind)); w(1, "'>" as *u8) 416 // GATED EVIDENCE: nothing is rendered before the click. The summary names the kind and the size so a 417 // reader decides with the facts; the media inside is exactly what an ungated row would have shown. 418 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) } 419 if kind == GAL_KIND_IMG { 420 if gtw > 0 { w(1, gtag) } 421 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) } 422 } 423 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) } 424 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) } 425 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) } 426 if gated == 1 { w(1, "</details>" as *u8) } 427 w(1, "<figcaption>" as *u8); gal_text(1, fld[2] as *u8) 428 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) 429 if (probe as i64) != 0 { 430 let pbuf: *u8 = sys_mmap(GAL_PROBE_CAP) 431 let plen: *i64 = sys_mmap(16) as *i64 432 let prc: i64 = gal_probe_run(probe, dom, fld[1] as *u8, pbuf, plen) 433 w(1, "<details class='galprobe'><summary>probe evidence</summary><pre>" as *u8) 434 if prc == -2 {w(1,"Not run: preview projects retained evidence without executing producer probes." as *u8)} else { 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) } } 435 if plen[0] >= GAL_PROBE_CAP { w(1, "[probe output filled its reserve -- view truncated, announced]" as *u8) } 436 w(1, "</pre></details>" as *u8) 437 } 438 w(1, "</figure>\n" as *u8) 439 } else { 440 w(1, "<div class='galmiss' data-t='" as *u8); wlow(1, fld[2] as *u8); wc(1, 32); wlow(1, fld[3] as *u8) 441 w(1, "'>absent from the docroot at emit: <code>" as *u8); gal_text(1, fld[1] as *u8) 442 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) 443 } 444 return 0 445} 446func gal_json(fld: *i64, count: i64, dom: *u8, probe: *u8, kind: i64, gated: i64) -> i64 { 447 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) } 448 wc(1, 123) 449 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 } 450 kv_s(1, "kind" as *u8, gal_kind_name(kind)); wc(1, 44) 451 kv_n(1, "gated" as *u8, gated); wc(1, 44) 452 kv_s(1, "file" as *u8, fld[1] as *u8); wc(1, 44) 453 kv_s(1, "caption" as *u8, fld[2] as *u8); wc(1, 44) 454 kv_s(1, "producer" as *u8, fld[3] as *u8); wc(1, 44) 455 kv_n(1, "bytes" as *u8, gp_probe(dom, fld[1] as *u8)) 456 if (probe as i64) != 0 { 457 let pbuf: *u8 = sys_mmap(GAL_PROBE_CAP) 458 let plen: *i64 = sys_mmap(16) as *i64 459 let prc: i64 = gal_probe_run(probe, dom, fld[1] as *u8, pbuf, plen) 460 wc(1, 44); kv_n(1, "probe_rc" as *u8, prc) 461 var pn: i64 = plen[0] 462 if pn >= GAL_PROBE_CAP { pn = GAL_PROBE_CAP - 1 } 463 pbuf[pn] = 0 as u8 464 wc(1, 44); kv_s(1, "probe_output" as *u8, pbuf) 465 } 466 wc(1, 125) 467 return 0 468} 469func gal_pass(path: *u8, buf: *u8, cap: i64, mode: i64, dom: *u8) -> i64 { return gal_pass_heading(path, buf, cap, mode, dom, 2) } 470func gal_pass_heading(path: *u8, buf: *u8, cap: i64, mode: i64, dom: *u8, heading_level: i64) -> i64 { 471 let n: i64 = c_read(path, buf, cap) 472 if n <= 0 { return 0 } 473 buf[n] = 0 as u8 474 let fld: *i64 = sys_mmap(200) as *i64 475 var count: i64 = 0 476 var p: i64 = 0 477 while p < n { 478 var e: i64 = p 479 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 480 buf[e] = 0 as u8 481 let line: *u8 = (buf as i64 + p) as *u8 482 p = e + 1 483 var skip: i64 = 0 484 if line[0] == (0 as u8) { skip = 1 } 485 if line[0] == (35 as u8) { skip = 1 } 486 if skip == 0 { 487 let nf: i64 = splitpipe(line, fld, 8) 488 var ktok: *u8 = fld[0] as *u8 489 var gated: i64 = 0 490 if starts(ktok, GAL_NSFW_PREFIX) == 1 { gated = 1; ktok = (ktok as i64 + 5) as *u8 } 491 let kind: i64 = gal_kind_code(ktok) 492 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) } } } 493 if nf >= 4 { 494 var probe: *u8 = 0 as *u8 495 if nf >= 5 { probe = fld[4] as *u8 } 496 if mode == 1 { gal_html_heading(fld, count, dom, probe, kind, gated, heading_level) } 497 if mode == 2 { gal_json(fld, count, dom, probe, kind, gated) } 498 count = count + 1 499 } 500 } 501 } 502 if count > 0 { if mode == 1 { w(1, "</div>\n" as *u8) } else { if mode == 2 { wc(1, 93) } } } 503 return count 504} 505// plan_pass, dstate and wlow LIFTED to nx_swcompare_lib.nx 2026-08-22 (rung DG5). They lived HERE, which 506// is why a domain rendered by the SOTA generator had its .plan admitted as data and then NEVER DRAWN -- 507// the tool plane's own build order was invisible on its own page. The base class owns them now and BOTH 508// generators call the one copy, so the two surfaces cannot drift into two plan dialects. The pre-lift 509// body below is the PRE-LIFT COPY and is UNREACHABLE -- nothing calls this name, and nx_cc now refuses 510// two definitions of one name outright, so it cannot shadow the base class copy either. 511// IT IS RETAINED DELIBERATELY: deleting an 85-line body by exact-match over a transport that is 503ing 512// risks corrupting the generator that emits EVERY /compare page, and removing dead code does not justify 513// that risk. Delete it on a calm transport, or via nx_oo_extract which owns removal with a byte proof. 514func plan_pass_PRELIFT_UNREACHABLE(path: *u8, buf: *u8, cap: i64, phase: i64) -> i64 { 515 let n: i64 = c_read(path, buf, cap) 516 if n <= 0 { return 0 } 517 buf[n] = 0 as u8 518 let fld: *i64 = sys_mmap(200) as *i64 519 let dsbuf: *u8 = sys_mmap(K_MAGIC_20480) 520 var dsn: i64 = 0 521 if phase == 3 { 522 let dsp: *u8 = sys_mmap(600) 523 var dq: i64 = 0 524 while path[dq] != (0 as u8) { dsp[dq] = path[dq]; dq = dq + 1 } 525 var cut: i64 = dq 526 while cut > 0 { if dsp[cut] == (46 as u8) { break } cut = cut - 1 } 527 if cut > 0 { dq = cut } 528 dq = scopy(dsp, dq, ".debtstate" as *u8) 529 dsp[dq] = 0 as u8 530 dsn = c_read(dsp, dsbuf, K_MAGIC_20479) 531 if dsn < 0 { dsn = 0 } 532 } 533 var in_rung: i64 = 0 534 var in_ms: i64 = 0 535 var in_biz: i64 = 0 536 var p: i64 = 0 537 while p < n { 538 var e: i64 = p 539 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 540 buf[e] = 0 as u8 541 let line: *u8 = (buf as i64 + p) as *u8 542 p = e + 1 543 var skip: i64 = 0 544 if line[0] == (0 as u8) { skip = 1 } 545 if line[0] == (35 as u8) { skip = 1 } 546 if skip == 0 { 547 let nf: i64 = splitpipe(line, fld, 20) 548 let kind: *u8 = fld[0] as *u8 549 if phase == 1 { 550 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) } } 551 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) } } 552 if streq(kind, "answer" as *u8) == 1 { if nf >= 4 { 553 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) } } 554 if streq(kind, "bar" as *u8) == 1 { if nf >= 6 { 555 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) 556 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) } } 557 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) } } 558 // biz|axis|position|figures|decision -- the BUSINESS CASE row kind (investment, opportunity 559 // cost, market, competitive position, go-to-market, buy-vs-build). Rendered as one table in 560 // the executive layer; biz rows belong LAST in a plan's phase-1 block so the table closes clean. 561 if streq(kind, "biz" as *u8) == 1 { if nf >= 5 { 562 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 } 563 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) 564 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) } } 565 } 566 if phase == 3 { 567 if streq(kind, "debt" as *u8) == 1 { if nf >= 5 { 568 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 } 569 w(1, "<tr><td class='ct'>" as *u8); w(1, fld[1] as *u8) 570 // STATE COMES FROM THE PLANE, NEVER FROM THIS ROW. An id the plane does not know is a 571 // page-local note wearing the shape of a filed debt, and saying so is the honest move. 572 dstate(1, fld[1] as *u8, dsbuf, dsn) 573 w(1, "</td><td class='r'>" as *u8); w(1, fld[2] as *u8) 574 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) } } 575 if streq(kind, "risk" as *u8) == 1 { if nf >= 4 { 576 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8); in_rung = 0 } 577 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 } 578 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) 579 w(1, "</td><td>" as *u8); w(1, fld[3] as *u8); w(1, "</td></tr>\n" as *u8) } } 580 } 581 if phase == 2 { 582 if streq(kind, "rung" as *u8) == 1 { if nf >= 8 { 583 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 } 584 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) 585 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) } 586 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) 587 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) } } 588 if streq(kind, "ms" as *u8) == 1 { if nf >= 5 { 589 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8); in_rung = 0 } 590 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 } 591 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) 592 w(1, "</td><td class='r'>" as *u8); w(1, fld[3] as *u8); w(1, " u</td></tr>\n" as *u8) } } 593 } 594 } 595 } 596 if in_rung == 1 { w(1, "</tbody></table>\n" as *u8) } 597 if in_ms == 1 { w(1, "</tbody></table>\n" as *u8) } 598 if in_biz == 1 { w(1, "</tbody></table>\n" as *u8) } 599 return 1 600} 601// wlow LIFTED to nx_swcompare_lib.nx 2026-08-22 (DG5) -- ONE renderer in the base, both generators call 602// it. Left as a duplicate it would still COMPILE (nx_cc accepts duplicate definitions silently, debt 603// 1785447657), which is exactly how one copy gets fixed and the other does not. 604func con_row(label: *u8, ns: i64) -> i64 { 605 w(1, " [" as *u8) 606 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) } } } 607 w(1, "] " as *u8); w(1, label); w(1, "\n" as *u8); return 0 608} 609 610// ---- CE2: THE ADOPTION LADDER PER ROW (2026-08-23, operator: "fully wired fully adopted... you deploy partially constantly") ---- 611// A Nishi mark used to be ONE bit: the implementing symbol exists in a source file -- rung one of the estate's 612// seven, so a gate compiled and never promoted, an organ promoted and never registered, a library imported only 613// by its own gate, all read identically to LIVE. Every MEASURED row now also carries WHERE ON ITS LADDER the organ 614// stands. The classifier is nx_catalog_lib's clb_classify (one composition of three rulers by organ kind: 615// program = the catalogue ladder, library = importer reach minus validation importers, gate = the 616// execution-surface census), shared with nx_compare_rank so the page and the ranker cannot disagree. 617// FULL = the top of its ladder; anything short is PARTIAL and NAMED with its remedy; every census source prints 618// its own asof= stamp. The flip law still holds: presence is necessary, adoption is necessary, the gate-proven 619// done-rule is the bar. 620// RANK_ROW_CAP: the ranked-order artefact (<dom>.rank, written by nx_compare_rank) is one line per rung, so its 621// byte size is bounded by the plan that produced it; this is the read reserve, announced if it ever fills. 622const RANK_READ_CAP: i64 = 65536 623 624// ---- CE6: render knowledge/compare/<dom>.rank (nx_compare_rank's stamped order) ---- 625// rows: finish|id|title|sym|state|remedy . rank|n|stage|id|priority|v|m|c|title|sym . last line # asof=... (position-anchored) 626func rank_pass(dom: *u8, cap: i64) -> i64 { return rank_pass_heading(dom, cap, 2) } 627func rank_pass_heading(dom: *u8, cap: i64, heading_level: i64) -> i64 { 628 // its OWN buffer, sized by the declared reserve -- the plan buffer handed around here is 20 KB and a 629 // reserve larger than the buffer it fills is an overrun wearing a constant 630 let buf: *u8 = sys_mmap(cap) 631 let rp: *u8 = sys_mmap(600) 632 var o: i64 = scopy(rp, 0, "knowledge/compare/" as *u8) 633 o = scopy(rp, o, dom); o = scopy(rp, o, ".rank" as *u8); rp[o] = 0 as u8 634 let n: i64 = c_read(rp, buf, cap - 1) 635 if n <= 0 { 636 sc_heading_open(1, heading_level, "" as *u8); w(1, "Recorded ranking" as *u8); sc_heading_close(1, heading_level); w(1, "\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) 637 return 0 638 } 639 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) } 640 buf[n] = 0 as u8 641 // the stamp is the LAST line: read it before the parser NUL-splits anything 642 var ls: i64 = n - 1 643 if buf[ls] == (10 as u8) { ls = ls - 1 } 644 while ls > 0 { if buf[ls - 1] == (10 as u8) { break } ls = ls - 1 } 645 let stamp: *u8 = (buf as i64 + ls) as *u8 646 var se: i64 = ls 647 while se < n { if buf[se] == (10 as u8) { break } se = se + 1 } 648 buf[se] = 0 as u8 649 let fld: *i64 = sys_mmap(24 * 8) as *i64 650 sc_heading_open(1, heading_level, "" as *u8); w(1, "Recorded priority estimates" as *u8); sc_heading_close(1, heading_level); w(1, "\n" as *u8) 651 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: listed before new work by this heuristic. Priority is not measured delivery cost or execution readiness. Stamp: <code>" as *u8); w(1, stamp); w(1, "</code></p>\n" as *u8) 652 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) 653 var rows: i64 = 0 654 var p: i64 = 0 655 while p < ls { 656 var e: i64 = p 657 while e < ls { if buf[e] == (10 as u8) { break } e = e + 1 } 658 buf[e] = 0 as u8 659 let line: *u8 = (buf as i64 + p) as *u8 660 p = e + 1 661 if line[0] != (35 as u8) { if line[0] != (0 as u8) { 662 let nf: i64 = splitpipe(line, fld, 24) 663 let kind: *u8 = fld[0] as *u8 664 if streq(kind, "finish" as *u8) == 1 { if nf >= 6 { 665 rows = rows + 1 666 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) 667 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) 668 } } 669 if streq(kind, "rank" as *u8) == 1 { if nf >= 10 { 670 rows = rows + 1 671 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) 672 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) 673 } } 674 } } 675 } 676 w(1, "</tbody></table>\n" as *u8) 677 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) } 678 return rows 679} 680 681// ---- CE7: THE EVIDENCE PROFILE BAND -- the referee gap profile, ON THE PUBLISHED PAGE (2026-08-31) ---- 682// nx_swcompare_evidence has computed the whole gap profile of every domain since 2026-08-31 and stamps 683// it to knowledge/status/evstamp_<dom>.verdict; nx_evprofile_lib is its ONE reader and nx_pm_board 684// consumes it. MEASURED THE SAME DAY (nx_shelltool grep evstamp_ over buildroot/runtime: 18 matches, 685// 23,410 files, coverage_complete=1 corpus_complete=1): NOT ONE GENERATOR READ IT. The profile reached 686// the PM board and never reached a single published board, so every /compare page could say RED and none 687// could say WHY. A measurement the organisation is paying for and not collecting is this estate own 688// named defect, and the operator ask is that the boards gaps be visible ON /compare. This is that half. 689// 690// THE ROOT TRAP, AND WHY THIS COMPOSES evp_load RATHER THAN OPENING A PATH ITSELF. nx_compare_regen runs 691// with CWD=buildroot (proven by its own RG_PUBJRNL of ../knowledge/status/...), and buildroot/knowledge/ 692// status holds ZERO evstamp files. A BARE RELATIVE READ FROM THIS GENERATOR WOULD RESOLVE INTO AN EMPTY 693// TREE AND RENDER no-evidence FOR ALL 96 DOMAINS, CONFIDENTLY -- a wrong answer wearing the shape of a 694// complete one. evp_load composes ep_artifact_path (CWD -> ../ -> estate root, fail-closed) and REFUSES 695// when two different files answer to one name, so this band can never publish another board numbers. 696// 697// ABSTAIN, NEVER ACQUIT. A stamp written before the profile shipped carries none of these keys and 698// evp_parse leaves every slot -1. That renders as UNKNOWN with NOT ONE numeric field printed. A 699// zero-filled profile is a fabricated constant wearing the shape of a measurement, and it fails in the 700// flattering direction, which is the direction nobody audits. 701// 702// NO SCALAR GRADE IS COMPUTED, STORED OR RENDERED HERE. Every number below is a count printed with its 703// denominator, and the gap classes are SEPARATE predicates never merged into one not-honest score: 704// CLAIM-ONLY needs a gate WRITTEN and GATE-FAILING needs a gate FIXED, and one merged number sends a 705// seat at the wrong work. A bucket named for how the reader failed merges a real failure with a pass. 706import "nx_evprofile_lib.nx" 707 708// The read reserve is EVP_STAMP_CAP -- the lib that owns the wire owns its size, so there is exactly one 709// copy of that number and this band cannot drift from the reader that defines it. 710const EVB_PATH_CAP: i64 = 512 711const EVB_SECS_PER_DAY: i64 = 86400 712const EVB_SECS_PER_HOUR: i64 = 3600 713// Wide data scrolls in ITS OWN container: the page body must never scroll horizontally. 714const EVB_SCROLL_OPEN: *u8 = "<div style='overflow-x:auto'>" 715 716// One gap class, rendered only when it FIRES, and always beside the work it names. A count without a 717// worklist is not actionable, and a worklist without its reason is still one step short. 718func evb_remedy(fired: i64, name: *u8, remedy: *u8) -> i64 { 719 if fired != 1 { return 0 } 720 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) 721 return 1 722} 723 724// a count and its denominator, never one without the other 725func evb_pair(label: *u8, a: i64, b: i64) -> i64 { 726 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) 727 return 0 728} 729 730func evb_one(label: *u8, a: i64) -> i64 { 731 w(1, "<span class='sep'>|</span>" as *u8); w(1, label); w(1, " <b>" as *u8); wn(1, a); w(1, "</b>" as *u8) 732 return 0 733} 734 735// A label whose value is a WORD, not a number. It exists so an abstention can be PRINTED in the same 736// row as the counts instead of being rounded down into one: -1 means UNKNOWN in this dialect, and a 737// reader that renders UNKNOWN as 0 publishes the one wrong answer nobody would question. 738func evb_word(label: *u8, word: *u8) -> i64 { 739 w(1, "<span class='sep'>|</span>" as *u8); w(1, label); w(1, " <b>" as *u8); w(1, word); w(1, "</b>" as *u8) 740 return 0 741} 742 743// ---- NON-VACUITY, FINALLY RENDERED WHERE A HUMAN LOOKS. ---- 744// `vacuous` on this band is the WEAK word: it counts gates that printed GREEN on a ZERO denominator. 745// Clause 4 of the evidence law means something strictly stronger by non-vacuity -- "each gate has a 746// RECORDED RED observation; a gate never observed failing measures nothing" -- and THAT number has been 747// measured by ev_bite_fold, stamped as redseen= and parsed into EVP_F_REDSEEN since the bite ledger 748// shipped, while reaching only api.json. SAME WORD, TWO MEANINGS, AND THE WEAKER ONE WAS THE ONE ON THE 749// PAGE: softbody published "gates green 11/11 | gates vacuous 0" over eleven gates the ledger records as 750// never bitten. So the weak count is renamed for exactly what it counts and the strong one prints beside 751// it, as a count WITH ITS DENOMINATOR and its complement, never as a score. 752// 753// THREE STATES, BECAUSE ZERO IS NOT A SAFE DEFAULT HERE. "never bitten 0" reads as "every gate has been 754// shown able to fail" -- the flattering direction, which is the direction nobody audits. A stamp that 755// cannot answer must SAY so. 756func evb_bite(f: *i64) -> i64 { 757 let ran: i64 = f[EVP_F_RAN] 758 let red: i64 = f[EVP_F_REDSEEN] 759 // The stamp did not carry the key (a stamp older than the bite ledger, or a capped read). ABSTAIN. 760 if ran < 0 { evb_word("proven able to fail" as *u8, "UNKNOWN" as *u8); return 0 } 761 if red < 0 { evb_word("proven able to fail" as *u8, "UNKNOWN" as *u8); return 0 } 762 // No gate ran, so there is no population that could have been bitten. A 0/0 printed here would read 763 // as a clean board; the honest answer is that the question has no subject on this board yet. 764 if ran == 0 { evb_word("proven able to fail" as *u8, "n/a &mdash; no gate ran" as *u8); return 0 } 765 // redseen is folded over the SAME rows that increment ran, one call each, so red > ran cannot happen 766 // from a run of the referee. It can only come from a hand-edited stamp, and the right answer to that 767 // is a refusal -- not a negative complement dressed up as good news. 768 if red > ran { evb_word("proven able to fail" as *u8, "INCOHERENT &mdash; redseen exceeds gates run" as *u8); return 0 } 769 evb_pair("proven able to fail" as *u8, red, ran) 770 evb_one("never bitten" as *u8, ran - red) 771 return 0 772} 773 774func ev_pass(dom: *u8) -> i64 { return ev_pass_heading(dom, 2) } 775func ev_pass_heading(dom: *u8, heading_level: i64) -> i64 { 776 let buf: *u8 = sys_mmap(EVP_STAMP_CAP) 777 let pathout: *u8 = sys_mmap(EVB_PATH_CAP) 778 let flags: *i64 = sys_mmap(8 * EVP_NFLAG) as *i64 779 let n: i64 = evp_load(dom, buf, EVP_STAMP_CAP, pathout, flags) 780 781 sc_heading_open(1, heading_level, "" as *u8); w(1, "Evidence profile &mdash; what the gaps on this board actually are" as *u8); sc_heading_close(1, heading_level); w(1, "\n" as *u8) 782 783 // Two different files answering to one name is REFUSED, not silently decided. ep_open_rd probes the 784 // caller CWD first on purpose, so a stray copy beside the generator would WIN, and win silently. 785 if n == EVP_RC_AMBIGUOUS { 786 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) 787 return 0 788 } 789 if n < 0 { 790 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) 791 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) 792 return 0 793 } 794 if flags[EVP_FL_BRIM] == 1 { 795 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) 796 } 797 798 let f: *i64 = sys_mmap(8 * EVP_NF) as *i64 799 evp_parse(buf, n, f) 800 801 // The version is DERIVED FROM THE WIRE, never declared on it: a v1 stamp simply has no profile keys. 802 if f[EVP_F_V] < 2 { 803 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) 804 w(1, "</code>. Read from <code>" as *u8); w(1, pathout); w(1, "</code>.</div>\n" as *u8) 805 return 0 806 } 807 808 let rec: i64 = evp_reconciles(f) 809 let cjf: i64 = evp_conj_fail(f) 810 let now: i64 = sys_now_realtime_sec() 811 let ttl: i64 = evp_ttl_sec() 812 let stale: i64 = evp_stale(f, now, ttl) 813 var age: i64 = now - f[EVP_F_EPOCH] 814 if age < 0 { age = 0 } 815 816 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) 817 818 w(1, "<p class='stats'>evidence" as *u8) 819 evb_pair("grounded" as *u8, f[EVP_F_GROUNDED], f[EVP_F_PRESENT]) 820 evb_one("unsupported" as *u8, f[EVP_F_UNGROUND]) 821 evb_pair("gates green" as *u8, f[EVP_F_GREEN], f[EVP_F_RAN]) 822 evb_bite(f) 823 evb_one("green at 0/0" as *u8, f[EVP_F_VACUOUS]) 824 evb_one("open gaps" as *u8, f[EVP_F_ABSENT]) 825 evb_one("of them unnamed" as *u8, f[EVP_F_ABSBARE]) 826 evb_one("of them proof withheld" as *u8, f[EVP_F_WITHHELD]) 827 evb_one("flips ready" as *u8, f[EVP_F_LANDED]) 828 w(1, "</p>\n" as *u8) 829 830 // The two gate-honesty figures above are DIFFERENT CLAIMS, and the page now says so in its own words: 831 // one word carried the weaker of the two meanings while sounding like the stronger one. 832 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) 833 834 // A PARTITION IS A CLAIM: CHECK THAT THE PARTS SUM, AND PRINT THE SUM. Three states, because a 835 // partition we could not check and one that leaked are different facts and only one is a defect. 836 w(1, "<p class='legend'>partition: grounded + unsupported = " as *u8); wn(1, f[EVP_F_GROUNDED] + f[EVP_F_UNGROUND]) 837 w(1, " vs present " as *u8); wn(1, f[EVP_F_PRESENT]) 838 w(1, " &middot; named + unnamed + withheld = " as *u8); wn(1, f[EVP_F_ABSNAMED] + f[EVP_F_ABSBARE] + f[EVP_F_WITHHELD]) 839 w(1, " vs open " as *u8); wn(1, f[EVP_F_ABSENT]); w(1, " &middot; " as *u8) 840 if rec == 1 { w(1, "<b>both reconcile</b>" as *u8) } 841 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) } 842 if rec < 0 { w(1, "<b>not measurable from this stamp</b>" as *u8) } 843 w(1, "</p>\n" as *u8) 844 845 // THE FAILING CONJUNCT, NAMED. The verdict line alone is a bare disjunction and the reader always 846 // guesses the alarming third; GPqN and gPQN are the same word and opposite work. 847 w(1, "<p class='legend'>liar-kill <code>conj=" as *u8) 848 if f[EVP_F_CJ_G] == 1 { w(1, "G" as *u8) } else { w(1, "g" as *u8) } 849 if f[EVP_F_CJ_P] == 1 { w(1, "P" as *u8) } else { w(1, "p" as *u8) } 850 if f[EVP_F_CJ_Q] == 1 { w(1, "Q" as *u8) } else { w(1, "q" as *u8) } 851 if f[EVP_F_CJ_N] == 1 { w(1, "N" as *u8) } else { w(1, "n" as *u8) } 852 w(1, "</code> &middot; " as *u8) 853 if cjf < 0 { w(1, "all four conjuncts held" as *u8) } else { 854 w(1, "first failing conjunct: <b>" as *u8); w(1, evp_conj_name(cjf)); w(1, "</b>" as *u8) 855 } 856 w(1, "</p>\n" as *u8) 857 858 // WHICH DOCUMENT WAS GRADED. A verdict that cannot name its subject document is not a verdict about 859 // the published board -- and there are two knowledge trees whose copies of a matrix differ. 860 w(1, "<p class='legend'>graded document: <b>" as *u8); w(1, evp_tree_name(f[EVP_F_MROOT])) 861 w(1, "</b> tree, " as *u8); wn(1, f[EVP_F_MBYTES]); w(1, " bytes" as *u8) 862 if f[EVP_F_MCAPPED] == 1 { w(1, " <b>(READ-CAPPED: the referee graded a PREFIX of this document)</b>" as *u8) } 863 w(1, " &middot; gates map: <b>" as *u8); w(1, evp_tree_name(f[EVP_F_GATESROOT])) 864 w(1, "</b> &middot; stamped " as *u8); wn(1, age / EVB_SECS_PER_DAY); w(1, "d " as *u8) 865 wn(1, (age - (age / EVB_SECS_PER_DAY) * EVB_SECS_PER_DAY) / EVB_SECS_PER_HOUR); w(1, "h ago" as *u8) 866 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) } 867 w(1, " &middot; source <code>" as *u8); w(1, pathout); w(1, "</code></p>\n" as *u8) 868 869 w(1, EVB_SCROLL_OPEN) 870 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) 871 var fired: i64 = 0 872 fired = fired + evb_remedy(evp_claim_only(f), "CLAIM-ONLY" as *u8, 873 "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) 874 fired = fired + evb_remedy(evp_gate_failing(f), "GATE-FAILING" as *u8, 875 "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) 876 fired = fired + evb_remedy(evp_fabricated(f), "UNSUPPORTED-CLAIM" as *u8, 877 "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) 878 fired = fired + evb_remedy(evp_flip_ready(f), "FLIP-READY" as *u8, 879 "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) 880 fired = fired + evb_remedy(evp_unnamed_gap(f), "UNNAMED-GAP" as *u8, 881 "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) 882 fired = fired + evb_remedy(evp_withheld(f), "PROOF-WITHHELD" as *u8, 883 "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) 884 fired = fired + evb_remedy(evp_withheld_refused(f), "WITHHELD-REFUSED" as *u8, 885 "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) 886 fired = fired + evb_remedy(evp_vacuous_gate(f), "VACUOUS-GATE" as *u8, 887 "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) 888 fired = fired + evb_remedy(stale, "STALE" as *u8, 889 "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) 890 if fired == 0 { 891 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) 892 } 893 w(1, "</tbody></table></div>\n" as *u8) 894 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) 895 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) 896 return fired 897} 898 899func main(argc: i64, argv: *i64) -> i64 { 900 sc_preview_projection=1 901 if argc < 2 { w(1, "usage: nx_swcompare_matrix <domain> [html]\n" as *u8); sys_exit(1); return 1 } 902 let domain: *u8 = argv[1] as *u8 903 let cap: i64 = K_MAGIC_262144 904 let buf: *u8 = sys_mmap(cap) 905 let buf2: *u8 = sys_mmap(cap) 906 let pathb: *u8 = sys_mmap(512) 907 var o: i64 = scopy(pathb, 0, "knowledge/compare/" as *u8) 908 o = scopy(pathb, o, domain); o = scopy(pathb, o, ".matrix" as *u8); pathb[o] = 0 as u8 909 // RESOLVE, don't assume. ct_compare_read_published probes the PUBLISHING tree first and the 910 // authored tree second, and its wrapper applies ct_swap_tree so `mwhich` is a TRUE TREE token 911 // rather than a POSITION token -- stamping the raw position would label every buildroot read 912 // PRIMARY and misname the very document it just graded correctly. 913 // The pathb build above is DELIBERATELY KEPT: lines below still print it as a diagnostic. 914 let mwhich: *i64 = sys_mmap(16) as *i64 915 mwhich[0] = CT_TREE_NONE 916 let n: i64 = ct_compare_read_published(domain, ".matrix" as *u8, buf, cap, mwhich) 917 // cdir = the tree that actually answered, so the sibling .refs and .plan reads below cannot 918 // silently come from a DIFFERENT generation than the .matrix they annotate. 919 var cdir: *u8 = ct_first_published() 920 if mwhich[0] == CT_TREE_PRIMARY { cdir = ct_second_published() } 921 // A domain with a .sota and no .matrix renders through THIS generator too: zero capability rows, the SOTA 922 // field section, and every shared pass. The refusal fires only when NEITHER data class exists. 923 let sst: *SotaState = sl_new() 924 let have_sota: i64 = sl_load(domain, sst) 925 var have_matrix: i64 = 1 926 if n <= 0 { have_matrix = 0 } 927 // THE REFUSAL NAMES BOTH TREES IT PROBED. The old text printed ONE hand-built path, which under a 928 // resolver is not necessarily a path anyone looked at -- a refusal that names the wrong subject 929 // costs the reader the investigation it was written to save them. 930 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 } } 931 // HASH BEFORE THE PARSER TOUCHES IT. splitpipe NUL-terminates fields IN PLACE, so by JSON-emit 932 // time buf is no longer the file -- hashing it there produced a value no consumer could 933 // reproduce from disk, and nx_comparestale reported all 46 pages stale minutes after they were 934 // published. A COMPARATOR AND A WRITER THAT DISAGREE ON CANONICAL FORM NEVER CONVERGE; the 935 // canonical form here is THE BYTES AS READ. 936 var src_hash: i64 = swc_src_hash(buf, n) 937 // AND DECLARE WHICH FILE THAT WAS. A consumer must never have to infer it from an extension 938 // precedence rule: llm and lang each have BOTH a .matrix and a .sota, so "try .matrix first" 939 // hashed the wrong file and called two perfectly current pages STALE. 940 let src_base: *u8 = sys_mmap(256) 941 var sbo: i64 = scopy(src_base, 0, domain); sbo = scopy(src_base, sbo, ".matrix" as *u8); src_base[sbo] = 0 as u8 942 // a sota-only domain declares the .sota as the source it was generated from (the staleness contract) 943 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 } 944 // citations register (research-paper references as data); absent file = byte-identical emit 945 let refspath: *u8 = sys_mmap(600) 946 var rpo: i64 = scopy(refspath, 0, "knowledge/compare/" as *u8) 947 rpo = scopy(refspath, rpo, domain); rpo = scopy(refspath, rpo, ".refs" as *u8); refspath[rpo] = 0 as u8 948 // rendered-evidence register (images as data); absent file = byte-identical emit 949 let galpath: *u8 = sys_mmap(600) 950 var gpo: i64 = scopy(galpath, 0, "knowledge/compare/" as *u8) 951 gpo = scopy(galpath, gpo, domain); gpo = scopy(galpath, gpo, ".gallery" as *u8); galpath[gpo] = 0 as u8 952 953 // ROW CAPACITY DERIVED FROM THE FILE, NOT GUESSED (2026-08-18). A data row costs at least one 954 // newline, so rows <= lines + 1 -- an invariant, not a knob. The fixed 64 this replaces silently 955 // DROPPED rows 65+ (measured live on browser.matrix: 66 rows authored, 64 rendered, the last two 956 // vanished under a healthy stats line -- the no-silent-caps law violated inside the very organ 957 // whose job is honest counts; debt 1787077715). The guard at the append site is kept as the 958 // fail-loud floor and now REFUSES instead of skipping. 959 var maxr_lines: i64 = 1 960 var maxr_i: i64 = 0 961 while maxr_i < n { if buf[maxr_i] == (10 as u8) { maxr_lines = maxr_lines + 1 } maxr_i = maxr_i + 1 } 962 let MAXR: i64 = maxr_lines + 1 963 let rf: *i64 = sys_mmap(MAXR * SWC_ROW_STRIDE * 8) as *i64 964 let rl: *i64 = sys_mmap(16) as *i64 // the rule the one ruler applied to the last row measured 965 let rnishi: *i64 = sys_mmap(MAXR * 8) as *i64 966 let rexceed: *i64 = sys_mmap(MAXR * 8) as *i64 967 // DARK CONTRACT per row (2026-09-06, operator: a permanent fix, we do not build and lose capability to darkness): 968 // 1 when a watch row's organ file EXISTS and was read but does not declare the contracted symbol -- something 969 // shipped at that path under another name. mmap-zeroed, so every non-watch row reads 0 without a write. 970 let rdark: *i64 = sys_mmap(MAXR * 8) as *i64 971 let max_cols: i64 = SWC_ROW_STRIDE - SWC_ROW_FIXED 972 let cf: *i64 = sys_mmap(max_cols * 8) as *i64 973 let fld: *i64 = sys_mmap(24 * 8) as *i64 974 var ncol: i64 = 0 975 var title: *u8 = "Comparison" as *u8 976 var sub: *u8 = 0 as *u8 977 var verdict: *u8 = 0 as *u8 978 var rown: i64 = 0 979 var rule_subonly: i64 = 0 980 981 var p: i64 = 0 982 while p < n { 983 var e: i64 = p 984 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 } 985 buf[e] = 0 as u8 986 let line: *u8 = (buf as i64 + p) as *u8 987 p = e + 1 988 if line[0] == (0 as u8) { } else { if line[0] == (35 as u8) { } else { 989 if line[0] == (64 as u8) { 990 if starts(line, "@title " as *u8) == 1 { title = (line as i64 + 7) as *u8 } else { 991 if starts(line, "@sub " as *u8) == 1 { sub = (line as i64 + 5) as *u8 } else { 992 if starts(line, "@verdict " as *u8) == 1 { verdict = (line as i64 + 9) as *u8 } else { 993 if starts(line, "@cols " as *u8) == 1 { ncol = splitpipe((line as i64 + 6) as *u8, cf, max_cols) } } } } 994 } else { 995 let cnt: i64 = splitpipe(line, fld, 24) 996 // SCHEMA v2: a row is label|organ|symbol|exceed then ONE CELL PER DECLARED COLUMN then the note, 997 // so its width is 5 + ncol rather than a fixed 9. Four-column domains still compute 9 and parse 998 // byte-identically; a fifth column (the research bar) now costs a data row, not a code change. 999 let roww: i64 = SWC_ROW_FIXED + ncol 1000 // AN OVER-COUNT ROW IS A LIE WEARING THE SHAPE OF A NOTE (2026-08-18). A stray pipe inside 1001 // prose (a sibling wrote the math with vertical bars; another used ' | reuse: ' as a 1002 // separator) shears the note at that pipe, and '>=' below published the PREFIX as the whole 1003 // note with a healthy byte count -- 6 rows across 48 matrices, one of them 2.7KB short across 1004 // three regens, invisible to every reader. REFUSE the domain, name the row, and show the text 1005 // that begins each surplus field so the author sees exactly where the pipe is. 1006 if cnt > roww { 1007 w(1, "MATRIX ROW REFUSED: " as *u8); w(1, pathb); w(1, " row-index " as *u8); wn(1, rown) 1008 w(1, " has " as *u8); wn(1, cnt); w(1, " fields, schema is " as *u8); wn(1, roww) 1009 w(1, " -- a stray '|' inside the note; surplus fields begin: " as *u8) 1010 var sf: i64 = roww 1011 while sf < cnt { w(1, "[" as *u8); w(1, fld[sf] as *u8); w(1, "] " as *u8); sf = sf + 1 } 1012 w(1, "\n" as *u8) 1013 sys_exit(1); return 1 1014 } 1015 if cnt == roww { if rown >= MAXR { 1016 w(1, "MATRIX ROWS EXCEED DERIVED CAPACITY -- impossible by derivation (rows <= file lines); refusing rather than silently dropping. file=" as *u8) 1017 w(1, pathb); w(1, " rown=" as *u8); wn(1, rown) 1018 w(1, " 1019" as *u8) 1020 sys_exit(1); return 1 1021 } } 1022 if cnt == roww { if rown >= MAXR { 1023 w(1, "MATRIX ROWS EXCEED DERIVED CAPACITY -- impossible by derivation (rows <= file lines); refusing rather than silently dropping. file=" as *u8) 1024 w(1, pathb); w(1, " rown=" as *u8); wn(1, rown) 1025 w(1, " 1026" as *u8) 1027 sys_exit(1); return 1 1028 } } 1029 if cnt == roww { if rown < MAXR { 1030 var k: i64 = 0 1031 while k < roww { rf[rown*SWC_ROW_STRIDE + k] = fld[k]; k = k + 1 } 1032 let organ: *u8 = fld[1] as *u8 1033 let sym: *u8 = fld[2] as *u8 1034 var present: i64 = 0 1035 if streq(sym, "_ABSENT_" as *u8) == 1 { present = 0 } else { 1036 if starts(sym, "_ABSENT_:" as *u8) == 1 { 1037 // WATCH ROW (2026-08-13, operator: pages must INHERIT workstream ships, never be 1038 // re-authored): the expectation is named in data as _ABSENT_:<future_symbol>; it is 1039 // MEASURED here on every emit with the same ruler as present rows, so the moment a 1040 // workstream ships the organ+symbol, the next beat flips the cell -- and if the organ 1041 // is later retired the cell reverts. Bidirectional, fail-safe, zero hand edits. 1042 let wsym: *u8 = (sym as i64 + 9) as *u8 1043 // ONE RULER (2026-08-23): a top-level DECLARATION in the organ, never a substring -- 1044 // nx_symdecl_lib is what the ranker and the comparewatch plane measure with too. 1045 present = 0 1046 let wst: i64 = sd_present(organ, wsym, rl) 1047 if wst == 1 { present = 1 } 1048 // DARK CONTRACT (2026-09-06): the ruler returns -1 for an organ it could not read and 0 for one it 1049 // READ whose symbol is not declared; a watch row in the second state names a path where something 1050 // shipped under another name (measured twice this week: DC16 amesh_run, motion mr_rig and 1051 // mo_body_index -- each read as 0 of N done for days). The JS rule's abstention is folded to 0 by 1052 // sd_present, so a JSDECL rule is excluded here: a cell the ruler cannot judge is OPEN, never DARK. 1053 if wst == 0 { if rl[0] != SD_RULE_JSDECL { rdark[rown] = 1 } } 1054 if present == 1 { rf[rown*SWC_ROW_STRIDE + 2] = wsym as i64 } 1055 } else { present = 0; if sd_present(organ, sym, rl) == 1 { present = 1 } } 1056 } 1057 // TWO SYMBOL RULERS, MEASURED (2026-08-23): this page tests a SUBSTRING, the ranker tests a 1058 // top-level DECLARATION (cl_symbol_declared), and a sibling seat caught a rung reading LANDED here 1059 // and OPEN there at once. Before the page switches rulers fleet-wide, COUNT the cells that would 1060 // flip: a row present by substring but not declared is a mention (comment, string, tooth name), 1061 // not an implementation. Published as rule_substring_only; the switch is a measured decision. 1062 if present == 1 { 1063 var dsym: *u8 = sym 1064 if starts(sym, "_ABSENT_:" as *u8) == 1 { dsym = (sym as i64 + 9) as *u8 } 1065 if cl_symbol_declared(organ, dsym) == 0 { rule_subonly = rule_subonly + 1 } 1066 } 1067 let exc: i64 = atoi(fld[3] as *u8) 1068 var nish: i64 = 0 1069 if present == 1 { if exc == 1 { nish = 2 } else { nish = 1 } } else { nish = 0 } 1070 rnishi[rown] = nish; rexceed[rown] = exc; rown = rown + 1 1071 } } 1072 } } } 1073 } 1074 1075 // DARK CONTRACT COUNT (2026-09-06): summed from the per-row facts, so the receipt and the page cannot disagree. 1076 var dark_c: i64 = 0 1077 var dki: i64 = 0 1078 while dki < rown { dark_c = dark_c + rdark[dki]; dki = dki + 1 } 1079 1080 // ---- CE2: adoption per measured row, one classification per distinct organ (memoised) ---- 1081 // every source the classifier reads, loaded ONCE, estate-anchored (the regen forks this organ from 1082 // buildroot/, where relative reads miss or hit stale twins -- measured on the first live emit) 1083 let ads: *i64 = sys_mmap(CLB_N * 8) as *i64 1084 clb_load(ads) 1085 // each census stamps itself; the page prints the stamp, never a trust it did not measure 1086 let imp_asof: i64 = ads[CLB_IMP_ASOF] 1087 let ga_asof: i64 = ads[CLB_GA_ASOF] 1088 let radopt: *i64 = sys_mmap(MAXR * 8) as *i64 1089 let rtok: *i64 = sys_mmap(MAXR * 8) as *i64 1090 let rrem: *i64 = sys_mmap(MAXR * 8) as *i64 1091 let mname: *i64 = sys_mmap(MAXR * 8) as *i64 1092 let mtok: *i64 = sys_mmap(MAXR * 8) as *i64 1093 let mful: *i64 = sys_mmap(MAXR * 8) as *i64 1094 let mrem: *i64 = sys_mmap(MAXR * 8) as *i64 1095 var mc: i64 = 0 1096 var adopt_full: i64 = 0 1097 var adopt_partial: i64 = 0 1098 var ra: i64 = 0 1099 while ra < rown { 1100 radopt[ra] = CLB_NA 1101 rtok[ra] = "" as *u8 as i64 1102 rrem[ra] = "" as *u8 as i64 1103 if rnishi[ra] > 0 { 1104 let oname: *u8 = sys_mmap(CLB_TOK_CAP) 1105 cl_name_of_path(rf[ra*SWC_ROW_STRIDE + 1] as *u8, oname, CLB_TOK_CAP) 1106 var hit: i64 = 0 - 1 1107 var mi: i64 = 0 1108 while mi < mc { if streq(mname[mi] as *u8, oname) == 1 { hit = mi; mi = mc } mi = mi + 1 } 1109 if hit < 0 { 1110 let tokb: *u8 = sys_mmap(CLB_TOK_CAP) 1111 let remp: *i64 = sys_mmap(8) as *i64 1112 let ful: i64 = clb_classify(oname, ads, tokb, remp) 1113 mname[mc] = oname as i64; mtok[mc] = tokb as i64; mful[mc] = ful; mrem[mc] = remp[0] 1114 hit = mc 1115 mc = mc + 1 1116 } 1117 radopt[ra] = mful[hit] 1118 rtok[ra] = mtok[hit] 1119 rrem[ra] = mrem[hit] 1120 if mful[hit] == CLB_FULL { adopt_full = adopt_full + 1 } else { adopt_partial = adopt_partial + 1 } 1121 } 1122 ra = ra + 1 1123 } 1124 1125 // EC10: histogram of the classifier's OWN tokens over the measured rows. rtok is empty for a row that 1126 // was never classified (no organ measured), so those rows contribute nothing here and the histogram's 1127 // population is exactly the FULL+PARTIAL tally above -- a partition the console line asserts by summing. 1128 let mxh_tok: *i64 = sys_mmap(MXH_MAX * 8) as *i64 1129 let mxh_cnt: *i64 = sys_mmap(MXH_MAX * 8) as *i64 1130 var mxh_n: i64 = 0 1131 var mxh_ovf: i64 = 0 1132 var mxh_i: i64 = 0 1133 while mxh_i < rown { 1134 let mxh_t: *u8 = rtok[mxh_i] as *u8 1135 if mxh_t[0] != (0 as u8) { 1136 var mxh_hit: i64 = 0 - 1 1137 var mxh_j: i64 = 0 1138 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 } 1139 if mxh_hit >= 0 { mxh_cnt[mxh_hit] = mxh_cnt[mxh_hit] + 1 } else { 1140 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 } 1141 } 1142 } 1143 mxh_i = mxh_i + 1 1144 } 1145 1146 var present_c: i64 = 0; var exceeds_c: i64 = 0; var absent_c: i64 = 0; var exflags: i64 = 0 1147 var r: i64 = 0 1148 while r < rown { 1149 if rexceed[r] == 1 { exflags = exflags + 1 } 1150 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 } } 1151 r = r + 1 1152 } 1153 let total: i64 = rown 1154 // RIVAL-CLAIM PROVENANCE (2026-09-05): rows whose rival columns assert Yes, Best or Part, split by whether the 1155 // note cites a reference mark. Computed ONCE here so the JSON tally and the HTML band cannot disagree. 1156 var rv_rows: i64 = 0; var rv_cited: i64 = 0; var rv_uncited: i64 = 0 1157 var rvr: i64 = 0 1158 while rvr < rown { 1159 let rvc0: i64 = rv_class(rf[rvr*SWC_ROW_STRIDE + 4 + ncol] as *u8, rf, rvr, SWC_ROW_STRIDE, ncol) 1160 if rvc0 != RV_NONE { rv_rows = rv_rows + 1 } 1161 if rvc0 == RV_CITED { rv_cited = rv_cited + 1 } 1162 if rvc0 == RV_UNCITED { rv_uncited = rv_uncited + 1 } 1163 rvr = rvr + 1 1164 } 1165 var coverage: i64 = 0 1166 if total > 0 { coverage = ((present_c + exceeds_c) * 1000) / total } 1167 var neg: i64 = 0 1168 if rown > 0 { if sd_present(rf[1] as *u8, "zzznope_symbol_xyz" as *u8, rl) == 1 { neg = 1 } } 1169 1170 var html: i64 = 0 1171 var jsonmode: i64 = 0 1172 if argc >= 3 { if streq(argv[2] as *u8, "html" as *u8) == 1 { html = 1 } } 1173 if argc >= 3 { if streq(argv[2] as *u8, "json" as *u8) == 1 { jsonmode = 1 } } 1174 1175 var ladder_model: *SgPlan = 0 as *SgPlan 1176 if html + jsonmode > 0 { ladder_model = sg_load(domain) } 1177 if jsonmode == 1 { 1178 wc(1, 123) 1179 kv_n(1, "v" as *u8, 1); wc(1, 44) 1180 kv_s(1, "api" as *u8, "nishi-compare" as *u8); wc(1, 44) 1181 kv_n(1, "generated_unix" as *u8, sys_now_realtime_sec()); wc(1, 44) 1182 // The page carries the hash of the SOURCE it was generated from -- staleness becomes decidable 1183 // by a consumer with no clock and no filesystem access to this machine. 1184 kv_s(1, "source_file" as *u8, src_base); wc(1, 44); kv_n(1, "source_hash" as *u8, src_hash); wc(1, 44) 1185 kv_s(1, "domain" as *u8, domain); wc(1, 44) 1186 kv_s(1, "kind" as *u8, "matrix" as *u8); wc(1, 44) 1187 kv_s(1, "title" as *u8, title); wc(1, 44) 1188 if (sub as i64) != 0 { kv_s(1, "subtitle" as *u8, sub); wc(1, 44) } 1189 wq(1); w(1, "competitors" as *u8); wq(1); wc(1, 58); wc(1, 91) 1190 var cj: i64 = 0 1191 while cj < ncol { if cj > 0 { wc(1, 44) } wq(1); wj(1, cf[cj] as *u8); wq(1); cj = cj + 1 } 1192 wc(1, 93); wc(1, 44) 1193 wq(1); w(1, "axes" as *u8); wq(1); wc(1, 58); wc(1, 91) 1194 var rj: i64 = 0 1195 while rj < rown { 1196 if rj > 0 { wc(1, 44) } 1197 wc(1, 123) 1198 kv_s(1, "label" as *u8, rf[rj*SWC_ROW_STRIDE + 0] as *u8); wc(1, 44) 1199 kv_n(1, "nishi" as *u8, rnishi[rj]); wc(1, 44) 1200 kv_n(1, "exceed" as *u8, rexceed[rj]); wc(1, 44) 1201 // CE2: the ladder state and a 0/1/2 adopted flag (2 = not applicable: the axis is open) 1202 kv_s(1, "adopt" as *u8, rtok[rj] as *u8); wc(1, 44) 1203 kv_n(1, "adopted" as *u8, radopt[rj]); wc(1, 44) 1204 wq(1); w(1, "cells" as *u8); wq(1); wc(1, 58); wc(1, 91) 1205 // SCHEMA v2 COMPLETED 2026-08-15. The JSON half of this emitter was left on the fixed 1206 // four-cell layout when the parser (roww = 5 + ncol) and the HTML half both moved to 1207 // one-cell-per-declared-column. On a five-column domain it therefore emitted cells[4] and 1208 // published the FIFTH CODE as the note, dropping every prose note with it -- mangagen's 1209 // DiffSensei research bar has been unpublished this way since 2026-08-13, and the page 1210 // looked entirely healthy the whole time. 1211 // TWO HALVES OF ONE EMITTER ARE TWO READERS, AND AN UPGRADE APPLIED TO ONLY ONE OF THEM 1212 // IS A WIRE DISAGREEMENT THAT SHIPS LOOKING CORRECT. 1213 // NEUTRALITY IS EXACT, NOT ASSERTED: for ncol == 4 these expressions reduce to the old 1214 // literals (4 and 4+4), so every four-column domain emits byte-identical JSON. 1215 var ij: i64 = 0 1216 while ij < ncol { if ij > 0 { wc(1, 44) } wn(1, atoi(rf[rj*SWC_ROW_STRIDE + 4 + ij] as *u8)); ij = ij + 1 } 1217 wc(1, 93); wc(1, 44) 1218 kv_s(1, "note" as *u8, rf[rj*SWC_ROW_STRIDE + 4 + ncol] as *u8) 1219 wc(1, 125) 1220 rj = rj + 1 1221 } 1222 wc(1, 93); wc(1, 44) 1223 wq(1); w(1, "tally" as *u8); wq(1); wc(1, 58); wc(1, 123) 1224 kv_n(1, "coverage" as *u8, coverage); wc(1, 44); kv_n(1, "exceeds" as *u8, exceeds_c); wc(1, 44) 1225 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) 1226 kv_n(1, "adopted_full" as *u8, adopt_full); wc(1, 44); kv_n(1, "adopted_partial" as *u8, adopt_partial); wc(1, 44) 1227 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) 1228 // EC10: the whole ladder, machine-readable. Keys are "state"/"rows" (not "class"/"count") so no 1229 // flat-searching consumer of this document can collide with them. 1230 wq(1); w(1, "adopt_classes" as *u8); wq(1); wc(1, 58); wc(1, 91) 1231 var mxh_e: i64 = 0 1232 while mxh_e < mxh_n { 1233 if mxh_e > 0 { wc(1, 44) } 1234 wc(1, 123); wq(1); w(1, "state" as *u8); wq(1); wc(1, 58); wq(1) 1235 sys_write(1, mxh_tok[mxh_e] as *u8, mx_tokclass_len(mxh_tok[mxh_e] as *u8)) 1236 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) 1237 mxh_e = mxh_e + 1 1238 } 1239 wc(1, 93); wc(1, 44) 1240 kv_n(1, "adopt_classes_overflow" as *u8, mxh_ovf); wc(1, 44) 1241 kv_n(1, "rule_substring_only" as *u8, rule_subonly); wc(1, 44) 1242 kv_n(1, "dark_contracts" as *u8, dark_c) 1243 wc(1, 125); wc(1, 44) 1244 wq(1); w(1, "adoption_sources" as *u8); wq(1); wc(1, 58); wc(1, 123) 1245 kv_n(1, "importers_asof" as *u8, imp_asof); wc(1, 44); kv_n(1, "gateadjudicate_asof" as *u8, ga_asof); wc(1, 44) 1246 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) 1247 wc(1, 125); wc(1, 44) 1248 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) 1249 kv_s(1, "measurement" as *u8, "nishi cells verified by implementing-symbol on disk; competitor cells are documented capability presence" as *u8) 1250 // THE SOTA FIELD, MACHINE-READABLE (2026-09-02): the same field names the sota generator published 1251 if have_sota == 1 { sl_json(sst, domain, 1) } 1252 wc(1, 44); wq(1); w(1, "ppp" as *u8); wq(1); wc(1, 58); ppp_pass(domain, 1, 2) 1253 refs_pass(refspath, buf2, cap, 2, domain, RP_HDR) 1254 gal_pass(galpath, buf2, cap, 2, domain) 1255 // THE EVIDENCE PROFILE, MACHINE-READABLE (F1208). The HTML band above (ev_pass) and this object 1256 // read THE SAME stamp through THE SAME reader, so the page and api.json cannot disagree about 1257 // this board's gaps. evj_pass lives in nx_swcompare_lib so the SOTA generator emits the same 1258 // dialect from one renderer -- the refs_pass/plan_pass precedent, not a second copy here. 1259 evj_pass(domain) 1260 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): <dom>.bench rides in api.json through the one reader; absent file = no key 1261 bench_pass(domain, 1, 2) 1262 // MINED INTELLIGENCE (intelmine IM3): <dom>.proposed rides in api.json through the one reader; absent file = no key 1263 prop_pass(domain, 1, 2) 1264 // 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 1265 field_pass(domain, 1, 2, cf, ncol) 1266 // GAUGE HEARTBEATS (codeeffectiveness CE9, 2026-09-06): <dom>.gauge rides in api.json through the one ruler; a stale gauge carries no value key 1267 gauge_pass(domain, 1, 2) 1268 gaps_pass(domain, 1, 2) 1269 sg_json(ladder_model, 1) 1270 wc(1, 125); wc(1, 10) 1271 sys_exit(0); return 0 1272 } 1273 1274 if html == 1 { 1275 // shared site chrome (nav + footer) from nx_site_chrome; graceful fallback to minimal nav if absent. 1276 let hdrbuf: *u8 = sys_mmap(K_MAGIC_20480) 1277 var hdn: i64 = c_read("knowledge/site/chrome_header.html" as *u8, hdrbuf, K_MAGIC_20479) 1278 if hdn < 0 { hdn = 0 } 1279 hdrbuf[hdn] = 0 as u8 1280 let ftbuf: *u8 = sys_mmap(K_MAGIC_20480) 1281 var ftn: i64 = c_read("knowledge/site/chrome_footer.html" as *u8, ftbuf, K_MAGIC_20479) 1282 if ftn < 0 { ftn = 0 } 1283 ftbuf[ftn] = 0 as u8 1284 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) 1285 w(1, "<title>" as *u8); w(1, title); w(1, " -- Nishi Compare</title>\n<style>\n" as *u8) 1286 // THREE THEMES AS TOKENS (2026-08-13, operator: white ground hurts legibility + honor the e-ink lane). 1287 // PAPER = low-glare default. INK = the e-ink profile: tones taken from the incumbent nx_eink_tone CIE L* 1288 // ladder (white / L*67 ~ rgb(168) / L*33 ~ rgb(78) / black) -- no mid-greys, accent collapses to black, and 1289 // the state marks are SHAPE-distinct so the matrix survives monochrome. DARK = the charcoal register. 1290 // PALETTE + THEME + BREAKPOINTS now come from sc_theme_pass in nx_swcompare_lib.nx, which 1291 // emits them from the estate's token SSOT (nx_brand_tokens). This replaced the light :root 1292 // AND the html[data-theme='dark'] literal that used to sit here: the dark values are now 1293 // declared ONCE as data and emitted TWICE -- under the chip selector and under 1294 // @media(prefers-color-scheme:dark){:root:not([data-theme]){...}} -- so the chip theme and 1295 // the OS-preference theme CANNOT drift apart. The guard on that media block is load-bearing; 1296 // sc_theme_pass documents why (paper is the bare :root default and sett() sets data-theme for 1297 // it, so an unguarded block would repaint an explicit Paper choice on an OS-dark machine). 1298 sc_theme_pass(1) 1299 // INK stays a literal HERE, deliberately: it is a THIRD theme and nx_brand_tokens' format 1300 // expresses exactly two keywords (token|/dark|). Bending the SSOT to carry a third register 1301 // for one page would be a schema change driven by a single caller. It now overrides the 1302 // --nx-color-* SSOT names rather than the short names, because the short names became 1303 // var() ALIASES in sc_theme_pass -- overriding an alias would be overriding the pointer 1304 // instead of the value, and ink would silently stop working for every aliased token. 1305 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) 1306 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) 1307 // ONE LAYOUT EMITTER (2026-08-31). This body rule was byte-identical in intent to the one in 1308 // nx_swcompare_sota and five other generators, and the family had already drifted to SIX page 1309 // widths -- so it moved into sc_layout_pass. This page's OWN rendering is unchanged by the move 1310 // (it already read both layout tokens); what it GAINS is the min-width:0 guard that stops a wide 1311 // table forcing horizontal scroll onto the document, and overflow-wrap on the long monospace 1312 // identifiers that are the only real width bombs in a .pl table. 1313 sc_layout_pass(1) 1314 if have_sota == 1 { sl_css(1) } 1315 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) 1316 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) 1317 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) 1318 // MEASURE CAP (2026-08-25): .meth and .verdict were the only prose blocks on the page with NO 1319 // max-width, so they inherited body's 1100px and set ~140-145 characters per line -- about 1.8x the 1320 // WCAG 1.4.8 (AAA) 80-character ceiling, and nearly 2x the 45-75 range typography practice uses for 1321 // body copy. They are bordered prose callouts, exactly the shape .answer already is, and .answer was 1322 // ALREADY capped at 72ch three rules away -- so this makes them consistent with their own sibling 1323 // rather than introducing a new value. text-wrap:pretty additionally suppresses orphaned last words 1324 // and is ignored by engines that do not implement it, so it degrades to today's rendering. 1325 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) 1326 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) 1327 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) 1328 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) 1329 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) 1330 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) 1331 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) 1332 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) 1333 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) 1334 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) 1335 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) 1336 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) 1337 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) 1338 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) 1339 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) 1340 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) 1341 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) 1342 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) 1343 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) 1344 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) 1345 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) 1346 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) 1347 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) 1348 let galcss_fd: i64 = sys_openat_rd(galpath) 1349 if galcss_fd >= 0 { sys_close(galcss_fd) 1350 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) 1351 } 1352 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) 1353 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) 1354 w(1, ".cnt,.rg,.galp,tr.grp td{color:var(--mut)}\n" as *u8) 1355 w(1, "</style>\n" as *u8) 1356 // theme applied BEFORE first paint so a chosen ground never flashes the default one 1357 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) 1358 w(1, "</head><body>\n" as *u8) 1359 w(1, "<a class='skip-link' href='" as *u8); wc(1, 35); w(1, "main'>Skip to content</a>\n" as *u8) 1360 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) } 1361 w(1, "<main id='main'>\n" as *u8) 1362 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) 1363 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) 1364 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) 1365 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) 1366 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) } 1367 // A domain that declares knowledge/compare/<dom>.plan leads with the executive answer and the 1368 // dependency-ordered path; the matrix then becomes Layer 3, the evidence behind both. 1369 let planpath: *u8 = sys_mmap(600) 1370 var plo: i64 = scopy(planpath, 0, "knowledge/compare/" as *u8) 1371 plo = scopy(planpath, plo, domain) 1372 plo = scopy(planpath, plo, ".plan" as *u8) 1373 planpath[plo] = 0 as u8 1374 var haveplan: i64 = 0 1375 let plfd: i64 = sys_openat_rd(planpath) 1376 if plfd >= 0 { sys_close(plfd); haveplan = 1 } 1377 let planbuf: *u8 = sys_mmap(K_MAGIC_20480) 1378 if haveplan == 1 { 1379 w(1, "<nav class='production-nav' aria-label='Domain sections'><a href='#exec'>Overview</a><a href='#roadmap'>Production map</a><a href='#eng'>Capability comparisons</a><a href='#delivery-evidence'>Delivery and evidence</a></nav>\n" as *u8) 1380 sc_production_open(1, "exec" as *u8, "Overview" as *u8, "The purpose, declared position and evidence coverage of this domain. Source presence and completed acceptance are different measures." as *u8) 1381 plan_pass_heading(planpath, planbuf, K_MAGIC_20479, 1, 3) 1382 } 1383 // PRESENT = measured-plus-exceeds. Reporting present_c alone read as "12 of 24" while 15 rows were 1384 // in fact measured, because the exceeds are counted in their own bucket -- a partition that does 1385 // not sum in the reader's head is a wrong number with an authoritative typeface. 1386 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) 1387 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) 1388 // CE2: adoption beside coverage -- a presence number alone is the partial-deploy blind spot 1389 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) 1390 // CE7: THE GAP PROFILE, FOR EVERY DOMAIN. Placed DELIBERATELY OUTSIDE the haveplan guard. 1391 // Beside rank_pass it would have been skipped for every plan-less board -- and a board with 1392 // no plan is exactly the one whose gaps most need publishing. That skip would have been 1393 // silent, and a silently absent band reads as a board with nothing to report. 1394 if haveplan == 1 { ev_pass_heading(domain, 3) } else { ev_pass(domain) } 1395 if haveplan == 1 { 1396 sc_production_close(1) 1397 sc_production_open(1, "roadmap" as *u8, "Production map" as *u8, "Follow the dependencies, declared acceptance criteria and recorded priorities. Inspect source binding before treating a rank as executable work." as *u8) 1398 // CE6 (2026-08-23): THE ORDER, WHERE A HUMAN READS IT. nx_compare_rank computes the priority of every 1399 // open rung from the boards and writes knowledge/compare/<dom>.rank (one line per rung, stamped); 1400 // the roadmap table below this used to render rungs in plan-file declaration order, so "the ranker 1401 // is the order" was a doctrine with no surface. FINISH rows come first: rungs whose symbol is 1402 // present but whose organ is short of full adoption -- the cheapest closures on the board. 1403 w(1, "<p class='meth'>Ranking source binding: <b>" as *u8) 1404 if (ladder_model as i64) == 0 { w(1, "UNAVAILABLE" as *u8) } else { w(1, sg_rank_state(ladder_model)) } 1405 w(1, "</b>. Recorded priorities require current acceptance evidence and resource checks before execution.</p>\n" as *u8) 1406 rank_pass_heading(domain, RANK_READ_CAP, 3) 1407 sc_heading_open(1, 3, "" as *u8); w(1, "Declared roadmap &mdash; contract, acceptance, executor, effort" as *u8); sc_heading_close(1, 3); w(1, "\n" as *u8) 1408 plan_pass_heading(planpath, planbuf, K_MAGIC_20479, 2, 3) 1409 sg_html_heading(ladder_model, 1, 3) 1410 sc_production_close(1) 1411 } 1412 sc_production_open(1, "eng" as *u8, "Capability comparisons" as *u8, "Compare the field, search individual capabilities and open their source and adoption evidence. Documented presence does not establish comparative quality." as *u8) 1413 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) 1414 sc_heading_open(1, 3, "" as *u8); w(1, "Capability matrix &mdash; measured against source" as *u8); sc_heading_close(1, 3); w(1, "\n" as *u8) 1415 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) 1416 w(1, " present</span><span class='m'>" as *u8); mark(1, 3); w(1, " partial</span><span class='m'>" as *u8); mark(1, 0) 1417 w(1, " absent</span> &middot; click any capability for its evidence</p>\n" as *u8) 1418 w(1, "<div class='fbar'><input id='q' type='search' placeholder='Search capabilities, organs, symbols...' aria-label='Search capabilities'>" as *u8) 1419 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) 1420 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) 1421 var ci: i64 = 0 1422 while ci < ncol { w(1, "<th>" as *u8); w(1, cf[ci] as *u8); w(1, "</th>" as *u8); ci = ci + 1 } 1423 w(1, "</tr></thead><tbody>\n" as *u8) 1424 let pg: *u8 = sys_mmap(32) 1425 pg[0] = 0 as u8 1426 var rr: i64 = 0 1427 while rr < rown { 1428 let lab: *u8 = rf[rr*SWC_ROW_STRIDE + 0] as *u8 1429 // group = label prefix before ':' within the first 14 chars -> section header on change 1430 var g: i64 = 0 1431 var gi2: i64 = 0 1432 var gstop: i64 = 0 1433 while gstop == 0 { 1434 if gi2 >= 14 { gstop = 1 } else { 1435 let lc: i64 = lab[gi2] as i64 1436 if lc == 0 { gstop = 1 } else { if lc == 58 { g = gi2; gstop = 1 } else { gi2 = gi2 + 1 } } 1437 } 1438 } 1439 var nameoff: i64 = 0 1440 if g > 0 { 1441 var same: i64 = 1 1442 var gk: i64 = 0 1443 var gks: i64 = 0 1444 while gks == 0 { if gk >= g { gks = 1 } else { if pg[gk] != lab[gk] { same = 0; gks = 1 } else { gk = gk + 1 } } } 1445 if same == 1 { let pgt: i64 = pg[g] as i64; if pgt != 0 { same = 0 } } 1446 if same == 0 { 1447 w(1, "<tr class='grp'><td colspan='" as *u8); wn(1, ncol + 2); w(1, "'>" as *u8) 1448 var gc: i64 = 0 1449 while gc < g { wc(1, lab[gc] as i64); gc = gc + 1 } 1450 w(1, "</td></tr>\n" as *u8) 1451 gc = 0 1452 while gc < g { pg[gc] = lab[gc]; gc = gc + 1 } 1453 pg[g] = 0 as u8 1454 } 1455 nameoff = g + 1 1456 let sp2: i64 = lab[nameoff] as i64 1457 if sp2 == 32 { nameoff = nameoff + 1 } 1458 } 1459 let rsym: *u8 = rf[rr*SWC_ROW_STRIDE + 2] as *u8 1460 let rorg: *u8 = rf[rr*SWC_ROW_STRIDE + 1] as *u8 1461 // an UNLANDED watch row: the contract is named and still open. A LANDED one has already had 1462 // its symbol normalised past the prefix upstream, so it reads as an ordinary measured row. 1463 var iswatch: i64 = 0 1464 if starts(rsym, "_ABSENT_:" as *u8) == 1 { iswatch = 1 } 1465 w(1, "<tr class='cx' data-s='" as *u8) 1466 if rnishi[rr] == 2 { w(1, "ex" as *u8) } else { 1467 if rnishi[rr] == 1 { w(1, "me" as *u8) } else { 1468 if iswatch == 1 { if rdark[rr] == 1 { w(1, "dk" as *u8) } else { w(1, "wa" as *u8) } } else { w(1, "ab" as *u8) } } } 1469 w(1, "' data-a='" as *u8) 1470 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) } } 1471 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) 1472 w(1, "<td><details><summary>" as *u8); w(1, (lab as i64 + nameoff) as *u8); w(1, "</summary><span class='ev'>" as *u8) 1473 // EVIDENCE, DERIVED -- never prose typed by a seat: what was measured, in which organ, by which rule. 1474 if rnishi[rr] == 2 { 1475 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) 1476 } else { 1477 if rnishi[rr] == 1 { 1478 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) 1479 } else { 1480 if iswatch == 1 { 1481 if rdark[rr] == 1 { 1482 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) 1483 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) 1484 } else { 1485 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) 1486 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) 1487 } 1488 } else { 1489 w(1, "Open &mdash; no implementing organ is measured for this axis yet. " as *u8) 1490 } } } 1491 wnote(1, rf[rr*SWC_ROW_STRIDE + 4 + ncol] as *u8) 1492 // RIVAL-CLAIM PROVENANCE (2026-09-05): a row that grades a rival with no reference mark says so in its own evidence 1493 let rvc: i64 = rv_class(rf[rr*SWC_ROW_STRIDE + 4 + ncol] as *u8, rf, rr, SWC_ROW_STRIDE, ncol) 1494 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) } 1495 // CE2: the ladder state, in the evidence for every measured row 1496 if radopt[rr] != CLB_NA { 1497 w(1, " <b>Adoption:</b> <code>" as *u8); w(1, rtok[rr] as *u8); w(1, "</code>" as *u8) 1498 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) } 1499 } 1500 w(1, "</span></details>" as *u8) 1501 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) } 1502 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) } 1503 pc_strip(1, rnishi[rr], rexceed[rr], iswatch, radopt[rr], rrem[rr] as *u8, cf, ncol, rf, rr) 1504 w(1, "</td>" as *u8) 1505 mark_td(1, "Nishi" as *u8, rnishi[rr], 1) 1506 var cj: i64 = 0 1507 while cj < ncol { 1508 let cn2: *u8 = cf[cj] as *u8 1509 mark_td(1, cn2, atoi(rf[rr*SWC_ROW_STRIDE + 4 + cj] as *u8), 0) 1510 cj = cj + 1 1511 } 1512 w(1, "</tr>\n" as *u8) 1513 rr = rr + 1 1514 } 1515 w(1, "</tbody></table></div>\n" as *u8) 1516 // RIVAL-CLAIM PROVENANCE (2026-09-05): the page's own count of rival claims and how many carry a reference mark 1517 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) 1518 w(1, " &middot; cited " as *u8); wn(1, rv_cited); w(1, " &middot; uncited " as *u8); wn(1, rv_uncited) 1519 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) 1520 sc_production_close(1) 1521 w(1,"<p class='meth'>Preview projection: reference assets are not republished; library links require existing identical published bytes. Gallery probes are not executed. Retained evidence and worklog entries do not establish fresh verification.</p>" as *u8) 1522 sc_production_open(1, "delivery-evidence" as *u8, "Delivery and evidence" as *u8, "Inspect risks, technical debt, rendered observations, experiments and references. Read scope and limitations alongside every result." as *u8) 1523 if haveplan == 1 { 1524 plan_pass_heading(planpath, planbuf, K_MAGIC_20479, 3, 3) 1525 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) 1526 } 1527 // THE SOTA FIELD (2026-09-02): the grade grid with measured bindings, one pass, only when a .sota exists 1528 if have_sota == 1 { sl_html_heading(sst, domain, 1, 3) } 1529 // rendered evidence: only when knowledge/compare/<domain>.gallery exists (publish-then-link, gal_pass) 1530 gal_pass_heading(galpath, planbuf, K_MAGIC_20479, 1, domain, 3) 1531 // evidence affordance: only when knowledge/compare/<domain>.gates exists (this domain has executable proofs) 1532 let gpath: *u8 = sys_mmap(256) 1533 var go: i64 = 0 1534 let gp1: *u8 = "knowledge/compare/" 1535 var gi: i64 = 0 1536 while gp1[gi] != (0 as u8) { gpath[go] = gp1[gi]; go = go + 1; gi = gi + 1 } 1537 var gd: i64 = 0 1538 while domain[gd] != (0 as u8) { gpath[go] = domain[gd]; go = go + 1; gd = gd + 1 } 1539 let gp2: *u8 = ".gates" 1540 var gj: i64 = 0 1541 while gp2[gj] != (0 as u8) { gpath[go] = gp2[gj]; go = go + 1; gj = gj + 1 } 1542 gpath[go] = 0 as u8 1543 let gfd: i64 = sys_openat_rd(gpath) 1544 if gfd >= 0 { 1545 sys_close(gfd) 1546 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) 1547 } 1548 if (verdict as i64) != 0 { 1549 w(1, "<div class='verdict'><b>Honest verdict.</b> " as *u8); wnote(1, verdict); w(1, "</div>\n" as *u8) 1550 } else { 1551 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) 1552 } 1553 // the paper ends with its references; a domain without a .refs file emits byte-identically here 1554 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): rendered by the base for both generators; absent file = no section 1555 bench_pass_heading(domain, 1, 1, 3) 1556 ppp_pass_heading(domain, 1, 1, 3) 1557 // 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 1558 prop_pass_heading(domain, 1, 1, 3) 1559 // 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 1560 field_pass_heading(domain, 1, 1, cf, ncol, 3) 1561 // 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 1562 gauge_pass_heading(domain, 1, 1, 3) 1563 gaps_pass_heading(domain, 1, 1, 3) 1564 refs_pass(refspath, planbuf, K_MAGIC_20479, 1, domain, RP_HDR) 1565 sc_production_close(1) 1566 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; source checks show implementation presence; runtime and user-outcome evidence are reported separately &middot; JavaScript supports page controls</p>\n" as *u8) 1567 // PRESENTATION SHIM ONLY (the JS-interop law): theme selection + row filtering. No comparison 1568 // logic lives here -- every mark was decided by the organ before a byte of this page was written. 1569 w(1, "<script>\n" as *u8) 1570 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) 1571 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) 1572 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) 1573 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) 1574 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) 1575 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) 1576 w(1, "var c=document.getElementById('cnt');if(c){c.textContent=n+' / '+rows.length+' axes'}}\n" as *u8) 1577 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) 1578 w(1, "</script>\n" as *u8) 1579 w(1, "</main>\n" as *u8) 1580 if ftn > 0 { w(1, ftbuf) } 1581 w(1, "</body></html>\n" as *u8) 1582 sys_exit(0); return 0 1583 } 1584 1585 w(1, "=== NX-SWCOMPARE-MATRIX domain=" as *u8); w(1, domain); w(1, " -- Nishi MEASURED vs 4 competitors ===\n" as *u8) 1586 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) 1587 var rc: i64 = 0 1588 while rc < rown { con_row(rf[rc*SWC_ROW_STRIDE + 0] as *u8, rnishi[rc]); rc = rc + 1 } 1589 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) 1590 // CE2: the adoption partition of the measured rows, with every partial state named (a count without a worklist is not actionable) 1591 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) 1592 w(1, " importers_asof=" as *u8); wn(1, imp_asof); w(1, " gateadjudicate_asof=" as *u8); wn(1, ga_asof) 1593 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) 1594 // EC10: the histogram, its partition ASSERTED against the tally it must sum to -- a partition is a claim 1595 w(1, " ADOPT-CLASSES:" as *u8) 1596 var mxh_p: i64 = 0 1597 var mxh_sum: i64 = 0 1598 while mxh_p < mxh_n { 1599 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]) 1600 mxh_sum = mxh_sum + mxh_cnt[mxh_p] 1601 mxh_p = mxh_p + 1 1602 } 1603 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) 1604 var rp: i64 = 0 1605 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 } 1606 1607 let liar_corpus: i64 = (rown >= 8) as i64 1608 let liar_neg: i64 = (neg == 0) as i64 1609 // WIDENED, NOT REMOVED (2026-09-05): this is a SIZE floor -- did the board MEASURE enough rows to be a comparison -- 1610 // and an EXCEEDS row is a measured-present row carrying a stronger claim; the ADOPTION denominator above already 1611 // counts present_c + exceeds_c as measured. Counting PRESENT alone refused /compare/observability (13 EXCEEDS, 1612 // 3 PRESENT, 800/1000 coverage) for being too STRONG on every regen, while exceeds<=flags already guards the 1613 // over-claim direction. The printed label names what is counted. 1614 let liar_present: i64 = (present_c + exceeds_c >= 5) as i64 1615 let liar_exbound: i64 = (exceeds_c <= exflags) as i64 1616 // ★WIDENED, NOT REMOVED. The check exists so a domain cannot quietly drop or invent competitor columns; 1617 // pinning it to exactly 4 also forbade comparing against a RESEARCH bar alongside the product field. 1618 // A floor of 4 keeps the original guarantee (no domain thins its field) while allowing a fifth column. 1619 let liar_cols: i64 = (ncol >= 4) as i64 1620 w(1, " LIAR-KILL: rows>=8=" as *u8); wn(1, liar_corpus); w(1, " neg-control-zero=" as *u8); wn(1, liar_neg) 1621 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) 1622 // THE FIELD CENSUS (2026-09-02): the sota liar-kill prints its own lines and its verdict folds in here; a 1623 // sota-only domain (no .matrix) is judged by the field alone -- the matrix floors cannot apply to zero rows. 1624 var sota_ok: i64 = 1 1625 if have_sota == 1 { sota_ok = sl_census(sst, domain, 1) } 1626 var ok: i64 = liar_corpus & liar_neg & liar_present & liar_exbound & liar_cols 1627 // A SOTA-BEARING DOMAIN IS JUDGED BY THE FIELD'S OWN LIAR-KILL (2026-09-02, measured on the first unified regen): 1628 // its .matrix is a WATCH REGISTER (foodscience 9 rows / 3 present, water 8 / 3, livingdocs 7 / 2), not the 1629 // comparison, so the matrix size floors (rows>=8, present>=5, cols>=4) refused five domains that the field pass 1630 // had just judged MEASURED-HONEST and their previous pages were kept. The INTEGRITY teeth stay on every domain 1631 // (the neg-control must be zero, exceeds may not exceed their flags); only the SIZE floors move to the field. 1632 if have_sota == 1 { ok = liar_neg & liar_exbound } 1633 if have_matrix == 0 { ok = 1 } 1634 ok = ok & sota_ok 1635 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) 1636 if ok == 1 { w(1, "MEASURED-HONEST (liar-killed)\n" as *u8); sys_exit(0); return 0 } 1637 // NAME THE FAILING CONJUNCT (2026-09-02): a compound assertion that will not name which part failed sends every 1638 // reader at the alarming third -- regen #7 refused five thin domains and the line said only "a check failed". 1639 w(1, "RED (a check failed:" as *u8) 1640 if liar_corpus == 0 { w(1, " rows<8" as *u8) } 1641 if liar_neg == 0 { w(1, " neg-control-nonzero" as *u8) } 1642 if liar_present == 0 { w(1, " measured<5" as *u8) } 1643 if liar_exbound == 0 { w(1, " exceeds>flags" as *u8) } 1644 if liar_cols == 0 { w(1, " cols<4" as *u8) } 1645 if sota_ok == 0 { w(1, " sota-field" as *u8) } 1646 w(1, " -- the previous page stays published)\n" as *u8); sys_exit(1); return 1 1647}