code wiki / _hdl_build / nx_browser_census.nx
nx_browser_census.nx
buildroot/runtime/_hdl_build/nx_browser_census.nx
about
nx_browser_census.nx -- SOVEREIGN browser-parity census scoreboard organ (MCP tool + API payload).
Operator directive 2026-07-23: "mcp and api and object oriented and agentic and workflow ready ... it needs
to scale." Replaces the one-off PowerShell -> static-JSON pipeline (the scattering root) with a data-driven
sovereign organ: sites + per-site results live in the SEG-STORE PLANE knowledge/store/browsercensus- (NOT
hardcoded, NOT a tsv per the sovereign-formats law) -> ADD SITES WITHOUT TOUCHING CODE = scales to N.
Reads the plane, parses each site RECORD, aggregates a SCOREBOARD (mean reading-recall vs Chrome, class
counts, mean height-ratio), emits structured JSON to stdout (the MCP + API payload) AND colocates it to
knowledge/status/browser_census.log (evidence). Fail-closed: absent/empty plane -> RED exit 1 (no scoreboard
without data).
---- BR2, 2026-08-26: THE STRUCTURAL-EXACTNESS COLUMN (rung BR2, symbol bc_struct_col) ----------------
The operator ratchet of 2026-07-28 is EXACT structural match to Chrome/Edge/Firefox, measured by
struct_diff matched-permil with dy and dx toward 0. Until today that lived in hand-run readings pasted
into a plan row; the census -- the thing that publishes -- had no column for it, so the ratchet could
not be tracked per site and could not be judged mechanically.
Row schema, now TEN tab fields (the last four are ADDITIVE -- a six-field row still parses and its
struct columns read UNMEASURED, never a silent 0):
site class reading_recall_pm ratio_pct chrome_h nishi_h
struct_matched_pm struct_dy struct_dx struct_bands_oracle
THE FOURTH NEW COLUMN IS THE DENOMINATOR AND IT IS NOT DECORATION. Measured on saved bytes on
2026-08-26 with the incumbent ruler: google returned "matched=2 (1000 permille)" over TWO oracle text
bands, and stackoverflow returned "matched=0 (0 permille)" over ZERO. A perfect score and a total
failure, both arithmetic on an empty subject, both arriving as a number a scoreboard would average.
bsc_band_floor() derives the smallest usable denominator FROM THE BAR itself and such rows are counted
as UNDERPOWERED -- named, excluded, never averaged and never silently dropped.
reading_recall_pm/ratio_pct = "-" or non-digit means UNMEASURED (excluded from the mean, never a silent 0).
Workflow-ready: one plane row per site, one JSON record per site -> composable/fan-out. license_tier: ORIGINAL
expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nxnx_browser_struct_col_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 36 | const BC_MAGIC_4096: i64 = 4096 |
| 38 | const BC_PLANE_CAP: i64 = 1048576 |
| 39 | const BC_JSON_CAP: i64 = 262144 |
| 42 | const BC_MAXF: i64 = 10 |
| 43 | const BC_WORD: i64 = 8 |
| 44 | const BC_FLD_BYTES: i64 = 80 // BC_MAXF * BC_WORD |
| 45 | const BC_SITECAP: i64 = 512 |
| 46 | const BC_MODECAP: i64 = 64 |
| 47 | const BC_PAIR_PLANE: *u8 = "knowledge/store/browsercensuspair-\x00" |
| 150 | const BC_MODE_UNKNOWN: i64 = 0 |
| 151 | const BC_MODE_ON: i64 = 1 |
| 152 | const BC_MODE_OFF: i64 = 2 |
functions
| 50 | func 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 } |
| 51 | func 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 } called by 1: main |
| 52 | func 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 } called by 1: main |
| 53 | func bc_catn(o: *u8, at: i64, v: i64) -> i64 |
| 63 | func bc_field_has(p: *u8, n: i64, sub: *u8) -> i64 |
| 75 | func bc_field_int(p: *u8, n: i64) -> i64 |
| 93 | func 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 |
| 100 | func bc_struct_state(r: i64) -> *u8 called by 1: main |
| 109 | func bc_leg_means(mb: *u8, mn: i64, out: *i64) -> i64 |
| 153 | func bc_mode_name(m: i64) -> *u8 called by 1: main |
| 158 | func bc_leg_mode(mb: *u8, mn: i64) -> i64 |
| 180 | func main() -> i64 |