|
| 1 | +# APA Custody Layer — Canonical Specification |
| 2 | + |
| 3 | +> **DITEMPA BUKAN DIBERI** — Forged, Not Given |
| 4 | +> **Status:** CANONICALLY RATIFIED 2026-07-26 |
| 5 | +> **Authority:** 888_JUDGE · F13 SOVEREIGN |
| 6 | +> **Layer:** A-FORGE Execution Shell (Ψ) |
| 7 | +> **Pipeline:** ART → KERNEL → APA → ACT → VAULT999 |
| 8 | +
|
| 9 | +--- |
| 10 | + |
| 11 | +## 0. Identity |
| 12 | + |
| 13 | +**APA (Action-Permission-Adapter)** is the safe handoff and custody wrapper that converts a KERNEL SEAL verdict into a bounded, lease-gated execution package before A-FORGE touches physical reality. |
| 14 | + |
| 15 | +APA is not thinking. APA is not judging. APA is not acting. APA is the **constraint bridge** between judgment and execution. |
| 16 | + |
| 17 | +``` |
| 18 | +arif_judge says: "Permission granted." |
| 19 | +APA says: "Through which controlled door, under what lease, with what limits?" |
| 20 | +ACT says: "Executing now." |
| 21 | +VAULT999 says: "Recorded forever." |
| 22 | +``` |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## 1. Pipeline Position |
| 27 | + |
| 28 | +``` |
| 29 | +┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ |
| 30 | +│ ART │ ──> │ KERNEL │ ──> │ APA │ ──> │ ACT │ ──> │ VAULT999 │ |
| 31 | +│ (Sees) │ │ (Permits)│ │(Constrains)│ │ (Moves) │ │(Remembers)│ |
| 32 | +└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ |
| 33 | +``` |
| 34 | + |
| 35 | +| Stage | Organ | Role | Question | |
| 36 | +|-------|-------|------|----------| |
| 37 | +| **ART** | Perception | Classifies action class | "What is this?" | |
| 38 | +| **KERNEL** | arifOS (Ω) | Judges against F1–F13; emits SEAL/HOLD | "May this happen?" | |
| 39 | +| **APA** | A-FORGE (Ψ) | Wraps in lease, manifest, bridge, blast radius | "How do we touch reality safely?" | |
| 40 | +| **ACT** | A-FORGE Actuator | Executes bounded manifest | "Can I execute this exact envelope?" | |
| 41 | +| **VAULT999** | Proof Anchor | Appends immutable receipt | "What did we do forever?" | |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 2. The 8 Invariant Checks |
| 46 | + |
| 47 | +Before handing any payload to ACT, APA enforces: |
| 48 | + |
| 49 | +| # | Check | Meaning | |
| 50 | +|---|-------|---------| |
| 51 | +| 1 | **Verb Class** | OBSERVE / MUTATE / IRREVERSIBLE | |
| 52 | +| 2 | **Blast Radius** | Scope of impact (file, repo, person, broadcast) | |
| 53 | +| 3 | **Reversibility (F1)** | Rollback exists? If no → F13 human gate | |
| 54 | +| 4 | **Bridge Routing** | email / calendar / github / telegram | |
| 55 | +| 5 | **Lease Allocation** | Time-bounded, single-use execution token | |
| 56 | +| 6 | **Manifest Schema** | Payload validated against static schema | |
| 57 | +| 7 | **Envelope Discipline** | Strips LLM prose; passes typed argument structs | |
| 58 | +| 8 | **Receipt Readiness (F11)** | Pre-formats VAULT999 receipt for post-execution hash | |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## 3. The 4 Bridges |
| 63 | + |
| 64 | +| Bridge | Port | Protocol | systemd Unit | F13 Gate? | |
| 65 | +|--------|------|----------|-------------|-----------| |
| 66 | +| **Email** | 18093 | IMAP/SMTP | `apa-email-bridge.service` | No | |
| 67 | +| **Calendar** | 18094 | CalDAV | `apa-calendar-bridge.service` | No | |
| 68 | +| **GitHub** | 18095 | REST API | `apa-github-bridge.service` | No | |
| 69 | +| **Telegram** | 18096 | Bot API | `apa-telegram-bridge.service` | **Yes — F13 veto lane** | |
| 70 | + |
| 71 | +All bridges return `apa_version: "1.0"` in `/health`. All bind `127.0.0.1` only. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## 4. Execution Flow |
| 76 | + |
| 77 | +``` |
| 78 | +Sealed Intent |
| 79 | + │ |
| 80 | + ▼ |
| 81 | +APA wraps: |
| 82 | + ├── Lease (who, how long, scope) |
| 83 | + ├── Manifest (exact payload, schema-validated) |
| 84 | + ├── Bridge selection (email/calendar/github/telegram) |
| 85 | + ├── Blast radius (what can be affected) |
| 86 | + └── Reversibility vector (rollback path) |
| 87 | + │ |
| 88 | + ▼ |
| 89 | +ACT executes bounded manifest through selected bridge |
| 90 | + │ |
| 91 | + ▼ |
| 92 | +VAULT999 appends immutable receipt |
| 93 | +``` |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## 5. Relation to APEX T-000 |
| 98 | + |
| 99 | +APA is the **execution-side complement** to APEX's governance calculus: |
| 100 | + |
| 101 | +- **APEX** measures whether intelligence *deserves* permission (G = GM(A,P,E,X)) |
| 102 | +- **APA** constrains *how* permitted action touches reality (lease + manifest + bridge) |
| 103 | + |
| 104 | +Together they form the complete governed-execution surface: **APEX gates the SEAL; APA gates the ACT.** |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## 6. Live Verification |
| 109 | + |
| 110 | +```bash |
| 111 | +# All 4 bridges should return apa_version: "1.0" |
| 112 | +for port in 18093 18094 18095 18096; do |
| 113 | + curl -s http://127.0.0.1:$port/health | jq .apa_version |
| 114 | +done |
| 115 | + |
| 116 | +# All 4 systemd units should be active |
| 117 | +systemctl status apa-email-bridge apa-calendar-bridge apa-github-bridge apa-telegram-bridge |
| 118 | +``` |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +*DITEMPA BUKAN DIBERI — APA = the governed bridge. After SEAL, before ACT.* |
0 commit comments