code wiki / (root) / nx_swcompare_evidence_matrix_t138.nx

nx_swcompare_evidence_matrix_t138.nx source

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