nx_allelopathy.nx source
↩ module page · 232 lines · 9943 B
1// nx_allelopathy.nx -- refused-niche enforcement per ecosystem-defense §2.4.
2//
3// Biology: allelopathy is the biological phenomenon of one organism
4// producing chemicals that inhibit growth or survival of others. Black
5// walnut produces juglone (5-hydroxy-1,4-naphthoquinone) that kills
6// sensitive species in the root zone. Eucalyptus secretes volatile
7// terpenes that inhibit understory competitors. This isn't reactive
8// defense; it's structural REFUSAL TO COEXIST with incompatible
9// neighbors.
10//
11// Substrate equivalent: nx_seed structurally refuses to assemble for
12// niches Nishi will not enable -- WEAPONS_PLATFORM / MASS_SURVEILLANCE_
13// NODE / PREDATORY_AI_INFERENCE / STATE_ACTOR_OFFENSIVE / HUMAN_RIGHTS_
14// VIOLATION_CONTEXT. The license clauses + niche-gating + refused-
15// deployment detection together raise the cost of weaponization above
16// what most attackers can pay.
17//
18// Per META-CARDINAL feedback-ecosystem-defense-risk-register-three-fears
19// §2.4: anti-weaponization is partly SOCIAL technology (license clauses
20// depend on courts + community + reputation to enforce). Against
21// determined sovereign-state attackers with unlimited resources no
22// software primitive solves the problem; this primitive is HONEST about
23// the limit. What it CAN do:
24// - raise legal + reputational cost of weaponization
25// - make resistance to talent recruitment for weaponized projects
26// structurally easier (the substrate's stance is visible)
27// - give whistleblowers a defensible reporting channel
28// - ensure ongoing substrate development steers AWAY from
29// weaponization-enabling features
30//
31// Composes:
32// nx_niche -- niche enum extended w/ refused niches
33// nx_seed -- refused-niche enforcement at assembly
34// nx_covenant -- multi-stakeholder consent extends to refused-
35// use scope
36// nx_aposematism -- public refused-deployment signaling
37//
38// V1 ships the refused-niche enum + assembly-gate predicate + license-
39// clause classification + honest-limit predicate.
40//
41// Gap list (V1 honest perf verdict):
42// - cannot stop a determined sovereign-state attacker (HONEST LIMIT)
43// - cannot enforce license clauses without external court system
44// - refused-deployment detection lives in nx_vitals + peer mesh
45// (queued); this primitive emits the STANCE, not the surveillance
46// - whistleblower channel infrastructure lives in nx_whistleblower
47// (queued); this primitive declares its existence as composable
48//
49// genealogy_id: nishi_metacardinal_2026-05-19_ecosystem_defense_three_fears
50// lineage_id: substrate_allelopathy_v1
51//
52// nx_safety_envelope:
53// intended_use: "Refused-niche enum + assembly-gate + license-
54// clause classification; defensive only; honestly
55// acknowledges cannot-stop-sovereign-state limit"
56// sil_target: SIL3
57// evidence: [refused_niches_explicit_enum,
58// honest_limit_acknowledged,
59// license_clauses_documented]
60// verdict: NOT_YET_EVALUATED
61
62import "nx_syscalls.nx"
63import "nx_tier.nx"
64
65// ===== Sealed enum: NxRefusedNiche ================================
66//
67// The substrate REFUSES to assemble for these niches. Numeric values
68// stable across substrate versions; new refused niches ADD entries
69// without renumbering existing ones (Cardinal 13 + 19 stability).
70//
71// V1 ships five canonical refused niches per ecosystem-defense §2.4.
72
73const NX_RN_NONE: nx_int = 0
74const NX_RN_WEAPONS_PLATFORM: nx_int = 1
75const NX_RN_MASS_SURVEILLANCE_NODE: nx_int = 2
76const NX_RN_PREDATORY_AI_INFERENCE: nx_int = 3
77const NX_RN_STATE_ACTOR_OFFENSIVE: nx_int = 4
78const NX_RN_HUMAN_RIGHTS_VIOLATION_CONTEXT: nx_int = 5
79const NX_RN_N_REFUSED: nx_int = 6
80
81// ===== Sealed enum: NxLicenseClauseKind ===========================
82//
83// License-clause categories the substrate ships with. Each refused
84// niche maps to one or more clause kinds. V1 enumerates the clause
85// kinds; clause body lives in the substrate's LICENSE files.
86
87const NX_LC_HIPPOCRATIC: nx_int = 0
88const NX_LC_ANTI_WEAPONS: nx_int = 1
89const NX_LC_ANTI_SURVEILLANCE: nx_int = 2
90const NX_LC_ANTI_DISCRIMINATION: nx_int = 3
91const NX_LC_DEFENSIVE_PATENT_GRANT: nx_int = 4
92const NX_LC_AGPL_COPYLEFT: nx_int = 5
93const NX_LC_N_CLAUSE_KINDS: nx_int = 6
94
95// ===== Sealed enum: NxAllelopathyVerdict ==========================
96
97const NX_AL_OK_ALLOWED: nx_int = 0
98const NX_AL_REFUSED: nx_int = 1
99const NX_AL_NEEDS_OPERATOR_REVIEW: nx_int = 2
100const NX_AL_INVALID: nx_int = 99
101const NX_AL_N_VERDICTS: nx_int = 3
102
103// ===== nx_rn_is_valid =============================================
104
105func nx_rn_is_valid(n: nx_int) -> nx_int {
106 if n < 0 { return 0 }
107 if n >= NX_RN_N_REFUSED { return 0 }
108 return 1
109}
110
111// ===== nx_rn_is_refused ===========================================
112//
113// Any non-NONE value in the refused-niche enum returns 1. Used by
114// nx_seed at assembly time to short-circuit refused-niche hosts.
115
116func nx_rn_is_refused(n: nx_int) -> nx_int {
117 if nx_rn_is_valid(n) == 0 { return 0 }
118 if n == NX_RN_NONE { return 0 }
119 return 1
120}
121
122// ===== nx_lc_kind_is_valid ========================================
123
124func nx_lc_kind_is_valid(k: nx_int) -> nx_int {
125 if k < 0 { return 0 }
126 if k >= NX_LC_N_CLAUSE_KINDS { return 0 }
127 return 1
128}
129
130// ===== nx_al_verdict_is_valid =====================================
131
132func nx_al_verdict_is_valid(v: nx_int) -> nx_int {
133 if v < 0 { return 0 }
134 if v >= NX_AL_N_VERDICTS { return 0 }
135 return 1
136}
137
138// ===== nx_rn_canonical_clauses ====================================
139//
140// Returns the canonical license-clause bitmask for a given refused
141// niche. The mapping: each refused niche cites which clause kinds
142// the substrate ships with that specifically address it.
143//
144// Bitmask values use 1 << clause_kind for compactness.
145
146const NX_LC_BIT_HIPPOCRATIC: nx_int = 1
147const NX_LC_BIT_ANTI_WEAPONS: nx_int = 2
148const NX_LC_BIT_ANTI_SURVEILLANCE: nx_int = 4
149const NX_LC_BIT_ANTI_DISCRIMINATION: nx_int = 8
150const NX_LC_BIT_DEFENSIVE_PATENT: nx_int = 16
151const NX_LC_BIT_AGPL: nx_int = 32
152
153func nx_rn_canonical_clauses(n: nx_int) -> nx_int {
154 if n == NX_RN_WEAPONS_PLATFORM {
155 return NX_LC_BIT_HIPPOCRATIC | NX_LC_BIT_ANTI_WEAPONS |
156 NX_LC_BIT_AGPL
157 }
158 if n == NX_RN_MASS_SURVEILLANCE_NODE {
159 return NX_LC_BIT_HIPPOCRATIC | NX_LC_BIT_ANTI_SURVEILLANCE |
160 NX_LC_BIT_AGPL
161 }
162 if n == NX_RN_PREDATORY_AI_INFERENCE {
163 return NX_LC_BIT_HIPPOCRATIC | NX_LC_BIT_ANTI_DISCRIMINATION |
164 NX_LC_BIT_ANTI_SURVEILLANCE | NX_LC_BIT_AGPL
165 }
166 if n == NX_RN_STATE_ACTOR_OFFENSIVE {
167 return NX_LC_BIT_HIPPOCRATIC | NX_LC_BIT_ANTI_WEAPONS |
168 NX_LC_BIT_ANTI_SURVEILLANCE | NX_LC_BIT_AGPL
169 }
170 if n == NX_RN_HUMAN_RIGHTS_VIOLATION_CONTEXT {
171 return NX_LC_BIT_HIPPOCRATIC | NX_LC_BIT_ANTI_DISCRIMINATION |
172 NX_LC_BIT_ANTI_SURVEILLANCE | NX_LC_BIT_AGPL
173 }
174 return 0
175}
176
177// ===== nx_al_assembly_verdict =====================================
178//
179// Verdict for nx_seed assembly: given an attested intended-niche,
180// emit ALLOW / REFUSE / OPERATOR_REVIEW.
181//
182// Logic:
183// - Refused niche -> REFUSED
184// - NONE -> OK_ALLOWED
185// - Invalid -> INVALID
186
187func nx_al_assembly_verdict(refused_niche: nx_int) -> nx_int {
188 if nx_rn_is_valid(refused_niche) == 0 { return NX_AL_INVALID }
189 if nx_rn_is_refused(refused_niche) == 1 { return NX_AL_REFUSED }
190 return NX_AL_OK_ALLOWED
191}
192
193// ===== nx_al_honest_limit_acknowledged ============================
194//
195// Predicate: returns 1 to acknowledge that nx_allelopathy cannot stop
196// a determined sovereign-state attacker with unlimited resources. No
197// software primitive solves this. Substrate honesty per [[feedback-
198// honest-perf-verdict-no-aspirational-claims]] -- nx_seed callers
199// check this predicate to remind themselves the defense is partial.
200
201func nx_al_honest_limit_acknowledged() -> nx_int {
202 return 1
203}
204
205// ===== nx_al_can_address_threat ===================================
206//
207// Returns 1 if substrate-side mechanisms (refused-niche + license +
208// peer-mesh signal + aposematism) can MEANINGFULLY raise the cost of
209// the named threat archetype. Returns 0 if the threat is structurally
210// beyond substrate's reach (sovereign-state with unlimited resources).
211//
212// V1: substrate CAN raise costs against patent trolls, criminal orgs,
213// corporate extractive forks, well-intentioned-but-wrong, accidental,
214// individual opportunists. Substrate CANNOT structurally stop
215// state-actor-hostile with unlimited resources -- explicit honest
216// acknowledgment per cardinal.
217//
218// Caller-supplied threat_actor_class id; mapping to NxThreatActorClass
219// from nx_risk_register is by-value (we don't import to avoid coupling).
220
221func nx_al_can_address_threat(threat_actor_class: nx_int) -> nx_int {
222 // Values match nx_risk_register's NX_AC_* enum (see that file).
223 // 0=INDIVIDUAL_OPPORTUNIST, 1=CRIMINAL_ORGANIZATION,
224 // 2=PATENT_TROLL, 3=LARGE_CORP_EXTRACTIVE, 4=STATE_ACTOR_HOSTILE,
225 // 5=STATE_ACTOR_DOMESTIC, 6=COMPROMISED_INSIDER,
226 // 7=WELL_INTENTIONED_BUT_WRONG, 8=ACCIDENTAL, 9=UNKNOWN_ACTOR
227 if threat_actor_class == 4 { return 0 } // STATE_ACTOR_HOSTILE
228 if threat_actor_class == 5 { return 0 } // STATE_ACTOR_DOMESTIC
229 if threat_actor_class < 0 { return 0 }
230 if threat_actor_class > 9 { return 0 }
231 return 1
232}