code wiki / _hdl_build / nx_research_conduct.nx
nx_research_conduct.nx source
↩ module page · 43 lines · 3317 B
1// nx_research_conduct.nx -- the NISHI-NATIVE autonomy wiring: admit the research CYCLE through the CONDUCTOR
2// (not cron, not bash, not me hand-running). Per nx_conductor_pulse, recurring work may only fire if ADMITTED:
3// (1) OWNED by an Accountable role -> "researcher" owns the research cycle (cp_owner_ok)
4// (2) GATE-GREEN -> nx_research_gate passes (the 24-index alignment+queryable gate) (cp_run_gate)
5// (3) NEVER-BRICK -> the cycle touches NO hardware (pure files/indexes) -> touches_hw=0
6// If admitted, the conductor's pulse fires nx_research_cycle on its cadence via cp_fire_governed -- so the whole
7// self-improving loop runs autonomously THROUGH the conductor's governance, exactly like nothing ships except
8// through the publisher. This organ computes + reports the admission (and exits non-zero if REJECTED, so a broken
9// system is never pulsed). Sovereign, no shell. expect_exit: 0 license_tier: ORIGINAL
10import "nx_conductor_registry.nx" // cr_is_governed + raci_is_accountable + cp_* (full conductor governance)
11
12func rcd_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
13func rcd_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
14
15func main() -> i64 {
16 rcd_puts("=== nx_research_conduct: is the research cycle a FULLY GOVERNED conductor pulse? ===\n" as *u8)
17
18 // (0) REGISTERED in the conductor's persistent registry (cr_seed -> seg_store)
19 let registered: i64 = cr_is_governed("nx_research_cycle" as *u8)
20 rcd_puts(" registered(nx_research_cycle)=" as *u8); rcd_num(registered); rcd_puts(" (1=in the conductor registry)\n" as *u8)
21
22 // (1) OWNED: RACI-accountable from the SOVEREIGN RACI store -- the real admission ownership check
23 let owner_ok: i64 = raci_is_accountable("researcher" as *u8)
24 rcd_puts(" raci_accountable(researcher)=" as *u8); rcd_num(owner_ok); rcd_puts("\n" as *u8)
25
26 // (2) GATE-GREEN: the researcher-system gate must pass before the cycle may pulse (#7 never pulse a broken organ)
27 let gate_exit: i64 = cp_run_gate("nx_research_gate" as *u8)
28 rcd_puts(" gate(nx_research_gate)_exit=" as *u8); rcd_num(gate_exit); rcd_puts(" (0=GREEN)\n" as *u8)
29
30 // (3) NEVER-BRICK: the cycle is pure indexing/files -> touches no hardware -> admissible by construction
31 let admitted: i64 = cp_admit(owner_ok, gate_exit, 0, 0)
32 rcd_puts(" ADMISSION=" as *u8); rcd_num(admitted); rcd_puts(" (1=ADMIT,0=REJECT)\n" as *u8)
33
34 var governed: i64 = 0
35 if registered == 1 { if admitted == CP_ADMIT { governed = 1 } }
36 if governed == 1 {
37 rcd_puts(" FULLY GOVERNED: registered + RACI-owned + gate GREEN + no-hardware -> the conductor fires nx_research_cycle\n" as *u8)
38 rcd_puts(" on cadence via cr_conductor_fire. The self-improving researcher loop runs autonomously, GOVERNED, the Nishi way.\n" as *u8)
39 sys_exit(0); return 0
40 }
41 rcd_puts(" NOT yet fully governed (see flags above) -- registration persisted; fix the failing predicate then re-check.\n" as *u8)
42 sys_exit(1); return 1
43}