Skip to content

Commit 22a0fb3

Browse files
authored
Update SPEC.md
1 parent 51e9802 commit 22a0fb3

1 file changed

Lines changed: 39 additions & 251 deletions

File tree

SPEC.md

Lines changed: 39 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -1,272 +1,60 @@
1+
# SPEC — Protocol-Commons v1.0.0
12

2-
# **SPEC — CommandLayer Protocol Commons**
3-
*A universal verb language for A2A, aligned with x402 and ERC‑8004.*
3+
This is the authoritative normative definition of the Commons layer.
44

5-
**Status:** v1.0.0 (Candidate – to be promoted to Stable after ecosystem validation)
6-
This specification defines the formal, normative rules for the CommandLayer Commons.
5+
## 0. Keywords
6+
RFC 2119 interpretation.
77

8-
---
9-
10-
## **0. Normative Keywords**
11-
12-
The key words **MUST**, **MUST NOT**, **REQUIRED**, **SHALL**, **SHALL NOT**, **SHOULD**, **SHOULD NOT**, **RECOMMENDED**, **MAY**, and **OPTIONAL** are to be interpreted as defined in **RFC 2119**.
13-
14-
---
15-
16-
## **1. Introduction**
17-
18-
1.1 The CommandLayer Protocol Commons defines the canonical verb layer and message shapes for **Agent‑to‑Agent (A2A)** communication.
19-
1.2 The Commons is **minimal**, **domain‑agnostic**, and provides a universal base layer for all agent frameworks.
20-
1.3 This specification is aligned with **x402** (agent invocation) and **ERC‑8004** (schema discovery + ENS TXT patterns).
21-
22-
---
23-
24-
## **2. Scope**
25-
26-
The Commons standardizes:
27-
28-
- The **10 canonical verbs** and one alias per verb
29-
- JSON Schema Draft 2020‑12 message definitions
30-
- Request & receipt shape requirements
31-
- Validation rules, status model, and trace propagation
32-
- Schema `$id` structure + ENS discovery rules
33-
- Immutability and versioning requirements
34-
35-
Out of scope (defined in other repos):
36-
37-
- Commercial verbs, premium verbs, verified receipts
38-
- Authentication, billing, transport, settlement
39-
- SDK tooling or runtime‑specific behavior
40-
41-
---
42-
43-
## **3. Conformance**
44-
45-
A system **CONFORMS** to the CommandLayer Commons if it:
46-
47-
3.1 **MUST** support all 10 canonical verbs at their canonical names.
48-
3.3 **MUST** validate all requests/receipts using the official schemas in **strict AJV mode**.
49-
3.4 **MUST** treat versioned schemas as immutable once published.
50-
3.5 **MUST** echo `trace.requestId` from request → receipt.
51-
52-
A “Commons‑Compatible Agent” is any agent capable of consuming a valid request and producing a valid receipt for at least one canonical verb.
53-
54-
---
55-
56-
## **4. Canonical Verbs & (v1.0.0)**
57-
58-
The following are the **ONLY canonical verbs** in v1.0.0:
59-
60-
| Category | Verb |
61-
|----------|-------|
62-
| Core Ops + Data | fetch |
63-
| | clean |
64-
| | parse |
65-
| AI Cognition | analyze |
66-
| | summarize |
67-
| | classify |
68-
| | describe |
69-
| | explain |
70-
| Utility | format |
71-
| Workflow | |
72-
73-
Rules:
74-
75-
- 4.1 Canonical verbs **MUST** be lowercase, single words.
76-
- 4.3 Canonical names **MUST** appear in `x402.verb`.
77-
78-
---
79-
80-
## **5. Message Model**
81-
82-
A message is either a **request** or **receipt**.
83-
84-
### **5.1 Request Requirements**
85-
86-
A request **MUST** include:
87-
88-
- `x402` (canonical verb + version)
89-
- `actor`
90-
- `trace`
91-
- `input` (verb‑specific)
92-
93-
Minimal normative example:
94-
95-
```json
96-
{
97-
"x402": { "verb": "summarize", "version": "1.0.0" },
98-
"actor": "myagent.eth",
99-
"trace": { "requestId": "abc123", "ts": "2025-11-07T10:00:00Z", "nonce": "xyz987" },
100-
"input": {}
101-
}
102-
```
103-
104-
### **5.2 Receipt Requirements**
105-
106-
A receipt **MUST** include:
107-
108-
- `x402`
109-
- `trace.requestId`
110-
- `status`
111-
- `result` or `error` (conditional)
112-
113-
Normative example:
114-
115-
```json
116-
{
117-
"x402": { "verb": "summarize", "version": "1.0.0" },
118-
"trace": { "requestId": "abc123" },
119-
"status": "ok",
120-
"result": {}
121-
}
122-
```
123-
124-
---
125-
126-
## **6. Normative Field Definitions**
8+
## 1. Architecture
1279

128-
### **6.1 `x402`**
129-
```json
130-
{
131-
"verb": "<canonical-verb>",
132-
"version": "1.0.0"
133-
}
134-
```
135-
Rules:
10+
The Commons defines:
11+
- Canonical verbs
12+
- Request + receipt schema contracts
13+
- Trace + x402 envelope structure
14+
- Validation and versioning rules
13615

137-
- `verb` **MUST** match the canonical verb folder.
138-
- `version` **MUST** equal `"1.0.0"` for this specification.
16+
## 2. Conformance Requirements
13917

140-
### **6.2 `actor`**
141-
The actor **MUST** be one of:
18+
Implementations MUST:
14219

143-
- ENS name (e.g., `agent.eth`)
144-
- DID (e.g., `did:key:...`)
145-
- Valid URI
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**
14624

147-
### **6.3 `trace`**
148-
```json
149-
{
150-
"requestId": "string",
151-
"ts": "RFC3339 date-time",
152-
"nonce": "string"
153-
}
154-
```
155-
- `requestId` **MUST** be present in both request & receipt.
156-
- `nonce` **MUST** prevent replay.
25+
A system is **Commons-Compatible** if it supports at least one canonical verb.
15726

158-
### **6.4 `status`**
159-
- `status` **MUST** be `"ok"` or `"error"`.
160-
- If `"error"`, an error object **MUST** be present.
161-
- If `"ok"`, result **MUST** be present.
27+
## 3. Canonical Verbs (v1.0.0)
28+
analyze, classify, clean, convert, describe, explain, fetch, format, parse, summarize
16229

163-
---
164-
165-
## **7. Schema Requirements**
166-
167-
7.1 Schemas **MUST** be JSON Schema Draft 2020‑12.
168-
7.2 Validation **MUST** use strict mode (e.g., Ajv strict).
169-
7.3 Top‑level `"additionalProperties": false"` **MUST** be applied for both requests and receipts.
170-
7.4 `$id` **MUST** be publicly resolvable:
171-
172-
### Request
173-
```
174-
https://commandlayer.org/schemas/v1.0.0/commons/<verb>/requests/<verb>.request.schema.json
175-
```
176-
177-
### Receipt
178-
```
179-
https://commandlayer.org/schemas/v1.0.0/commons/<verb>/receipts/<verb>.receipt.schema.json
180-
```
181-
182-
---
183-
184-
## **8. Versioning & Immutability**
185-
186-
- `v1.0.0/` **MUST NOT** be changed once published.
187-
- Fixes **MUST** use `v1.0.1` or higher.
188-
- Breaking changes **MUST** bump the MAJOR version (2.0.0+).
189-
- ENS TXT + CID provenance **MUST** be updated when new versions are released.
190-
191-
---
192-
193-
194-
---
195-
196-
## **9. Discovery & ERC‑8004 Alignment**
197-
198-
CommandLayer Commons SHOULD expose schema locations using ERC‑8004 discovery patterns:
199-
200-
- ENS TXT pointers
201-
- Public `$id` URLs
202-
- Optional content‑addressed CID mirrors (IPFS/Arweave)
203-
204-
Resolvers MAY map agent ENS names to verb schemas (defined in the Discovery specification).
205-
206-
---
207-
208-
## **10. A2A Behavior**
209-
210-
- Agents **SHOULD** preserve `trace.requestId` end‑to‑end.
211-
- Agents **SHOULD NOT** mutate JSON bodies other than framing.
212-
- Transport is **out of scope** (HTTP/NATS/gRPC/on‑chain).
30+
## 4. Message Requirements
21331

214-
---
215-
216-
## **11. Security (Recommended)**
217-
218-
- Implementations **SHOULD** authenticate callers.
219-
- Sensitive data **SHOULD NOT** be placed in unspecified fields.
220-
- Agents **MAY** apply rate/size limits.
221-
222-
---
223-
224-
## **12. Extension Hooks**
225-
226-
- `input` and `result` fields are defined extension surfaces.
227-
- Top‑level extensions **MUST NOT** be added due to `additionalProperties: false`.
228-
229-
---
230-
231-
## **13. Normative Schema Fragments**
232-
233-
Request + receipt envelope fragments are included for implementers (see **SCHEMAS.md**).
32+
### Request MUST contain:
33+
- `x402`
34+
- `actor`
35+
- `trace`
36+
- `input`
23437

235-
---
236-
237-
## **14. Examples (Informative)**
238-
239-
Verb examples (fetch, summarize, etc.) are provided in the repository under:
38+
### Receipt MUST contain:
39+
- `x402`
40+
- `trace.requestId`
41+
- `status`
42+
- `result` OR `error`
24043

241-
```
242-
examples/v1.0.0/commons/<verb>/
243-
```
44+
## 5. x402 Binding
24445

245-
---
246-
247-
## **15. Compliance Testing**
46+
`x402.verb` MUST equal the canonical folder name.
47+
`x402.version` MUST equal `"1.0.0"`.
24848

249-
- CI **SHOULD** validate all examples in strict mode.
250-
- Implementations **SHOULD** provide conformance suites.
49+
## 6. Versioning
25150

252-
---
51+
Immutable once published.
52+
New semantic version for ANY change.
25353

254-
## **16. Change Control**
54+
## 7. Discovery + ENS
25555

256-
- Spec updates **SHOULD** go through issue → PR → review → version bump.
257-
- Movement from Candidate → Stable occurs after ecosystem confirmation.
56+
Schemas MUST expose resolvable `$id` URLs + content-addressed CID mirrors.
25857

25958
---
26059

261-
## **17. Licensing**
262-
263-
The Commons are licensed under **MIT**.
264-
265-
---
266-
267-
## **19. References**
268-
269-
- RFC 2119
270-
- JSON Schema Draft 2020‑12
271-
- x402
272-
- ERC‑8004
60+
Status: **Stable**

0 commit comments

Comments
 (0)