@cleocode/core 2026.3.44 → 2026.3.46

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 (166) hide show
  1. package/dist/admin/import-tasks.d.ts +10 -2
  2. package/dist/admin/import-tasks.d.ts.map +1 -1
  3. package/dist/bootstrap.d.ts.map +1 -1
  4. package/dist/index.js +1890 -504
  5. package/dist/index.js.map +4 -4
  6. package/dist/init.d.ts.map +1 -1
  7. package/dist/injection.d.ts +1 -1
  8. package/dist/injection.d.ts.map +1 -1
  9. package/dist/internal.d.ts +3 -1
  10. package/dist/internal.d.ts.map +1 -1
  11. package/dist/nexus/index.d.ts +2 -0
  12. package/dist/nexus/index.d.ts.map +1 -1
  13. package/dist/nexus/transfer-types.d.ts +123 -0
  14. package/dist/nexus/transfer-types.d.ts.map +1 -0
  15. package/dist/nexus/transfer.d.ts +31 -0
  16. package/dist/nexus/transfer.d.ts.map +1 -0
  17. package/dist/routing/capability-matrix.d.ts +6 -4
  18. package/dist/routing/capability-matrix.d.ts.map +1 -1
  19. package/dist/scaffold.d.ts +16 -9
  20. package/dist/scaffold.d.ts.map +1 -1
  21. package/dist/skills/agents/install.d.ts.map +1 -1
  22. package/dist/skills/routing-table.d.ts +17 -16
  23. package/dist/skills/routing-table.d.ts.map +1 -1
  24. package/dist/skills/skill-paths.d.ts.map +1 -1
  25. package/dist/store/brain-sqlite.d.ts +4 -1
  26. package/dist/store/brain-sqlite.d.ts.map +1 -1
  27. package/dist/store/nexus-sqlite.d.ts +4 -1
  28. package/dist/store/nexus-sqlite.d.ts.map +1 -1
  29. package/dist/store/sqlite.d.ts +4 -1
  30. package/dist/store/sqlite.d.ts.map +1 -1
  31. package/dist/store/tasks-schema.d.ts +3 -3
  32. package/dist/store/tasks-schema.d.ts.map +1 -1
  33. package/dist/store/validation-schemas.d.ts +5 -4
  34. package/dist/store/validation-schemas.d.ts.map +1 -1
  35. package/dist/system/health.d.ts.map +1 -1
  36. package/dist/ui/index.d.ts +0 -1
  37. package/dist/ui/index.d.ts.map +1 -1
  38. package/package.json +9 -4
  39. package/schemas/adr-frontmatter.schema.json +72 -0
  40. package/schemas/agent-configs.schema.json +120 -0
  41. package/schemas/agent-registry.json +243 -0
  42. package/schemas/agent-registry.schema.json +132 -0
  43. package/schemas/archive/research-manifest.schema.json +257 -0
  44. package/schemas/archive.schema.json +450 -0
  45. package/schemas/brain-decision.schema.json +69 -0
  46. package/schemas/brain-learning.schema.json +57 -0
  47. package/schemas/brain-pattern.schema.json +72 -0
  48. package/schemas/config.schema.json +2606 -0
  49. package/schemas/context-state.schema.json +137 -0
  50. package/schemas/contribution.schema.json +722 -0
  51. package/schemas/critical-path.schema.json +246 -0
  52. package/schemas/deps-cache.schema.json +97 -0
  53. package/schemas/doctor-output.schema.json +283 -0
  54. package/schemas/error.schema.json +161 -0
  55. package/schemas/export-package.schema.json +375 -0
  56. package/schemas/global-config.schema.json +219 -0
  57. package/schemas/grade.schema.json +49 -0
  58. package/schemas/log.schema.json +250 -0
  59. package/schemas/metrics.schema.json +328 -0
  60. package/schemas/migrations.schema.json +150 -0
  61. package/schemas/nexus-registry.schema.json +90 -0
  62. package/schemas/operation-constitution.schema.json +438 -0
  63. package/schemas/output.schema.json +164 -0
  64. package/schemas/project-context.schema.json +164 -0
  65. package/schemas/project-info.schema.json +180 -0
  66. package/schemas/projects-registry.schema.json +107 -0
  67. package/schemas/protocol-frontmatter.schema.json +72 -0
  68. package/schemas/rcasd-consensus-report.schema.json +10 -0
  69. package/schemas/rcasd-evidence.schema.json +42 -0
  70. package/schemas/rcasd-gate-result.schema.json +46 -0
  71. package/schemas/rcasd-hitl-resolution.schema.json +10 -0
  72. package/schemas/rcasd-index.schema.json +10 -0
  73. package/schemas/rcasd-manifest.schema.json +10 -0
  74. package/schemas/rcasd-research-output.schema.json +10 -0
  75. package/schemas/rcasd-spec-frontmatter.schema.json +10 -0
  76. package/schemas/rcasd-stage-transition.schema.json +38 -0
  77. package/schemas/releases.schema.json +267 -0
  78. package/schemas/skills-manifest.schema.json +91 -0
  79. package/schemas/skillsmp.schema.json +208 -0
  80. package/schemas/spec-index.schema.json +196 -0
  81. package/schemas/system-flow-atlas.schema.json +125 -0
  82. package/src/__tests__/injection-chain.test.ts +11 -10
  83. package/src/__tests__/injection-mvi-tiers.test.ts +4 -2
  84. package/src/admin/import-tasks.ts +53 -29
  85. package/src/agents/__tests__/capacity.test.d.ts +7 -0
  86. package/src/agents/__tests__/capacity.test.d.ts.map +1 -0
  87. package/src/agents/__tests__/capacity.test.js +173 -0
  88. package/src/agents/__tests__/capacity.test.js.map +1 -0
  89. package/src/agents/__tests__/registry.test.d.ts +8 -0
  90. package/src/agents/__tests__/registry.test.d.ts.map +1 -0
  91. package/src/agents/__tests__/registry.test.js +348 -0
  92. package/src/agents/__tests__/registry.test.js.map +1 -0
  93. package/src/agents/__tests__/retry.test.d.ts +7 -0
  94. package/src/agents/__tests__/retry.test.d.ts.map +1 -0
  95. package/src/agents/__tests__/retry.test.js +225 -0
  96. package/src/agents/__tests__/retry.test.js.map +1 -0
  97. package/src/bootstrap.ts +3 -1
  98. package/src/init.ts +63 -18
  99. package/src/injection.ts +11 -5
  100. package/src/intelligence/__tests__/impact.test.d.ts +15 -0
  101. package/src/intelligence/__tests__/impact.test.d.ts.map +1 -0
  102. package/src/intelligence/__tests__/impact.test.js +384 -0
  103. package/src/intelligence/__tests__/impact.test.js.map +1 -0
  104. package/src/intelligence/__tests__/patterns.test.d.ts +8 -0
  105. package/src/intelligence/__tests__/patterns.test.d.ts.map +1 -0
  106. package/src/intelligence/__tests__/patterns.test.js +370 -0
  107. package/src/intelligence/__tests__/patterns.test.js.map +1 -0
  108. package/src/intelligence/__tests__/prediction.test.d.ts +8 -0
  109. package/src/intelligence/__tests__/prediction.test.d.ts.map +1 -0
  110. package/src/intelligence/__tests__/prediction.test.js +314 -0
  111. package/src/intelligence/__tests__/prediction.test.js.map +1 -0
  112. package/src/internal.ts +7 -1
  113. package/src/nexus/__tests__/nexus-e2e.test.d.ts +12 -0
  114. package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +1 -0
  115. package/src/nexus/__tests__/nexus-e2e.test.js +1220 -0
  116. package/src/nexus/__tests__/nexus-e2e.test.js.map +1 -0
  117. package/src/nexus/__tests__/transfer.test.d.ts +8 -0
  118. package/src/nexus/__tests__/transfer.test.d.ts.map +1 -0
  119. package/src/nexus/__tests__/transfer.test.js +372 -0
  120. package/src/nexus/__tests__/transfer.test.js.map +1 -0
  121. package/src/nexus/__tests__/transfer.test.ts +446 -0
  122. package/src/nexus/index.ts +14 -0
  123. package/src/nexus/transfer-types.ts +129 -0
  124. package/src/nexus/transfer.ts +314 -0
  125. package/src/routing/capability-matrix.ts +1435 -205
  126. package/src/scaffold.ts +18 -11
  127. package/src/skills/__tests__/routing-table.test.ts +53 -33
  128. package/src/skills/agents/install.ts +9 -1
  129. package/src/skills/routing-table.ts +39 -253
  130. package/src/skills/skill-paths.ts +3 -2
  131. package/src/store/__tests__/project-detect.test.ts +1 -1
  132. package/src/store/brain-sqlite.ts +7 -3
  133. package/src/store/nexus-sqlite.ts +7 -3
  134. package/src/store/sqlite.ts +9 -3
  135. package/src/store/tasks-schema.ts +1 -1
  136. package/src/system/health.ts +18 -7
  137. package/src/ui/index.ts +0 -6
  138. package/src/validation/operation-gate-validators.ts +2 -2
  139. package/templates/CLEO-INJECTION.md +120 -0
  140. package/templates/README.md +29 -0
  141. package/templates/agent-registry.json +305 -0
  142. package/templates/cleo-gitignore +74 -0
  143. package/templates/config.template.json +187 -0
  144. package/templates/git-hooks/commit-msg +149 -0
  145. package/templates/git-hooks/pre-commit +40 -0
  146. package/templates/git-hooks/pre-push +79 -0
  147. package/templates/github/ISSUE_TEMPLATE/bug_report.yml +143 -0
  148. package/templates/github/ISSUE_TEMPLATE/config.yml +8 -0
  149. package/templates/github/ISSUE_TEMPLATE/feature_request.yml +125 -0
  150. package/templates/github/ISSUE_TEMPLATE/help_question.yml +99 -0
  151. package/templates/global-config.template.json +56 -0
  152. package/templates/hooks/precompact-safestop.sh +89 -0
  153. package/templates/issue-templates/bug_report.yml +143 -0
  154. package/templates/issue-templates/config.yml +8 -0
  155. package/templates/issue-templates/feature_request.yml +125 -0
  156. package/templates/issue-templates/help_question.yml +99 -0
  157. package/templates/skillsmp.json.example +28 -0
  158. package/templates/skillsmp.json.example.md +214 -0
  159. package/dist/ui/injection-legacy.d.ts +0 -26
  160. package/dist/ui/injection-legacy.d.ts.map +0 -1
  161. package/src/ui/__tests__/injection-registry.test.d.ts +0 -11
  162. package/src/ui/__tests__/injection-registry.test.d.ts.map +0 -1
  163. package/src/ui/__tests__/injection-registry.test.js +0 -46
  164. package/src/ui/__tests__/injection-registry.test.js.map +0 -1
  165. package/src/ui/__tests__/injection-registry.test.ts +0 -57
  166. package/src/ui/injection-legacy.ts +0 -44
@@ -0,0 +1,722 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://cleo-dev.com/schemas/v2/contribution.schema.json",
4
+ "schemaVersion": "2.0.0",
5
+ "title": "Multi-Agent Contribution",
6
+ "description": "Schema for validating agent session contributions in multi-agent research workflows. Implements CONTRIB-001 through CONTRIB-015 RFC 2119 requirements. v2.0.0 introduces JSON-first format with numeric confidence scores, structured evidence references, and enhanced conflict resolution.",
7
+ "type": "object",
8
+ "required": ["$schema", "_meta", "sessionId", "epicId", "taskId", "markerLabel", "researchOutputs", "decisions"],
9
+ "additionalProperties": false,
10
+
11
+ "properties": {
12
+ "$schema": {
13
+ "type": "string",
14
+ "description": "Self-referencing schema URI for validation"
15
+ },
16
+ "_meta": {
17
+ "type": "object",
18
+ "description": "Contribution metadata for tracking and audit",
19
+ "required": ["contributionId", "createdAt", "agentId"],
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "contributionId": {
23
+ "type": "string",
24
+ "pattern": "^contrib_[a-f0-9]{8}$",
25
+ "description": "Unique contribution identifier. Format: contrib_{8 hex chars}"
26
+ },
27
+ "protocolVersion": {
28
+ "type": "string",
29
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
30
+ "default": "2.0.0",
31
+ "description": "Contribution protocol version (semver)"
32
+ },
33
+ "createdAt": {
34
+ "type": "string",
35
+ "format": "date-time",
36
+ "description": "When contribution was created (ISO 8601)"
37
+ },
38
+ "completedAt": {
39
+ "type": ["string", "null"],
40
+ "format": "date-time",
41
+ "description": "When contribution was finalized (ISO 8601). Null if incomplete."
42
+ },
43
+ "agentId": {
44
+ "type": "string",
45
+ "pattern": "^[a-zA-Z0-9_-]{1,50}$",
46
+ "description": "Identifier for the contributing agent (e.g., 'opus-1', 'sonnet-worker-2')"
47
+ },
48
+ "checksum": {
49
+ "type": ["string", "null"],
50
+ "pattern": "^[a-f0-9]{16}$",
51
+ "description": "SHA-256 truncated hash (16 hex chars) for integrity verification"
52
+ },
53
+ "consensusReady": {
54
+ "type": "boolean",
55
+ "default": false,
56
+ "description": "Whether contribution is ready for consensus computation"
57
+ }
58
+ }
59
+ },
60
+
61
+ "sessionId": {
62
+ "type": "string",
63
+ "pattern": "^session_\\d{8}_\\d{6}_[a-f0-9]{6}$",
64
+ "description": "MUST match active CLEO session ID. Format: session_YYYYMMDD_HHMMSS_6hex. (CONTRIB-001)"
65
+ },
66
+ "sessionLabel": {
67
+ "type": "string",
68
+ "pattern": "^[Ss]ession [A-Z]$",
69
+ "description": "Human-readable session label (e.g., 'Session A', 'Session B')"
70
+ },
71
+
72
+ "epicId": {
73
+ "type": "string",
74
+ "pattern": "^T\\d{3,}$",
75
+ "description": "MUST reference existing parent epic task ID. (CONTRIB-001)"
76
+ },
77
+ "epicTitle": {
78
+ "type": "string",
79
+ "minLength": 5,
80
+ "maxLength": 200,
81
+ "description": "Parent epic title for context"
82
+ },
83
+
84
+ "taskId": {
85
+ "type": "string",
86
+ "pattern": "^T\\d{3,}$",
87
+ "description": "MUST be the contribution task ID created under epicId. (CONTRIB-001)"
88
+ },
89
+
90
+ "markerLabel": {
91
+ "type": "string",
92
+ "pattern": "^[a-z][a-z0-9-]*$",
93
+ "minLength": 3,
94
+ "maxLength": 50,
95
+ "description": "MUST be present on task for discovery across sessions. (CONTRIB-002)"
96
+ },
97
+
98
+ "researchOutputs": {
99
+ "type": "array",
100
+ "minItems": 0,
101
+ "items": {
102
+ "$ref": "#/definitions/researchOutput"
103
+ },
104
+ "description": "MUST list ALL research files created during this session. (CONTRIB-003, CONTRIB-004)"
105
+ },
106
+
107
+ "decisions": {
108
+ "type": "array",
109
+ "minItems": 1,
110
+ "items": {
111
+ "$ref": "#/definitions/decision"
112
+ },
113
+ "description": "MUST document decisions on ALL key questions defined in protocol. (CONTRIB-005, CONTRIB-007)"
114
+ },
115
+
116
+ "conflicts": {
117
+ "type": "array",
118
+ "items": {
119
+ "$ref": "#/definitions/conflict"
120
+ },
121
+ "default": [],
122
+ "description": "MUST flag explicit conflicts with baseline session. (CONTRIB-006, CONTRIB-010)"
123
+ },
124
+
125
+ "baselineReference": {
126
+ "type": "object",
127
+ "description": "Reference to baseline session for conflict comparison",
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "sessionId": {
131
+ "type": "string",
132
+ "pattern": "^session_\\d{8}_\\d{6}_[a-f0-9]{6}$",
133
+ "description": "Baseline session identifier"
134
+ },
135
+ "sessionLabel": {
136
+ "type": "string",
137
+ "pattern": "^[Ss]ession [A-Z]$",
138
+ "description": "Baseline session label (e.g., 'Session A')"
139
+ },
140
+ "taskId": {
141
+ "type": "string",
142
+ "pattern": "^T\\d{3,}$",
143
+ "description": "Baseline contribution task ID"
144
+ },
145
+ "contributionId": {
146
+ "type": "string",
147
+ "pattern": "^contrib_[a-f0-9]{8}$",
148
+ "description": "Baseline contribution ID for cross-reference"
149
+ }
150
+ }
151
+ },
152
+
153
+ "status": {
154
+ "type": "string",
155
+ "enum": ["draft", "complete", "validated", "merged"],
156
+ "default": "draft",
157
+ "description": "Contribution lifecycle status"
158
+ },
159
+
160
+ "completionNote": {
161
+ "type": ["string", "null"],
162
+ "maxLength": 2000,
163
+ "description": "Summary note when marking contribution complete"
164
+ },
165
+
166
+ "validation": {
167
+ "type": "object",
168
+ "description": "Validation results against CONTRIB-XXX requirements",
169
+ "additionalProperties": false,
170
+ "properties": {
171
+ "passed": {
172
+ "type": "boolean",
173
+ "description": "Whether all MUST requirements were satisfied"
174
+ },
175
+ "checkedAt": {
176
+ "type": "string",
177
+ "format": "date-time",
178
+ "description": "When validation was performed"
179
+ },
180
+ "results": {
181
+ "type": "array",
182
+ "items": {
183
+ "$ref": "#/definitions/validationResult"
184
+ },
185
+ "description": "Individual requirement validation results"
186
+ }
187
+ }
188
+ }
189
+ },
190
+
191
+ "definitions": {
192
+ "researchOutput": {
193
+ "type": "object",
194
+ "description": "A research file produced during this session",
195
+ "required": ["filePath", "type"],
196
+ "additionalProperties": false,
197
+ "properties": {
198
+ "filePath": {
199
+ "type": "string",
200
+ "pattern": "^[a-zA-Z0-9_./-]+\\.md$",
201
+ "description": "Relative path to research output file. SHOULD follow YYYY-MM-DD_topic-slug.md pattern. (CONTRIB-012)"
202
+ },
203
+ "researchId": {
204
+ "type": "string",
205
+ "pattern": "^research_[a-f0-9]{8}$",
206
+ "description": "Research manifest ID for cross-reference"
207
+ },
208
+ "type": {
209
+ "type": "string",
210
+ "enum": ["analysis", "research", "specification", "synthesis", "comparison", "notes"],
211
+ "description": "Output file type classification"
212
+ },
213
+ "title": {
214
+ "type": "string",
215
+ "maxLength": 200,
216
+ "description": "Document title"
217
+ },
218
+ "createdAt": {
219
+ "type": "string",
220
+ "format": "date-time",
221
+ "description": "When file was created"
222
+ },
223
+ "linkedAt": {
224
+ "type": ["string", "null"],
225
+ "format": "date-time",
226
+ "description": "When file was linked to task via notes (CONTRIB-004)"
227
+ },
228
+ "summary": {
229
+ "type": "string",
230
+ "maxLength": 500,
231
+ "description": "Brief summary of file contents"
232
+ }
233
+ }
234
+ },
235
+
236
+ "evidence": {
237
+ "type": "object",
238
+ "description": "Evidence reference supporting a decision or position",
239
+ "required": ["section"],
240
+ "additionalProperties": false,
241
+ "properties": {
242
+ "file": {
243
+ "type": "string",
244
+ "maxLength": 500,
245
+ "description": "Relative path to source file"
246
+ },
247
+ "section": {
248
+ "type": "string",
249
+ "maxLength": 200,
250
+ "description": "Section identifier or description"
251
+ },
252
+ "quote": {
253
+ "type": "string",
254
+ "maxLength": 500,
255
+ "description": "Exact quote supporting the decision"
256
+ },
257
+ "line": {
258
+ "type": "integer",
259
+ "minimum": 1,
260
+ "description": "Line number for code references"
261
+ },
262
+ "url": {
263
+ "type": "string",
264
+ "format": "uri",
265
+ "description": "URL for external sources"
266
+ },
267
+ "type": {
268
+ "type": "string",
269
+ "enum": ["code", "documentation", "research", "external"],
270
+ "description": "Evidence classification"
271
+ }
272
+ },
273
+ "anyOf": [
274
+ { "required": ["file"] },
275
+ { "required": ["url"] }
276
+ ]
277
+ },
278
+
279
+ "decision": {
280
+ "type": "object",
281
+ "description": "A decision point documented with rationale and evidence. (CONTRIB-005, CONTRIB-007)",
282
+ "required": ["questionId", "question", "answer", "confidence", "rationale", "evidence"],
283
+ "additionalProperties": false,
284
+ "properties": {
285
+ "questionId": {
286
+ "type": "string",
287
+ "pattern": "^[A-Z]+-\\d{3}$",
288
+ "description": "Unique question identifier from decision matrix (e.g., 'RCSD-001')"
289
+ },
290
+ "question": {
291
+ "type": "string",
292
+ "minLength": 10,
293
+ "maxLength": 300,
294
+ "description": "The decision question being answered"
295
+ },
296
+ "answer": {
297
+ "type": "string",
298
+ "minLength": 5,
299
+ "maxLength": 1000,
300
+ "description": "MUST NOT use vague or ambiguous language. (CONTRIB-011)"
301
+ },
302
+ "confidence": {
303
+ "type": "number",
304
+ "minimum": 0.0,
305
+ "maximum": 1.0,
306
+ "description": "Confidence score 0.0-1.0. Ranges: 0.90-1.00 (very high), 0.70-0.89 (high), 0.50-0.69 (medium), 0.30-0.49 (low), 0.00-0.29 (tentative)"
307
+ },
308
+ "rationale": {
309
+ "type": "string",
310
+ "minLength": 20,
311
+ "maxLength": 2000,
312
+ "description": "MUST include rationale for decision. (CONTRIB-007)"
313
+ },
314
+ "evidence": {
315
+ "type": "array",
316
+ "items": {
317
+ "$ref": "#/definitions/evidence"
318
+ },
319
+ "minItems": 1,
320
+ "description": "MUST include evidence supporting decision. SHOULD reference specific sections. (CONTRIB-007, CONTRIB-013)"
321
+ },
322
+ "uncertaintyNote": {
323
+ "type": ["string", "null"],
324
+ "maxLength": 500,
325
+ "description": "SHOULD explain uncertainty when confidence < 0.7. (CONTRIB-015)"
326
+ },
327
+ "alternatives": {
328
+ "type": "array",
329
+ "items": {
330
+ "$ref": "#/definitions/alternative"
331
+ },
332
+ "description": "Alternative options considered and why rejected"
333
+ }
334
+ }
335
+ },
336
+
337
+ "alternative": {
338
+ "type": "object",
339
+ "description": "An alternative option that was considered but rejected",
340
+ "required": ["option", "reason"],
341
+ "additionalProperties": false,
342
+ "properties": {
343
+ "option": {
344
+ "type": "string",
345
+ "maxLength": 300,
346
+ "description": "Alternative option considered"
347
+ },
348
+ "reason": {
349
+ "type": "string",
350
+ "maxLength": 500,
351
+ "description": "Reason for not choosing this option"
352
+ }
353
+ }
354
+ },
355
+
356
+ "sessionPosition": {
357
+ "type": "object",
358
+ "description": "A session's position on a conflicting question",
359
+ "required": ["position", "confidence"],
360
+ "additionalProperties": false,
361
+ "properties": {
362
+ "sessionId": {
363
+ "type": "string",
364
+ "pattern": "^session_\\d{8}_\\d{6}_[a-f0-9]{6}$",
365
+ "description": "Session identifier (only for otherSession)"
366
+ },
367
+ "sessionLabel": {
368
+ "type": "string",
369
+ "pattern": "^[Ss]ession [A-Z]$",
370
+ "description": "Human-readable session label"
371
+ },
372
+ "contributionId": {
373
+ "type": "string",
374
+ "pattern": "^contrib_[a-f0-9]{8}$",
375
+ "description": "Contribution ID for cross-reference"
376
+ },
377
+ "position": {
378
+ "type": "string",
379
+ "minLength": 5,
380
+ "maxLength": 1000,
381
+ "description": "Session's position on the question"
382
+ },
383
+ "confidence": {
384
+ "type": "number",
385
+ "minimum": 0.0,
386
+ "maximum": 1.0,
387
+ "description": "Confidence in this position (0.0-1.0)"
388
+ },
389
+ "evidence": {
390
+ "type": "array",
391
+ "items": {
392
+ "$ref": "#/definitions/evidence"
393
+ },
394
+ "description": "Evidence supporting this position"
395
+ }
396
+ }
397
+ },
398
+
399
+ "resolutionVote": {
400
+ "type": "object",
401
+ "description": "A vote on a proposed resolution",
402
+ "required": ["agentId", "vote"],
403
+ "additionalProperties": false,
404
+ "properties": {
405
+ "agentId": {
406
+ "type": "string",
407
+ "pattern": "^[a-zA-Z0-9_-]{1,50}$",
408
+ "description": "Voting agent identifier"
409
+ },
410
+ "vote": {
411
+ "type": "string",
412
+ "enum": ["accept", "reject", "abstain"],
413
+ "description": "Vote decision"
414
+ },
415
+ "confidence": {
416
+ "type": "number",
417
+ "minimum": 0.0,
418
+ "maximum": 1.0,
419
+ "description": "Confidence in vote (0.0-1.0)"
420
+ },
421
+ "reason": {
422
+ "type": "string",
423
+ "maxLength": 500,
424
+ "description": "Vote rationale"
425
+ }
426
+ }
427
+ },
428
+
429
+ "resolution": {
430
+ "type": "object",
431
+ "description": "Conflict resolution proposal and voting state",
432
+ "required": ["status"],
433
+ "additionalProperties": false,
434
+ "properties": {
435
+ "status": {
436
+ "type": "string",
437
+ "enum": ["pending", "proposed", "accepted", "rejected"],
438
+ "description": "Resolution status"
439
+ },
440
+ "proposedBy": {
441
+ "type": "string",
442
+ "pattern": "^[a-zA-Z0-9_-]{1,50}$",
443
+ "description": "Agent who proposed the resolution"
444
+ },
445
+ "proposedAt": {
446
+ "type": "string",
447
+ "format": "date-time",
448
+ "description": "When resolution was proposed"
449
+ },
450
+ "proposal": {
451
+ "type": "string",
452
+ "maxLength": 2000,
453
+ "description": "Detailed resolution proposal"
454
+ },
455
+ "resolutionType": {
456
+ "type": "string",
457
+ "enum": ["merge", "choose-a", "choose-b", "new", "defer", "escalate"],
458
+ "description": "Type of resolution: merge (combine), choose-a (this session), choose-b (other session), new (neither), defer (postpone), escalate (HITL)"
459
+ },
460
+ "votes": {
461
+ "type": "array",
462
+ "items": {
463
+ "$ref": "#/definitions/resolutionVote"
464
+ },
465
+ "description": "Agent votes on proposed resolution"
466
+ },
467
+ "resolvedAt": {
468
+ "type": "string",
469
+ "format": "date-time",
470
+ "description": "When resolution was accepted/rejected"
471
+ },
472
+ "finalDecision": {
473
+ "type": "string",
474
+ "maxLength": 2000,
475
+ "description": "The accepted resolution text"
476
+ }
477
+ }
478
+ },
479
+
480
+ "conflict": {
481
+ "type": "object",
482
+ "description": "A conflict with baseline session requiring resolution. (CONTRIB-006, CONTRIB-010, CONTRIB-014)",
483
+ "required": ["questionId", "conflictId", "severity", "conflictType", "thisSession", "otherSession", "rationale", "requiresConsensus"],
484
+ "additionalProperties": false,
485
+ "properties": {
486
+ "questionId": {
487
+ "type": "string",
488
+ "pattern": "^[A-Z]+-\\d{3}$",
489
+ "description": "Question ID where conflict exists"
490
+ },
491
+ "conflictId": {
492
+ "type": "string",
493
+ "pattern": "^conflict_[a-f0-9]{8}$",
494
+ "description": "Unique conflict identifier"
495
+ },
496
+ "severity": {
497
+ "type": "string",
498
+ "enum": ["low", "medium", "high", "critical"],
499
+ "description": "Impact severity: critical (mutually exclusive, MUST resolve), high (significant impact, SHOULD resolve), medium (both viable, MAY defer), low (minor preference)"
500
+ },
501
+ "conflictType": {
502
+ "type": "string",
503
+ "enum": ["contradiction", "partial-overlap", "scope-difference", "priority-difference", "evidence-conflict"],
504
+ "description": "Conflict classification: contradiction (mutually exclusive), partial-overlap (partial agreement), scope-difference (different interpretation), priority-difference (ranking disagreement), evidence-conflict (same evidence, different conclusions)"
505
+ },
506
+ "thisSession": {
507
+ "$ref": "#/definitions/sessionPosition",
508
+ "description": "This session's position on the question"
509
+ },
510
+ "otherSession": {
511
+ "allOf": [
512
+ { "$ref": "#/definitions/sessionPosition" },
513
+ { "required": ["sessionId"] }
514
+ ],
515
+ "description": "Baseline session's position (requires sessionId)"
516
+ },
517
+ "rationale": {
518
+ "type": "string",
519
+ "minLength": 20,
520
+ "maxLength": 1000,
521
+ "description": "MUST include rationale for why positions differ. (CONTRIB-010)"
522
+ },
523
+ "resolution": {
524
+ "$ref": "#/definitions/resolution",
525
+ "description": "SHOULD propose resolution when conflict identified. (CONTRIB-014)"
526
+ },
527
+ "requiresConsensus": {
528
+ "type": "boolean",
529
+ "description": "Whether this conflict requires multi-session consensus"
530
+ },
531
+ "escalatedToHITL": {
532
+ "type": "boolean",
533
+ "default": false,
534
+ "description": "Whether conflict has been escalated to human review"
535
+ }
536
+ }
537
+ },
538
+
539
+ "validationResult": {
540
+ "type": "object",
541
+ "description": "Result of validating a single CONTRIB-XXX requirement",
542
+ "required": ["requirementId", "passed"],
543
+ "additionalProperties": false,
544
+ "properties": {
545
+ "requirementId": {
546
+ "type": "string",
547
+ "pattern": "^CONTRIB-\\d{3}$",
548
+ "description": "RFC 2119 requirement identifier"
549
+ },
550
+ "level": {
551
+ "type": "string",
552
+ "enum": ["MUST", "MUST NOT", "SHOULD"],
553
+ "description": "RFC 2119 requirement level"
554
+ },
555
+ "passed": {
556
+ "type": "boolean",
557
+ "description": "Whether requirement was satisfied"
558
+ },
559
+ "message": {
560
+ "type": ["string", "null"],
561
+ "maxLength": 300,
562
+ "description": "Explanation for pass/fail"
563
+ },
564
+ "checkedFields": {
565
+ "type": "array",
566
+ "items": {
567
+ "type": "string"
568
+ },
569
+ "description": "JSON paths checked for this requirement"
570
+ }
571
+ }
572
+ }
573
+ },
574
+
575
+ "examples": [
576
+ {
577
+ "$schema": "https://cleo-dev.com/schemas/v2/contribution.schema.json",
578
+ "_meta": {
579
+ "contributionId": "contrib_a1b2c3d4",
580
+ "protocolVersion": "2.0.0",
581
+ "createdAt": "2026-01-26T14:00:00Z",
582
+ "completedAt": null,
583
+ "agentId": "opus-1",
584
+ "checksum": null,
585
+ "consensusReady": false
586
+ },
587
+ "sessionId": "session_20260126_140000_abc123",
588
+ "epicId": "T2308",
589
+ "taskId": "T2315",
590
+ "markerLabel": "protocol-v2-contrib",
591
+ "researchOutputs": [],
592
+ "decisions": [
593
+ {
594
+ "questionId": "PROTO-001",
595
+ "question": "Should contributions use JSON or YAML format?",
596
+ "answer": "JSON with strict schema validation",
597
+ "confidence": 0.95,
598
+ "rationale": "JSON has better tooling support, stricter parsing, and native jq integration in CLEO.",
599
+ "evidence": [
600
+ {
601
+ "file": "lib/validation.sh",
602
+ "section": "validate_json_schema",
603
+ "type": "code"
604
+ }
605
+ ]
606
+ }
607
+ ],
608
+ "conflicts": [],
609
+ "status": "draft"
610
+ },
611
+ {
612
+ "$schema": "https://cleo-dev.com/schemas/v2/contribution.schema.json",
613
+ "_meta": {
614
+ "contributionId": "contrib_b2c3d4e5",
615
+ "protocolVersion": "2.0.0",
616
+ "createdAt": "2026-01-26T15:00:00Z",
617
+ "completedAt": "2026-01-26T16:30:00Z",
618
+ "agentId": "sonnet-2",
619
+ "checksum": "a1b2c3d4e5f6a7b8",
620
+ "consensusReady": true
621
+ },
622
+ "sessionId": "session_20260126_150000_def456",
623
+ "sessionLabel": "Session B",
624
+ "epicId": "T2204",
625
+ "epicTitle": "RCSD Integration Research Consolidation",
626
+ "taskId": "T2216",
627
+ "markerLabel": "rcsd-consensus-contrib",
628
+ "researchOutputs": [
629
+ {
630
+ "filePath": "claudedocs/research-outputs/2026-01-26_rcsd-architecture-analysis.md",
631
+ "researchId": "research_f1e2d3c4",
632
+ "type": "analysis",
633
+ "title": "RCSD Architecture Options Analysis",
634
+ "createdAt": "2026-01-26T15:15:00Z",
635
+ "linkedAt": "2026-01-26T15:20:00Z",
636
+ "summary": "Comparative analysis of single-file vs split-file codebase map architectures"
637
+ }
638
+ ],
639
+ "decisions": [
640
+ {
641
+ "questionId": "RCSD-001",
642
+ "question": "Codebase Map Architecture: Single JSON file or split files?",
643
+ "answer": "Single .cleo/codebase/codebase-map.json with internal sections for component types",
644
+ "confidence": 0.85,
645
+ "rationale": "Single file simplifies atomic updates and validation. Split files add merge complexity without proportional benefit at typical project sizes (<10K files).",
646
+ "evidence": [
647
+ {
648
+ "file": "lib/file-ops.sh",
649
+ "section": "atomic_write function",
650
+ "line": 142,
651
+ "quote": "Atomic pattern: temp -> validate -> backup -> rename",
652
+ "type": "code"
653
+ },
654
+ {
655
+ "file": "docs/specs/FILE-LOCKING-SPEC.md",
656
+ "section": "Part 4: Atomic Operations",
657
+ "type": "documentation"
658
+ }
659
+ ],
660
+ "alternatives": [
661
+ {
662
+ "option": "Split into codebase-map-{type}.json per component type",
663
+ "reason": "Adds merge complexity and potential race conditions without proportional benefit"
664
+ }
665
+ ]
666
+ }
667
+ ],
668
+ "conflicts": [
669
+ {
670
+ "questionId": "RCSD-001",
671
+ "conflictId": "conflict_c3d4e5f6",
672
+ "severity": "high",
673
+ "conflictType": "contradiction",
674
+ "thisSession": {
675
+ "position": "Single JSON file architecture",
676
+ "confidence": 0.85,
677
+ "evidence": [
678
+ {
679
+ "file": "lib/file-ops.sh",
680
+ "section": "atomic_write function",
681
+ "type": "code"
682
+ }
683
+ ]
684
+ },
685
+ "otherSession": {
686
+ "sessionId": "session_20260126_120000_abc123",
687
+ "sessionLabel": "Session A",
688
+ "contributionId": "contrib_a1b2c3d4",
689
+ "position": "Split files per component type (scripts.json, libs.json, tests.json)",
690
+ "confidence": 0.75,
691
+ "evidence": [
692
+ {
693
+ "file": "claudedocs/research-outputs/2026-01-26_session-a-analysis.md",
694
+ "section": "Architecture Recommendations",
695
+ "type": "research"
696
+ }
697
+ ]
698
+ },
699
+ "rationale": "Session A prioritized parallel editing capability; this session prioritizes atomic consistency. Both are valid concerns with different tradeoffs.",
700
+ "resolution": {
701
+ "status": "proposed",
702
+ "proposedBy": "sonnet-2",
703
+ "proposedAt": "2026-01-26T16:00:00Z",
704
+ "proposal": "Use single file with internal locking; add split-file mode as future config option for large repos",
705
+ "resolutionType": "merge",
706
+ "votes": []
707
+ },
708
+ "requiresConsensus": true,
709
+ "escalatedToHITL": false
710
+ }
711
+ ],
712
+ "baselineReference": {
713
+ "sessionId": "session_20260126_120000_abc123",
714
+ "sessionLabel": "Session A",
715
+ "taskId": "T2215",
716
+ "contributionId": "contrib_a1b2c3d4"
717
+ },
718
+ "status": "complete",
719
+ "completionNote": "Full analysis complete. One high-severity conflict on architecture requiring consensus."
720
+ }
721
+ ]
722
+ }