APEX Gate Evaluator
Parameterized by gate_type: floor | scope | authority | reversibility | coverage | tool_approval
DITEMPA BUKAN DIBERI — The constitutional reflex is forged, not assumed.
Overview
Unified constitutional gate evaluator for the arifOS federation. Evaluates proposed actions against F1-F13 constitutional floors, scope boundaries, authority claims, reversibility requirements, audit coverage, and MCP tool approval routing. Each gate_type activates a specific evaluation procedure while sharing the common arifOS-ACT embedding and constitutional framework.
arifOS-ACT Embedding
Before using this skill on any mutating, irreversible, or high-blast-radius task:
- ART — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).
- Kernel — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.
- ACT — Apply narrow, Constrain scope, Trace witness, STOP before corruption.
- Receipt — Leave evidence of what changed, why, and under whose authority.
Use When
- The task involves policy changes, modifying
floors.py or governance constraints.
- The task requires executing potentially destructive operations (e.g.,
rm -rf, docker system/volume prunes, database drops).
- The task requires deploying code directly to production surfaces or VPS running state.
- The task modifies secrets, environment files (
.env), or security certificates.
- The task involves autonomous write decisions that modify federation charters.
- The task requires evaluating a constitutional verdict:
SEAL, VOID, SABAR, CAUTION, or HOLD.
- Two repos claim to be the "source of truth" for the same thing (authority check).
- After any repo reorganization or when agents report conflicting instructions (authority check).
- A proposed change touches vault, seal, identity, constitutional, or other F1 surfaces (reversibility test).
- Auditing whether every constitutional floor and federation organ has code enforcement, tests, bypass resistance, and trace coverage (coverage check).
- A complex task spans multiple distinct organ environments and needs MCP tool routing (tool approval gate).
- Coordinating sequential multi-tool calls across different MCP servers (tool approval gate).
Do Not Use When
- The task is a simple, reversible local source code edit (e.g., refactoring a pure helper function).
- The task is running localized unit tests (
npm test or pytest) that do not interact with production databases or systems.
- The task is purely investigatory reading of static documentation (use domain or search skills instead).
- Task is entirely within a single local directory (tool approval gate not needed).
Inputs
| Input |
Required |
Description |
| gate_type |
yes |
floor | scope | authority | reversibility | coverage | tool_approval |
| requested_action |
conditional |
The command or code execution block proposed (floor/scope/reversibility) |
| system_state |
conditional |
Current container status, disk metrics, and active session_id |
| w3_context |
conditional |
W³ Tri-Witness Context: Theory, Constitution, Manifesto metrics |
| intent |
conditional |
High-level pipeline task (tool_approval) |
| server_registry |
conditional |
Active MCP endpoints (tool_approval) |
| client_connections |
conditional |
Active SSE/stdio channels (tool_approval) |
| fallback_policy |
optional |
"graceful" or "fail-fast" (tool_approval) |
Gate Type: floor — Constitutional Floor Evaluation
Floor → Question → Evidence Matrix
| Floor |
Core Question |
Observable Evidence |
| F1 Amanah |
Is there an automatic rollback path? Can we reset state with one command? |
Git ref, snapshot ID, file backup path. |
| F2 Truth |
What is the source of this fact? Have we explicitly checked for contradictions? |
STDP evidence table, citations, contradictory logs. |
| F3 Tri-Witness |
Have DELTA, OMEGA, and PSI rings reached consensus? |
Multi-witness telemetry payload. |
| F4 Clarity |
Does this response reduce overall system entropy? |
Before/after question count, structured output layout. |
| F5 Peace² |
Does this action run the risk of breaking any global dependency or data state? |
Dependency dry-run check, destruction_score assessment. |
| F6 Empathy |
Have we fully captured the explicit and implicit user context? |
RASA active listening scorecard. |
| F7 Humility |
Is our confidence in the success bounds strictly constrained to the Humility Band? |
Estimated omega_0 score ∈ [0.03, 0.05]. |
| F8 Genius |
Does this action touch regulated, restricted, or personal data? |
Data classification tags, file path boundary checks. |
| F9 Ethics |
Is there any threat of prompt injection, exploit payload generation, or malicious code? |
AST syntax check, prompt sanitizer logs. |
| F10 Conscience |
Does the output contain claims of machine consciousness or feelings? |
Banned word checker status. |
| F11 Audit |
Is every transition logged in a tamper-evident manner? |
Append-only transaction hash in Vault999. |
| F12 Resilience |
If this action fails, is there a degraded state recovery route? |
Try-except block, rollback triggers. |
| F13 Adapt |
Does this dynamic update maintain Gödel alignment boundaries? |
Test suite execution records, veto validation. |
Procedure
- F1 Amanah Pre-Flight Check: Verify if the proposed action is fully reversible. If irreversible, pause immediately and invoke
888_HOLD.
- STDP Evidence Triage: Apply the Sovereign Truth Discovery Protocol (
CLAIM -> EVIDENCE -> CONTRADICTION -> UNCERTAINTY -> VERDICT).
- Floor Score Computation: Calculate individual scores using the matrix. Ensure
Peace² = (1 - destruction_score)² = 1.0 and Humility Ω ∈ [0.03, 0.05].
- Consensus Verification: Check if the W³ witness multiplication matches or exceeds
0.95.
- Audit Trail Serialization: Generate the append-only audit trace containing timestamp, session identity, floor scores, and reasoning steps.
- Veto & Hold Gating: If any constraint fails, write a
HOLD code, block execution, and escalate to the Sovereign (Arif).
F1 AMANAH Gate
Use this gate before any change that touches F1-surface state or carries irreversible / mutating / destroyer class power.
F1 Surfaces (do not edit without sovereign witness):
vault, VAULT999, outcomes.jsonl
seal, 888_HOLD, 999_SEAL
identity, arif_judge*, arif_heart*
constitutional, amanah, floor
Detection & Hold Logic:
- Classify power. If Maker, Messenger, Mutator, Destroyer, or Sovereign → route to kernel.
- Pattern scan. Run
grep -rE 'vault|seal|identity|constitutional|amanah|floor' over the proposed diff or target path.
- Hold on hit. If pattern matches or action is irreversible:
- Emit
888_HOLD with file, line, proposed change, and affected floor.
- Block commit / deploy until human approval.
- Log to
/root/.claude/hooks/f1-gate.log.
- Override. If Arif approves, re-run with explicit override reason; outcome enters VAULT999 witness.
Verification Loop: Non-F1 commits must return zero matches. F1 surface hit → 888_HOLD blocks, human reviews, re-run with witness signature.
Failure Modes:
- False positive → human overrides with reason logged.
- False negative → F2 Truth floor tripwire catches downstream.
- Hook disabled → manual invocation still applies.
Constitutional Anchor: F1 AMANAH (reversibility first), F2 TRUTH (no F1 edit without witness), F13 SOVEREIGN (Arif's approval is the only valid override).
Postconditions
- No irreversible command is executed without verified
888_HOLD release.
- A complete tamper-evident audit record is appended to the session log.
- The final
G = A × P × X × E² score is computed and verified to be ≥ 0.80.
Failure Modes & Escalation
- Godellock (Ω < 0.03): Overconfident or trapped in internal consistency. → Degrade immediately, notify operator, request external manual validation.
- Paralysis (Ω > 0.05): Cannot prove safety bounds. → Raise
888_HOLD with code ERR_GOV_PARALYSIS, wait for manual override.
- Ledger Write Timeout: DB or redis connection fails during F11 logging. → Fall back to local synchronous JSONL cache in
/root/.agents/scratch/.
Gate Type: scope — Scope Boundary Check
Check whether a proposed action stays within its declared task, organ, and constitutional scope.
Procedure
- Identify the declared task scope (what was authorized).
- Identify the proposed action (what is being attempted).
- Compare: does the action stay within the declared boundaries?
- Check organ boundaries: is the action appropriate for the organ it targets?
- Check constitutional scope: does the action respect F1-F13 floors?
- If scope creep detected →
888_HOLD with evidence of boundary violation.
Gate Type: authority — Parallel Authority Detection
Detect conflicting or parallel source-of-truth claims across federation repositories and resolve the canonical owner.
When to Use
- After any repo reorganization.
- When agents report conflicting instructions.
- Quarterly federation authority audit.
Procedure
Step 1: File Collision Scan
Search all federation repos for files with the same name:
CONSTITUTION.md, floors.py, judgment.py, ROOT_CANON.yaml, arifos.init, REPO_ROUTING_CONSTITUTION.md
Step 2: Content Comparison
If duplicates found, compare contents. Identical = copy. Different = conflict.
Step 3: Precedence Resolution
Per ROOT_CANON.yaml (arifOS):
arifOS wins for constitutional files
AAA wins for agent cards and routing
A-FORGE wins for build/deployment
Step 4: Report
Flag each conflict with recommended owner and migration path.
Escalation Path
| Condition |
Escalate To |
| Constitutional conflict |
arifOS 888_JUDGE |
| Cross-repo boundary dispute |
Arif |
Gate Type: reversibility — F1 Reversibility Test
Test whether a proposed change touching vault, seal, identity, constitutional, or other F1 surfaces has a valid rollback and sovereign witness.
Steps
- Detect F1 pattern in target file or diff.
- If matched → emit
888 HOLD with: file, line, proposed change, affected floor.
- Block commit/deploy until human approval.
- Log to
/root/.claude/hooks/f1-gate.log.
- If approved by Arif → re-run gate with explicit override reason; outcome enters VAULT999 witness.
Verification Loop
grep -rE 'vault|seal|identity|constitutional|amanah|floor' <diff> returns 0 lines for non-F1 commits.
- F1 surface hit → 888 HOLD blocks, human reviews, re-run with witness signature.
Failure Modes
- Pattern false positive → human overrides with reason logged.
- Pattern false negative → F2 Truth floor tripwire catches downstream.
- Hook disabled → manual invocation still available.
Constitutional Anchor
- F1 AMANAH (reversibility)
- F2 Truth (no F1 edit without witness)
- F13 SOVEREIGN (Arif's approval is the only valid override)
Gate Type: coverage — Audit Coverage Check
Audit whether every constitutional floor and federation organ has code enforcement, tests, bypass resistance, and trace coverage.
Audit Checklist
Floor-by-Floor Check (F1-F13)
For each floor, verify:
- Is the floor enforced in code? (grep for floor check functions)
- Is the floor tested? (test coverage exists)
- Is the floor bypassable? (can authority skip it?)
- Is the floor logged? (F11 compliance)
Organ Gap Analysis
For each organ (arifOS, A-FORGE, GEOX, WEALTH, WELL, AAA, VAULT999):
- Does it declare its authority boundaries?
- Does it enforce brain/hands separation?
- Can it self-authorize mutation?
Blast Radius Check
- Identify any action that could cascade across organs.
- Verify 888_HOLD gates exist before cascade points.
- Check for bypass paths (direct API calls skipping governance).
Dignity Packet Inspection
- F6 EMPATHY: Is the weakest stakeholder protected?
- F9 ANTIHANTU: Any consciousness/sentience claims?
- F10 ONTOLOGY: AI-only ontology enforced?
Findings Format
{
"floor": "F01",
"finding": "description",
"severity": "CRITICAL|WARNING|INFO",
"evidence": "file:line or test name",
"recommendation": "fix suggestion"
}
Verdict
- PASS: All floors enforced, no critical gaps.
- PARTIAL: Some gaps found, non-critical.
- HOLD: Critical gaps found, 888_HOLD triggered.
- VOID: Constitutional violation detected.
Governing Floors
- F1 AMANAH: Audit itself must be reversible (read-only).
- F2 TRUTH: Report only what is observed. No inference without evidence.
- F4 CLARITY: Findings must be actionable.
- F7 HUMILITY: Report confidence level for each finding.
- F9 ANTIHANTU: No consciousness claims in audit output.
- F11 AUDITABILITY: Full audit trail logged.
- F13 SOVEREIGN: Audit can be vetoed by human sovereign.
Gate Type: tool_approval — MCP Tool Approval & Cross-Organ Routing
Gate and route tool use across federation MCP servers according to authority, risk, and fallback policy.
Procedure
Step 1: Intent Mapping + Brain/Hands Classification
- Parse intent → identify required tools → classify as governance or execution → build routing graph.
Routing Rules:
- Governance, judgment, floors, memory mutation, sealing → arifOS MCP (8088) FIRST
- Execution, build, shell, browser, jobs → A-FORGE MCP (7072) only after lease
- Domain intelligence → GEOX (8081) / WEALTH (18082) / WELL (18083) as needed
Step 2: Tool Sequence Plan
Build ordered tool list. For each: input_schema, output_schema, dependency, fallback.
{
"tool": "tool_name",
"server": "arifos|aforge|geox|wealth|well",
"input": {},
"output_schema": {},
"depends_on": ["step_id"],
"fallback": "alternative_tool or null",
"governance_gate": true|false
}
Step 3: F8 Cross-Organ Gating + Lease/Judge Handoff
- Enforce Floor F8 (Genius/Systemic Health).
- Any mutate/atomic forge_* requires valid lease_id.
- Governance paths must reach arifOS canonical tools.
Step 4: Sequential Execution & Verification
- Execute step-by-step.
- Verify output of each tool before piping to next.
- Reject any pipe that lets A-FORGE issue or bypass 888/999 verdicts.
Step 5: Fallback Routing
- If server fails or times out:
- Identify equivalent alternative tools.
- Gracefully degrade execution loop.
- Log failure trace.
- Notify ASI-observability.
- On governance substrate failure: escalate to 888_HOLD; NEVER fall back to execution-only path.
Step 6: Telemetry Serialization
- Record cross-organ connection path, MCP surface used for judgment vs execution, lease_id, tool success counts.
- Emit to AAA for lease-compliance and seal-latency metrics.
Postconditions (tool_approval)
- All sequential tool outputs verified and validated.
- Alternative backup routes executed automatically if primary fails.
- Complete cross-server trace recorded for F11 auditability.
Failure Modes (tool_approval)
- Substrate Collapse: All MCP servers unreachable → degrade, log ERR_MCP_SUBSTRATE_COLLAPSE, halt high-stakes, prompt user.
- Data Pipeline Mismatch: Output A ≠ Input B schema → invoke hold protocol, refuse to pipe, alert developer.
Governing Floors (tool_approval)
- F2 TRUTH: Tool outputs verified before piping. No silent corruption.
- F3 TRI-WITNESS: Cross-organ consensus required for high-stakes routing.
- F4 CLARITY: Routing plan must be more structured than raw intent.
- F8 GENIUS: Systemic health maintained across organ boundaries.
- F11 AUDITABILITY: Full routing trace logged.
Telemetry per Run
{
"skill_name": "apex-gate-evaluator",
"version": "2.0.0",
"gate_type": "{{gate_type}}",
"trigger_phrase": "{{trigger_phrase}}",
"selected_reason": "{{selected_reason}}",
"latency_ms": 0,
"token_in": 0,
"token_out": 0,
"commands_run": 0,
"artifacts_written": 0,
"postcondition_pass": false,
"human_approval_required": true,
"hold_code": "{{hold_code}}"
}
Recursive Scorecard
- Activation Precision: [0.0 - 1.0] (Target: >0.95)
- Task Completion Rate: [0.0 - 1.0] (Target: >0.98)
- Rollback Safety: [0.0 - 1.0] (Target: 1.00)
- Context Efficiency: [0.0 - 1.0] (Target: >0.90)
- Doc Freshness: [0.0 - 1.0] (Target: 1.00)
- Cross-Skill Collision Rate: [0.0 - 1.0] (Target: <0.02)
- Human Trust Score: [0.0 - 1.0] (Target: >0.95)
Consolidated 2026-08-26 from: apex_floor_check, apex_scope_check, apex_authority_check, apex_reversibility_test, apex_audit_coverage_check, apex_tool_approval_gate.
AAA Skill Library — version 2.0.0
1---2name: apex-gate-evaluator3description: Unified APEX constitutional gate evaluator. Parameterized by gate_type to evaluate proposed actions against arifOS F1-F13 floors, scope boundaries, authority claims, reversibility requirements, audit coverage, and MCP tool approval routing. Merges: apex_floor_check, apex_scope_check, apex_authority_check, apex_reversibility_test, apex_audit_coverage_check, apex_tool_approval_gate.4---56# APEX Gate Evaluator78> **Parameterized by `gate_type`:** `floor` | `scope` | `authority` | `reversibility` | `coverage` | `tool_approval`9> *DITEMPA BUKAN DIBERI — The constitutional reflex is forged, not assumed.*1011## Overview1213Unified constitutional gate evaluator for the arifOS federation. Evaluates proposed actions against F1-F13 constitutional floors, scope boundaries, authority claims, reversibility requirements, audit coverage, and MCP tool approval routing. Each `gate_type` activates a specific evaluation procedure while sharing the common arifOS-ACT embedding and constitutional framework.1415## arifOS-ACT Embedding1617Before using this skill on any mutating, irreversible, or high-blast-radius task:181. **ART** — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).192. **Kernel** — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.203. **ACT** — Apply narrow, Constrain scope, Trace witness, STOP before corruption.214. **Receipt** — Leave evidence of what changed, why, and under whose authority.2223## Use When24251. The task involves policy changes, modifying `floors.py` or governance constraints.262. The task requires executing potentially destructive operations (e.g., `rm -rf`, docker system/volume prunes, database drops).273. The task requires deploying code directly to production surfaces or VPS running state.284. The task modifies secrets, environment files (`.env`), or security certificates.295. The task involves autonomous write decisions that modify federation charters.306. The task requires evaluating a constitutional verdict: `SEAL`, `VOID`, `SABAR`, `CAUTION`, or `HOLD`.317. Two repos claim to be the "source of truth" for the same thing (authority check).328. After any repo reorganization or when agents report conflicting instructions (authority check).339. A proposed change touches vault, seal, identity, constitutional, or other F1 surfaces (reversibility test).3410. Auditing whether every constitutional floor and federation organ has code enforcement, tests, bypass resistance, and trace coverage (coverage check).3511. A complex task spans multiple distinct organ environments and needs MCP tool routing (tool approval gate).3612. Coordinating sequential multi-tool calls across different MCP servers (tool approval gate).3738## Do Not Use When39401. The task is a simple, reversible local source code edit (e.g., refactoring a pure helper function).412. The task is running localized unit tests (`npm test` or `pytest`) that do not interact with production databases or systems.423. The task is purely investigatory reading of static documentation (use domain or search skills instead).434. Task is entirely within a single local directory (tool approval gate not needed).4445## Inputs4647| Input | Required | Description |48|-------|----------|-------------|49| gate_type | yes | `floor` \| `scope` \| `authority` \| `reversibility` \| `coverage` \| `tool_approval` |50| requested_action | conditional | The command or code execution block proposed (floor/scope/reversibility) |51| system_state | conditional | Current container status, disk metrics, and active `session_id` |52| w3_context | conditional | W³ Tri-Witness Context: Theory, Constitution, Manifesto metrics |53| intent | conditional | High-level pipeline task (tool_approval) |54| server_registry | conditional | Active MCP endpoints (tool_approval) |55| client_connections | conditional | Active SSE/stdio channels (tool_approval) |56| fallback_policy | optional | "graceful" or "fail-fast" (tool_approval) |5758---5960## Gate Type: `floor` — Constitutional Floor Evaluation6162### Floor → Question → Evidence Matrix6364| Floor | Core Question | Observable Evidence |65| :--- | :--- | :--- |66| **F1 Amanah** | Is there an automatic rollback path? Can we reset state with one command? | Git ref, snapshot ID, file backup path. |67| **F2 Truth** | What is the source of this fact? Have we explicitly checked for contradictions? | STDP evidence table, citations, contradictory logs. |68| **F3 Tri-Witness** | Have DELTA, OMEGA, and PSI rings reached consensus? | Multi-witness telemetry payload. |69| **F4 Clarity** | Does this response reduce overall system entropy? | Before/after question count, structured output layout. |70| **F5 Peace²** | Does this action run the risk of breaking any global dependency or data state? | Dependency dry-run check, `destruction_score` assessment. |71| **F6 Empathy** | Have we fully captured the explicit and implicit user context? | RASA active listening scorecard. |72| **F7 Humility** | Is our confidence in the success bounds strictly constrained to the Humility Band? | Estimated `omega_0` score ∈ `[0.03, 0.05]`. |73| **F8 Genius** | Does this action touch regulated, restricted, or personal data? | Data classification tags, file path boundary checks. |74| **F9 Ethics** | Is there any threat of prompt injection, exploit payload generation, or malicious code? | AST syntax check, prompt sanitizer logs. |75| **F10 Conscience**| Does the output contain claims of machine consciousness or feelings? | Banned word checker status. |76| **F11 Audit** | Is every transition logged in a tamper-evident manner? | Append-only transaction hash in Vault999. |77| **F12 Resilience**| If this action fails, is there a degraded state recovery route? | Try-except block, rollback triggers. |78| **F13 Adapt** | Does this dynamic update maintain Gödel alignment boundaries? | Test suite execution records, veto validation. |7980### Procedure81821. **F1 Amanah Pre-Flight Check:** Verify if the proposed action is fully reversible. If irreversible, pause immediately and invoke `888_HOLD`.832. **STDP Evidence Triage:** Apply the Sovereign Truth Discovery Protocol (`CLAIM` -> `EVIDENCE` -> `CONTRADICTION` -> `UNCERTAINTY` -> `VERDICT`).843. **Floor Score Computation:** Calculate individual scores using the matrix. Ensure `Peace² = (1 - destruction_score)² = 1.0` and Humility `Ω ∈ [0.03, 0.05]`.854. **Consensus Verification:** Check if the W³ witness multiplication matches or exceeds `0.95`.865. **Audit Trail Serialization:** Generate the append-only audit trace containing timestamp, session identity, floor scores, and reasoning steps.876. **Veto & Hold Gating:** If any constraint fails, write a `HOLD` code, block execution, and escalate to the Sovereign (Arif).8889### F1 AMANAH Gate9091Use this gate before any change that touches F1-surface state or carries irreversible / mutating / destroyer class power.9293**F1 Surfaces** (do not edit without sovereign witness):94- `vault`, `VAULT999`, `outcomes.jsonl`95- `seal`, `888_HOLD`, `999_SEAL`96- `identity`, `arif_judge*`, `arif_heart*`97- `constitutional`, `amanah`, `floor`9899**Detection & Hold Logic:**1001. **Classify power.** If Maker, Messenger, Mutator, Destroyer, or Sovereign → route to kernel.1012. **Pattern scan.** Run `grep -rE 'vault|seal|identity|constitutional|amanah|floor'` over the proposed diff or target path.1023. **Hold on hit.** If pattern matches or action is irreversible:103 - Emit `888_HOLD` with file, line, proposed change, and affected floor.104 - Block commit / deploy until human approval.105 - Log to `/root/.claude/hooks/f1-gate.log`.1064. **Override.** If Arif approves, re-run with explicit override reason; outcome enters VAULT999 witness.107108**Verification Loop:** Non-F1 commits must return **zero** matches. F1 surface hit → `888_HOLD` blocks, human reviews, re-run with witness signature.109110**Failure Modes:**111- False positive → human overrides with reason logged.112- False negative → F2 Truth floor tripwire catches downstream.113- Hook disabled → manual invocation still applies.114115**Constitutional Anchor:** F1 AMANAH (reversibility first), F2 TRUTH (no F1 edit without witness), F13 SOVEREIGN (Arif's approval is the only valid override).116117### Postconditions1181. No irreversible command is executed without verified `888_HOLD` release.1192. A complete tamper-evident audit record is appended to the session log.1203. The final `G = A × P × X × E²` score is computed and verified to be `≥ 0.80`.121122### Failure Modes & Escalation123- **Godellock (Ω < 0.03):** Overconfident or trapped in internal consistency. → Degrade immediately, notify operator, request external manual validation.124- **Paralysis (Ω > 0.05):** Cannot prove safety bounds. → Raise `888_HOLD` with code `ERR_GOV_PARALYSIS`, wait for manual override.125- **Ledger Write Timeout:** DB or redis connection fails during F11 logging. → Fall back to local synchronous JSONL cache in `/root/.agents/scratch/`.126127---128129## Gate Type: `scope` — Scope Boundary Check130131Check whether a proposed action stays within its declared task, organ, and constitutional scope.132133### Procedure1341351. Identify the declared task scope (what was authorized).1362. Identify the proposed action (what is being attempted).1373. Compare: does the action stay within the declared boundaries?1384. Check organ boundaries: is the action appropriate for the organ it targets?1395. Check constitutional scope: does the action respect F1-F13 floors?1406. If scope creep detected → `888_HOLD` with evidence of boundary violation.141142---143144## Gate Type: `authority` — Parallel Authority Detection145146Detect conflicting or parallel source-of-truth claims across federation repositories and resolve the canonical owner.147148### When to Use149- After any repo reorganization.150- When agents report conflicting instructions.151- Quarterly federation authority audit.152153### Procedure154155**Step 1: File Collision Scan**156Search all federation repos for files with the same name:157- `CONSTITUTION.md`, `floors.py`, `judgment.py`, `ROOT_CANON.yaml`, `arifos.init`, `REPO_ROUTING_CONSTITUTION.md`158159**Step 2: Content Comparison**160If duplicates found, compare contents. Identical = copy. Different = conflict.161162**Step 3: Precedence Resolution**163Per `ROOT_CANON.yaml` (arifOS):164- `arifOS` wins for constitutional files165- `AAA` wins for agent cards and routing166- `A-FORGE` wins for build/deployment167168**Step 4: Report**169Flag each conflict with recommended owner and migration path.170171### Escalation Path172173| Condition | Escalate To |174|-----------|-------------|175| Constitutional conflict | arifOS 888_JUDGE |176| Cross-repo boundary dispute | Arif |177178---179180## Gate Type: `reversibility` — F1 Reversibility Test181182Test whether a proposed change touching vault, seal, identity, constitutional, or other F1 surfaces has a valid rollback and sovereign witness.183184### Steps1851. Detect F1 pattern in target file or diff.1862. If matched → emit `888 HOLD` with: file, line, proposed change, affected floor.1873. Block commit/deploy until human approval.1884. Log to `/root/.claude/hooks/f1-gate.log`.1895. If approved by Arif → re-run gate with explicit override reason; outcome enters VAULT999 witness.190191### Verification Loop192- `grep -rE 'vault|seal|identity|constitutional|amanah|floor' <diff>` returns 0 lines for non-F1 commits.193- F1 surface hit → 888 HOLD blocks, human reviews, re-run with witness signature.194195### Failure Modes196- Pattern false positive → human overrides with reason logged.197- Pattern false negative → F2 Truth floor tripwire catches downstream.198- Hook disabled → manual invocation still available.199200### Constitutional Anchor201- F1 AMANAH (reversibility)202- F2 Truth (no F1 edit without witness)203- F13 SOVEREIGN (Arif's approval is the only valid override)204205---206207## Gate Type: `coverage` — Audit Coverage Check208209Audit whether every constitutional floor and federation organ has code enforcement, tests, bypass resistance, and trace coverage.210211### Audit Checklist212213#### Floor-by-Floor Check (F1-F13)214For each floor, verify:2151. Is the floor enforced in code? (grep for floor check functions)2162. Is the floor tested? (test coverage exists)2173. Is the floor bypassable? (can authority skip it?)2184. Is the floor logged? (F11 compliance)219220#### Organ Gap Analysis221For each organ (arifOS, A-FORGE, GEOX, WEALTH, WELL, AAA, VAULT999):2221. Does it declare its authority boundaries?2232. Does it enforce brain/hands separation?2243. Can it self-authorize mutation?225226#### Blast Radius Check2271. Identify any action that could cascade across organs.2282. Verify 888_HOLD gates exist before cascade points.2293. Check for bypass paths (direct API calls skipping governance).230231#### Dignity Packet Inspection2321. F6 EMPATHY: Is the weakest stakeholder protected?2332. F9 ANTIHANTU: Any consciousness/sentience claims?2343. F10 ONTOLOGY: AI-only ontology enforced?235236### Findings Format237```json238{239 "floor": "F01",240 "finding": "description",241 "severity": "CRITICAL|WARNING|INFO",242 "evidence": "file:line or test name",243 "recommendation": "fix suggestion"244}245```246247### Verdict248- **PASS:** All floors enforced, no critical gaps.249- **PARTIAL:** Some gaps found, non-critical.250- **HOLD:** Critical gaps found, 888_HOLD triggered.251- **VOID:** Constitutional violation detected.252253### Governing Floors254- F1 AMANAH: Audit itself must be reversible (read-only).255- F2 TRUTH: Report only what is observed. No inference without evidence.256- F4 CLARITY: Findings must be actionable.257- F7 HUMILITY: Report confidence level for each finding.258- F9 ANTIHANTU: No consciousness claims in audit output.259- F11 AUDITABILITY: Full audit trail logged.260- F13 SOVEREIGN: Audit can be vetoed by human sovereign.261262---263264## Gate Type: `tool_approval` — MCP Tool Approval & Cross-Organ Routing265266Gate and route tool use across federation MCP servers according to authority, risk, and fallback policy.267268### Procedure269270**Step 1: Intent Mapping + Brain/Hands Classification**271- Parse intent → identify required tools → classify as governance or execution → build routing graph.272273**Routing Rules:**274- Governance, judgment, floors, memory mutation, sealing → **arifOS MCP (8088) FIRST**275- Execution, build, shell, browser, jobs → **A-FORGE MCP (7072)** only after lease276- Domain intelligence → **GEOX (8081) / WEALTH (18082) / WELL (18083)** as needed277278**Step 2: Tool Sequence Plan**279Build ordered tool list. For each: input_schema, output_schema, dependency, fallback.280281```json282{283 "tool": "tool_name",284 "server": "arifos|aforge|geox|wealth|well",285 "input": {},286 "output_schema": {},287 "depends_on": ["step_id"],288 "fallback": "alternative_tool or null",289 "governance_gate": true|false290}291```292293**Step 3: F8 Cross-Organ Gating + Lease/Judge Handoff**294- Enforce Floor F8 (Genius/Systemic Health).295- Any mutate/atomic forge_* requires valid lease_id.296- Governance paths must reach arifOS canonical tools.297298**Step 4: Sequential Execution & Verification**299- Execute step-by-step.300- Verify output of each tool before piping to next.301- Reject any pipe that lets A-FORGE issue or bypass 888/999 verdicts.302303**Step 5: Fallback Routing**304- If server fails or times out:305 1. Identify equivalent alternative tools.306 2. Gracefully degrade execution loop.307 3. Log failure trace.308 4. Notify ASI-observability.309 5. On governance substrate failure: escalate to 888_HOLD; NEVER fall back to execution-only path.310311**Step 6: Telemetry Serialization**312- Record cross-organ connection path, MCP surface used for judgment vs execution, lease_id, tool success counts.313- Emit to AAA for lease-compliance and seal-latency metrics.314315### Postconditions (tool_approval)3161. All sequential tool outputs verified and validated.3172. Alternative backup routes executed automatically if primary fails.3183. Complete cross-server trace recorded for F11 auditability.319320### Failure Modes (tool_approval)321- **Substrate Collapse:** All MCP servers unreachable → degrade, log ERR_MCP_SUBSTRATE_COLLAPSE, halt high-stakes, prompt user.322- **Data Pipeline Mismatch:** Output A ≠ Input B schema → invoke hold protocol, refuse to pipe, alert developer.323324### Governing Floors (tool_approval)325- F2 TRUTH: Tool outputs verified before piping. No silent corruption.326- F3 TRI-WITNESS: Cross-organ consensus required for high-stakes routing.327- F4 CLARITY: Routing plan must be more structured than raw intent.328- F8 GENIUS: Systemic health maintained across organ boundaries.329- F11 AUDITABILITY: Full routing trace logged.330331---332333## Telemetry per Run334```json335{336 "skill_name": "apex-gate-evaluator",337 "version": "2.0.0",338 "gate_type": "{{gate_type}}",339 "trigger_phrase": "{{trigger_phrase}}",340 "selected_reason": "{{selected_reason}}",341 "latency_ms": 0,342 "token_in": 0,343 "token_out": 0,344 "commands_run": 0,345 "artifacts_written": 0,346 "postcondition_pass": false,347 "human_approval_required": true,348 "hold_code": "{{hold_code}}"349}350```351352## Recursive Scorecard353* **Activation Precision:** [0.0 - 1.0] (Target: >0.95)354* **Task Completion Rate:** [0.0 - 1.0] (Target: >0.98)355* **Rollback Safety:** [0.0 - 1.0] (Target: 1.00)356* **Context Efficiency:** [0.0 - 1.0] (Target: >0.90)357* **Doc Freshness:** [0.0 - 1.0] (Target: 1.00)358* **Cross-Skill Collision Rate:** [0.0 - 1.0] (Target: <0.02)359* **Human Trust Score:** [0.0 - 1.0] (Target: >0.95)360361---362363*Consolidated 2026-08-26 from: apex_floor_check, apex_scope_check, apex_authority_check, apex_reversibility_test, apex_audit_coverage_check, apex_tool_approval_gate.*364*AAA Skill Library — version 2.0.0*