|
1 | | -# SPEC — Protocol-Commons v1.0.0 |
| 1 | +# SPEC — Protocol-Commons v1.0.0 |
| 2 | +CommandLayer Core Standards · Semantic Layer |
2 | 3 |
|
3 | | -This is the authoritative normative definition of the Commons layer. |
| 4 | +> This document is NORMATIVE and ENFORCEABLE. |
4 | 5 |
|
5 | | -## Keywords |
6 | | -RFC 2119 interpretation. |
| 6 | +## RFC 2119 Keywords |
| 7 | +MUST / MUST NOT / SHOULD / SHOULD NOT / MAY retain their RFC-defined meanings. |
7 | 8 |
|
8 | | -## 1. Architecture |
| 9 | +--- |
9 | 10 |
|
10 | | -The Commons defines: |
11 | | -- Canonical verbs |
12 | | -- Request + receipt schema contracts |
13 | | -- Trace + x402 envelope structure |
14 | | -- Validation and versioning rules |
| 11 | +## 1. Purpose |
15 | 12 |
|
16 | | -## 2. Conformance Requirements |
| 13 | +Protocol-Commons defines the **canonical action grammar for autonomous agents**: |
17 | 14 |
|
18 | | -Implementations MUST: |
| 15 | +- **Verbs** — What actions exist |
| 16 | +- **Request/Receipt Schemas** — Typed message contracts |
| 17 | +- **Trace + Status rules** — Deterministic provenance |
| 18 | +- **Versioning + Immutability** — Trust guarantees |
| 19 | + |
| 20 | +Execution, payment, identity, and routing are the domain of other layers. |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## 2. Architecture Position |
| 25 | + |
| 26 | +The Commons is the **lowest** layer of the CommandLayer Standard Stack: |
| 27 | +``` |
| 28 | +┌────────────────────────────┐ |
| 29 | +│ Execution — x402 runtime │ (value + invocation) |
| 30 | +└──────────────▲─────────────┘ |
| 31 | +│ |
| 32 | +┌──────────────┴─────────────┐ |
| 33 | +│ Identity — Agent-Cards │ (ENS discovery) |
| 34 | +└──────────────▲─────────────┘ |
| 35 | +│ |
| 36 | +┌──────────────┴─────────────┐ |
| 37 | +│ Semantics — Commons │ (canonical verbs) |
| 38 | +└────────────────────────────┘ |
| 39 | +``` |
| 40 | + |
| 41 | +**Commons answers: “What is this agent trying to do?”** |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 3. Canonical Verb Set (v1.0.0) |
| 46 | + |
| 47 | +The only canonical verbs are: |
| 48 | + |
| 49 | +analyze, classify, clean, convert, describe, |
| 50 | +explain, fetch, format, parse, summarize |
| 51 | + |
| 52 | + |
| 53 | +Each verb MUST map to: |
| 54 | + |
| 55 | +- `<verb>.request.schema.json` |
| 56 | +- `<verb>.receipt.schema.json` |
| 57 | + |
| 58 | +No aliases. No synonyms. |
| 59 | + |
| 60 | +--- |
19 | 61 |
|
20 | | -1️⃣ Support **all** canonical verbs |
21 | | -2️⃣ Validate against official schemas in strict mode |
22 | | -3️⃣ Echo `trace.requestId` request → receipt |
23 | | -4️⃣ Treat versioned directories as **immutable** |
| 62 | +## 4. Schema Directory Contract |
24 | 63 |
|
25 | | -A system is **Commons-Compatible** if it supports at least one canonical verb. |
| 64 | +Every schema file MUST reside under: |
26 | 65 |
|
27 | | -## 3. Canonical Verbs (v1.0.0) |
28 | | -analyze, classify, clean, convert, describe, explain, fetch, format, parse, summarize |
| 66 | +schemas/v1.0.0/commons/<verb>/ |
| 67 | +requests/<verb>.request.schema.json |
| 68 | +receipts/<verb>.receipt.schema.json |
29 | 69 |
|
30 | | -## 4. Message Requirements |
| 70 | +Shared primitives located at: |
| 71 | +schemas/v1.0.0/_shared/ |
| 72 | +x402.schema.json |
| 73 | +trace.schema.json |
| 74 | +receipt.base.schema.json |
31 | 75 |
|
32 | | -### Request MUST contain: |
33 | | -- `x402` |
34 | | -- `actor` |
35 | | -- `trace` |
36 | | -- `input` |
| 76 | +**Directory is version-locked.** |
| 77 | +Moving files is a breaking change. |
37 | 78 |
|
38 | | -### Receipt MUST contain: |
39 | | -- `x402` |
40 | | -- `trace.requestId` |
41 | | -- `status` |
42 | | -- `result` OR `error` |
| 79 | +--- |
| 80 | + |
| 81 | +## 5. Schema `$id` Rules (Deterministic) |
| 82 | + |
| 83 | +Every schema MUST use this `$id` pattern: |
43 | 84 |
|
44 | | -## 5. x402 Binding |
| 85 | +### Request |
| 86 | +https://commandlayer.org/schemas/v1.0.0/commons/<verb>/requests/<verb>.request.schema.json |
45 | 87 |
|
46 | | -`x402.verb` MUST equal the canonical folder name. |
47 | | -`x402.version` MUST equal `"1.0.0"`. |
| 88 | +shell |
| 89 | +Copy code |
48 | 90 |
|
49 | | -## 6. Versioning |
| 91 | +### Receipt |
| 92 | +https://commandlayer.org/schemas/v1.0.0/commons/<verb>/receipts/<verb>.receipt.schema.json |
50 | 93 |
|
51 | | -Immutable once published. |
52 | | -New semantic version for ANY change. |
| 94 | +shell |
| 95 | +Copy code |
53 | 96 |
|
54 | | -## 7. Discovery + ENS |
| 97 | +### Shared |
| 98 | +https://commandlayer.org/schemas/v1.0.0/_shared/<schema>.json |
55 | 99 |
|
56 | | -Schemas MUST expose resolvable `$id` URLs + content-addressed CID mirrors. |
| 100 | +yaml |
| 101 | +Copy code |
| 102 | + |
| 103 | +All `$id` values MUST be resolvable over HTTPS. |
57 | 104 |
|
58 | 105 | --- |
59 | 106 |
|
60 | | -Status: **Stable** |
| 107 | +## 6. x402 Envelope Binding |
| 108 | + |
| 109 | +All requests MUST embed: |
| 110 | + |
| 111 | +```jsonc |
| 112 | +"x402": { |
| 113 | + "verb": "<verb>", |
| 114 | + "version": "1.0.0" |
| 115 | +} |
| 116 | +All receipts MUST embed: |
| 117 | + |
| 118 | +jsonc |
| 119 | +Copy code |
| 120 | +"x402": { |
| 121 | + "verb": "<verb>", |
| 122 | + "version": "1.0.0", |
| 123 | + "status": "ok" | "error" |
| 124 | +} |
| 125 | +No additional properties permitted inside x402. |
| 126 | + |
| 127 | +7. Trace Guarantees |
| 128 | +Every receipt MUST echo: |
| 129 | + |
| 130 | +ini |
| 131 | +Copy code |
| 132 | +trace.requestId = request.trace.requestId |
| 133 | +This is REQUIRED for chaining & auditability. |
| 134 | + |
| 135 | +Additional trace fields MAY exist (per _shared/trace.schema.json) |
| 136 | +but MAY NOT weaken determinism or referential integrity. |
| 137 | + |
| 138 | +8. Request Contract |
| 139 | +Requests MUST contain: |
| 140 | + |
| 141 | +Field Required Source of Truth |
| 142 | +x402 Yes _shared/x402.schema.json |
| 143 | +actor Yes Freeform identifier |
| 144 | +trace Yes _shared/trace.schema.json |
| 145 | +input Yes Verb-specific |
| 146 | + |
| 147 | +Requests MUST validate in strict Ajv mode. |
| 148 | + |
| 149 | +9. Receipt Contract |
| 150 | +Receipts MUST contain: |
| 151 | + |
| 152 | +Field Required Conditional |
| 153 | +x402 Yes Always |
| 154 | +trace Yes Always |
| 155 | +status Yes "ok" or "error" |
| 156 | +result Yes IF status = ok |
| 157 | +error Yes IF status = error |
| 158 | + |
| 159 | +Strict conditional logic is canonical and MUST pass CI validation. |
| 160 | + |
| 161 | +Error receipts MUST NOT include result. |
| 162 | + |
| 163 | +10. Versioning + Immutability |
| 164 | +Once published under: |
| 165 | + |
| 166 | +bash |
| 167 | +Copy code |
| 168 | +schemas/v1.0.0/ |
| 169 | +There MUST NEVER be: |
| 170 | + |
| 171 | +File content changes |
| 172 | + |
| 173 | +Field requirement changes |
| 174 | + |
| 175 | +$id changes |
| 176 | + |
| 177 | +Behavior changes |
| 178 | + |
| 179 | +Any mutation requires: |
| 180 | + |
| 181 | +New version directory (e.g. v1.0.1/) |
| 182 | + |
| 183 | +New CID |
| 184 | + |
| 185 | +Updated checksums + manifest |
| 186 | + |
| 187 | +ENS TXT update |
| 188 | + |
| 189 | +Governance approval |
| 190 | + |
| 191 | +11. Discovery + ENS TXT Responsibilities |
| 192 | +Protocol-Commons governs ONLY: |
| 193 | + |
| 194 | +pgsql |
| 195 | +Copy code |
| 196 | +cl.verb |
| 197 | +cl.version |
| 198 | +cl.schema.request |
| 199 | +cl.schema.receipt |
| 200 | +cl.cid.schemas |
| 201 | +cl.schemas.mirror.ipfs |
| 202 | +These MUST be correct or the schema is unauthenticated. |
| 203 | + |
| 204 | +Identity pointers (cl.agentcard, etc.) are NOT in scope here. |
| 205 | + |
| 206 | +12. Conformance Requirements |
| 207 | +Implementations MUST: |
| 208 | + |
| 209 | +1️⃣ Validate requests & receipts in Ajv strict (2020-12) |
| 210 | +2️⃣ Support schema resolution from $id URLs |
| 211 | +3️⃣ Mirror schema CIDs correctly |
| 212 | +4️⃣ Treat version directories as immutable |
| 213 | +5️⃣ Respect full trace echo |
| 214 | + |
| 215 | +A system supporting ANY canonical verb MAY claim: |
| 216 | + |
| 217 | +“Commons-Compatible” |
| 218 | + |
| 219 | +13. Failure Modes |
| 220 | +If ANY of the following occur: |
| 221 | + |
| 222 | +$id mismatch |
| 223 | + |
| 224 | +Incorrect CID root |
| 225 | + |
| 226 | +trace.requestId mismatch |
| 227 | + |
| 228 | +status mismatch |
| 229 | + |
| 230 | +Request/receipt schema drift |
| 231 | + |
| 232 | +→ Schema is INVALID |
| 233 | +→ Execution MUST be rejected |
| 234 | +→ Incident MUST be logged |
| 235 | + |
| 236 | +14. Security |
| 237 | +Protocol-Commons is Security-Critical Infrastructure: |
| 238 | + |
| 239 | +No PII |
| 240 | + |
| 241 | +No execution logic |
| 242 | + |
| 243 | +No proprietary references |
| 244 | + |
| 245 | +No commercial conditions |
| 246 | + |
| 247 | +Security escalation MUST follow repository policy (SECURITY.md). |
| 248 | + |
| 249 | +Status |
| 250 | +Stable — v1.0.0 locked |
| 251 | +CommandLayer Core Standards |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
0 commit comments