Skip to content

Commit 788c122

Browse files
authored
Update SPEC.md
1 parent 1ac5762 commit 788c122

1 file changed

Lines changed: 235 additions & 39 deletions

File tree

SPEC.md

Lines changed: 235 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,256 @@
1-
# SPEC — Protocol-Commons v1.0.0
1+
# SPEC — Protocol-Commons v1.0.0
2+
CommandLayer Core Standards · Semantic Layer
23

3-
This is the authoritative normative definition of the Commons layer.
4+
> This document is NORMATIVE and ENFORCEABLE.
45
5-
## Keywords
6-
RFC 2119 interpretation.
6+
## RFC 2119 Keywords
7+
MUST / MUST NOT / SHOULD / SHOULD NOT / MAY retain their RFC-defined meanings.
78

8-
## 1. Architecture
9+
---
910

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
1512

16-
## 2. Conformance Requirements
13+
Protocol-Commons defines the **canonical action grammar for autonomous agents**:
1714

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+
---
1961

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
2463

25-
A system is **Commons-Compatible** if it supports at least one canonical verb.
64+
Every schema file MUST reside under:
2665

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
2969

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
3175

32-
### Request MUST contain:
33-
- `x402`
34-
- `actor`
35-
- `trace`
36-
- `input`
76+
**Directory is version-locked.**
77+
Moving files is a breaking change.
3778

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:
4384

44-
## 5. x402 Binding
85+
### Request
86+
https://commandlayer.org/schemas/v1.0.0/commons/<verb>/requests/<verb>.request.schema.json
4587

46-
`x402.verb` MUST equal the canonical folder name.
47-
`x402.version` MUST equal `"1.0.0"`.
88+
shell
89+
Copy code
4890

49-
## 6. Versioning
91+
### Receipt
92+
https://commandlayer.org/schemas/v1.0.0/commons/<verb>/receipts/<verb>.receipt.schema.json
5093

51-
Immutable once published.
52-
New semantic version for ANY change.
94+
shell
95+
Copy code
5396

54-
## 7. Discovery + ENS
97+
### Shared
98+
https://commandlayer.org/schemas/v1.0.0/_shared/<schema>.json
5599

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.
57104

58105
---
59106

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

Comments
 (0)