|
1 | | -# Schemas Policy — Protocol Commons |
| 1 | +# SCHEMAS_POLICY.md — Protocol-Commons (CommandLayer) |
2 | 2 |
|
3 | | -This document governs the creation, evolution, and stability of all canonical schemas within the Protocol Commons layer of CommandLayer. |
| 3 | +**Scope:** Protocol-Commons |
| 4 | +**Status:** v1.0.0 — Stable-Lock |
4 | 5 |
|
5 | | -Machine interoperability depends on **predictable**, **verifiable**, and **non-breaking** behavior. These rules ensure that autonomous agents integrating Protocol Commons never lose trust in the core semantics. |
| 6 | +This document is **NORMATIVE and ENFORCEABLE**. |
| 7 | +Machine interoperability depends on **predictable**, **verifiable**, and **non-breaking** semantics. |
| 8 | + |
| 9 | +Protocol-Commons defines the **canonical language of agent intent**. |
| 10 | +All schemas under this layer MUST comply with this policy. |
6 | 11 |
|
7 | 12 | --- |
8 | 13 |
|
9 | | -## 1. Canonical Verb Requirements |
| 14 | +## 1. Canonical Verb Requirements — NORMATIVE |
10 | 15 |
|
11 | | -A canonical verb MUST: |
| 16 | +A **Commons** (canonical) verb MUST: |
12 | 17 |
|
13 | 18 | - Be a **single lowercase word** |
14 | 19 | - Have exactly **one** interpretation |
15 | 20 | - Be **domain-neutral** and non-commercial |
16 | | -- Be approved through governance review PRIOR to publication |
| 21 | +- Pass governance review **prior to publication** |
17 | 22 |
|
18 | | -Commons verbs SHALL NOT encode: |
| 23 | +Canonical **Commons** verbs SHALL NOT encode: |
19 | 24 |
|
20 | | -- Payments or finance |
21 | | -- Authentication or identity proofing |
22 | | -- Business-specific logic |
| 25 | +- Payments, invoicing, authorization, or settlement |
| 26 | +- Authentication or identity proofing |
| 27 | +- Business, policy, or market-specific logic |
23 | 28 |
|
24 | | -Those belong to **Commercial** standards. |
| 29 | +> Economic and business semantics belong to **Commercial** verbs — |
| 30 | +> their schemas are permanently free, but NOT considered Commons. |
25 | 31 |
|
26 | 32 | --- |
27 | 33 |
|
28 | | -## 2. Required Artifacts Per Verb |
| 34 | +## 2. Directory Layout — NORMATIVE |
| 35 | + |
| 36 | +Each Commons verb MUST follow this **exact directory structure**: |
| 37 | +``` |
| 38 | +schemas/v1.0.0/commons/<verb>/requests/<verb>.request.schema.json |
| 39 | +schemas/v1.0.0/commons/<verb>/receipts/<verb>.receipt.schema.json |
| 40 | +schemas/v1.0.0/examples/<verb>/valid/.json |
| 41 | +schemas/v1.0.0/examples/<verb>/invalid/.json |
| 42 | +``` |
29 | 43 |
|
30 | | -Each verb MUST include: |
| 44 | +No aliases, shortcuts, or alternate layouts permitted. |
| 45 | + |
| 46 | +--- |
31 | 47 |
|
32 | | -- `requests/<verb>.request.schema.json` |
33 | | -- `receipts/<verb>.receipt.schema.json` |
34 | | -- Valid + invalid example sets: |
| 48 | +## 3. JSON Schema Requirements — NORMATIVE |
35 | 49 |
|
36 | | -`examples/valid/.json` |
37 | | -`examples/invalid/.json` |
| 50 | +All Protocol-Commons schemas MUST: |
38 | 51 |
|
39 | | -vbnet |
40 | | -Copy code |
41 | | -Schematics MUST reference shared primitives under: |
| 52 | +- Use JSON Schema Draft **2020-12** |
| 53 | +- Validate under Ajv **strict** mode |
| 54 | +- Include `"additionalProperties": false` on every object |
| 55 | +- Define `$id` deterministically: |
| 56 | +``` |
| 57 | +https://commandlayer.org/schemas/v1.0.0/commons/ |
| 58 | +<verb>/requests/<verb>.request.schema.json |
| 59 | +``` |
42 | 60 |
|
| 61 | +Schemas MUST reference shared primitives only from: |
| 62 | +``` |
43 | 63 | schemas/v1.0.0/_shared/ |
| 64 | +``` |
| 65 | + |
| 66 | +No external schema dependencies permitted. |
44 | 67 |
|
45 | 68 | --- |
46 | 69 |
|
47 | | -## 3. JSON Schema Requirements |
| 70 | +## 4. x402 Alignment — NORMATIVE |
48 | 71 |
|
49 | | -- Draft **2020-12** |
50 | | -- Ajv **strict** validation |
51 | | -- `"additionalProperties": false` |
52 | | -- Deterministic `$id` structure: |
| 72 | +All **requests MUST contain**: |
53 | 73 |
|
54 | | -https://commandlayer.org/schemas/v1.0.0/commons/<verb>/requests/<verb>.request.schema.json |
55 | | -https://commandlayer.org/schemas/v1.0.0/commons/<verb>/receipts/<verb>.receipt.schema.json |
| 74 | +- `x402.verb = <verb>` |
| 75 | +- `x402.version = "1.0.0"` |
56 | 76 |
|
| 77 | +All **receipts MUST contain**: |
57 | 78 |
|
58 | | -Directory layout MUST NOT vary. |
| 79 | +- `x402.status = "ok" | "error"` |
59 | 80 |
|
60 | | ---- |
| 81 | +Receipts MUST echo: |
| 82 | + |
| 83 | +- `trace.requestId` |
| 84 | +- `$id` and CID of request schema |
61 | 85 |
|
62 | | -## 4. x402 Alignment (Normative) |
| 86 | +This guarantees **verifiable interaction lineage**. |
63 | 87 |
|
64 | | -**All requests MUST define:** |
| 88 | +--- |
| 89 | + |
| 90 | +## 5. Immutable Semantics — Anti-Rug |
65 | 91 |
|
66 | | -- x402.verb = <verb> |
67 | | -- x402.version = "1.0.0" |
| 92 | +Once published: |
68 | 93 |
|
| 94 | +- **NO** in-place semantic modification permitted |
| 95 | +- Breaking behavior change → **major** version (`v2.0.0`) |
| 96 | +- Additive change → **minor** version |
| 97 | +- Documentation/example fixes → **patch** version |
69 | 98 |
|
70 | | -**All receipts MUST define:** |
| 99 | +New versions MUST include: |
71 | 100 |
|
72 | | -`x402.status = "ok" | "error"` |
| 101 | +- Updated **CIDs + SHA-256 checksums** |
| 102 | +- Required TXT binding updates where governed |
73 | 103 |
|
74 | | -Trace MUST echo `request.trace.requestId`. |
| 104 | +Historical versions MUST remain **resolvable forever**. |
75 | 105 |
|
76 | 106 | --- |
77 | 107 |
|
78 | | -## 5. Immutability |
| 108 | +## 6. Validity Requirements — NORMATIVE |
79 | 109 |
|
80 | | -Once published: |
| 110 | +Every Commons verb MUST provide: |
81 | 111 |
|
82 | | -- No modification permitted in-place |
83 | | -- Breaking change → new major version dir |
84 | | -- Additive change → minor version dir |
85 | | -- Example/docs fixes → patch version |
| 112 | +- Minimum **3 valid** example instances |
| 113 | +- Minimum **3 invalid** example instances including: |
| 114 | + - missing required fields |
| 115 | + - incorrect types |
| 116 | + - unauthorized extra properties |
86 | 117 |
|
87 | | -New versions MUST include: |
| 118 | +CI MUST enforce: |
| 119 | + |
| 120 | +- No failing examples |
| 121 | +- No unreferenced files |
| 122 | +- No schema drift across commits |
88 | 123 |
|
89 | | -- Updated CIDs |
90 | | -- Updated checksums |
91 | | -- ENS TXT update where applicable |
| 124 | +> A verb without test vectors is NOT canonical. |
92 | 125 |
|
93 | 126 | --- |
94 | 127 |
|
95 | | -## 6. Governance Compliance |
| 128 | +## 7. Governance Compliance — NORMATIVE |
96 | 129 |
|
97 | | -Every change MUST: |
| 130 | +All semantic changes MUST: |
98 | 131 |
|
99 | | -- Have an issue link |
100 | | -- Pass CI validation |
101 | | -- Be recorded in `RESOLUTION.md` |
102 | | -- Be signed by governance maintainer |
| 132 | +1. Reference an Issue requesting change |
| 133 | +2. Pass validation CI |
| 134 | +3. Be recorded in `RESOLUTION.md` |
| 135 | +4. Be signed by governance maintainer |
| 136 | + |
| 137 | +Silent changes are **forbidden**. |
103 | 138 |
|
104 | 139 | --- |
105 | 140 |
|
106 | | -_Last updated: v1.0.0 — Stable-Lock_ |
| 141 | +_Last updated: v1.0.0 — Stable-Lock_ |
| 142 | +Signed: **`commandlayer.eth`** |
| 143 | +*Founding Steward — CommandLayer Semantic Standards* |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
107 | 156 |
|
0 commit comments