code wiki / _hdl_build / nx_office_census_gate.nx

nx_office_census_gate.nx source

↩ module page · 68 lines · 4789 B

1// nx_office_census_gate.nx -- GATE: the OFFICE-SUITE capability census, reusing the improved capability-comparison 2// engine (nx_capability_census) to map a sovereign Nishi office suite vs Microsoft PowerPoint/Office. our-grade is 3// disk-fact (an organ on disk), competitor evidence is corroborated over the sovereign-fetched office corpus (run the 4// researcher to populate). This NAILS DOWN the roadmap: what we already have (presentation via nx_deck) and what the 5// superior sovereign suite still needs (docs/sheets/charts/collab/diagrams). 6// T1 HAVE -- nx_deck on disk -> presentation editor us=PRESENT. 7// T2 LIAR -- a non-existent doc organ -> ABSENT (cannot fake PRESENT). 8// T3 VERDICT-- reuse the engine's GAP/AHEAD logic. 9// Then prints the office matrix. GREEN iff T1-T3. Sovereign nx_cc->nxasm. expect_exit: 0 license_tier: ORIGINAL 10import "nx_capability_census.nx" 11import "nx_syscalls.nx" 12 13func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 14func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } 15 16func demo_row(label: *u8, term: *u8, organ: *u8, exceed: *u8, paths: *i64, npaths: i64, buf: *u8, cap: i64) -> i64 { 17 let comp: i64 = cc_comp_attest(paths, npaths, term, buf, cap) 18 let our: i64 = cc_our_grade(organ, exceed) 19 let v: i64 = cc_verdict(comp, our) 20 w(" "); w(cc_verdict_str(v)); w(" us="); w(cc_grade_str(our)); w(" them(src="); wn(comp); w(") "); w(label); w("\n") 21 return 0 22} 23 24func main() -> i64 { 25 w("=== nx_office_census_gate: Nishi office suite vs Microsoft PowerPoint/Office (improved census) ===\n" as *u8) 26 var pass: i64 = 0; var total: i64 = 0 27 let cap: i64 = 2097152 28 let buf: *u8 = sys_mmap(cap) 29 let none: *u8 = "runtime/nx_NONE_zz.nx" as *u8 30 let deck: *u8 = "runtime/_hdl_build/nx_deck.nx" as *u8 31 32 // T1 we have a presentation editor 33 let g1: i64 = cc_our_grade(deck, none) 34 total=total+1; if g1==3 { pass=pass+1; w(" [PASS] " as *u8) } else { w(" [FAIL] " as *u8) } 35 w("T1 HAVE: presentation editor (nx_deck) us=" as *u8); wn(g1); w(" (PRESENT)\n" as *u8) 36 37 // T2 liar-kill: doc editor absent 38 let g2: i64 = cc_our_grade("runtime/nx_doc_NONE.nx" as *u8, none) 39 total=total+1; if g2==0 { pass=pass+1; w(" [PASS] " as *u8) } else { w(" [FAIL] " as *u8) } 40 w("T2 LIAR: missing doc organ us=" as *u8); wn(g2); w(" (ABSENT, cannot fake)\n" as *u8) 41 42 // T3 verdict logic 43 var t3: i64 = 1 44 if cc_verdict(1,0)!=1 { t3=0 } // they have, we ABSENT -> GAP 45 if cc_verdict(0,3)!=3 { t3=0 } // we have, they unattested -> AHEAD 46 total=total+1; if t3==1 { pass=pass+1; w(" [PASS] " as *u8) } else { w(" [FAIL] " as *u8) } 47 w("T3 VERDICT: GAP/AHEAD logic reused from the engine\n" as *u8) 48 49 // the office matrix 50 let subj: *i64=sys_mmap(8*4) as *i64 51 subj[0]="knowledge/fetched/office_powerpoint.raw" as *u8 as i64 52 subj[1]="knowledge/fetched/office_msoffice.raw" as *u8 as i64 53 subj[2]="knowledge/fetched/office_comparison.raw" as *u8 as i64 54 let ns: i64 = 3 55 w("\n --- Microsoft PowerPoint/Office vs Nishi office suite (them-src from fetched office_*.raw; 0 = run researcher) ---\n" as *u8) 56 demo_row("presentation / slides editor" as *u8, "presentation" as *u8, deck, none, subj, ns, buf, cap) 57 demo_row("superior sovereign deck format (.ndeck)" as *u8, "format" as *u8, deck, none, subj, ns, buf, cap) 58 demo_row("PowerPoint .pptx OOXML export" as *u8, "PowerPoint" as *u8, deck, none, subj, ns, buf, cap) 59 demo_row("word-processor / document editor" as *u8, "document" as *u8, "runtime/nx_doc_NONE.nx" as *u8, none, subj, ns, buf, cap) 60 demo_row("spreadsheet + formulas" as *u8, "spreadsheet" as *u8, "runtime/nx_sheet_NONE.nx" as *u8, none, subj, ns, buf, cap) 61 demo_row("charts / data visualization" as *u8, "chart" as *u8, "runtime/nx_chart_NONE.nx" as *u8, none, subj, ns, buf, cap) 62 demo_row("real-time multi-user collaboration" as *u8, "collaborat" as *u8, "runtime/nx_collab_NONE.nx" as *u8, none, subj, ns, buf, cap) 63 demo_row("diagram / drawing editor" as *u8, "diagram" as *u8, "runtime/nx_diagram_NONE.nx" as *u8, none, subj, ns, buf, cap) 64 65 w("\n=== nx_office_census_gate " as *u8); wn(pass); w("/" as *u8); wn(total) 66 if pass == total { w(" GREEN (office-suite map nailed down: presentation HAVE; docs/sheets/charts/collab/diagrams = the sovereign-suite roadmap)\n" as *u8); sys_exit(0); return 0 } 67 w(" RED\n" as *u8); sys_exit(1); return 1 68}