code wiki / _hdl_build / nx_orchestration_audit.nx
nx_orchestration_audit.nx source
↩ module page · 49 lines · 3496 B
1// nx_orchestration_audit.nx -- acts on the Critic's CONTESTED/blind-spot finding ("ALL recurring work
2// conductor-governed?"). Enumerates the known recurring-work organs (pulses + governed gates) and checks each
3// against the conductor's persistent registry (cr_is_governed): GOVERNED (declared in the conductor) vs UNGOVERNED
4// (runs ad-hoc -> the orchestration gap, since "nothing pulses except through the conductor"). Read-only: it
5// surfaces the gap with real data so the operator + teams decide what to register (owner/cadence) -- it does NOT
6// auto-register (wrong owner/nature would be worse). Turns the Critic's assertion into grounded evidence.
7// expect_exit: 0 license_tier: ORIGINAL
8import "nx_conductor_registry.nx" // cr_is_governed + syscalls
9
10func oa_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
11func oa_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 }
12
13// check one candidate recurring organ; print GOVERNED/UNGOVERNED; return 1 if governed
14func oa_check(name: *u8) -> i64 {
15 let g: i64 = cr_is_governed(name)
16 if g == 1 { oa_puts(" GOVERNED " as *u8) } else { oa_puts(" UNGOVERNED " as *u8) }
17 oa_puts(name); oa_puts("\n" as *u8)
18 return g
19}
20
21func main() -> i64 {
22 oa_puts("=== nx_orchestration_audit: which recurring organs are conductor-governed? (Critic follow-up) ===\n" as *u8)
23 // ensure the registry is seeded/persisted before auditing (idempotent)
24 cr_seed()
25 var gov: i64 = 0; var ung: i64 = 0
26
27 // --- registered governed pulses/gates (expected GOVERNED) ---
28 if oa_check("nx_research_cycle" as *u8)==1 {gov=gov+1} else {ung=ung+1}
29 if oa_check("nx_team_train_gate" as *u8)==1 {gov=gov+1} else {ung=ung+1}
30 if oa_check("nx_sovaudit_ratchet_gate" as *u8)==1 {gov=gov+1} else {ung=ung+1}
31 if oa_check("nx_sprawl_ratchet_gate" as *u8)==1 {gov=gov+1} else {ung=ung+1}
32
33 // --- candidate recurring PULSES found in the tree (expected UNGOVERNED until registered) ---
34 if oa_check("nx_work_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
35 if oa_check("nx_apm_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
36 if oa_check("nx_team_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
37 if oa_check("nx_docpub_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
38 if oa_check("nx_search_reach_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
39 if oa_check("nx_pub_recover_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
40 if oa_check("nx_transient_pulse" as *u8)==1 {gov=gov+1} else {ung=ung+1}
41
42 oa_puts("\n AUDIT: governed="); oa_num(gov); oa_puts(" ungoverned="); oa_num(ung); oa_puts(" (of "); oa_num(gov+ung); oa_puts(" candidates)\n" as *u8)
43 oa_puts(" FINDING: the conductor governs the registered pulses; the UNGOVERNED ones either run ad-hoc OR are\n" as *u8)
44 oa_puts(" governed by a SEPARATE register (e.g. nx_work_pulse_register) = orchestration FRAGMENTATION to unify.\n" as *u8)
45 oa_puts(" S-CLASS ORCHESTRATION = every recurring organ declared in ONE conductor registry (owner+cadence), none ad-hoc.\n" as *u8)
46 oa_puts(" NEXT (operator+teams decide owner/cadence per organ, then register via cr_seed): converge all -> the conductor.\n" as *u8)
47 oa_puts(" AUDIT-OK\n" as *u8)
48 sys_exit(0); return 0
49}