code wiki / _hdl_build / nx_team_chain_test.nx

nx_team_chain_test.nx source

↩ module page · 68 lines · 4201 B

1// nx_team_chain_test.nx -- ENGINEER's gate for the executed chain: a 5-candidate research-grounded 2// backlog goes in; the PM classifies+gates the plan; the three grounded+actionable items come out as 3// ADMITTED capabilities with zero hand-driving (incl. the THRESHOLD_TABLE route, first exercise of 4// that emitter through the Warden); the thin-evidence and unknown-action items stay honestly 5// BLOCKED/PURSUE. Numbers are the lane's REAL researched values (PETG capacity curve 190->6000/ 6// 210->10000/230->13000 milli-mm3/s; jam window 180..260C; polite-fetch 1500ms/500ms/8s). 7// license_tier: ORIGINAL 8import "nx_team_chain.nx" 9 10func main() -> i64 { 11 var pass: i64 = 0 12 // the PM's candidate table (corroboration, action-known, charter layer, dep depth, dependency) 13 let corrob: *i64 = sys_mmap(64) as *i64 14 let known: *i64 = sys_mmap(64) as *i64 15 let layer: *i64 = sys_mmap(64) as *i64 16 let depth: *i64 = sys_mmap(64) as *i64 17 let dep: *i64 = sys_mmap(64) as *i64 18 // 0: PETG capacity curve (x2 sources, actionable) 19 corrob[0]=2; known[0]=1; layer[0]=3; depth[0]=0; dep[0]=0-1 20 // 1: jam temp window verdict (x3 sources, actionable) 21 corrob[1]=3; known[1]=1; layer[1]=3; depth[1]=0; dep[1]=0-1 22 // 2: polite-fetch governor (x2 sources -- the Wikimedia 403/UA lesson, actionable) 23 corrob[2]=2; known[2]=1; layer[2]=2; depth[2]=0; dep[2]=0-1 24 // 3: spectral-slope novelty metric (x1 source, action NOT yet designed) 25 corrob[3]=1; known[3]=0; layer[3]=4; depth[3]=0; dep[3]=0-1 26 // 4: dopant diffusion profile (no evidence yet) 27 corrob[4]=0; known[4]=1; layer[4]=5; depth[4]=0; dep[4]=0-1 28 // KAT 1: the PM's S-class spec gate admits the plan (grounded 800 permil >= 600, order monotonic) 29 if ag_spec_gate(corrob, layer, depth, dep, 5, 600) == 1 { pass = pass + 1 } 30 // KAT 2: classification honesty (3 BUILD, 1 BLOCKED, 1 PURSUE) 31 if ag_classify(corrob[0], known[0]) == AG_BUILD { pass = pass + 1 } 32 if ag_classify(corrob[1], known[1]) == AG_BUILD { pass = pass + 1 } 33 if ag_classify(corrob[2], known[2]) == AG_BUILD { pass = pass + 1 } 34 if ag_classify(corrob[3], known[3]) == AG_BLOCKED { pass = pass + 1 } 35 if ag_classify(corrob[4], known[4]) == AG_PURSUE { pass = pass + 1 } 36 cn_report("_cn_slope" as *u8, AG_BLOCKED, 0, 0) 37 cn_report("_cn_dopant" as *u8, AG_PURSUE, 0, 0) 38 // the executable specs for the BUILD items (traits + researched params per CN_STRIDE row) 39 let spec: *i64 = sys_mmap(256) as *i64 40 spec[0]=PLC_IN_TABLE; spec[1]=PLC_OUT_VALUE; spec[2]=190; spec[3]=6000; spec[4]=210; spec[5]=10000; spec[6]=230; spec[7]=13000 41 spec[8]=PLC_OUT_VERDICT; spec[9]=0-1; spec[10]=180; spec[11]=260 42 spec[16]=PLC_HAS_TIME; spec[17]=PLC_IN_STATE; spec[18]=1500; spec[19]=500; spec[20]=8000 43 // KAT 3: the chain BUILDS all three, hands-off 44 let out: *i64 = sys_mmap(32) as *i64 45 let pats: *i64 = sys_mmap(32) as *i64 46 var admitted: i64 = 0 47 var st: i64 = cn_build_one(spec, 0, "_cn_flow" as *u8, out) 48 cn_report("_cn_flow" as *u8, AG_BUILD, st, out[2]) 49 pats[0] = out[0] 50 if st == BP_ADMITTED { if out[2] == 1 { pass = pass + 1; admitted = admitted + 1 } } 51 st = cn_build_one(spec, 1, "_cn_jam" as *u8, out) 52 cn_report("_cn_jam" as *u8, AG_BUILD, st, out[2]) 53 pats[1] = out[0] 54 if st == BP_ADMITTED { if out[2] == 1 { pass = pass + 1; admitted = admitted + 1 } } 55 st = cn_build_one(spec, 2, "_cn_fetch" as *u8, out) 56 cn_report("_cn_fetch" as *u8, AG_BUILD, st, out[2]) 57 pats[2] = out[0] 58 if st == BP_ADMITTED { if out[2] == 1 { pass = pass + 1; admitted = admitted + 1 } } 59 // KAT 4: every build was pattern-covered (batch autonomy = 1000 permil over the BUILD set) 60 if bp_autonomy_permil(pats, 3) == 1000 { pass = pass + 1 } 61 // KAT 5: the chain summary records ALL-BUILDS-ADMITTED with the plan's true grounding 62 if cn_summary(5, 3, admitted, ag_grounded_permil(corrob, 5)) == 1 { pass = pass + 1 } 63 64 wb_w(1, "TEAM CHAIN: passed=" as *u8); wb_wn(1, pass); wb_w(1, "/11 (backlog->assignments->3 ADMITTED builds, BLOCKED+PURSUE honest)\n" as *u8) 65 if pass == 11 { sys_exit(0) } 66 sys_exit(1) 67 return 1 68}