nx_commons_govern_gate.nx source
↩ module page · 129 lines · 7005 B
1// nx_commons_govern_gate.nx -- proves that some rules are not votable, and that this is what stops
2// capture rather than any threshold.
3//
4// T1 is the tooth: a unanimous, fully-quorate, well-formed proposal to raise the 3:1 spread cap to
5// 100:1 must return VOID. It is bite-proven against plain quorum (the nx_council_gate shape, kept in
6// the library as a negative control) which ALLOWS it -- because plain quorum has no answer to "what
7// if they simply vote to remove the protection". Threshold rules lose to money; unamendable ones do
8// not, because there is nothing to buy.
9// license_tier: ORIGINAL expect_exit: 0
10import "nx_gate_verdict.nx"
11import "nx_commons_govern.nx"
12
13const GG_N: i64 = 4
14const GG_PROPOSER: i64 = 9
15const GG_TOTAL: i64 = 1000
16
17func main() -> i64 {
18 let ctr: *i64 = gv_ctr()
19 gv_head("nx_commons_govern_gate -- what may no majority change?" as *u8)
20
21 // Four approvers, four distinct roles, all with real standing, nobody the proposer.
22 let ids: *i64 = sys_mmap(GG_N * 8) as *i64
23 let roles: *i64 = sys_mmap(GG_N * 8) as *i64
24 let st: *i64 = sys_mmap(GG_N * 8) as *i64
25 ids[0]=1; roles[0]=10; st[0]=200
26 ids[1]=2; roles[1]=11; st[1]=200
27 ids[2]=3; roles[2]=12; st[2]=200
28 ids[3]=4; roles[3]=13; st[3]=200
29
30 // A: the capture attempt -- unanimous, quorate, well-formed, and aimed at the spread cap.
31 let cap_attack: i64 = cg_decide(CG_CLAUSE_SPREAD_CAP, ids, roles, st, GG_N, GG_PROPOSER, 0, GG_TOTAL)
32 let cap_plain: i64 = cg_plain_quorum_decide(ids, roles, st, GG_N, 0)
33
34 // B: an ordinary, lawful proposal -- must pass, or this is a wall not a government.
35 let ordinary: i64 = cg_decide(CG_CLAUSE_NONE, ids, roles, st, GG_N, GG_PROPOSER, 0, GG_TOTAL)
36
37 // C: one principled objection sinks it (inherited from the known good).
38 let with_reject: i64 = cg_decide(CG_CLAUSE_NONE, ids, roles, st, GG_N, GG_PROPOSER, 1, GG_TOTAL)
39
40 // D: self-approval -- the proposer stacks the roster with itself.
41 let ids2: *i64 = sys_mmap(GG_N * 8) as *i64
42 let roles2: *i64 = sys_mmap(GG_N * 8) as *i64
43 let st2: *i64 = sys_mmap(GG_N * 8) as *i64
44 ids2[0]=GG_PROPOSER; roles2[0]=10; st2[0]=200
45 ids2[1]=GG_PROPOSER; roles2[1]=11; st2[1]=200
46 ids2[2]=GG_PROPOSER; roles2[2]=12; st2[2]=200
47 ids2[3]=2; roles2[3]=13; st2[3]=200
48 let selfstack: i64 = cg_decide(CG_CLAUSE_NONE, ids2, roles2, st2, GG_N, GG_PROPOSER, 0, GG_TOTAL)
49
50 // E: the whale -- one member holding most of the standing, plus enough friends for quorum.
51 let ids3: *i64 = sys_mmap(GG_N * 8) as *i64
52 let roles3: *i64 = sys_mmap(GG_N * 8) as *i64
53 let st3: *i64 = sys_mmap(GG_N * 8) as *i64
54 ids3[0]=5; roles3[0]=10; st3[0]=900 // 90% of all standing
55 ids3[1]=6; roles3[1]=11; st3[1]=30
56 ids3[2]=7; roles3[2]=12; st3[2]=30
57 ids3[3]=8; roles3[3]=13; st3[3]=40
58 let whale: i64 = cg_decide(CG_CLAUSE_NONE, ids3, roles3, st3, GG_N, GG_PROPOSER, 0, GG_TOTAL)
59 let whale_w: i64 = cg_effective_weight(900, GG_TOTAL)
60
61 // F: sybils with no witnessed standing.
62 let ids4: *i64 = sys_mmap(GG_N * 8) as *i64
63 let roles4: *i64 = sys_mmap(GG_N * 8) as *i64
64 let st4: *i64 = sys_mmap(GG_N * 8) as *i64
65 ids4[0]=20; roles4[0]=10; st4[0]=0
66 ids4[1]=21; roles4[1]=11; st4[1]=0
67 ids4[2]=22; roles4[2]=12; st4[2]=0
68 ids4[3]=23; roles4[3]=13; st4[3]=0
69 let sybils: i64 = cg_decide(CG_CLAUSE_NONE, ids4, roles4, st4, GG_N, GG_PROPOSER, 0, GG_TOTAL)
70
71 gv_puts(" (VOID=" as *u8); gv_num(CG_VOID); gv_puts(" DENY=" as *u8); gv_num(CG_DENY)
72 gv_puts(" ALLOW=" as *u8); gv_num(CG_ALLOW); gv_puts(")\n" as *u8)
73 gv_puts(" unanimous attack on the spread cap : constitutional=" as *u8); gv_num(cap_attack)
74 gv_puts(" plain-quorum=" as *u8); gv_num(cap_plain); gv_puts("\n" as *u8)
75 gv_puts(" ordinary lawful proposal : " as *u8); gv_num(ordinary); gv_puts("\n" as *u8)
76 gv_puts(" one reject : " as *u8); gv_num(with_reject); gv_puts("\n" as *u8)
77 gv_puts(" proposer stacks itself 3x : " as *u8); gv_num(selfstack); gv_puts("\n" as *u8)
78 gv_puts(" whale 90% standing : " as *u8); gv_num(whale)
79 gv_puts(" capped weight=" as *u8); gv_num(whale_w); gv_puts(" of " as *u8); gv_num(GG_TOTAL); gv_puts("\n" as *u8)
80 gv_puts(" four zero-standing sybils : " as *u8); gv_num(sybils); gv_puts("\n\n" as *u8)
81
82 // ---- T1: THE TOOTH ----
83 var plain_allows: i64 = 0
84 if cap_plain == CG_ALLOW { plain_allows = 1 }
85 var const_allows: i64 = 0
86 if cap_attack == CG_ALLOW { const_allows = 1 }
87 gv_bite("T1 unanimous attack on the spread cap: plain quorum ALLOWS it (fires), constitutional does not" as *u8,
88 plain_allows, const_allows, ctr)
89
90 var t2: i64 = 0
91 if cap_attack == CG_VOID { t2 = 1 }
92 gv_check("T2 the attack is VOID, not merely DENIED -- the vote is never counted at all" as *u8, t2, ctr)
93
94 var t3: i64 = 0
95 if ordinary == CG_ALLOW { t3 = 1 }
96 gv_check("T3 NEG-CONTROL an ordinary lawful proposal at quorum PASSES (a government, not a wall)" as *u8, t3, ctr)
97
98 var t4: i64 = 0
99 if with_reject == CG_DENY { t4 = 1 }
100 gv_check("T4 one principled objection sinks a quorate proposal (any reject is fail-safe)" as *u8, t4, ctr)
101
102 var t5: i64 = 0
103 if selfstack == CG_DENY { t5 = 1 }
104 gv_check("T5 the proposer cannot approve its own proposal, however many roles it wears" as *u8, t5, ctr)
105
106 // CORRECTED 2026-08-06. This asserted the whale case must DENY. It must not: four distinct roles
107 // approved a lawful proposal and one of them is wealthy, which is a legitimate pass. Denying it
108 // would mean a rich member's participation POISONS any proposal -- a wall, not a government.
109 // I ASSERTED AN OUTCOME I HAD NOT REASONED THROUGH, FOR THE SECOND TIME IN THIS SESSION.
110 // The two real properties: the whale's weight is CAPPED, and the whale ALONE cannot reach quorum.
111 let whale_alone_ids: *i64 = sys_mmap(8) as *i64
112 let whale_alone_roles: *i64 = sys_mmap(8) as *i64
113 let whale_alone_st: *i64 = sys_mmap(8) as *i64
114 whale_alone_ids[0]=5; whale_alone_roles[0]=10; whale_alone_st[0]=900
115 let alone: i64 = cg_decide(CG_CLAUSE_NONE, whale_alone_ids, whale_alone_roles, whale_alone_st, 1, GG_PROPOSER, 0, GG_TOTAL)
116 gv_puts(" whale ALONE (1 role, 90% standing) : " as *u8); gv_num(alone); gv_puts("\n" as *u8)
117 var t6: i64 = 0
118 if whale_w <= ((GG_TOTAL * 4) / 10) { if alone == CG_DENY { t6 = 1 } }
119 gv_check("T6 whale weight CAPPED at <=40% and the whale ALONE cannot reach quorum (influence, not sovereignty)" as *u8, t6, ctr)
120
121 var t7: i64 = 0
122 if sybils == CG_DENY { t7 = 1 }
123 gv_check("T7 zero-standing identities have zero votes (the witness layer already priced them)" as *u8, t7, ctr)
124
125 let rc: i64 = gv_verdict("COMMONS-GOVERN" as *u8, ctr,
126 "the floors are not votable; no threshold, however high, can be bought past them" as *u8)
127 sys_exit(rc)
128 return rc
129}