code wiki / (root) / nx_sreach_scorecard.nx

nx_sreach_scorecard.nx source

↩ module page · 116 lines · 6928 B

1// nx_sreach_scorecard.nx -- the SEARCH lane's S-CLASS-EXCEED scorecard, 2// GATE-DERIVED (Auditor verb: GRADE; the B0 evidence-driven-assessment law: 3// a grade is the LAST verdict of a re-runnable gate, never an assertion). 4// 5// module: nishi-core.search.sreach_scorecard 6// capability: GRADER + EVIDENCE 7// 8// Two layers, kept honest and separate: 9// RUNGS -- every shipped SREACH rung graded from its own gate log's LAST 10// verdict row (stale log = RED, claim without fresh gate). 11// GAPS -- the NAMED remaining work between "policy-layer exceed, gated" 12// and FULL-FIELD S-CLASS EXCEED. A gap is never hidden by a 13// green scorecard; the verdict prints both layers. 14// Durable row -> knowledge/status/sreach_scorecard.log (examinable). 15 16import "nx_str.nx" 17import "nx_syscalls.nx" 18import "nx_gate_green.nx" 19 20func scp(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 } 21func scn(v: i64) -> i64 { 22 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 } 23 var m: i64 = v; if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } 24 let t: *u8 = sys_mmap(28); var k: i64 = 0 25 while m > 0 { t[k] = 0x30 + (m - (m/10)*10); m = m/10; k = k + 1 } 26 while k > 0 { k = k - 1; sys_write(1, (((t as i64)+k) as *u8), 1) } 27 return 0 28} 29func scf(fd: i64, s: *u8) -> i64 { sys_write(fd, s, nx_str_len(s)); return 0 } 30func scfn(fd: i64, v: i64) -> i64 { 31 let b: *u8 = sys_mmap(28); let t: *u8 = sys_mmap(28) 32 var m: i64 = v; if m < 0 { m = 0 - m } 33 var k: i64 = 0 34 if m == 0 { t[0] = 48; k = 1 } 35 while m > 0 { t[k] = 48 + (m % 10); m = m / 10; k = k + 1 } 36 var i: i64 = 0 37 while i < k { b[i] = t[k-1-i]; i = i + 1 } 38 sys_write(fd, b, k) 39 return 0 40} 41 42// line judging = the shared nx_gate_green lib (false-green bug fixed + 43// KAT-pinned there; this module had the buggy private copy -- standards audit) 44func sc_row(lfd: i64, name: *u8, path: *u8, anchor: *u8, pat: *u8, acc: *i64) -> i64 { 45 let g: i64 = gg_gate_green(path, anchor, pat) 46 scp(" "); scp(name); scp(": ") 47 if g == 1 { scp("GREEN\n") } else { scp("RED/ABSENT (gate log missing or last verdict not green)\n") } 48 scf(lfd, "SC-RUNG name=" as *u8); scf(lfd, name) 49 if g == 1 { scf(lfd, " grade=GREEN\n" as *u8) } else { scf(lfd, " grade=RED\n" as *u8) } 50 acc[0] = acc[0] + 1 51 if g == 1 { acc[1] = acc[1] + 1 } 52 return g 53} 54 55func sc_gap(lfd: i64, name: *u8, why: *u8) -> i64 { 56 scp(" GAP "); scp(name); scp(" -- "); scp(why); scp("\n") 57 scf(lfd, "SC-GAP name=" as *u8); scf(lfd, name); scf(lfd, "\n" as *u8) 58 return 0 59} 60 61func main() -> i64 { 62 scp("=== SREACH S-CLASS-EXCEED SCORECARD (gate-derived; rungs then NAMED gaps) ===\n") 63 let lfd: i64 = sys_openat_append("knowledge/status/sreach_scorecard.log" as *u8, 0x1a4) 64 if lfd < 0 { scp(" log open failed\n"); sys_exit(1); return 1 } 65 scf(lfd, "SC-RUN epoch=" as *u8); scfn(lfd, sys_now_realtime_sec()); scf(lfd, "\n" as *u8) 66 let acc: *i64 = sys_mmap(16) as *i64 67 acc[0] = 0 68 acc[1] = 0 69 scp(" RUNGS (each = its own gate's LAST verdict):\n") 70 sc_row(lfd, "R0+R2+R4-loop(policy exceed x2, re-proven per-beat)" as *u8, 71 "knowledge/status/search_reach.log" as *u8, "SREACH-PULSE" as *u8, "verdict=GREEN" as *u8, acc) 72 sc_row(lfd, "R1-own-crawl-reach(live, guarded)" as *u8, 73 "knowledge/status/search_live_reach.log" as *u8, "SREACH-R1 GUARDED GATE:" as *u8, "PASS" as *u8, acc) 74 sc_row(lfd, "R1+-live-ranked-SERP" as *u8, 75 "knowledge/status/search_live_serp.log" as *u8, "SREACH-R1+ LIVE SERP GATE:" as *u8, "PASS" as *u8, acc) 76 sc_row(lfd, "R2-facet-classifier(no gold in ranking)" as *u8, 77 "knowledge/status/search_facets.log" as *u8, "FACET-GATE" as *u8, "verdict=PASS" as *u8, acc) 78 sc_row(lfd, "R2++-neutrality-charter(no-filter, tamper-RED)" as *u8, 79 "knowledge/status/search_neutrality.log" as *u8, "NEUTRALITY-GATE" as *u8, "verdict=GREEN" as *u8, acc) 80 sc_row(lfd, "R3a-ignored-host-census(vk/bunkr class)" as *u8, 81 "knowledge/status/search_ignored_hosts.log" as *u8, "IHR-GATE" as *u8, "verdict=GREEN" as *u8, acc) 82 sc_row(lfd, "R3a.1-wall-triage(control-trusted diagnosis)" as *u8, 83 "knowledge/status/wall_triage.log" as *u8, "WT-VERDICT" as *u8, "verdict=TRUSTED" as *u8, acc) 84 sc_row(lfd, "R3b-crawler-discovery(never hand-curated)" as *u8, 85 "knowledge/status/search_discovery.log" as *u8, "ED-GATE" as *u8, "verdict=GREEN" as *u8, acc) 86 sc_row(lfd, "R4-on-the-team-beat(pulse step green)" as *u8, 87 "knowledge/status/team_pulse.log" as *u8, "name=nx_search_reach_pulse" as *u8, "rc=0" as *u8, acc) 88 89 scp(" NAMED GAPS to FULL-FIELD S-CLASS EXCEED (a green rung never hides these):\n") 90 var gaps: i64 = 0 91 sc_gap(lfd, "SCALE-MULTI-ENTITY" as *u8, "exceed proven on ONE entity/46-doc universe; must hold across query breadth + corpus-scale index (IM lane postings)" as *u8); gaps = gaps + 1 92 sc_gap(lfd, "FULL-ENGINE-FIELD" as *u8, "Yandex/Baidu SERPs bot-walled -> real-browser->CAS capture; field exceed measured, charter exceed only today" as *u8); gaps = gaps + 1 93 scp(" GAP-CLOSED H2-ALPN -- BOTH halves gated+live: CLIENT large-page DONE (ALPN-h2 + streaming >256KB, gated 6/6 + live rumble 200 ~1.2MB) + SERVE DONE (R4-H2-007: in-memory 7/7 + live loopback _h2_serve_loopback_gate GREEN, OUR client<->OUR ALPN-h2 server over real TLS); not counted as a gap\n") 94 sc_gap(lfd, "JS-RENDER" as *u8, "bunkr/bitchute serve JS shells -> content needs the real-browser/render milestone, never faked" as *u8); gaps = gaps + 1 95 sc_gap(lfd, "MEASURED-CV-IN-SERP" as *u8, "content value now MEASURED from bytes at discovery (CAPREG378, corpus feed live); remaining = live SERP consumes corpus + measured-cv in its ranking" as *u8); gaps = gaps + 1 96 sc_gap(lfd, "PERF-RACE" as *u8, "S-class = fast too; latency/efficiency never raced vs incumbents" as *u8); gaps = gaps + 1 97 98 let permil: i64 = (acc[1] * 1000) / (acc[0] + gaps) 99 scp(" rungs green "); scn(acc[1]); scp("/"); scn(acc[0]) 100 scp(" gaps named "); scn(gaps) 101 scp(" progress-to-full-exceed permil="); scn(permil); scp("\n") 102 var policy: i64 = 0 103 if acc[1] == acc[0] { policy = 1 } 104 scp(" POLICY-LAYER S-CLASS EXCEED (reach 2x + research-delivery, gated, on the loop): ") 105 if policy == 1 { scp("ACHIEVED\n") } else { scp("NOT-HELD (a rung gate is red)\n") } 106 scp(" FULL-FIELD S-CLASS EXCEED: NOT-YET (gaps above are the work)\n") 107 scf(lfd, "SREACH-SCORE rungs=" as *u8); scfn(lfd, acc[1]) 108 scf(lfd, "/" as *u8); scfn(lfd, acc[0]) 109 scf(lfd, " gaps=" as *u8); scfn(lfd, gaps) 110 scf(lfd, " permil=" as *u8); scfn(lfd, permil) 111 if policy == 1 { scf(lfd, " policy_exceed=ACHIEVED verdict=ON-LADDER\n" as *u8) } else { scf(lfd, " policy_exceed=NOT-HELD verdict=ATTENTION\n" as *u8) } 112 sys_close(lfd) 113 if policy == 1 { sys_exit(0); return 0 } 114 sys_exit(1) 115 return 1 116}