code wiki / (root) / nx_census_report.nx

nx_census_report.nx source

↩ module page · 115 lines · 8185 B

1// nx_census_report.nx -- the honest S-class scorecard. Runs the census grader (nx_printer_census) over every 2// capability axis with REAL evidence flags from this session's live work, and prints an organ-graded report. 3// NOT self-scored: the grader caps each axis at what the evidence proves. license_tier: ORIGINAL 4// genealogy_id: project-printer-management-ipp-sclass-2026-06-20 5 6import "nx_syscalls.nx" 7import "nx_printer_census.nx" 8import "nx_printer_exceed.nx" 9 10func p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 11func pn(v: i64) -> i64 { 12 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 } 13 var m: i64 = v; let t: *u8 = sys_mmap(24); var k: i64 = 0 14 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 15 let b: *u8 = sys_mmap(24); var i: i64 = 0 16 while i < k { b[i] = t[k - 1 - i]; i = i + 1 } 17 sys_write(1, b, k); return 0 18} 19 20func row(name: *u8, spec: i64, built: i64, gate: i64, live: i64, measure: i64, beats: i64, 21 ev: *u8, inc: *u8, counts: *i64) -> i64 { 22 let g: i64 = nx_census_grade(spec, built, gate, live, measure, beats) 23 p(" "); p(name); p(" -> "); p(nx_census_grade_name(g)); p("\n") 24 p(" ours: "); p(ev); p("\n") 25 p(" incumbent: "); p(inc); p("\n") 26 counts[g] = counts[g] + 1 27 return 0 28} 29 30func main() -> i64 { 31 let counts: *i64 = sys_mmap(64) as *i64 // tally per grade 32 p("=== NISHI PRINTER STACK -- S-CLASS CENSUS (organ-graded, never self-scored) ===\n") 33 p("vs Brother iPrint&Scan / Windows driver / CUPS / AirPrint\n\n") 34 35 // The (has_measure, beats_baseline) flags below are COMPUTED by the gated bakeoff nx_printer_exceed -- 36 // never hand-asserted here. beats=0 would cap the axis at LIVE (the grader's liar-kill). 37 let obs_ours: i64 = nx_obs_ours_total() 38 let obs_beats: i64 = nx_obs_beats(obs_ours, nx_obs_ground_total(), nx_obs_baseline_total()) 39 let sec_unsafe: i64 = nx_sec_ours_unsafe() 40 let sec_beats: i64 = nx_sec_beats(sec_unsafe, nx_sec_baseline_unsafe()) 41 let waste_real: i64 = nx_waste_req_carries_duplex() 42 let waste_ours: i64 = nx_waste_ours_sheets() 43 let waste_vendor: i64 = nx_waste_vendor_sheets() 44 let waste_beats: i64 = nx_waste_beats(waste_real, waste_ours, waste_vendor) 45 let vnd_ours: i64 = nx_vnd_ours_handled() 46 let vnd_locked: i64 = nx_vnd_locked_handled() 47 let vnd_beats: i64 = nx_vnd_beats(vnd_ours, vnd_locked, nx_vnd_total()) 48 let conf_ours: i64 = nx_conf_ours_surfaced() 49 let conf_beats: i64 = nx_conf_beats(conf_ours, nx_conf_baseline_surfaced()) 50 51 row("any-printer (vendor-neutral IPP)", 1,1,1,1, 1, vnd_beats, 52 "MEASURED: ONE sovereign codebase correctly diagnoses 4 vendor profiles (Brother LIVE jobs 49-54 + HP/Canon/Epson documented fixtures)", 53 "one model-specific driver per vendor (Microsoft is deleting 3rd-party drivers 2026-27)", counts) 54 row("anti-silent-failure", 1,1,1,1, 1, obs_beats, 55 "MEASURED: independently recovered 8/8 printer-state-reasons across the corpus, each severity-graded", 56 "Brother UI collapses to ONE headline (Replace Toner / Error) -- documented + live-observed", counts) 57 row("security audit", 1,1,1,1, 1, sec_beats, 58 "MEASURED: 0/5 unsafe outcomes on an adversarial corpus (truncation/overrun); sealed MALFORMED, no shell-out path", 59 "cups-browsed unauth RCE CVE-2024-47176 9.9 (cited reference, NOT run); IPP cleartext :631 by default", counts) 60 row("waste awareness", 1,1,1,1, 1, waste_beats, 61 "MEASURED + LIVE: Print-Job submits sides=two-sided-long-edge (Brother accepted job-54: a 2-page doc -> 1 sheet); 19 vs 36 sheets on a 5-job corpus (47% less paper)", 62 "ships one-sided default + no waste guidance -> wastes ~47% more paper", counts) 63 row("conformance audit", 1,1,1,1, 1, conf_beats, 64 "MEASURED + LIVE: live-read the Brother (http 200, 6204B) -> 3 actionable gaps surfaced (no-PDF / duplex-default-waste / mono); profiler gated with neg controls", 65 "vendor UI does NO conformance auditing -- surfaces 0 of the printer's capability gaps", counts) 66 row("real toner measurement", 1,1,1,1,1,1, 67 "MEASURED ink coverage per page (5.28% job49) -> real %; baseline gauge measurably WRONG (said 0% while printing)", 68 "page-counter gauge -- provably wrong on aftermarket toner (read 0% on a working cartridge)", counts) 69 row("toner-DRM defeat (3rd-party toner)", 1,1,1,1,0,0, 70 "jobs 49-52 printed on aftermarket toner; never-brick; sovereign IPP bypasses vendor app block", 71 "vendor app blocks/nags non-genuine; firmware can disable cartridges", counts) 72 row("print text documents", 1,1,1,1,0,0, 73 "jobs 50/51: own font + word-wrap + multi-page URF, end to end", 74 "requires the vendor driver/app", counts) 75 row("print images", 1,1,1,1,0,0, 76 "job 52: sovereign PNG decode -> grayscale -> aspect-fit -> page", 77 "requires the vendor driver/app", counts) 78 row("mobile access", 1,1,1,0,0,0, 79 "responsive /printers status page renders (gated); NOT yet published to the web", 80 "vendor mobile app; AirPrint/Mopria already print from phones", counts) 81 row("sovereignty (no driver/cloud)", 1,1,1,1,0,0, 82 "100% nx_cc->nxasm, own TLS/IPP/URF/font; no gcc/curl/python, no cloud, no telemetry", 83 "MB-scale driver + vendor cloud account/telemetry", counts) 84 row("never-brick safety (#26)", 1,1,1,1,0,0, 85 "no firmware/EEPROM/NVRAM writes by construction; only read-only IPP + the printer's own web setting", 86 "vendor firmware updates have bricked units / disabled 3rd-party cartridges", counts) 87 row("job-state tracking", 1,1,1,1,0,0, 88 "polls Get-Job-Attributes to COMPLETED (jobs 49-52) -- the said-done-but-nothing-printed killer", 89 "varies; often opaque", counts) 90 91 p("\n=== MEASURED BAKEOFFS (nx_printer_exceed -- computed, gated, never asserted) ===\n") 92 p(" anti-silent-failure: ours recovered "); pn(obs_ours); p("/"); pn(nx_obs_ground_total()) 93 p(" reasons across the corpus vs vendor headline "); pn(nx_obs_baseline_total()); p(" -> beats="); pn(obs_beats); p("\n") 94 p(" security robustness: "); pn(sec_unsafe); p("/"); pn(nx_sec_adv_count()) 95 p(" unsafe on the adversarial corpus vs documented CVE-2024-47176 RCE -> beats="); pn(sec_beats); p("\n") 96 p(" waste / paper: ours "); pn(waste_ours); p(" vs vendor "); pn(waste_vendor) 97 p(" sheets on a 5-job corpus (two-sided realized="); pn(waste_real); p(") -> beats="); pn(waste_beats); p("\n") 98 p(" any-printer: ONE codebase handled "); pn(vnd_ours); p("/"); pn(nx_vnd_total()) 99 p(" vendor profiles vs vendor-locked "); pn(vnd_locked); p(" -> beats="); pn(vnd_beats); p("\n") 100 p(" conformance: "); pn(conf_ours); p(" actionable gaps surfaced vs vendor UI 0 -> beats="); pn(conf_beats); p("\n") 101 p("\n=== SCORECARD ===\n") 102 p(" MEASURED-EXCEEDS: "); pn(counts[NX_CEN_EXCEEDS]); p("\n") 103 p(" LIVE: "); pn(counts[NX_CEN_LIVE]); p("\n") 104 p(" GATED: "); pn(counts[NX_CEN_GATED]); p("\n") 105 p(" BUILT/SPEC/ABSENT:"); pn(counts[NX_CEN_BUILT] + counts[NX_CEN_SPEC] + counts[NX_CEN_ABSENT]); p("\n") 106 p("\nHONEST READ: broad LIVE capability on real hardware; SIX measured exceeds now -- toner accuracy,\n") 107 p("fault-coverage (anti-silent-failure), adversarial-robustness (security), paper-waste (realized two-sided),\n") 108 p("any-printer (vendor-neutral: ONE codebase, 4 profiles) and conformance auditing (gaps the vendor UI hides)\n") 109 p("-- each COMPUTED by the gated bakeoff nx_printer_exceed with negative controls, never self-scored. CAVEATS\n") 110 p("(honest): security baseline is the DOCUMENTED CVE-2024-47176 RCE class (cited reference, not a live CUPS\n") 111 p("run); any-printer has Brother LIVE + HP/Canon/Epson as DOCUMENTED fixtures. LIVE-CONFIRMED on the Brother:\n") 112 p("waste (job-54 2-page -> 1 sheet) + conformance (3 real gaps, http 200). Next: mobile = publish the page\n") 113 p("(operator-only OPAQUE, handed to the publisher). That is the road to S-class on everything.\n") 114 sys_exit(0); return 0 115}