@agent-teams/docs-protocol 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +51 -2
  3. package/assets/catalog.json +1 -1
  4. package/assets/history/sha256-d697c5c7c9bcfccfc006fcf7e4d4cc8e7c629f9689781b9b0b50f30d82bc019e/caller.yml +14 -0
  5. package/assets/transition-catalog.json +1 -1
  6. package/dist/adapters/docs-command-envelope-schema-validator.d.ts.map +1 -1
  7. package/dist/adapters/docs-command-envelope-schema-validator.js +30 -8
  8. package/dist/adapters/docs-command-envelope-schema-validator.js.map +1 -1
  9. package/dist/adapters/docs-profile-schema-validator.d.ts.map +1 -1
  10. package/dist/adapters/docs-profile-schema-validator.js +13 -7
  11. package/dist/adapters/docs-profile-schema-validator.js.map +1 -1
  12. package/dist/adapters/foundation-docs-port.d.ts +10 -9
  13. package/dist/adapters/foundation-docs-port.d.ts.map +1 -1
  14. package/dist/adapters/foundation-docs-port.js +15 -10
  15. package/dist/adapters/foundation-docs-port.js.map +1 -1
  16. package/dist/adapters/node-adoption-inspector.js +2 -2
  17. package/dist/adapters/node-adoption-inspector.js.map +1 -1
  18. package/dist/adapters/node-profile-reader.d.ts +3 -3
  19. package/dist/adapters/node-profile-reader.d.ts.map +1 -1
  20. package/dist/application/authority-handshake.d.ts +4 -4
  21. package/dist/application/authority-handshake.d.ts.map +1 -1
  22. package/dist/application/compiled-document.d.ts +11 -0
  23. package/dist/application/compiled-document.d.ts.map +1 -0
  24. package/dist/application/compiled-document.js +31 -0
  25. package/dist/application/compiled-document.js.map +1 -0
  26. package/dist/application/docs-new-completion.d.ts +5 -4
  27. package/dist/application/docs-new-completion.d.ts.map +1 -1
  28. package/dist/application/docs-new-completion.js.map +1 -1
  29. package/dist/application/docs-protocol-v1-presenter.d.ts +140 -0
  30. package/dist/application/docs-protocol-v1-presenter.d.ts.map +1 -0
  31. package/dist/application/docs-protocol-v1-presenter.js +77 -0
  32. package/dist/application/docs-protocol-v1-presenter.js.map +1 -0
  33. package/dist/application/docs-protocol.d.ts +210 -3
  34. package/dist/application/docs-protocol.d.ts.map +1 -1
  35. package/dist/application/docs-protocol.js +46 -13
  36. package/dist/application/docs-protocol.js.map +1 -1
  37. package/dist/composition/cli-input.d.ts +12 -0
  38. package/dist/composition/cli-input.d.ts.map +1 -0
  39. package/dist/composition/cli-input.js +66 -0
  40. package/dist/composition/cli-input.js.map +1 -0
  41. package/dist/composition/cli.d.ts +4 -4
  42. package/dist/composition/cli.d.ts.map +1 -1
  43. package/dist/composition/cli.js +21 -144
  44. package/dist/composition/cli.js.map +1 -1
  45. package/dist/composition/docs-human-renderer.d.ts +5 -0
  46. package/dist/composition/docs-human-renderer.d.ts.map +1 -0
  47. package/dist/composition/docs-human-renderer.js +94 -0
  48. package/dist/composition/docs-human-renderer.js.map +1 -0
  49. package/dist/composition/node-docs-api.d.ts +191 -0
  50. package/dist/composition/node-docs-api.d.ts.map +1 -1
  51. package/dist/composition/node-docs-api.js +18 -0
  52. package/dist/composition/node-docs-api.js.map +1 -1
  53. package/dist/composition/qualification-cli.d.ts +2 -0
  54. package/dist/composition/qualification-cli.d.ts.map +1 -0
  55. package/dist/composition/qualification-cli.js +119 -0
  56. package/dist/composition/qualification-cli.js.map +1 -0
  57. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts.map +1 -1
  58. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js +8 -3
  59. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js.map +1 -1
  60. package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts.map +1 -1
  61. package/dist/consumer-integration/adapters/node-consumer-integration-repository.js +10 -3
  62. package/dist/consumer-integration/adapters/node-consumer-integration-repository.js.map +1 -1
  63. package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts +2 -1
  64. package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts.map +1 -1
  65. package/dist/consumer-integration/application/policies/consumer-integration-assets.js +12 -5
  66. package/dist/consumer-integration/application/policies/consumer-integration-assets.js.map +1 -1
  67. package/dist/consumer-integration/application/policies/consumer-integration-prior-cohort.js +2 -2
  68. package/dist/consumer-integration/application/policies/consumer-integration-prior-cohort.js.map +1 -1
  69. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js +2 -2
  70. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js.map +1 -1
  71. package/dist/consumer-integration/composition/canonical-docs-skill-v2.d.ts +2 -0
  72. package/dist/consumer-integration/composition/canonical-docs-skill-v2.d.ts.map +1 -0
  73. package/dist/consumer-integration/composition/canonical-docs-skill-v2.js +2 -0
  74. package/dist/consumer-integration/composition/canonical-docs-skill-v2.js.map +1 -0
  75. package/dist/consumer-integration/generated/canonical-assets.d.ts +2 -1
  76. package/dist/consumer-integration/generated/canonical-assets.d.ts.map +1 -1
  77. package/dist/consumer-integration/generated/canonical-assets.js +2 -1
  78. package/dist/consumer-integration/generated/canonical-assets.js.map +1 -1
  79. package/dist/domain/model-v2.d.ts +170 -0
  80. package/dist/domain/model-v2.d.ts.map +1 -0
  81. package/dist/domain/model-v2.js +2 -0
  82. package/dist/domain/model-v2.js.map +1 -0
  83. package/dist/domain/model.d.ts +1 -99
  84. package/dist/domain/model.d.ts.map +1 -1
  85. package/dist/domain/model.js.map +1 -1
  86. package/dist/domain/profile-policy.d.ts +2 -1
  87. package/dist/domain/profile-policy.d.ts.map +1 -1
  88. package/dist/domain/profile-policy.js +20 -12
  89. package/dist/domain/profile-policy.js.map +1 -1
  90. package/dist/index.d.ts +4 -2
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +3 -2
  93. package/dist/index.js.map +1 -1
  94. package/dist/qualification/filesystem-evidence.d.ts +15 -0
  95. package/dist/qualification/filesystem-evidence.d.ts.map +1 -0
  96. package/dist/qualification/filesystem-evidence.js +325 -0
  97. package/dist/qualification/filesystem-evidence.js.map +1 -0
  98. package/dist/qualification/index.d.ts +3 -0
  99. package/dist/qualification/index.d.ts.map +1 -1
  100. package/dist/qualification/index.js +12 -326
  101. package/dist/qualification/index.js.map +1 -1
  102. package/dist/qualification/qualification-runtime.d.ts +58 -0
  103. package/dist/qualification/qualification-runtime.d.ts.map +1 -0
  104. package/dist/qualification/qualification-runtime.js +160 -0
  105. package/dist/qualification/qualification-runtime.js.map +1 -0
  106. package/dist/qualification/qualification-v2-runner.d.ts +4 -0
  107. package/dist/qualification/qualification-v2-runner.d.ts.map +1 -0
  108. package/dist/qualification/qualification-v2-runner.js +306 -0
  109. package/dist/qualification/qualification-v2-runner.js.map +1 -0
  110. package/dist/qualification/v2-contract.d.ts +91 -0
  111. package/dist/qualification/v2-contract.d.ts.map +1 -0
  112. package/dist/qualification/v2-contract.js +2 -0
  113. package/dist/qualification/v2-contract.js.map +1 -0
  114. package/package.json +7 -2
  115. package/schemas/docs-consumer-integration-profile/v2.schema.json +283 -0
  116. package/schemas/docs-protocol-command-envelope/v2.schema.json +285 -0
  117. package/schemas/docs-protocol-profile/v2.schema.json +46 -0
  118. package/schemas/docs-protocol-qualification/v2.schema.json +78 -0
  119. package/schemas/docs-protocol-qualification-receipt/v2.schema.json +113 -0
  120. package/skills/docs/SKILL.md +3 -2
@@ -0,0 +1,285 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-teams.ai/schemas/docs-protocol-command-envelope/v2",
4
+ "title": "Agent Teams Docs Protocol Command Envelope",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "protocol", "command", "outcome", "diagnostics", "result"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "protocol": { "$ref": "#/$defs/protocol" },
11
+ "command": { "enum": ["docs.info", "docs.find", "docs.new", "docs.doctor", "docs.recover", "docs.check", "docs.qualify"] },
12
+ "outcome": { "enum": ["success", "conflict", "violation", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] },
13
+ "diagnostics": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/diagnostic" } },
14
+ "result": {
15
+ "oneOf": [
16
+ { "$ref": "#/$defs/emptyResult" },
17
+ { "$ref": "#/$defs/infoResult" },
18
+ { "$ref": "#/$defs/findResult" },
19
+ { "$ref": "#/$defs/newResult" },
20
+ { "$ref": "#/$defs/doctorResult" },
21
+ { "$ref": "#/$defs/recoverResult" },
22
+ { "$ref": "#/$defs/checkResult" },
23
+ { "$ref": "https://agent-teams.ai/schemas/docs-protocol-qualification-receipt/v2" }
24
+ ]
25
+ }
26
+ },
27
+ "allOf": [
28
+ { "$ref": "#/$defs/infoEnvelope" },
29
+ { "$ref": "#/$defs/findEnvelope" },
30
+ { "$ref": "#/$defs/newEnvelope" },
31
+ { "$ref": "#/$defs/doctorEnvelope" },
32
+ { "$ref": "#/$defs/recoverEnvelope" },
33
+ { "$ref": "#/$defs/checkEnvelope" },
34
+ { "$ref": "#/$defs/qualificationEnvelope" }
35
+ ],
36
+ "$defs": {
37
+ "protocol": {
38
+ "type": "object", "additionalProperties": false, "required": ["id", "version"],
39
+ "properties": { "id": { "const": "agent-teams.docs-protocol" }, "version": { "const": 1 } }
40
+ },
41
+ "lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
42
+ "opaqueId": { "type": "string", "minLength": 1, "maxLength": 214, "pattern": "^[A-Za-z0-9@][A-Za-z0-9@._/-]*$" },
43
+ "repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" },
44
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
45
+ "emptyResult": { "type": "object", "additionalProperties": false, "maxProperties": 0 },
46
+ "diagnostic": {
47
+ "type": "object", "additionalProperties": false,
48
+ "required": ["ruleId", "severity", "phase", "subject", "message"],
49
+ "properties": {
50
+ "ruleId": { "$ref": "#/$defs/opaqueId" },
51
+ "severity": { "enum": ["error", "info", "warning"] },
52
+ "phase": { "enum": ["apply", "authority", "input", "planning", "query", "recovery"] },
53
+ "subject": { "type": "string", "minLength": 1, "maxLength": 512 },
54
+ "message": { "type": "string", "minLength": 1, "maxLength": 1000 }
55
+ }
56
+ },
57
+ "jsonValue": {
58
+ "oneOf": [
59
+ { "type": "boolean" },
60
+ { "type": "null" },
61
+ { "type": "number" },
62
+ { "type": "string" },
63
+ { "type": "array", "maxItems": 10000, "items": { "$ref": "#/$defs/jsonValue" } },
64
+ { "type": "object", "maxProperties": 10000, "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
65
+ ]
66
+ },
67
+ "foundationProfile": {
68
+ "oneOf": [
69
+ { "type": "object", "additionalProperties": false, "required": ["path", "schemaVersion", "metadataSidecarPolicy"], "properties": { "path": { "$ref": "#/$defs/repositoryPath" }, "schemaVersion": { "const": 2 }, "metadataSidecarPolicy": { "const": "foundation-profile-v2-strict-merge" } } },
70
+ { "type": "object", "additionalProperties": false, "required": ["path", "schemaVersion", "metadataSidecarPolicy"], "properties": { "path": { "$ref": "#/$defs/repositoryPath" }, "schemaVersion": { "const": 3 }, "metadataSidecarPolicy": { "const": "foundation-profile-v3-strict-merge" } } }
71
+ ]
72
+ },
73
+ "metadataSidecar": {
74
+ "oneOf": [
75
+ { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "const": "none" } } },
76
+ { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "const": "path-metadata-map" }, "path": { "$ref": "#/$defs/repositoryPath" } } }
77
+ ]
78
+ },
79
+ "authorityEvidence": { "type": "object", "additionalProperties": false, "required": ["path", "digest", "size"], "properties": { "path": { "$ref": "#/$defs/repositoryPath" }, "digest": { "$ref": "#/$defs/digest" }, "size": { "type": "integer", "minimum": 0, "maximum": 10485760 } } },
80
+ "identity": {
81
+ "type": "object", "additionalProperties": false, "required": ["kind", "format"],
82
+ "properties": {
83
+ "kind": { "const": "explicit" },
84
+ "format": { "enum": ["adr-four-digits", "open-decision-three-digits", "qualified"] },
85
+ "grammar": {
86
+ "type": "object", "additionalProperties": false,
87
+ "required": ["prefixSegments", "minSuffixSegments", "maxSuffixSegments"],
88
+ "properties": {
89
+ "prefixSegments": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "$ref": "#/$defs/lowerId" } },
90
+ "minSuffixSegments": { "type": "integer", "minimum": 1, "maximum": 16 },
91
+ "maxSuffixSegments": { "type": "integer", "minimum": 1, "maximum": 16 }
92
+ }
93
+ }
94
+ }
95
+ },
96
+ "placement": {
97
+ "oneOf": [
98
+ {
99
+ "type": "object", "additionalProperties": false, "required": ["kind", "directory", "filename"],
100
+ "properties": { "kind": { "const": "collection" }, "directory": { "$ref": "#/$defs/repositoryPath" }, "filename": { "enum": ["numeric-id-slug", "id-slug", "slug", "README.md"] } }
101
+ },
102
+ {
103
+ "type": "object", "additionalProperties": false, "required": ["kind", "root", "requiredBasename"],
104
+ "properties": { "kind": { "const": "qualified-leaf-index" }, "root": { "$ref": "#/$defs/repositoryPath" }, "requiredBasename": { "const": "README.md" } }
105
+ },
106
+ {
107
+ "type": "object", "additionalProperties": false,
108
+ "required": ["kind", "allowedRoots", "requiredSegmentsInOrder", "requiredBasename", "minimumSegmentsBeforeRequired", "minimumSegmentsAfterRequired"],
109
+ "properties": {
110
+ "kind": { "const": "explicit" },
111
+ "allowedRoots": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/repositoryPath" } },
112
+ "requiredSegmentsInOrder": { "type": "array", "minItems": 1, "maxItems": 16, "items": { "type": "string", "pattern": "^[A-Za-z0-9._@-]+$", "maxLength": 255 } },
113
+ "requiredBasename": { "const": "README.md" },
114
+ "minimumSegmentsBeforeRequired": { "type": "integer", "minimum": 0, "maximum": 16 },
115
+ "minimumSegmentsAfterRequired": { "type": "integer", "minimum": 0, "maximum": 16 }
116
+ }
117
+ }
118
+ ]
119
+ },
120
+ "reachability": {
121
+ "oneOf": [
122
+ { "type": "object", "additionalProperties": false, "required": ["kind", "indexPath"], "properties": { "kind": { "const": "manual-fixed-index" }, "indexPath": { "$ref": "#/$defs/repositoryPath" } } },
123
+ { "type": "object", "additionalProperties": false, "required": ["kind", "pathPrefix", "indexBasename"], "properties": { "kind": { "const": "manual-colocated-index" }, "pathPrefix": { "const": "before-required-segments" }, "indexBasename": { "const": "README.md" } } },
124
+ { "type": "object", "additionalProperties": false, "required": ["kind", "reason"], "properties": { "kind": { "const": "not-required" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } } }
125
+ ]
126
+ },
127
+ "typeInfo": {
128
+ "type": "object", "additionalProperties": false,
129
+ "required": ["type", "initialStatus", "allowedOwnerIds", "identity", "heading", "placement", "template", "requiredMetadata", "reachability"],
130
+ "properties": {
131
+ "type": { "$ref": "#/$defs/lowerId" },
132
+ "initialStatus": { "$ref": "#/$defs/lowerId" },
133
+ "allowedOwnerIds": { "type": "array", "minItems": 1, "maxItems": 4096, "items": { "$ref": "#/$defs/opaqueId" } },
134
+ "identity": { "$ref": "#/$defs/identity" },
135
+ "heading": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["id-colon-title", "title"] } } },
136
+ "placement": { "$ref": "#/$defs/placement" },
137
+ "template": { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "const": "fenced-markdown-body" }, "path": { "$ref": "#/$defs/repositoryPath" } } },
138
+ "requiredMetadata": { "type": "array", "minItems": 5, "maxItems": 128, "items": { "type": "string", "maxLength": 128 } },
139
+ "reachability": { "$ref": "#/$defs/reachability" }
140
+ }
141
+ },
142
+ "infoResult": {
143
+ "type": "object", "additionalProperties": false,
144
+ "required": ["kind", "projectId", "protocol", "foundationProfile", "agentWorkflow", "authority", "authorityPaths", "catalog", "semanticDigest", "metadataSchemaPath", "metadataSidecar", "ownerIds", "types", "semanticValidatorIds"],
145
+ "properties": {
146
+ "kind": { "const": "info" }, "projectId": { "$ref": "#/$defs/lowerId" }, "protocol": { "$ref": "#/$defs/protocol" },
147
+ "foundationProfile": { "$ref": "#/$defs/foundationProfile" },
148
+ "agentWorkflow": { "type": "object", "additionalProperties": false, "required": ["skillPath"], "properties": { "skillPath": { "$ref": "#/$defs/repositoryPath" } } },
149
+ "authority": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": ["metadataSchema", "ownerCatalog", "profile", "templates"],
153
+ "properties": {
154
+ "metadataSchema": { "$ref": "#/$defs/authorityEvidence" },
155
+ "metadataSidecar": { "$ref": "#/$defs/authorityEvidence" },
156
+ "ownerCatalog": { "$ref": "#/$defs/authorityEvidence" },
157
+ "profile": { "$ref": "#/$defs/authorityEvidence" },
158
+ "templates": {
159
+ "type": "array",
160
+ "maxItems": 32,
161
+ "items": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": ["evidence", "type"],
165
+ "properties": {
166
+ "evidence": { "$ref": "#/$defs/authorityEvidence" },
167
+ "type": { "$ref": "#/$defs/lowerId" }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ },
173
+ "authorityPaths": { "type": "array", "minItems": 3, "maxItems": 96, "uniqueItems": true, "items": { "$ref": "#/$defs/repositoryPath" } },
174
+ "catalog": { "type": "object", "additionalProperties": false, "required": ["collections", "excludedPrefixes"], "properties": { "collections": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/catalogCollection" } }, "excludedPrefixes": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/repositoryPath" } } } },
175
+ "semanticDigest": { "$ref": "#/$defs/digest" },
176
+ "metadataSchemaPath": { "$ref": "#/$defs/repositoryPath" }, "metadataSidecar": { "$ref": "#/$defs/metadataSidecar" },
177
+ "ownerIds": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/opaqueId" } },
178
+ "types": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/typeInfo" } },
179
+ "semanticValidatorIds": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/lowerId" } }
180
+ }
181
+ },
182
+ "catalogCollection": {
183
+ "oneOf": [
184
+ { "type": "object", "additionalProperties": false, "required": ["kind", "root"], "properties": { "kind": { "const": "markdown-tree" }, "root": { "$ref": "#/$defs/repositoryPath" } } },
185
+ { "type": "object", "additionalProperties": false, "required": ["kind", "roots"], "properties": { "kind": { "const": "frontmatter-readme" }, "roots": { "type": "array", "minItems": 1, "maxItems": 32, "uniqueItems": true, "items": { "$ref": "#/$defs/repositoryPath" } } } }
186
+ ]
187
+ },
188
+ "document": {
189
+ "type": "object", "additionalProperties": false,
190
+ "required": ["id", "type", "status", "owner", "summary", "title", "repositoryPath", "source", "metadata", "related", "blockedBy"],
191
+ "properties": {
192
+ "id": { "$ref": "#/$defs/opaqueId" }, "type": { "$ref": "#/$defs/lowerId" }, "status": { "$ref": "#/$defs/lowerId" },
193
+ "owner": { "$ref": "#/$defs/opaqueId" }, "summary": { "type": "string", "minLength": 1, "maxLength": 1000 },
194
+ "title": { "type": "string", "minLength": 1, "maxLength": 240 }, "repositoryPath": { "$ref": "#/$defs/repositoryPath" },
195
+ "source": { "enum": ["frontmatter-readme", "markdown-tree"] },
196
+ "metadata": { "type": "object", "maxProperties": 10000, "additionalProperties": { "$ref": "#/$defs/jsonValue" } },
197
+ "related": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } },
198
+ "blockedBy": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } }
199
+ }
200
+ },
201
+ "findResult": { "type": "object", "additionalProperties": false, "required": ["kind", "matches", "documents"], "properties": { "kind": { "const": "find" }, "matches": { "type": "integer", "minimum": 0, "maximum": 10000 }, "documents": { "type": "array", "maxItems": 10000, "items": { "$ref": "#/$defs/document" } } } },
202
+ "reachabilityAction": {
203
+ "oneOf": [
204
+ { "type": "object", "additionalProperties": false, "required": ["state", "indexPath", "markdownLink"], "properties": { "state": { "const": "manual-required" }, "indexPath": { "$ref": "#/$defs/repositoryPath" }, "markdownLink": { "type": "string", "minLength": 1, "maxLength": 1024 } } },
205
+ { "type": "object", "additionalProperties": false, "required": ["state", "reason"], "properties": { "state": { "const": "not-required" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } } }
206
+ ]
207
+ },
208
+ "compiledDocument": {
209
+ "type": "object", "additionalProperties": false,
210
+ "required": ["schemaVersion", "document", "frontmatter", "metadata", "relations", "anchors"],
211
+ "properties": {
212
+ "schemaVersion": { "const": 1 },
213
+ "document": { "type": "object", "additionalProperties": false, "required": ["content", "digest", "mediaType", "size"], "properties": { "content": { "type": "string", "maxLength": 1048576 }, "digest": { "$ref": "#/$defs/digest" }, "mediaType": { "const": "text/markdown; charset=utf-8" }, "size": { "type": "integer", "minimum": 1, "maximum": 1048576 } } },
214
+ "frontmatter": { "type": "string", "minLength": 1, "maxLength": 262144 },
215
+ "metadata": { "type": "object", "maxProperties": 10000, "additionalProperties": { "$ref": "#/$defs/jsonValue" } },
216
+ "relations": { "type": "object", "additionalProperties": false, "required": ["blockedBy", "related"], "properties": { "blockedBy": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } }, "related": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } } } },
217
+ "anchors": { "type": "array", "maxItems": 256, "items": { "type": "object", "additionalProperties": false, "required": ["enforcement", "pattern"], "properties": { "enforcement": { "enum": ["advisory", "required"] }, "pattern": { "type": "string", "minLength": 1, "maxLength": 1000 } } } }
218
+ }
219
+ },
220
+ "recovery": { "type": "object", "additionalProperties": false, "required": ["commandId", "args"], "properties": { "commandId": { "enum": ["detach", "docs.recover", "docs-recover", "scaffold-recover"] }, "args": { "type": "object", "maxProperties": 16, "additionalProperties": { "type": "string", "maxLength": 512 } } } },
221
+ "receiptEvidence": {
222
+ "type": "object", "additionalProperties": false, "required": ["outcome", "commit"],
223
+ "properties": {
224
+ "outcome": { "enum": ["applied", "already-applied", "authority-stale", "rejected", "recovery-required", "manual-recovery-required", "failed-before-publication", "cancelled"] },
225
+ "commit": { "type": "object", "additionalProperties": false, "required": ["state", "publication", "recoverability"], "properties": { "state": { "enum": ["committed", "not-published", "recovery-required", "manual-recovery-required"] }, "publication": { "enum": ["none", "preexisting-exact", "published", "unknown"] }, "recoverability": { "enum": ["not-required", "preserved-for-recovery"] } } },
226
+ "directoryMaterialization": { "type": "object", "additionalProperties": false, "required": ["state", "plannedDirectories", "observedCreatedDirectories"], "properties": { "state": { "enum": ["none-created", "created-and-retained", "preserved-unknown"] }, "plannedDirectories": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/repositoryPath" } }, "observedCreatedDirectories": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/repositoryPath" } } } }
227
+ }
228
+ },
229
+ "transaction": {
230
+ "type": "object", "additionalProperties": false, "required": ["state"],
231
+ "properties": { "state": { "enum": ["idle", "recoverable", "manual-recovery-required"] }, "transactionKind": { "enum": ["corrupt", "document", "local-mode", "scaffold", "transition-residue", "unknown", "version-mismatch"] }, "reason": { "type": "string", "minLength": 1, "maxLength": 1000 }, "recovery": { "$ref": "#/$defs/recovery" } }
232
+ },
233
+ "newResult": {
234
+ "oneOf": [
235
+ { "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "transaction"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "blocked" }, "transaction": { "$ref": "#/$defs/transaction" } } },
236
+ { "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "reason"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "blocked" }, "reason": { "enum": ["adoption-invalid", "authority-stale"] } } },
237
+ { "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "documentPath", "planDigest", "compiled", "reachability"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "preview" }, "documentPath": { "$ref": "#/$defs/repositoryPath" }, "planDigest": { "$ref": "#/$defs/digest" }, "compiled": { "$ref": "#/$defs/compiledDocument" }, "reachability": { "$ref": "#/$defs/reachabilityAction" } } },
238
+ { "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "documentPath", "planDigest", "compiled", "receiptDigest", "receiptOutcome", "receipt"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "enum": ["applied", "already-applied", "published-recovery-required", "unchanged", "unknown"] }, "documentPath": { "$ref": "#/$defs/repositoryPath" }, "planDigest": { "$ref": "#/$defs/digest" }, "compiled": { "$ref": "#/$defs/compiledDocument" }, "receiptDigest": { "$ref": "#/$defs/digest" }, "receiptOutcome": { "enum": ["applied", "already-applied", "authority-stale", "rejected", "recovery-required", "manual-recovery-required", "failed-before-publication", "cancelled"] }, "receipt": { "$ref": "#/$defs/receiptEvidence" }, "reachability": { "$ref": "#/$defs/reachabilityAction" } } }
239
+ ]
240
+ },
241
+ "environment": { "type": "object", "additionalProperties": false, "required": ["installedFoundationVersion", "installedFoundationBuildIdentity", "filesystem"], "properties": { "installedFoundationVersion": { "type": "string", "minLength": 1, "maxLength": 100 }, "installedFoundationBuildIdentity": { "$ref": "#/$defs/digest" }, "filesystem": { "type": "object", "additionalProperties": false, "required": ["basis", "strictDirectoryDurability"], "properties": { "basis": { "const": "platform-contract" }, "strictDirectoryDurability": { "enum": ["platform-supported", "platform-unsupported"] } } } } },
242
+ "doctorResult": { "type": "object", "additionalProperties": false, "required": ["kind", "protocol", "environment", "transaction"], "properties": { "kind": { "const": "doctor" }, "protocol": { "$ref": "#/$defs/protocol" }, "projectId": { "$ref": "#/$defs/lowerId" }, "environment": { "$ref": "#/$defs/environment" }, "transaction": { "$ref": "#/$defs/transaction" } } },
243
+ "recoverResult": { "oneOf": [
244
+ { "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState"], "properties": { "kind": { "const": "recover" }, "transactionState": { "const": "no-pending-transaction" }, "writeState": { "const": "unchanged" } } },
245
+ { "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState", "transaction"], "properties": { "kind": { "const": "recover" }, "transactionState": { "const": "manual-required" }, "writeState": { "const": "unknown" }, "transaction": { "$ref": "#/$defs/transaction" } } },
246
+ { "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState", "receiptDigest", "receipt"], "properties": { "kind": { "const": "recover" }, "transactionState": { "enum": ["recovered", "recovery-required"] }, "writeState": { "enum": ["unchanged", "unknown", "committed", "published-recovery-required"] }, "receiptDigest": { "$ref": "#/$defs/digest" }, "receipt": { "$ref": "#/$defs/receiptEvidence" } } }
247
+ ] },
248
+ "checkResult": { "type": "object", "additionalProperties": false, "required": ["kind", "projectId", "catalogStatus", "documents", "foundationProfile", "metadataSidecar", "semanticValidatorIds", "valid"], "properties": { "kind": { "const": "check" }, "projectId": { "$ref": "#/$defs/lowerId" }, "catalogStatus": { "enum": ["complete", "partial"] }, "documents": { "type": "integer", "minimum": 0, "maximum": 100000 }, "foundationProfile": { "$ref": "#/$defs/foundationProfile" }, "metadataSidecar": { "$ref": "#/$defs/metadataSidecar" }, "semanticValidatorIds": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/lowerId" } }, "valid": { "type": "boolean" } } },
249
+ "infoEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.info" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/infoResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
250
+ "findEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.find" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/findResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
251
+ "newEnvelope": {
252
+ "if": { "type": "object", "properties": { "command": { "const": "docs.new" } }, "required": ["command"] },
253
+ "then": {
254
+ "type": "object",
255
+ "properties": { "outcome": { "enum": ["success", "conflict", "violation", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } },
256
+ "allOf": [
257
+ { "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["preview", "applied", "already-applied"] } }, "required": ["writeState"] }] } } } },
258
+ { "if": { "type": "object", "properties": { "outcome": { "const": "authority-stale" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["blocked", "unchanged", "unknown"] } }, "required": ["writeState"] }] } } } },
259
+ { "if": { "type": "object", "properties": { "outcome": { "const": "recovery-required" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["blocked", "published-recovery-required", "unknown", "unchanged"] } }, "required": ["writeState"] }] } } } },
260
+ { "if": { "type": "object", "properties": { "outcome": { "const": "conflict" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["unchanged", "unknown"] }, "receipt": true }, "required": ["writeState", "receipt"] }] } } } },
261
+ { "if": { "type": "object", "properties": { "outcome": { "const": "violation" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "const": "blocked" }, "reason": { "const": "adoption-invalid" } }, "required": ["writeState", "reason"] }] } } } },
262
+ { "if": { "type": "object", "properties": { "outcome": { "const": "invalid-input" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } },
263
+ { "if": { "type": "object", "properties": { "outcome": { "enum": ["execution-failure", "cancelled"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "oneOf": [{ "$ref": "#/$defs/emptyResult" }, { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["unchanged", "unknown", "published-recovery-required"] }, "receipt": true }, "required": ["writeState", "receipt"] }] }] } } } }
264
+ ]
265
+ }
266
+ },
267
+ "doctorEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.doctor" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "recovery-required"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/doctorResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
268
+ "recoverEnvelope": {
269
+ "if": { "type": "object", "properties": { "command": { "const": "docs.recover" } }, "required": ["command"] },
270
+ "then": {
271
+ "type": "object",
272
+ "properties": { "outcome": { "enum": ["success", "conflict", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } },
273
+ "allOf": [
274
+ { "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "enum": ["no-pending-transaction", "recovered"] } }, "required": ["transactionState"] }] } } } },
275
+ { "if": { "type": "object", "properties": { "outcome": { "const": "recovery-required" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "enum": ["manual-required", "recovery-required"] } }, "required": ["transactionState"] }] } } } },
276
+ { "if": { "type": "object", "properties": { "outcome": { "enum": ["conflict", "authority-stale"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "const": "recovery-required" }, "receipt": true }, "required": ["transactionState", "receipt"] }] } } } },
277
+ { "if": { "type": "object", "properties": { "outcome": { "const": "invalid-input" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } },
278
+ { "if": { "type": "object", "properties": { "outcome": { "enum": ["execution-failure", "cancelled"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "oneOf": [{ "$ref": "#/$defs/emptyResult" }, { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "const": "recovery-required" }, "receipt": true }, "required": ["transactionState", "receipt"] }] }] } } } }
279
+ ]
280
+ }
281
+ },
282
+ "checkEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.check" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/checkResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
283
+ "qualificationEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.qualify" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "https://agent-teams.ai/schemas/docs-protocol-qualification-receipt/v2" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } }
284
+ }
285
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-teams.ai/schemas/docs-protocol-profile/v2",
4
+ "title": "Agent Teams Docs Protocol Profile",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "protocol", "foundationProfile", "agentWorkflow", "semanticValidatorIds"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "protocol": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["id", "version"],
14
+ "properties": {
15
+ "id": { "const": "agent-teams.docs-protocol" },
16
+ "version": { "const": 1 }
17
+ }
18
+ },
19
+ "foundationProfile": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["path", "schemaVersion", "metadataSidecarPolicy"],
23
+ "properties": {
24
+ "path": { "$ref": "#/$defs/repositoryPath" },
25
+ "schemaVersion": { "const": 3 },
26
+ "metadataSidecarPolicy": { "const": "foundation-profile-v3-strict-merge" }
27
+ }
28
+ },
29
+ "agentWorkflow": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["skillPath"],
33
+ "properties": { "skillPath": { "$ref": "#/$defs/repositoryPath" } }
34
+ },
35
+ "semanticValidatorIds": {
36
+ "type": "array",
37
+ "maxItems": 256,
38
+ "uniqueItems": true,
39
+ "items": { "$ref": "#/$defs/lowerId" }
40
+ }
41
+ },
42
+ "$defs": {
43
+ "lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
44
+ "repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" }
45
+ }
46
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-teams.ai/schemas/docs-protocol-qualification/v2",
4
+ "title": "Docs Protocol consumer qualification v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "scenarios"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "scenarios": {
11
+ "type": "array", "minItems": 1, "maxItems": 32,
12
+ "items": { "$ref": "#/$defs/scenario" }
13
+ }
14
+ },
15
+ "$defs": {
16
+ "lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
17
+ "opaqueId": { "type": "string", "minLength": 1, "maxLength": 214, "pattern": "^[A-Za-z0-9@][A-Za-z0-9@._/-]*$" },
18
+ "repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" },
19
+ "jsonValue": {
20
+ "oneOf": [
21
+ { "type": "boolean" }, { "type": "null" }, { "type": "number" }, { "type": "string" },
22
+ { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/jsonValue" } },
23
+ { "type": "object", "maxProperties": 256, "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
24
+ ]
25
+ },
26
+ "anchor": {
27
+ "type": "object", "additionalProperties": false, "required": ["enforcement", "pattern"],
28
+ "properties": { "enforcement": { "enum": ["advisory", "required"] }, "pattern": { "type": "string", "minLength": 1, "maxLength": 1000 } }
29
+ },
30
+ "intent": {
31
+ "type": "object", "additionalProperties": false,
32
+ "required": ["id", "title", "owner", "summary"],
33
+ "properties": {
34
+ "id": { "$ref": "#/$defs/opaqueId" },
35
+ "title": { "type": "string", "minLength": 1, "maxLength": 240 },
36
+ "owner": { "$ref": "#/$defs/opaqueId" },
37
+ "summary": { "type": "string", "minLength": 1, "maxLength": 1000 },
38
+ "slug": { "type": "string", "minLength": 1, "maxLength": 160 },
39
+ "destination": { "$ref": "#/$defs/repositoryPath" },
40
+ "related": { "type": "array", "maxItems": 256, "uniqueItems": true, "items": { "$ref": "#/$defs/opaqueId" } },
41
+ "blockedBy": { "type": "array", "maxItems": 256, "uniqueItems": true, "items": { "$ref": "#/$defs/opaqueId" } },
42
+ "codeAnchors": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/anchor" } },
43
+ "metadata": { "type": "object", "maxProperties": 256, "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
44
+ }
45
+ },
46
+ "reachability": {
47
+ "oneOf": [
48
+ { "type": "object", "additionalProperties": false, "required": ["state", "indexPath", "markdownLink"], "properties": { "state": { "const": "manual-required" }, "indexPath": { "$ref": "#/$defs/repositoryPath" }, "markdownLink": { "type": "string", "minLength": 1, "maxLength": 1024 } } },
49
+ { "type": "object", "additionalProperties": false, "required": ["state", "reason"], "properties": { "state": { "const": "not-required" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } } }
50
+ ]
51
+ },
52
+ "expected": {
53
+ "type": "object", "additionalProperties": false,
54
+ "required": ["documentPath", "metadataStorage", "reachability"],
55
+ "properties": {
56
+ "documentPath": { "$ref": "#/$defs/repositoryPath" },
57
+ "metadataStorage": { "const": "frontmatter" },
58
+ "reachability": { "$ref": "#/$defs/reachability" },
59
+ "goldenFile": { "$ref": "#/$defs/repositoryPath" },
60
+ "goldenDigest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
61
+ },
62
+ "oneOf": [
63
+ { "not": { "anyOf": [{ "required": ["goldenFile"], "properties": { "goldenFile": true } }, { "required": ["goldenDigest"], "properties": { "goldenDigest": true } }] } },
64
+ { "required": ["goldenFile"], "properties": { "goldenFile": true }, "not": { "required": ["goldenDigest"], "properties": { "goldenDigest": true } } },
65
+ { "required": ["goldenDigest"], "properties": { "goldenDigest": true }, "not": { "required": ["goldenFile"], "properties": { "goldenFile": true } } }
66
+ ]
67
+ },
68
+ "scenario": {
69
+ "type": "object", "additionalProperties": false, "required": ["id", "type", "intent", "expected"],
70
+ "properties": {
71
+ "id": { "$ref": "#/$defs/lowerId" },
72
+ "type": { "$ref": "#/$defs/lowerId" },
73
+ "intent": { "$ref": "#/$defs/intent" },
74
+ "expected": { "$ref": "#/$defs/expected" }
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-teams.ai/schemas/docs-protocol-qualification-receipt/v2",
4
+ "title": "Docs Protocol qualification receipt v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "receiptDigest", "cohortAdmissible", "evidenceClass", "projectId", "scenarios", "checks", "derived", "evidence"],
8
+ "allOf": [
9
+ {
10
+ "if": { "properties": { "evidenceClass": { "const": "local-development" } }, "required": ["evidenceClass"] },
11
+ "then": { "properties": { "cohortAdmissible": { "const": false } } }
12
+ },
13
+ {
14
+ "if": { "properties": { "evidenceClass": { "const": "released-cohort" } }, "required": ["evidenceClass"] },
15
+ "then": { "properties": { "cohortAdmissible": { "const": true } } }
16
+ }
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": { "const": 2 },
20
+ "receiptDigest": { "$ref": "#/$defs/digest" },
21
+ "cohortAdmissible": { "type": "boolean" },
22
+ "evidenceClass": { "enum": ["local-development", "released-cohort"] },
23
+ "projectId": { "$ref": "#/$defs/lowerId" },
24
+ "scenarios": {
25
+ "type": "array", "minItems": 1, "maxItems": 32,
26
+ "items": {
27
+ "type": "object", "additionalProperties": false,
28
+ "required": ["id", "type", "documentPath", "outputDigest"],
29
+ "properties": {
30
+ "id": { "$ref": "#/$defs/lowerId" },
31
+ "type": { "$ref": "#/$defs/lowerId" },
32
+ "documentPath": { "$ref": "#/$defs/repositoryPath" },
33
+ "outputDigest": { "$ref": "#/$defs/digest" }
34
+ }
35
+ }
36
+ },
37
+ "checks": { "$ref": "#/$defs/checks" },
38
+ "derived": {
39
+ "type": "object", "additionalProperties": false,
40
+ "required": ["contractPath", "gateCommand", "packageVersions", "profilePath"],
41
+ "properties": {
42
+ "contractPath": { "$ref": "#/$defs/repositoryPath" },
43
+ "gateCommand": { "const": "pnpm docs:protocol:check" },
44
+ "packageVersions": {
45
+ "type": "object", "additionalProperties": false,
46
+ "required": ["docsProtocol", "engineeringFoundation"],
47
+ "properties": {
48
+ "docsProtocol": { "$ref": "#/$defs/version" },
49
+ "engineeringFoundation": { "$ref": "#/$defs/version" }
50
+ }
51
+ },
52
+ "profilePath": { "$ref": "#/$defs/repositoryPath" }
53
+ }
54
+ },
55
+ "evidence": {
56
+ "type": "object", "additionalProperties": false,
57
+ "required": ["sourceDigest", "integration", "contract", "profile", "skill", "packageManifestDigest", "lockfileDigest", "executingDocsProtocol", "executingFoundation", "cohort"],
58
+ "properties": {
59
+ "sourceDigest": { "$ref": "#/$defs/digest" },
60
+ "integration": { "$ref": "#/$defs/pathEvidence" },
61
+ "contract": { "$ref": "#/$defs/pathEvidence" },
62
+ "profile": { "$ref": "#/$defs/pathEvidence" },
63
+ "skill": { "$ref": "#/$defs/pathEvidence" },
64
+ "packageManifestDigest": { "$ref": "#/$defs/digest" },
65
+ "lockfileDigest": { "$ref": "#/$defs/digest" },
66
+ "executingDocsProtocol": {
67
+ "type": "object", "additionalProperties": false,
68
+ "required": ["version", "buildDigest"],
69
+ "properties": { "version": { "$ref": "#/$defs/version" }, "buildDigest": { "$ref": "#/$defs/digest" } }
70
+ },
71
+ "executingFoundation": {
72
+ "type": "object", "additionalProperties": false,
73
+ "required": ["version", "buildIdentity"],
74
+ "properties": { "version": { "$ref": "#/$defs/version" }, "buildIdentity": { "$ref": "#/$defs/digest" } }
75
+ },
76
+ "cohort": { "$ref": "https://agent-teams.ai/schemas/docs-consumer-integration-profile/v2#/$defs/cohortBinding" }
77
+ }
78
+ }
79
+ },
80
+ "$defs": {
81
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
82
+ "lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
83
+ "repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" },
84
+ "version": { "type": "string", "minLength": 1, "maxLength": 100 },
85
+ "pathEvidence": {
86
+ "type": "object", "additionalProperties": false,
87
+ "required": ["path", "digest"],
88
+ "properties": { "path": { "$ref": "#/$defs/repositoryPath" }, "digest": { "$ref": "#/$defs/digest" } }
89
+ },
90
+ "checks": {
91
+ "oneOf": [
92
+ {
93
+ "type": "array", "minItems": 10, "maxItems": 10,
94
+ "prefixItems": [
95
+ { "const": "info" }, { "const": "find" }, { "const": "check" }, { "const": "doctor" },
96
+ { "const": "recover" }, { "const": "preview" }, { "const": "apply" }, { "const": "path" },
97
+ { "const": "reachability" }, { "const": "source-unchanged" }
98
+ ],
99
+ "items": false
100
+ },
101
+ {
102
+ "type": "array", "minItems": 11, "maxItems": 11,
103
+ "prefixItems": [
104
+ { "const": "info" }, { "const": "find" }, { "const": "check" }, { "const": "doctor" },
105
+ { "const": "recover" }, { "const": "preview" }, { "const": "apply" }, { "const": "path" },
106
+ { "const": "reachability" }, { "const": "golden" }, { "const": "source-unchanged" }
107
+ ],
108
+ "items": false
109
+ }
110
+ ]
111
+ }
112
+ }
113
+ }
@@ -16,10 +16,11 @@ Protocol: `agent-teams.docs-protocol/v1`.
16
16
  - Review the exact destination, metadata, relations, anchors, and diagnostics.
17
17
  - Apply with `pnpm docs:new -- --type TYPE --id ID --title TITLE --owner OWNER --summary SUMMARY --apply` after review.
18
18
  - Manually update the reported index/link exactly when reachability requires it.
19
- - Finish with `pnpm docs:check` after the index is current.
19
+ - For edits, preserve canonical frontmatter and sidecar ownership; use the repository's governed review flow rather than bypassing the create-only writer.
20
+ - For accepted authority, record supersession explicitly instead of silently rewriting history.
21
+ - Finish with the full consumer gate `pnpm docs:protocol:check` after the index is current.
20
22
 
21
23
  ## Rules
22
-
23
24
  - Never invent owners, types, statuses, paths, or metadata outside `docs:info`.
24
25
  - If dependencies are absent, use only `pnpm install --frozen-lockfile`; never use npx, dlx, or latest tags.
25
26
  - Keep preview and apply inputs identical.