code wiki / _hdl_build / nx_roster_full.nx
nx_roster_full.nx source
↩ module page · 114 lines · 6719 B
1// nx_roster_full.nx -- the COMPLETE team roster + partition audit (operator: "make sure we dont miss
2// genealogist and the other novel roles we have and their capabilities"). My earlier nx_raci_audit had
3// only 10 roles -- it MISSED the novel ones (Racing/Examiner/Critic/Auditor/Genealogist/Caretaker/
4// Scientist/Market-Researcher/Hub + the Conductor/Warden split). This audits ALL ~20, each bound to ONE
5// distinct VERB and mapped to its OWNING capability, and proves the partition is clean -- with a special
6// guard on the EVALUATION CLUSTER (Racing/Referee/Examiner/Critic/Auditor) which the v1 roster wrongly
7// folded together: COMPETE / JUDGE / SELF-GRADE / COUNTER / AUDIT are five different verbs.
8// Composes nx_role_audit (ra_distinct). LAWS: struct-free, integer-only. license_tier: ORIGINAL
9import "nx_role_audit.nx"
10import "nx_syscalls.nx"
11
12const RST_N: i64 = 20
13
14const TV_AUTHOR: i64 = 1 // BUILDER [nx_scaffold_author / nx_pattern_emit]
15const TV_TEST: i64 = 2 // ENGINEER [nx_engineer_verify]
16const TV_HEAL: i64 = 3 // DOCTOR [nx_doctor_build]
17const TV_SEARCH: i64 = 4 // RESEARCHER [nx_research_synth / nx_research_backlog]
18const TV_JUDGE: i64 = 5 // REFEREE [nx_referee]
19const TV_PLAN: i64 = 6 // PM [nx_pm_plan / nx_assign_gen]
20const TV_ADMIT: i64 = 7 // COUNCIL [nx_ingest_governed]
21const TV_DOCUMENT: i64 = 8 // LIBRARIAN [nx_cap_register]
22const TV_LOG: i64 = 9 // SCRIBE [nx_crew_scribe]
23const TV_ORCHESTRATE:i64 = 10 // CONDUCTOR [nx_build_pipeline / nx_overnight_conductor]
24const TV_GATE: i64 = 11 // WARDEN [nx_build_raci / nx_four_pillars]
25const TV_COMPETE: i64 = 12 // RACING [nx_racing]
26const TV_SELFGRADE: i64 = 13 // EXAMINER [nx_examiner]
27const TV_COUNTER: i64 = 14 // CRITIC [nx_critic]
28const TV_AUDIT: i64 = 15 // AUDITOR [nx_auditor / nx_maturity_auditor]
29const TV_DEDUP: i64 = 16 // GENEALOGIST [nx_genealogist / nx_lineage_archive]
30const TV_PRUNE: i64 = 17 // CARETAKER [nx_caretaker]
31const TV_PUBLISH: i64 = 18 // SCIENTIST [nx_scientist / nx_paper_emit]
32const TV_ANALYZE: i64 = 19 // ANALYST [nx_analyst / nx_opportunity_loop] (was MARKET-RESEARCHER=FIND-OPPORTUNITY 2026-06-10: opportunity-finding is one input; the role's real verb is EXPLAIN -- decompose a measured price into a traced cost ledger + NAME the unexplained residual. Researcher GATHERS, Analyst EXPLAINS.)
33const TV_GROW: i64 = 20 // HUB [nx_hub_spoke]
34
35func tr_verbs(out: *i64) -> i64 {
36 out[0]=TV_AUTHOR; out[1]=TV_TEST; out[2]=TV_HEAL; out[3]=TV_SEARCH; out[4]=TV_JUDGE
37 out[5]=TV_PLAN; out[6]=TV_ADMIT; out[7]=TV_DOCUMENT; out[8]=TV_LOG; out[9]=TV_ORCHESTRATE
38 out[10]=TV_GATE; out[11]=TV_COMPETE; out[12]=TV_SELFGRADE; out[13]=TV_COUNTER; out[14]=TV_AUDIT
39 out[15]=TV_DEDUP; out[16]=TV_PRUNE; out[17]=TV_PUBLISH; out[18]=TV_ANALYZE; out[19]=TV_GROW
40 return RST_N
41}
42
43// pairwise distinctness over the WHOLE roster -> number of conflating pairs (0 = clean partition)
44func tr_conflating_pairs(verbs: *i64, n: i64) -> i64 {
45 var c: i64 = 0
46 var i: i64 = 0
47 while i < n {
48 var j: i64 = i + 1
49 while j < n { if ra_distinct(verbs[i], verbs[j]) == 0 { c = c + 1 } j = j + 1 }
50 i = i + 1
51 }
52 return c
53}
54
55// the EVALUATION-CLUSTER guard: the five evaluation verbs must all be distinct (the exact v1 error).
56func tr_eval_cluster_distinct() -> i64 {
57 if ra_distinct(TV_COMPETE, TV_JUDGE) == 0 { return 0 }
58 if ra_distinct(TV_JUDGE, TV_SELFGRADE) == 0 { return 0 }
59 if ra_distinct(TV_SELFGRADE, TV_COUNTER) == 0 { return 0 }
60 if ra_distinct(TV_COUNTER, TV_AUDIT) == 0 { return 0 }
61 if ra_distinct(TV_COMPETE, TV_AUDIT) == 0 { return 0 }
62 if ra_distinct(TV_COMPETE, TV_SELFGRADE) == 0 { return 0 }
63 if ra_distinct(TV_JUDGE, TV_AUDIT) == 0 { return 0 }
64 if ra_distinct(TV_JUDGE, TV_COUNTER) == 0 { return 0 }
65 if ra_distinct(TV_COMPETE, TV_COUNTER) == 0 { return 0 }
66 if ra_distinct(TV_SELFGRADE, TV_AUDIT) == 0 { return 0 }
67 return 1
68}
69
70// every role staffed AND its capability present? present[i]=1 if the role has a registered cap.
71func tr_all_staffed(present: *i64, n: i64) -> i64 {
72 if ra_missed_count(present, n) == 0 { return 1 }
73 return 0
74}
75
76// the OVERALL verdict: roster clean iff all verbs distinct, the eval cluster distinct, and no role missing.
77func tr_roster_clean(verbs: *i64, present: *i64, n: i64) -> i64 {
78 if tr_conflating_pairs(verbs, n) != 0 { return 0 }
79 if tr_eval_cluster_distinct() == 0 { return 0 }
80 if tr_all_staffed(present, n) == 0 { return 0 }
81 return 1
82}
83
84func tr_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
85func tr_wn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m} let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
86
87func tr_role(i: i64) -> *u8 {
88 if i==0 {return "BUILDER=AUTHOR" as *u8} if i==1 {return "ENGINEER=TEST" as *u8}
89 if i==2 {return "DOCTOR=HEAL" as *u8} if i==3 {return "RESEARCHER=SEARCH" as *u8}
90 if i==4 {return "REFEREE=JUDGE" as *u8} if i==5 {return "PM=PLAN" as *u8}
91 if i==6 {return "COUNCIL=ADMIT" as *u8} if i==7 {return "LIBRARIAN=DOCUMENT" as *u8}
92 if i==8 {return "SCRIBE=LOG" as *u8} if i==9 {return "CONDUCTOR=ORCHESTRATE" as *u8}
93 if i==10 {return "WARDEN=GATE" as *u8} if i==11 {return "RACING=COMPETE" as *u8}
94 if i==12 {return "EXAMINER=SELF-GRADE" as *u8} if i==13 {return "CRITIC=COUNTER" as *u8}
95 if i==14 {return "AUDITOR=AUDIT" as *u8} if i==15 {return "GENEALOGIST=DEDUP" as *u8}
96 if i==16 {return "CARETAKER=PRUNE" as *u8} if i==17 {return "SCIENTIST=PUBLISH" as *u8}
97 if i==18 {return "ANALYST=EXPLAIN (renamed from market-researcher)" as *u8}
98 return "HUB=GROW" as *u8
99}
100
101func tr_report(verbs: *i64, present: *i64, n: i64) -> i64 {
102 tr_w("=== COMPLETE TEAM ROSTER (role=verb, capability) ===\n" as *u8)
103 var i: i64 = 0
104 while i < n {
105 tr_w(" ") ; tr_w(tr_role(i))
106 if present[i] != 1 { tr_w(" [NO CAPABILITY -- gap]") }
107 tr_w("\n" as *u8)
108 i = i + 1
109 }
110 tr_w(" roles=" as *u8); tr_wn(n); tr_w(" conflating-pairs=" as *u8); tr_wn(tr_conflating_pairs(verbs, n))
111 tr_w(" eval-cluster-distinct=" as *u8); tr_wn(tr_eval_cluster_distinct())
112 tr_w(" roster-clean=" as *u8); tr_wn(tr_roster_clean(verbs, present, n)); tr_w(" (1=clean)\n" as *u8)
113 return 0
114}