code wiki / _hdl_build / nx_ecosystem_maturity_rollup.nx

nx_ecosystem_maturity_rollup.nx source

↩ module page · 51 lines · 3522 B

1// nx_ecosystem_maturity_rollup.nx -- THE unifier CLI, SOVEREIGN edition: one re-runnable command that 2// measures the whole ecosystem's maturity (depth x breadth) from the NATIVE seg_store (knowledge/store/ 3// ecomat -- no TSV) + the live autonomy ledger, prints the picture, writes a durable ledger line, and 4// exits GREEN/RED by the liar-kill. "Where are we?" = one command, sourced from the sovereign store. 5// argv[1]=store_prefix argv[2]=autonomy_log argv[3]=out_log. license_tier: ORIGINAL 6import "nx_ecomat_lib.nx" 7 8func main(argc: i64, argv: *i64) -> i64 { 9 var store: *u8 = ECOMAT_STORE 10 var autolog: *u8 = "knowledge/status/autonomy_meter.log" as *u8 11 var outlog: *u8 = "knowledge/status/ecosystem_maturity.log" as *u8 12 if argc >= 2 { store = argv[1] as *u8 } 13 if argc >= 3 { autolog = argv[2] as *u8 } 14 if argc >= 4 { outlog = argv[3] as *u8 } 15 _p("=== NISHI ECOSYSTEM MATURITY ROLLUP -- sovereign seg_store, measured never asserted ===\n" as *u8) 16 let out: *i64 = sys_mmap(256) 17 let verdict: i64 = em_rollup_store(store, autolog, out, 1) 18 if out[2] == 0 { _p("\n store EMPTY -- run nx_ecomat_seed first (authors knowledge/store/ecomat)\n" as *u8); sys_exit(1); return 1 } 19 let lfd: i64 = sys_openat_append(outlog, 0x1a4) 20 if lfd >= 0 { 21 _fp(lfd, "ECOMAT epoch=" as *u8); _fn(lfd, sys_now_realtime_sec()) 22 _fp(lfd, " domains=" as *u8); _fn(lfd, out[2]) 23 _fp(lfd, " overall_permil=" as *u8); _fn(lfd, out[0]) 24 _fp(lfd, " sum_cur=" as *u8); _fn(lfd, out[6]) 25 _fp(lfd, " sum_bar=" as *u8); _fn(lfd, out[7]) 26 _fp(lfd, " sclass_plus=" as *u8); _fn(lfd, out[3]) 27 _fp(lfd, " absent=" as *u8); _fn(lfd, out[4]) 28 _fp(lfd, " autonomy_permil=" as *u8); _fn(lfd, out[5]) 29 _fp(lfd, " liar_kill=" as *u8); _fn(lfd, out[1]) 30 _fp(lfd, " triangulated=" as *u8); _fn(lfd, out[8]) 31 _fp(lfd, " conflict=" as *u8); _fn(lfd, out[9]) 32 _fp(lfd, " single=" as *u8); _fn(lfd, out[10]) 33 _fp(lfd, " dangling=" as *u8); _fn(lfd, out[11]) 34 _fp(lfd, " src=seg_store verdict=" as *u8) 35 if verdict == 0 { _fp(lfd, "GREEN" as *u8) } else { _fp(lfd, "RED" as *u8) } 36 _fp(lfd, "\n" as *u8) 37 sys_close(lfd) 38 } 39 _p("\n OVERALL maturity toward S-class (depth x breadth) = " as *u8); _fn(1, out[0]) 40 _p(" permil (" as *u8); _fn(1, out[6]); _p("/" as *u8); _fn(1, out[7]); _p(" levels across " as *u8); _fn(1, out[2]); _p(" domains)\n" as *u8) 41 _p(" live autonomy = " as *u8); _fn(1, out[5]); _p(" permil | S-class reached in " as *u8); _fn(1, out[3]) 42 _p(" domains | ABSENT in " as *u8); _fn(1, out[4]); _p(" domains\n" as *u8) 43 let stored_n: i64 = out[2] - out[8] - out[10] - out[9] - out[11] 44 _p(" VALIDATION (triangulated = 2+ INDEPENDENT sources that converge): triangulated " as *u8); _fn(1, out[8]) 45 _p(" / single-source " as *u8); _fn(1, out[10]); _p(" / stored " as *u8); _fn(1, stored_n); _p(" / DANGLING " as *u8); _fn(1, out[11]); _p(" / CONFLICTS " as *u8); _fn(1, out[9]); _p("\n" as *u8) 46 if out[11] > 0 { _p(" ^ DANGLING = evidence pointer declared but its log is missing/unreadable -> grade is the UNVERIFIED stored assertion (regenerate the gate log to validate)\n" as *u8) } 47 _p(" source: knowledge/store/ecomat (sovereign seg_store, no TSV) durable: ecosystem_maturity.log verdict=" as *u8) 48 if verdict == 0 { _p("GREEN\n" as *u8) } else { _p("RED (liar-kill fired)\n" as *u8) } 49 sys_exit(verdict) 50 return verdict 51}