code wiki / _hdl_build / nx_browser_census.nx
nx_browser_census.nx source
↩ module page · 330 lines · 20606 B
1// nx_browser_census.nx -- SOVEREIGN browser-parity census scoreboard organ (MCP tool + API payload).
2// Operator directive 2026-07-23: "mcp and api and object oriented and agentic and workflow ready ... it needs
3// to scale." Replaces the one-off PowerShell -> static-JSON pipeline (the scattering root) with a data-driven
4// sovereign organ: sites + per-site results live in the SEG-STORE PLANE knowledge/store/browsercensus- (NOT
5// hardcoded, NOT a tsv per the sovereign-formats law) -> ADD SITES WITHOUT TOUCHING CODE = scales to N.
6// Reads the plane, parses each site RECORD, aggregates a SCOREBOARD (mean reading-recall vs Chrome, class
7// counts, mean height-ratio), emits structured JSON to stdout (the MCP + API payload) AND colocates it to
8// knowledge/status/browser_census.log (evidence). Fail-closed: absent/empty plane -> RED exit 1 (no scoreboard
9// without data).
10//
11// ---- BR2, 2026-08-26: THE STRUCTURAL-EXACTNESS COLUMN (rung BR2, symbol bc_struct_col) ----------------
12// The operator ratchet of 2026-07-28 is EXACT structural match to Chrome/Edge/Firefox, measured by
13// struct_diff matched-permil with dy and dx toward 0. Until today that lived in hand-run readings pasted
14// into a plan row; the census -- the thing that publishes -- had no column for it, so the ratchet could
15// not be tracked per site and could not be judged mechanically.
16//
17// Row schema, now TEN tab fields (the last four are ADDITIVE -- a six-field row still parses and its
18// struct columns read UNMEASURED, never a silent 0):
19// site class reading_recall_pm ratio_pct chrome_h nishi_h
20// struct_matched_pm struct_dy struct_dx struct_bands_oracle
21//
22// THE FOURTH NEW COLUMN IS THE DENOMINATOR AND IT IS NOT DECORATION. Measured on saved bytes on
23// 2026-08-26 with the incumbent ruler: google returned "matched=2 (1000 permille)" over TWO oracle text
24// bands, and stackoverflow returned "matched=0 (0 permille)" over ZERO. A perfect score and a total
25// failure, both arithmetic on an empty subject, both arriving as a number a scoreboard would average.
26// bsc_band_floor() derives the smallest usable denominator FROM THE BAR itself and such rows are counted
27// as UNDERPOWERED -- named, excluded, never averaged and never silently dropped.
28//
29// reading_recall_pm/ratio_pct = "-" or non-digit means UNMEASURED (excluded from the mean, never a silent 0).
30// Workflow-ready: one plane row per site, one JSON record per site -> composable/fan-out. license_tier: ORIGINAL
31// expect_exit: 0
32import "nx_store_seed_lib.nx"
33import "nx_seg_store.nx"
34import "nx_syscalls.nx"
35import "nx_browser_struct_col_lib.nx"
36const BC_MAGIC_4096: i64 = 4096
37
38const BC_PLANE_CAP: i64 = 1048576
39const BC_JSON_CAP: i64 = 262144
40// TEN fields, one i64 slot each for the offset and one for the length: the arrays are sized from the
41// schema rather than from a round number, so adding a column moves exactly one constant.
42const BC_MAXF: i64 = 10
43const BC_WORD: i64 = 8
44const BC_FLD_BYTES: i64 = 80 // BC_MAXF * BC_WORD
45const BC_SITECAP: i64 = 512
46const BC_MODECAP: i64 = 64
47const BC_PAIR_PLANE: *u8 = "knowledge/store/browsercensuspair-\x00"
48
49// ---- emit helpers (single-responsibility string builders) ----
50func bc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
51func bc_cat(o: *u8, at: i64, s: *u8) -> i64 { var i: i64=0; var a: i64=at; while s[i]!=(0 as u8){o[a]=s[i]; a=a+1; i=i+1} return a }
52func bc_catf(o: *u8, at: i64, p: *u8, n: i64) -> i64 { var i: i64=0; var a: i64=at; while i<n { o[a]=p[i]; a=a+1; i=i+1 } return a }
53func bc_catn(o: *u8, at: i64, v: i64) -> i64 {
54 var a: i64=at; var x: i64=v
55 if x<0 { o[a]=45 as u8; a=a+1; x=0-x }
56 let tm: *u8=sys_mmap(24); var k: i64=0
57 if x==0 { tm[0]=48 as u8; k=1 }
58 while x>0 { tm[k]=(48+x%10) as u8; x=x/10; k=k+1 }
59 var j: i64=0; while j<k { o[a]=tm[k-1-j]; a=a+1; j=j+1 }
60 return a
61}
62// does field p[0..n) contain zero-terminated sub? (no-break style: sentinel exits)
63func bc_field_has(p: *u8, n: i64, sub: *u8) -> i64 {
64 var sl: i64=0; while sub[sl]!=(0 as u8){sl=sl+1}
65 if sl==0 { return 0 }
66 var i: i64=0; var found: i64=0
67 while i+sl<=n {
68 var jj: i64=0; var ok: i64=1
69 while jj<sl { if p[i+jj]!=sub[jj] { ok=0; jj=sl } else { jj=jj+1 } }
70 if ok==1 { found=1; i=n } else { i=i+1 }
71 }
72 return found
73}
74// parse field p[0..n) as a non-negative int; -1 if the first byte is not a digit ("-" = UNMEASURED)
75func bc_field_int(p: *u8, n: i64) -> i64 {
76 if n<=0 { return 0-1 }
77 let c0: i64=p[0] as i64
78 if c0<48 { return 0-1 }
79 if c0>57 { return 0-1 }
80 var v: i64=0; var i: i64=0
81 while i<n { let c: i64=p[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 }
82 return v
83}
84
85// ---- bc_struct_col: THE BR2 COLUMN, DECLARED HERE AND JUDGED IN THE LIB ------------------------------
86// The compare-matrix symbol ruler (nx_symdecl_lib, SD_RULE_DECL) requires a TOP-LEVEL declaration of the
87// watched symbol in the organ the matrix row names, and it is right to: a completion signal that keys on
88// a name rewards writing the name, so a call site is deliberately not enough. The judgement itself is in
89// nx_browser_struct_col_lib.nx because that is the only place a mutation harness can reach it -- a gate
90// over this program would have to fork the promoted binary and every mutant would read NOT-REACHED.
91// So this is the seam, and it does exactly one thing: turn four raw plane fields into one folded row.
92// Returns 1 measured, 0 unmeasured, 2 underpowered (oracle band count below the derived floor).
93func bc_struct_col(acc: *i64, csv: *u8, site: *u8, slen: i64, p6: *u8, n6: i64, p7: *u8, n7: i64, p8: *u8, n8: i64, p9: *u8, n9: i64, floor: i64, bar_pm: i64, bar_dy: i64) -> i64 {
94 let pm: i64 = bsc_field_int(p6, n6)
95 let dy: i64 = bsc_field_int(p7, n7)
96 let dx: i64 = bsc_field_int(p8, n8)
97 let bands: i64 = bsc_field_int(p9, n9)
98 return bsc_row(acc, csv, site, slen, pm, dy, dx, bands, floor, bar_pm, bar_dy)
99}
100func bc_struct_state(r: i64) -> *u8 {
101 if r == 1 { return "MEASURED" as *u8 }
102 if r == 2 { return "UNDERPOWERED" as *u8 }
103 return "UNMEASURED" as *u8
104}
105
106// mean reading recall over one plane's measured rows -- used for BOTH legs of the CSS pair, so the two
107// legs can never be computed by two different rules. out[0]=mean (or -1), out[1]=measured row count,
108// out[2]=mean struct matched permil (or -1), out[3]=struct measured rows.
109func bc_leg_means(mb: *u8, mn: i64, out: *i64) -> i64 {
110 let fs: *i64=sys_mmap(BC_FLD_BYTES) as *i64
111 let fl: *i64=sys_mmap(BC_FLD_BYTES) as *i64
112 var rsum: i64=0; var rcnt: i64=0; var ssum: i64=0; var scnt: i64=0
113 var i: i64=0
114 while i<mn {
115 let ls: i64=i
116 var le: i64=ls; var scan: i64=1
117 while scan==1 { if le>=mn { scan=0 } else { if mb[le]==(10 as u8) { scan=0 } else { le=le+1 } } }
118 let lend: i64=le
119 i=le+1
120 let llen: i64=lend-ls
121 if llen>3 { if mb[ls]!=(35 as u8) {
122 var nf: i64=0; var p: i64=ls; var fstart: i64=ls
123 while p<lend {
124 if mb[p]==(9 as u8) { if nf<BC_MAXF { fs[nf]=fstart; fl[nf]=p-fstart; nf=nf+1 } fstart=p+1 }
125 p=p+1
126 }
127 if nf<BC_MAXF { fs[nf]=fstart; fl[nf]=lend-fstart; nf=nf+1 }
128 if nf>=3 {
129 let rec: i64=bc_field_int((mb as i64+fs[2]) as *u8, fl[2])
130 if rec>=0 { rsum=rsum+rec; rcnt=rcnt+1 }
131 }
132 if nf>=7 {
133 let spm: i64=bc_field_int((mb as i64+fs[6]) as *u8, fl[6])
134 if spm>=0 { ssum=ssum+spm; scnt=scnt+1 }
135 }
136 } }
137 }
138 out[0]=bsc_mean(rsum, rcnt)
139 out[1]=rcnt
140 out[2]=bsc_mean(ssum, scnt)
141 out[3]=scnt
142 return 0
143}
144
145// WHICH LEG IS THIS PLANE? Read from the rows' own class field, never assumed and never configured
146// separately -- a second place to say it is a second place for it to be wrong. A plane whose rows
147// declare neither mode, or both, returns UNKNOWN and the pair verdict then refuses rather than
148// guessing an orientation. "CSS-ON" is not a substring of "CSS-OFF", so the two are distinguishable
149// by exactly this test; CSS-OFF is checked first so one row can never count as both.
150const BC_MODE_UNKNOWN: i64 = 0
151const BC_MODE_ON: i64 = 1
152const BC_MODE_OFF: i64 = 2
153func bc_mode_name(m: i64) -> *u8 {
154 if m == BC_MODE_ON { return "CSS-ON" as *u8 }
155 if m == BC_MODE_OFF { return "CSS-OFF" as *u8 }
156 return "UNKNOWN" as *u8
157}
158func bc_leg_mode(mb: *u8, mn: i64) -> i64 {
159 var on: i64=0; var off: i64=0
160 var i: i64=0
161 while i<mn {
162 let ls: i64=i
163 var le: i64=ls; var scan: i64=1
164 while scan==1 { if le>=mn { scan=0 } else { if mb[le]==(10 as u8) { scan=0 } else { le=le+1 } } }
165 let lend: i64=le
166 i=le+1
167 let llen: i64=lend-ls
168 if llen>3 { if mb[ls]!=(35 as u8) {
169 let p: *u8=(mb as i64+ls) as *u8
170 if bc_field_has(p, llen, "CSS-OFF\x00" as *u8)==1 { off=off+1 } else {
171 if bc_field_has(p, llen, "CSS-ON\x00" as *u8)==1 { on=on+1 }
172 }
173 } }
174 }
175 if on>0 { if off==0 { return BC_MODE_ON } }
176 if off>0 { if on==0 { return BC_MODE_OFF } }
177 return BC_MODE_UNKNOWN
178}
179
180func main() -> i64 {
181 let mb: *u8=sys_mmap(BC_PLANE_CAP)
182 let mn: i64=sts_load("knowledge/store/browsercensus-\x00" as *u8, mb, BC_PLANE_CAP-BC_MAGIC_4096)
183 if mn<=0 {
184 bc_puts("BROWSER-CENSUS RED -- native plane knowledge/store/browsercensus- ABSENT or EMPTY (fail-closed, no scoreboard without data)\n" as *u8)
185 sys_exit(1)
186 return 1
187 }
188 // ---- the BR2 bar, read as DATA. Every value is fail-closed: an unreadable conf yields a negative
189 // bar, which makes every downstream verdict UNOBSERVABLE rather than silently permissive.
190 let sites_csv: *u8 = sys_mmap(BC_SITECAP)
191 bsc_bar_sites(sites_csv, BC_SITECAP)
192 let bar_pm: i64 = bsc_bar_pm()
193 let bar_dy: i64 = bsc_bar_dy()
194 let pair_band: i64 = bsc_pair_band()
195 let bar_decl: i64 = bsc_bar_declared(sites_csv)
196 let floor: i64 = bsc_band_floor(bar_pm)
197 let acc: *i64 = bsc_acc()
198
199 let jb: *u8=sys_mmap(BC_JSON_CAP)
200 var j: i64=0
201 j=bc_cat(jb, j, "{\x22v\x22:2,\x22kind\x22:\x22browser-census\x22,\x22oracle\x22:\x22chrome-headless + Windows.Media.Ocr + struct_diff text-line bands\x22,\x22sites\x22:[" as *u8)
202 // ---- parse the data-driven plane: one RECORD per site row (up to BC_MAXF tab fields) ----
203 let fs: *i64=sys_mmap(BC_FLD_BYTES) as *i64
204 let fl: *i64=sys_mmap(BC_FLD_BYTES) as *i64
205 var nsites: i64=0; var content_ok: i64=0; var blank: i64=0; var fetch_empty: i64=0; var chrome_blocked: i64=0
206 var rsum: i64=0; var rcnt: i64=0; var ratsum: i64=0; var ratcnt: i64=0
207 var i: i64=0; var first: i64=1
208 while i<mn {
209 let ls: i64=i
210 var le: i64=ls; var scan: i64=1
211 while scan==1 { if le>=mn { scan=0 } else { if mb[le]==(10 as u8) { scan=0 } else { le=le+1 } } }
212 let lend: i64=le
213 i=le+1
214 let llen: i64=lend-ls
215 if llen>3 { if mb[ls]!=(35 as u8) {
216 var nf: i64=0; var p: i64=ls; var fstart: i64=ls
217 while p<lend {
218 if mb[p]==(9 as u8) { if nf<BC_MAXF { fs[nf]=fstart; fl[nf]=p-fstart; nf=nf+1 } fstart=p+1 }
219 p=p+1
220 }
221 if nf<BC_MAXF { fs[nf]=fstart; fl[nf]=lend-fstart; nf=nf+1 }
222 if nf>=2 {
223 // 0=site 1=class 2=reading_recall_pm 3=ratio_pct 4=chrome_h 5=nishi_h
224 // 6=struct_matched_pm 7=struct_dy 8=struct_dx 9=struct_bands_oracle
225 let clsp: *u8=(mb as i64+fs[1]) as *u8
226 let clsn: i64=fl[1]
227 if bc_field_has(clsp, clsn, "CONTENT-OK\x00" as *u8)==1 { content_ok=content_ok+1 }
228 if bc_field_has(clsp, clsn, "BLANK\x00" as *u8)==1 { blank=blank+1 }
229 if bc_field_has(clsp, clsn, "FETCH-EMPTY\x00" as *u8)==1 { fetch_empty=fetch_empty+1 }
230 if bc_field_has(clsp, clsn, "CHROME-BLOCKED\x00" as *u8)==1 { chrome_blocked=chrome_blocked+1 }
231 var rec: i64=0-1; var rat: i64=0-1
232 if nf>=3 { rec=bc_field_int((mb as i64+fs[2]) as *u8, fl[2]) }
233 if nf>=4 { rat=bc_field_int((mb as i64+fs[3]) as *u8, fl[3]) }
234 if rec>=0 { rsum=rsum+rec; rcnt=rcnt+1 }
235 if rat>=0 { ratsum=ratsum+rat; ratcnt=ratcnt+1 }
236 // ---- BR2: the struct columns. Absent fields are handed to the seam as zero-length,
237 // which bsc_field_int reads as UNMEASURED -- so a legacy six-field row is neutral here.
238 var s6: *u8 = sites_csv; var l6: i64 = 0
239 var s7: *u8 = sites_csv; var l7: i64 = 0
240 var s8: *u8 = sites_csv; var l8: i64 = 0
241 var s9: *u8 = sites_csv; var l9: i64 = 0
242 if nf>=7 { s6=(mb as i64+fs[6]) as *u8; l6=fl[6] }
243 if nf>=8 { s7=(mb as i64+fs[7]) as *u8; l7=fl[7] }
244 if nf>=9 { s8=(mb as i64+fs[8]) as *u8; l8=fl[8] }
245 if nf>=10 { s9=(mb as i64+fs[9]) as *u8; l9=fl[9] }
246 let srow: i64 = bc_struct_col(acc, sites_csv, (mb as i64+fs[0]) as *u8, fl[0], s6, l6, s7, l7, s8, l8, s9, l9, floor, bar_pm, bar_dy)
247 nsites=nsites+1
248 if first==0 { j=bc_cat(jb, j, "," as *u8) }
249 first=0
250 j=bc_cat(jb, j, "{\x22site\x22:\x22" as *u8); j=bc_catf(jb, j, (mb as i64+fs[0]) as *u8, fl[0])
251 j=bc_cat(jb, j, "\x22,\x22class\x22:\x22" as *u8); j=bc_catf(jb, j, clsp, clsn)
252 j=bc_cat(jb, j, "\x22,\x22reading_recall_pm\x22:" as *u8); j=bc_catn(jb, j, rec)
253 j=bc_cat(jb, j, ",\x22ratio_pct\x22:" as *u8); j=bc_catn(jb, j, rat)
254 j=bc_cat(jb, j, ",\x22struct_matched_pm\x22:" as *u8); j=bc_catn(jb, j, bsc_field_int(s6, l6))
255 j=bc_cat(jb, j, ",\x22struct_dy\x22:" as *u8); j=bc_catn(jb, j, bsc_field_int(s7, l7))
256 j=bc_cat(jb, j, ",\x22struct_dx\x22:" as *u8); j=bc_catn(jb, j, bsc_field_int(s8, l8))
257 j=bc_cat(jb, j, ",\x22struct_bands_oracle\x22:" as *u8); j=bc_catn(jb, j, bsc_field_int(s9, l9))
258 j=bc_cat(jb, j, ",\x22struct_state\x22:\x22" as *u8); j=bc_cat(jb, j, bc_struct_state(srow))
259 j=bc_cat(jb, j, "\x22}" as *u8)
260 }
261 } }
262 }
263 // A MEAN OVER ZERO MEASURED ROWS IS ABSENT, NOT ZERO -- and this organ's own note already said so
264 // ("-1 = UNMEASURED ... never a silent 0") while these two lines printed a 0. Caught 2026-08-26 on
265 // the FIRST real run of the BR2 column: the struct half returned -1 and the recall half returned 0
266 // for exactly the same condition, in the same JSON object. Half a fix living beside the thing it
267 // fixes. Both halves now go through the one bsc_mean so they cannot disagree again.
268 let meanr: i64 = bsc_mean(rsum, rcnt)
269 let meanrat: i64 = bsc_mean(ratsum, ratcnt)
270 j=bc_cat(jb, j, "],\x22n_sites\x22:" as *u8); j=bc_catn(jb, j, nsites)
271 j=bc_cat(jb, j, ",\x22content_ok\x22:" as *u8); j=bc_catn(jb, j, content_ok)
272 j=bc_cat(jb, j, ",\x22blank\x22:" as *u8); j=bc_catn(jb, j, blank)
273 j=bc_cat(jb, j, ",\x22fetch_empty\x22:" as *u8); j=bc_catn(jb, j, fetch_empty)
274 j=bc_cat(jb, j, ",\x22chrome_blocked\x22:" as *u8); j=bc_catn(jb, j, chrome_blocked)
275 j=bc_cat(jb, j, ",\x22mean_reading_recall_pm\x22:" as *u8); j=bc_catn(jb, j, meanr)
276 j=bc_cat(jb, j, ",\x22mean_height_ratio_pct\x22:" as *u8); j=bc_catn(jb, j, meanrat)
277 j=bc_cat(jb, j, ",\x22recall_measured_sites\x22:" as *u8); j=bc_catn(jb, j, rcnt)
278 // ---- BR2 aggregates. The partition is printed so it can be reconciled: a row is measured,
279 // underpowered or unmeasured, and the three must sum to the rows seen.
280 j=bc_cat(jb, j, ",\x22struct_rows_seen\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_ROWS])
281 j=bc_cat(jb, j, ",\x22struct_measured_sites\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_MEASURED])
282 j=bc_cat(jb, j, ",\x22struct_underpowered_sites\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_UNDERPOWERED])
283 j=bc_cat(jb, j, ",\x22struct_unmeasured_sites\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_UNMEASURED])
284 j=bc_cat(jb, j, ",\x22mean_struct_matched_pm\x22:" as *u8); j=bc_catn(jb, j, bsc_mean(acc[BSC_A_SUMPM], acc[BSC_A_MEASURED]))
285 j=bc_cat(jb, j, ",\x22mean_struct_dy\x22:" as *u8); j=bc_catn(jb, j, bsc_mean(acc[BSC_A_SUMDY], acc[BSC_A_MEASURED]))
286 j=bc_cat(jb, j, ",\x22mean_struct_dx\x22:" as *u8); j=bc_catn(jb, j, bsc_mean(acc[BSC_A_SUMDX], acc[BSC_A_MEASURED]))
287 j=bc_cat(jb, j, ",\x22struct_band_floor\x22:" as *u8); j=bc_catn(jb, j, floor)
288 j=bc_cat(jb, j, ",\x22bar_matched_permil_min\x22:" as *u8); j=bc_catn(jb, j, bar_pm)
289 j=bc_cat(jb, j, ",\x22bar_mean_dy_max\x22:" as *u8); j=bc_catn(jb, j, bar_dy)
290 j=bc_cat(jb, j, ",\x22bar_sites_declared\x22:" as *u8); j=bc_catn(jb, j, bar_decl)
291 j=bc_cat(jb, j, ",\x22bar_sites_measured\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_BARN])
292 j=bc_cat(jb, j, ",\x22bar_sites_met\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_BARMET])
293 j=bc_cat(jb, j, ",\x22bar_worst_matched_pm\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_WORSTPM])
294 j=bc_cat(jb, j, ",\x22bar_worst_dy\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_WORSTDY])
295 j=bc_cat(jb, j, ",\x22bar_worst_dx\x22:" as *u8); j=bc_catn(jb, j, acc[BSC_A_WORSTDX])
296 let barv: i64 = bsc_bar_verdict(acc, bar_decl, bar_pm, bar_dy)
297 j=bc_cat(jb, j, ",\x22br2_bar_verdict\x22:\x22" as *u8); j=bc_cat(jb, j, bsc_verdict_name(barv)); j=bc_cat(jb, j, "\x22" as *u8)
298 // ---- THE PAIR. The second leg is its own plane; absent, the verdict is UNOBSERVABLE, which is the
299 // honest reading of a census that only ran one side. Both legs go through bc_leg_means so they can
300 // never be computed by two different rules.
301 let pb: *u8=sys_mmap(BC_PLANE_CAP)
302 let pn: i64=sts_load(BC_PAIR_PLANE, pb, BC_PLANE_CAP-BC_MAGIC_4096)
303 let pl: *i64=sys_mmap(BC_FLD_BYTES) as *i64
304 pl[0]=0-1; pl[1]=0; pl[2]=0-1; pl[3]=0
305 if pn>0 { bc_leg_means(pb, pn, pl) }
306 // ORIENTATION IS READ, NEVER ASSUMED. The first cut of this line passed the OTHER leg as the
307 // CSS-ON argument and the primary as CSS-OFF, which is backwards whenever the primary plane is the
308 // CSS-ON leg -- it would have printed FAVOURS-CSS-ON for a census CSS-OFF had won. BR2's second
309 // clause is a FLIP DECISION, so that is the one error this column must not make. Caught 2026-08-26
310 // by reading this organ's own first output; the modes are now data, taken from the rows themselves.
311 let pmode: i64 = bc_leg_mode(mb, mn)
312 let omode: i64 = bc_leg_mode(pb, pn)
313 var pv: i64 = BSC_PAIR_UNOBSERVABLE
314 if pmode == BC_MODE_ON { if omode == BC_MODE_OFF { pv = bsc_pair_verdict(meanr, rcnt, pl[0], pl[1], pair_band) } }
315 if pmode == BC_MODE_OFF { if omode == BC_MODE_ON { pv = bsc_pair_verdict(pl[0], pl[1], meanr, rcnt, pair_band) } }
316 j=bc_cat(jb, j, ",\x22pair_primary_leg\x22:\x22" as *u8); j=bc_cat(jb, j, bc_mode_name(pmode)); j=bc_cat(jb, j, "\x22" as *u8)
317 j=bc_cat(jb, j, ",\x22pair_other_leg\x22:\x22" as *u8); j=bc_cat(jb, j, bc_mode_name(omode)); j=bc_cat(jb, j, "\x22" as *u8)
318 j=bc_cat(jb, j, ",\x22pair_other_leg_rows\x22:" as *u8); j=bc_catn(jb, j, pl[1])
319 j=bc_cat(jb, j, ",\x22pair_other_leg_mean_recall_pm\x22:" as *u8); j=bc_catn(jb, j, pl[0])
320 j=bc_cat(jb, j, ",\x22pair_other_leg_mean_struct_pm\x22:" as *u8); j=bc_catn(jb, j, pl[2])
321 j=bc_cat(jb, j, ",\x22pair_variance_permil\x22:" as *u8); j=bc_catn(jb, j, pair_band)
322 j=bc_cat(jb, j, ",\x22pair_verdict\x22:\x22" as *u8); j=bc_cat(jb, j, bsc_pair_name(pv)); j=bc_cat(jb, j, "\x22" as *u8)
323 j=bc_cat(jb, j, ",\x22note\x22:\x22reading_recall vs Chrome (1000=parity); -1 = UNMEASURED (excluded from every mean, never a silent 0); struct columns are struct_diff text-line bands and a row whose ORACLE band count is below struct_band_floor is UNDERPOWERED, not a score -- the floor is derived from the bar, since one band moves a reading by 1000/bands permil; pair_verdict compares this plane against knowledge/store/browsercensuspair- and calls anything inside pair_variance_permil TIED; data-driven SEG-STORE plane, add sites without code\x22}" as *u8)
324 // colocate evidence (0x1a4 = 0644)
325 let fd: i64=sys_openat_wr("knowledge/status/browser_census.log\x00" as *u8, 0x1a4)
326 if fd>=0 { sys_write(fd, jb, j); sys_write(fd, "\n\x00" as *u8, 1); sys_close(fd) }
327 sys_write(1, jb, j)
328 sys_write(1, "\n\x00" as *u8, 1)
329 return 0
330}