Skip to content

Commit 30384b1

Browse files
author
kimi-code/FI-008
committed
feat(kernel): F1 MCP Governance Wrapper — 3 patches executed
Patch 1: capability_registry.json - 8 capabilities with arifos_governance block (4 fields each) - Derivation from existing fields (mutation/irreversible/authority) - Missing governance defaults to BLOCKED (impact_radius=5, requires_888_hold=true) - Semantic hash UNCHANGED — governance is metadata overlay Patch 2: kernel_abi.py + arifos_kernel_wiring.py - get_governance(): extract governance block with strict defaults - evaluate_governance(): 5-check decision tree (not-found/role/write/hold/approved) - filter_tools_for_role(): role-scoped tool visibility - Pre-filter runs BEFORE OPA evaluation in dispatch pipeline - _last_hash persistence: chain resumes from audit file on restart Patch 3: Audit JSONL trail - 16 flat fields, Rust serde_json compatible - chain_hash + previous_hash tamper-evident append-only - /root/AAA/governance/audit/mcp-governance-audit.jsonl All 6 test suites PASS (registry load, governance extraction, default fallback, 9-subtest decision tree, role filtering, audit chain integrity + persistence). DITEMPA BUKAN DIBERI
1 parent 5665bd2 commit 30384b1

7 files changed

Lines changed: 1904 additions & 0 deletions

File tree

arifos_kernel/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""arifOS kernel module."""

arifos_kernel/abi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""arifOS kernel module."""
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
{
2+
"$schema": "arifos://schema/kernel-capability-registry/v1",
3+
"abi_version": "2026.07.24",
4+
"governance_version": "1.0.0",
5+
"governance_description": "arifOS MCP Governance Wrapper — F1-MCP-Governance-Wrapper RFC fields. Default for missing: is_reversible=false, impact_radius=5, requires_888_hold=true, allowed_roles=[].",
6+
"capabilities": [
7+
{
8+
"capability_id": "session.bind",
9+
"version": "1.0.0",
10+
"semantic_hash": "sha256:2a947992f413a8c969df2383c230f665c374f761de7618f5cf8f7a0e4299a5a5",
11+
"input_schema_ref": "tool://arif_init/input",
12+
"output_schema_ref": "tool://arif_init/output",
13+
"action_class": "OBSERVE",
14+
"mutation": false,
15+
"irreversible": false,
16+
"authority_required": "ANONYMOUS",
17+
"evidence_required": false,
18+
"idempotency": "conditional",
19+
"receipt_policy": "session",
20+
"constitutional_floors": ["F1", "F2", "F4", "F11", "F13"],
21+
"provider": {"type": "mcp", "tool": "arif_init"},
22+
"tier": "gated",
23+
"arifos_governance": {
24+
"is_reversible": true,
25+
"impact_radius": 0,
26+
"requires_888_hold": false,
27+
"allowed_roles": ["333-AGI", "555-ASI", "888-APEX", "A-FORGE"]
28+
}
29+
},
30+
{
31+
"capability_id": "reality.observe",
32+
"version": "1.0.0",
33+
"semantic_hash": "sha256:6bb61ee140a9e784ccdd6d3cafeabc34b20390e59cddece0c1d95076df0bce7",
34+
"input_schema_ref": "tool://arif_observe/input",
35+
"output_schema_ref": "tool://arif_observe/output",
36+
"action_class": "OBSERVE",
37+
"mutation": false,
38+
"irreversible": false,
39+
"authority_required": "OBSERVER",
40+
"evidence_required": false,
41+
"idempotency": "safe",
42+
"receipt_policy": "optional",
43+
"constitutional_floors": ["F2", "F4", "F7", "F9", "F12"],
44+
"provider": {"type": "mcp", "tool": "arif_observe"},
45+
"tier": "open",
46+
"arifos_governance": {
47+
"is_reversible": true,
48+
"impact_radius": 0,
49+
"requires_888_hold": false,
50+
"allowed_roles": ["333-AGI", "555-ASI", "888-APEX"]
51+
}
52+
},
53+
{
54+
"capability_id": "cognition.think",
55+
"version": "1.0.0",
56+
"semantic_hash": "sha256:88dcc1c39b6f59f9a0ef3b2f028b6891a0cb8f751915c948846820e95a527546",
57+
"input_schema_ref": "tool://arif_think/input",
58+
"output_schema_ref": "tool://arif_think/output",
59+
"action_class": "PREPARE",
60+
"mutation": false,
61+
"irreversible": false,
62+
"authority_required": "OBSERVER",
63+
"evidence_required": true,
64+
"idempotency": "safe",
65+
"receipt_policy": "optional",
66+
"constitutional_floors": ["F2", "F3", "F4", "F7", "F8", "F9"],
67+
"provider": {"type": "mcp", "tool": "arif_think"},
68+
"tier": "open",
69+
"arifos_governance": {
70+
"is_reversible": true,
71+
"impact_radius": 0,
72+
"requires_888_hold": false,
73+
"allowed_roles": ["333-AGI", "555-ASI", "888-APEX"]
74+
}
75+
},
76+
{
77+
"capability_id": "intent.route",
78+
"version": "1.0.0",
79+
"semantic_hash": "sha256:a0d24c437488bc1521d1f0170071665177b7a55a80c5e96e79b5a4cba4ff04bd",
80+
"input_schema_ref": "tool://arif_route/input",
81+
"output_schema_ref": "tool://arif_route/output",
82+
"action_class": "PREPARE",
83+
"mutation": false,
84+
"irreversible": false,
85+
"authority_required": "OBSERVER",
86+
"evidence_required": false,
87+
"idempotency": "safe",
88+
"receipt_policy": "optional",
89+
"constitutional_floors": ["F2", "F4", "F8", "F10", "F12"],
90+
"provider": {"type": "mcp", "tool": "arif_route"},
91+
"tier": "open",
92+
"arifos_governance": {
93+
"is_reversible": true,
94+
"impact_radius": 0,
95+
"requires_888_hold": false,
96+
"allowed_roles": ["333-AGI", "555-ASI", "888-APEX"]
97+
}
98+
},
99+
{
100+
"capability_id": "memory.govern",
101+
"version": "1.0.0",
102+
"semantic_hash": "sha256:9fd0dae38007619f6f2092e2bdb0d55ddf4327018c940052fd0c436e8dc810af",
103+
"input_schema_ref": "tool://arif_memory/input",
104+
"output_schema_ref": "tool://arif_memory/output",
105+
"action_class": "MATERIAL",
106+
"mutation": true,
107+
"irreversible": false,
108+
"authority_required": "TRUSTED_AGENT",
109+
"evidence_required": true,
110+
"idempotency": "keyed",
111+
"receipt_policy": "required_on_write",
112+
"constitutional_floors": ["F1", "F2", "F4", "F11", "F13"],
113+
"provider": {"type": "mcp", "tool": "arif_memory"},
114+
"tier": "open",
115+
"arifos_governance": {
116+
"is_reversible": false,
117+
"impact_radius": 3,
118+
"requires_888_hold": true,
119+
"allowed_roles": ["333-AGI", "888-APEX"]
120+
}
121+
},
122+
{
123+
"capability_id": "authority.judge",
124+
"version": "1.0.0",
125+
"semantic_hash": "sha256:b1c58a6eeeeacb8ed8dd771295c24aeb28649b8dd4b8c3aa251cf4cd6a759abd",
126+
"input_schema_ref": "tool://arif_judge/input",
127+
"output_schema_ref": "tool://arif_judge/output",
128+
"action_class": "MATERIAL",
129+
"mutation": false,
130+
"irreversible": false,
131+
"authority_required": "TRUSTED_AGENT",
132+
"evidence_required": true,
133+
"idempotency": "keyed",
134+
"receipt_policy": "required",
135+
"constitutional_floors": ["F1", "F2", "F3", "F4", "F11", "F13"],
136+
"provider": {"type": "mcp", "tool": "arif_judge"},
137+
"tier": "open",
138+
"arifos_governance": {
139+
"is_reversible": true,
140+
"impact_radius": 1,
141+
"requires_888_hold": false,
142+
"allowed_roles": ["333-AGI", "888-APEX"]
143+
}
144+
},
145+
{
146+
"capability_id": "action.execute",
147+
"version": "1.0.0",
148+
"semantic_hash": "sha256:3ce5463279351e0c8c371dc046cc4062c796540516bb1f31c79c712299db07f3",
149+
"input_schema_ref": "tool://arif_forge/input",
150+
"output_schema_ref": "tool://arif_forge/output",
151+
"action_class": "MATERIAL",
152+
"mutation": true,
153+
"irreversible": false,
154+
"authority_required": "EXECUTOR",
155+
"evidence_required": true,
156+
"idempotency": "keyed",
157+
"receipt_policy": "required",
158+
"constitutional_floors": ["F1", "F2", "F3", "F4", "F7", "F11", "F13"],
159+
"provider": {"type": "mcp", "tool": "arif_forge"},
160+
"tier": "open",
161+
"arifos_governance": {
162+
"is_reversible": false,
163+
"impact_radius": 3,
164+
"requires_888_hold": true,
165+
"allowed_roles": ["A-FORGE"]
166+
}
167+
},
168+
{
169+
"capability_id": "history.seal",
170+
"version": "1.0.0",
171+
"semantic_hash": "sha256:22ecfcb626b9c4fe1bedb8e9c31dbf79862588736177149c8492a8d35f2e4119",
172+
"input_schema_ref": "tool://arif_seal/input",
173+
"output_schema_ref": "tool://arif_seal/output",
174+
"action_class": "IRREVERSIBLE",
175+
"mutation": true,
176+
"irreversible": true,
177+
"authority_required": "SOVEREIGN",
178+
"evidence_required": true,
179+
"idempotency": "keyed",
180+
"receipt_policy": "required",
181+
"constitutional_floors": ["F1", "F2", "F3", "F4", "F11", "F13"],
182+
"provider": {"type": "mcp", "tool": "arif_seal"},
183+
"tier": "open",
184+
"arifos_governance": {
185+
"is_reversible": false,
186+
"impact_radius": 5,
187+
"requires_888_hold": true,
188+
"allowed_roles": []
189+
}
190+
}
191+
],
192+
"compatibility_aliases": {
193+
"arif_session_init": {"capability_id": "session.bind"},
194+
"arif_sense_observe": {"capability_id": "reality.observe"},
195+
"arif_fetch": {"capability_id": "reality.observe", "mode": "fetch"},
196+
"arif_evidence_fetch": {"capability_id": "reality.observe", "mode": "fetch"},
197+
"arif_critique": {"capability_id": "cognition.think", "mode": "critique"},
198+
"arif_bridge_connect": {"capability_id": "intent.route", "mode": "bridge"},
199+
"arif_memory_recall": {"capability_id": "memory.govern", "mode": "recall"},
200+
"arif_judge_deliberate": {"capability_id": "authority.judge"},
201+
"arif_forge_execute": {"capability_id": "action.execute"},
202+
"arif_reply_compose": {"capability_id": "cognition.think", "mode": "compose"},
203+
"arif_vault_seal": {"capability_id": "history.seal"}
204+
},
205+
"tier_doctrine": "arifOS canon = 8 capabilities in 2 public tiers: 7 open (observe, think, route, memory, judge, forge, seal) · 1 acknowledgment-gated (session.bind — F1 Amanah, binding creates durable state). Governance fields enforce per-tool reversibility, impact radius, and sovereign hold requirements.",
206+
"tier_doctrine_en": "Anonymous external probing must reproduce the public claim exactly: tools/list returns 7 unconditionally + 1 with ack_irreversible = 8 total. Governance layer adds deterministic enforcement: missing arifos_governance defaults to BLOCKED (impact_radius=5, requires_888_hold=true, allowed_roles=[])."
207+
}

0 commit comments

Comments
 (0)