@cleocode/core 2026.3.45 → 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.
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/index.js +1475 -372
- package/dist/index.js.map +4 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/injection.d.ts +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/routing/capability-matrix.d.ts +6 -4
- package/dist/routing/capability-matrix.d.ts.map +1 -1
- package/dist/scaffold.d.ts +16 -9
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/skills/agents/install.d.ts.map +1 -1
- package/dist/skills/routing-table.d.ts +17 -16
- package/dist/skills/routing-table.d.ts.map +1 -1
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +9 -4
- package/schemas/adr-frontmatter.schema.json +72 -0
- package/schemas/agent-configs.schema.json +120 -0
- package/schemas/agent-registry.json +243 -0
- package/schemas/agent-registry.schema.json +132 -0
- package/schemas/archive/research-manifest.schema.json +257 -0
- package/schemas/archive.schema.json +450 -0
- package/schemas/brain-decision.schema.json +69 -0
- package/schemas/brain-learning.schema.json +57 -0
- package/schemas/brain-pattern.schema.json +72 -0
- package/schemas/config.schema.json +2606 -0
- package/schemas/context-state.schema.json +137 -0
- package/schemas/contribution.schema.json +722 -0
- package/schemas/critical-path.schema.json +246 -0
- package/schemas/deps-cache.schema.json +97 -0
- package/schemas/doctor-output.schema.json +283 -0
- package/schemas/error.schema.json +161 -0
- package/schemas/export-package.schema.json +375 -0
- package/schemas/global-config.schema.json +219 -0
- package/schemas/grade.schema.json +49 -0
- package/schemas/log.schema.json +250 -0
- package/schemas/metrics.schema.json +328 -0
- package/schemas/migrations.schema.json +150 -0
- package/schemas/nexus-registry.schema.json +90 -0
- package/schemas/operation-constitution.schema.json +438 -0
- package/schemas/output.schema.json +164 -0
- package/schemas/project-context.schema.json +164 -0
- package/schemas/project-info.schema.json +180 -0
- package/schemas/projects-registry.schema.json +107 -0
- package/schemas/protocol-frontmatter.schema.json +72 -0
- package/schemas/rcasd-consensus-report.schema.json +10 -0
- package/schemas/rcasd-evidence.schema.json +42 -0
- package/schemas/rcasd-gate-result.schema.json +46 -0
- package/schemas/rcasd-hitl-resolution.schema.json +10 -0
- package/schemas/rcasd-index.schema.json +10 -0
- package/schemas/rcasd-manifest.schema.json +10 -0
- package/schemas/rcasd-research-output.schema.json +10 -0
- package/schemas/rcasd-spec-frontmatter.schema.json +10 -0
- package/schemas/rcasd-stage-transition.schema.json +38 -0
- package/schemas/releases.schema.json +267 -0
- package/schemas/skills-manifest.schema.json +91 -0
- package/schemas/skillsmp.schema.json +208 -0
- package/schemas/spec-index.schema.json +196 -0
- package/schemas/system-flow-atlas.schema.json +125 -0
- package/src/__tests__/injection-chain.test.ts +11 -10
- package/src/__tests__/injection-mvi-tiers.test.ts +4 -2
- package/src/agents/__tests__/capacity.test.d.ts +7 -0
- package/src/agents/__tests__/capacity.test.d.ts.map +1 -0
- package/src/agents/__tests__/capacity.test.js +173 -0
- package/src/agents/__tests__/capacity.test.js.map +1 -0
- package/src/agents/__tests__/registry.test.d.ts +8 -0
- package/src/agents/__tests__/registry.test.d.ts.map +1 -0
- package/src/agents/__tests__/registry.test.js +348 -0
- package/src/agents/__tests__/registry.test.js.map +1 -0
- package/src/agents/__tests__/retry.test.d.ts +7 -0
- package/src/agents/__tests__/retry.test.d.ts.map +1 -0
- package/src/agents/__tests__/retry.test.js +225 -0
- package/src/agents/__tests__/retry.test.js.map +1 -0
- package/src/bootstrap.ts +3 -1
- package/src/init.ts +63 -18
- package/src/injection.ts +11 -5
- package/src/intelligence/__tests__/impact.test.d.ts +15 -0
- package/src/intelligence/__tests__/impact.test.d.ts.map +1 -0
- package/src/intelligence/__tests__/impact.test.js +384 -0
- package/src/intelligence/__tests__/impact.test.js.map +1 -0
- package/src/intelligence/__tests__/patterns.test.d.ts +8 -0
- package/src/intelligence/__tests__/patterns.test.d.ts.map +1 -0
- package/src/intelligence/__tests__/patterns.test.js +370 -0
- package/src/intelligence/__tests__/patterns.test.js.map +1 -0
- package/src/intelligence/__tests__/prediction.test.d.ts +8 -0
- package/src/intelligence/__tests__/prediction.test.d.ts.map +1 -0
- package/src/intelligence/__tests__/prediction.test.js +314 -0
- package/src/intelligence/__tests__/prediction.test.js.map +1 -0
- package/src/nexus/__tests__/nexus-e2e.test.d.ts +12 -0
- package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +1 -0
- package/src/nexus/__tests__/nexus-e2e.test.js +1220 -0
- package/src/nexus/__tests__/nexus-e2e.test.js.map +1 -0
- package/src/nexus/__tests__/transfer.test.d.ts +8 -0
- package/src/nexus/__tests__/transfer.test.d.ts.map +1 -0
- package/src/nexus/__tests__/transfer.test.js +372 -0
- package/src/nexus/__tests__/transfer.test.js.map +1 -0
- package/src/nexus/__tests__/transfer.test.ts +1 -1
- package/src/routing/capability-matrix.ts +1435 -205
- package/src/scaffold.ts +18 -11
- package/src/skills/__tests__/routing-table.test.ts +53 -33
- package/src/skills/agents/install.ts +9 -1
- package/src/skills/routing-table.ts +39 -253
- package/src/skills/skill-paths.ts +3 -2
- package/src/store/__tests__/project-detect.test.ts +1 -1
- package/src/system/health.ts +18 -7
- package/src/ui/index.ts +0 -6
- package/src/validation/operation-gate-validators.ts +2 -2
- package/templates/CLEO-INJECTION.md +120 -0
- package/templates/README.md +29 -0
- package/templates/agent-registry.json +305 -0
- package/templates/cleo-gitignore +74 -0
- package/templates/config.template.json +187 -0
- package/templates/git-hooks/commit-msg +149 -0
- package/templates/git-hooks/pre-commit +40 -0
- package/templates/git-hooks/pre-push +79 -0
- package/templates/github/ISSUE_TEMPLATE/bug_report.yml +143 -0
- package/templates/github/ISSUE_TEMPLATE/config.yml +8 -0
- package/templates/github/ISSUE_TEMPLATE/feature_request.yml +125 -0
- package/templates/github/ISSUE_TEMPLATE/help_question.yml +99 -0
- package/templates/global-config.template.json +56 -0
- package/templates/hooks/precompact-safestop.sh +89 -0
- package/templates/issue-templates/bug_report.yml +143 -0
- package/templates/issue-templates/config.yml +8 -0
- package/templates/issue-templates/feature_request.yml +125 -0
- package/templates/issue-templates/help_question.yml +99 -0
- package/templates/skillsmp.json.example +28 -0
- package/templates/skillsmp.json.example.md +214 -0
- package/dist/ui/injection-legacy.d.ts +0 -26
- package/dist/ui/injection-legacy.d.ts.map +0 -1
- package/src/ui/__tests__/injection-registry.test.d.ts +0 -11
- package/src/ui/__tests__/injection-registry.test.d.ts.map +0 -1
- package/src/ui/__tests__/injection-registry.test.js +0 -46
- package/src/ui/__tests__/injection-registry.test.js.map +0 -1
- package/src/ui/__tests__/injection-registry.test.ts +0 -57
- package/src/ui/injection-legacy.ts +0 -44
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cleo-dev.com/schemas/v1/metrics.schema.json",
|
|
4
|
+
"schemaVersion": "1.0.0",
|
|
5
|
+
"title": "CLEO Metrics Schema",
|
|
6
|
+
"description": "Self-auditing metrics system for compliance, efficiency, session, and self-improvement tracking. ALL fields use STRICT ENUMS - NO freetext allowed.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
|
|
10
|
+
"definitions": {
|
|
11
|
+
"severityEnum": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["low", "medium", "high", "critical"],
|
|
14
|
+
"description": "Violation severity level"
|
|
15
|
+
},
|
|
16
|
+
"manifestIntegrityEnum": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": ["valid", "partial", "invalid", "missing"],
|
|
19
|
+
"description": "Manifest file integrity state"
|
|
20
|
+
},
|
|
21
|
+
"instructionStabilityEnum": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": ["stable", "clarified", "revised", "unstable"],
|
|
24
|
+
"description": "User instruction consistency within session"
|
|
25
|
+
},
|
|
26
|
+
"sessionDegradationEnum": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": ["none", "mild", "moderate", "severe"],
|
|
29
|
+
"description": "Performance degradation over session lifetime"
|
|
30
|
+
},
|
|
31
|
+
"agentReliabilityEnum": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"enum": ["high", "medium", "low", "unreliable"],
|
|
34
|
+
"description": "Agent task completion reliability rating"
|
|
35
|
+
},
|
|
36
|
+
"metricCategoryEnum": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["compliance", "efficiency", "session", "improvement"],
|
|
39
|
+
"description": "Metric category classification"
|
|
40
|
+
},
|
|
41
|
+
"metricSourceEnum": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["task", "session", "agent", "system", "orchestrator"],
|
|
44
|
+
"description": "Entity that generated this metric"
|
|
45
|
+
},
|
|
46
|
+
"aggregationPeriodEnum": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": ["instant", "hourly", "daily", "weekly", "monthly"],
|
|
49
|
+
"description": "Time aggregation period for metric"
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
"complianceMetric": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "Compliance-related metrics for rule adherence tracking",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"compliance_pass_rate": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"minimum": 0,
|
|
60
|
+
"maximum": 1,
|
|
61
|
+
"description": "Percent tasks with zero violations (0.0-1.0)"
|
|
62
|
+
},
|
|
63
|
+
"rule_adherence_score": {
|
|
64
|
+
"type": "number",
|
|
65
|
+
"minimum": 0,
|
|
66
|
+
"maximum": 1,
|
|
67
|
+
"description": "Required rules satisfied / total rules (0.0-1.0)"
|
|
68
|
+
},
|
|
69
|
+
"violation_count": {
|
|
70
|
+
"type": "integer",
|
|
71
|
+
"minimum": 0,
|
|
72
|
+
"description": "Total violations per task/agent/session"
|
|
73
|
+
},
|
|
74
|
+
"violation_severity": {
|
|
75
|
+
"$ref": "#/definitions/severityEnum"
|
|
76
|
+
},
|
|
77
|
+
"critical_breach_rate": {
|
|
78
|
+
"type": "number",
|
|
79
|
+
"minimum": 0,
|
|
80
|
+
"maximum": 1,
|
|
81
|
+
"description": "Percent tasks with >=1 critical violation (0.0-1.0)"
|
|
82
|
+
},
|
|
83
|
+
"policy_drift_indicator": {
|
|
84
|
+
"type": "number",
|
|
85
|
+
"minimum": -1,
|
|
86
|
+
"maximum": 1,
|
|
87
|
+
"description": "Violation increase over time (-1.0 to 1.0, positive = worsening)"
|
|
88
|
+
},
|
|
89
|
+
"compliance_latency_ms": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"minimum": 0,
|
|
92
|
+
"description": "Time to verdict after task completion (milliseconds)"
|
|
93
|
+
},
|
|
94
|
+
"manifest_integrity": {
|
|
95
|
+
"$ref": "#/definitions/manifestIntegrityEnum"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
"efficiencyMetric": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"description": "Efficiency-related metrics for resource utilization tracking",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"properties": {
|
|
105
|
+
"token_utilization_rate": {
|
|
106
|
+
"type": "number",
|
|
107
|
+
"minimum": 0,
|
|
108
|
+
"maximum": 2,
|
|
109
|
+
"description": "Tokens used / tokens allocated (0.0-2.0, >1 means over budget)"
|
|
110
|
+
},
|
|
111
|
+
"context_retention_efficiency": {
|
|
112
|
+
"type": "number",
|
|
113
|
+
"minimum": 0,
|
|
114
|
+
"maximum": 1,
|
|
115
|
+
"description": "Relevant tokens / total tokens (0.0-1.0)"
|
|
116
|
+
},
|
|
117
|
+
"token_waste_ratio": {
|
|
118
|
+
"type": "number",
|
|
119
|
+
"minimum": 0,
|
|
120
|
+
"maximum": 1,
|
|
121
|
+
"description": "Tokens in failed/discarded tasks / total tokens (0.0-1.0)"
|
|
122
|
+
},
|
|
123
|
+
"cost_per_successful_task": {
|
|
124
|
+
"type": "number",
|
|
125
|
+
"minimum": 0,
|
|
126
|
+
"description": "Cost / compliant tasks (USD cents)"
|
|
127
|
+
},
|
|
128
|
+
"task_completion_time_ms": {
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"minimum": 0,
|
|
131
|
+
"description": "Start to return time (milliseconds)"
|
|
132
|
+
},
|
|
133
|
+
"agent_turn_count": {
|
|
134
|
+
"type": "integer",
|
|
135
|
+
"minimum": 1,
|
|
136
|
+
"description": "Back-and-forth interactions required"
|
|
137
|
+
},
|
|
138
|
+
"retry_rate": {
|
|
139
|
+
"type": "number",
|
|
140
|
+
"minimum": 0,
|
|
141
|
+
"maximum": 1,
|
|
142
|
+
"description": "Re-executions due to failure / total executions (0.0-1.0)"
|
|
143
|
+
},
|
|
144
|
+
"sub_agent_yield": {
|
|
145
|
+
"type": "number",
|
|
146
|
+
"minimum": 0,
|
|
147
|
+
"maximum": 1,
|
|
148
|
+
"description": "Useful outputs / agents invoked (0.0-1.0)"
|
|
149
|
+
},
|
|
150
|
+
"orchestration_overhead": {
|
|
151
|
+
"type": "number",
|
|
152
|
+
"minimum": 0,
|
|
153
|
+
"description": "Orchestrator tokens / subagent tokens ratio"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
"sessionMetric": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"description": "Session-related metrics for work session tracking",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"properties": {
|
|
163
|
+
"session_efficiency_score": {
|
|
164
|
+
"type": "number",
|
|
165
|
+
"minimum": 0,
|
|
166
|
+
"maximum": 1,
|
|
167
|
+
"description": "Composite session score (0.0-1.0)"
|
|
168
|
+
},
|
|
169
|
+
"human_intervention_rate": {
|
|
170
|
+
"type": "number",
|
|
171
|
+
"minimum": 0,
|
|
172
|
+
"maximum": 1,
|
|
173
|
+
"description": "Percent tasks needing correction (0.0-1.0)"
|
|
174
|
+
},
|
|
175
|
+
"instruction_stability": {
|
|
176
|
+
"$ref": "#/definitions/instructionStabilityEnum"
|
|
177
|
+
},
|
|
178
|
+
"session_degradation": {
|
|
179
|
+
"$ref": "#/definitions/sessionDegradationEnum"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
"improvementMetric": {
|
|
185
|
+
"type": "object",
|
|
186
|
+
"description": "Self-improvement metrics for agent learning tracking",
|
|
187
|
+
"additionalProperties": false,
|
|
188
|
+
"properties": {
|
|
189
|
+
"improvement_delta": {
|
|
190
|
+
"type": "number",
|
|
191
|
+
"minimum": -1,
|
|
192
|
+
"maximum": 1,
|
|
193
|
+
"description": "Change vs last N sessions (-1.0 to 1.0)"
|
|
194
|
+
},
|
|
195
|
+
"rule_friction_score": {
|
|
196
|
+
"type": "number",
|
|
197
|
+
"minimum": 0,
|
|
198
|
+
"description": "Violations per rule (lower = better)"
|
|
199
|
+
},
|
|
200
|
+
"agent_reliability": {
|
|
201
|
+
"$ref": "#/definitions/agentReliabilityEnum"
|
|
202
|
+
},
|
|
203
|
+
"prompt_effectiveness": {
|
|
204
|
+
"type": "number",
|
|
205
|
+
"minimum": 0,
|
|
206
|
+
"maximum": 1,
|
|
207
|
+
"description": "Pass rate per prompt version (0.0-1.0)"
|
|
208
|
+
},
|
|
209
|
+
"regression_signal": {
|
|
210
|
+
"type": "boolean",
|
|
211
|
+
"description": "True if sudden metric drop detected"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
"metricEntry": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"description": "Single metrics JSONL line format",
|
|
219
|
+
"required": ["timestamp", "category", "source", "source_id"],
|
|
220
|
+
"additionalProperties": false,
|
|
221
|
+
"properties": {
|
|
222
|
+
"timestamp": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"format": "date-time",
|
|
225
|
+
"description": "ISO 8601 timestamp when metric was recorded"
|
|
226
|
+
},
|
|
227
|
+
"category": {
|
|
228
|
+
"$ref": "#/definitions/metricCategoryEnum"
|
|
229
|
+
},
|
|
230
|
+
"source": {
|
|
231
|
+
"$ref": "#/definitions/metricSourceEnum"
|
|
232
|
+
},
|
|
233
|
+
"source_id": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"pattern": "^[A-Za-z0-9_-]+$",
|
|
236
|
+
"minLength": 1,
|
|
237
|
+
"maxLength": 64,
|
|
238
|
+
"description": "ID of source entity (task ID, session ID, agent name)"
|
|
239
|
+
},
|
|
240
|
+
"period": {
|
|
241
|
+
"$ref": "#/definitions/aggregationPeriodEnum"
|
|
242
|
+
},
|
|
243
|
+
"compliance": {
|
|
244
|
+
"$ref": "#/definitions/complianceMetric"
|
|
245
|
+
},
|
|
246
|
+
"efficiency": {
|
|
247
|
+
"$ref": "#/definitions/efficiencyMetric"
|
|
248
|
+
},
|
|
249
|
+
"session": {
|
|
250
|
+
"$ref": "#/definitions/sessionMetric"
|
|
251
|
+
},
|
|
252
|
+
"improvement": {
|
|
253
|
+
"$ref": "#/definitions/improvementMetric"
|
|
254
|
+
},
|
|
255
|
+
"project": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"minLength": 1,
|
|
258
|
+
"maxLength": 128,
|
|
259
|
+
"description": "Project name (for global metrics file)"
|
|
260
|
+
},
|
|
261
|
+
"tags": {
|
|
262
|
+
"type": "array",
|
|
263
|
+
"items": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
266
|
+
"minLength": 1,
|
|
267
|
+
"maxLength": 32
|
|
268
|
+
},
|
|
269
|
+
"maxItems": 10,
|
|
270
|
+
"uniqueItems": true,
|
|
271
|
+
"description": "Classification tags for filtering"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
"metricsFile": {
|
|
277
|
+
"type": "object",
|
|
278
|
+
"description": "Full metrics JSON file format (alternative to JSONL)",
|
|
279
|
+
"required": ["version", "_meta", "entries"],
|
|
280
|
+
"additionalProperties": false,
|
|
281
|
+
"properties": {
|
|
282
|
+
"version": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
285
|
+
"description": "Schema version"
|
|
286
|
+
},
|
|
287
|
+
"_meta": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"required": ["schemaVersion", "lastModified", "entryCount"],
|
|
290
|
+
"additionalProperties": false,
|
|
291
|
+
"properties": {
|
|
292
|
+
"schemaVersion": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
295
|
+
},
|
|
296
|
+
"lastModified": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"format": "date-time"
|
|
299
|
+
},
|
|
300
|
+
"entryCount": {
|
|
301
|
+
"type": "integer",
|
|
302
|
+
"minimum": 0
|
|
303
|
+
},
|
|
304
|
+
"oldestEntry": {
|
|
305
|
+
"type": "string",
|
|
306
|
+
"format": "date-time"
|
|
307
|
+
},
|
|
308
|
+
"newestEntry": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"format": "date-time"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"entries": {
|
|
315
|
+
"type": "array",
|
|
316
|
+
"items": {
|
|
317
|
+
"$ref": "#/definitions/metricEntry"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
"oneOf": [
|
|
325
|
+
{ "$ref": "#/definitions/metricEntry" },
|
|
326
|
+
{ "$ref": "#/definitions/metricsFile" }
|
|
327
|
+
]
|
|
328
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cleo-dev.com/schemas/v1/migrations.schema.json",
|
|
4
|
+
"schemaVersion": "1.0.0",
|
|
5
|
+
"title": "CLEO Migration Journal Schema",
|
|
6
|
+
"description": "Audit trail of schema migration operations. Tracks applied migrations with checksums and execution metadata for data integrity verification.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"_meta",
|
|
10
|
+
"appliedMigrations"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"_meta": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": [
|
|
17
|
+
"schemaVersion"
|
|
18
|
+
],
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"properties": {
|
|
21
|
+
"schemaVersion": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
24
|
+
"description": "Schema version for this migrations journal (semver)."
|
|
25
|
+
},
|
|
26
|
+
"lastChecked": {
|
|
27
|
+
"type": [
|
|
28
|
+
"string",
|
|
29
|
+
"null"
|
|
30
|
+
],
|
|
31
|
+
"format": "date-time",
|
|
32
|
+
"description": "Last time migration status was checked."
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"appliedMigrations": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"description": "Chronologically ordered list of applied migrations. Append-only for audit trail.",
|
|
39
|
+
"items": {
|
|
40
|
+
"$ref": "#/definitions/migrationEntry"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"definitions": {
|
|
45
|
+
"migrationEntry": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": [
|
|
48
|
+
"version",
|
|
49
|
+
"fileType",
|
|
50
|
+
"checksum",
|
|
51
|
+
"appliedAt",
|
|
52
|
+
"status"
|
|
53
|
+
],
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"properties": {
|
|
56
|
+
"version": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
59
|
+
"description": "Target schema version of this migration (semver)."
|
|
60
|
+
},
|
|
61
|
+
"fileType": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"enum": [
|
|
64
|
+
"todo",
|
|
65
|
+
"config",
|
|
66
|
+
"archive",
|
|
67
|
+
"log",
|
|
68
|
+
"sessions",
|
|
69
|
+
"migrations"
|
|
70
|
+
],
|
|
71
|
+
"description": "Type of file that was migrated."
|
|
72
|
+
},
|
|
73
|
+
"functionName": {
|
|
74
|
+
"type": [
|
|
75
|
+
"string",
|
|
76
|
+
"null"
|
|
77
|
+
],
|
|
78
|
+
"description": "Migration function name that was executed (e.g., 'migrate_todo_to_2_3_0'). Null for version-bump-only migrations."
|
|
79
|
+
},
|
|
80
|
+
"checksum": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[a-f0-9]{64}$",
|
|
83
|
+
"description": "SHA256 checksum of the migration function source code (for verification)."
|
|
84
|
+
},
|
|
85
|
+
"appliedAt": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"format": "date-time",
|
|
88
|
+
"description": "When this migration was executed (UTC)."
|
|
89
|
+
},
|
|
90
|
+
"status": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": [
|
|
93
|
+
"success",
|
|
94
|
+
"failed",
|
|
95
|
+
"skipped"
|
|
96
|
+
],
|
|
97
|
+
"description": "Outcome of the migration operation."
|
|
98
|
+
},
|
|
99
|
+
"executionTimeMs": {
|
|
100
|
+
"type": [
|
|
101
|
+
"integer",
|
|
102
|
+
"null"
|
|
103
|
+
],
|
|
104
|
+
"minimum": 0,
|
|
105
|
+
"description": "Time taken to execute migration in milliseconds."
|
|
106
|
+
},
|
|
107
|
+
"previousVersion": {
|
|
108
|
+
"type": [
|
|
109
|
+
"string",
|
|
110
|
+
"null"
|
|
111
|
+
],
|
|
112
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
113
|
+
"description": "Schema version before this migration was applied."
|
|
114
|
+
},
|
|
115
|
+
"logs": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"description": "Log messages generated during migration execution.",
|
|
118
|
+
"items": {
|
|
119
|
+
"type": "string"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"backupPath": {
|
|
123
|
+
"type": [
|
|
124
|
+
"string",
|
|
125
|
+
"null"
|
|
126
|
+
],
|
|
127
|
+
"description": "Path to backup created before migration (for rollback)."
|
|
128
|
+
},
|
|
129
|
+
"error": {
|
|
130
|
+
"type": [
|
|
131
|
+
"object",
|
|
132
|
+
"null"
|
|
133
|
+
],
|
|
134
|
+
"description": "Error details if migration failed.",
|
|
135
|
+
"properties": {
|
|
136
|
+
"code": {
|
|
137
|
+
"type": "string"
|
|
138
|
+
},
|
|
139
|
+
"message": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"recoverable": {
|
|
143
|
+
"type": "boolean"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cleo-dev.com/schemas/v1/nexus-registry.schema.json",
|
|
4
|
+
"title": "CLEO Nexus Registry Schema (DEPRECATED)",
|
|
5
|
+
"description": "DEPRECATED: This schema is no longer used. nexus.db (SQLite) is the live backend as of 2026.3. Legacy JSON (projects-registry.json) is auto-migrated on first nexus init. Retained for historical reference only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["version", "lastUpdated", "projects"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "JSON Schema reference for validation."
|
|
13
|
+
},
|
|
14
|
+
"version": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
17
|
+
"description": "Schema version (semver). MUST match semantic versioning."
|
|
18
|
+
},
|
|
19
|
+
"lastUpdated": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"format": "date-time",
|
|
22
|
+
"description": "ISO 8601 timestamp of last registry modification."
|
|
23
|
+
},
|
|
24
|
+
"projects": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"description": "Map of project_hash → project metadata. Keyed by 12-character hexadecimal hash.",
|
|
27
|
+
"patternProperties": {
|
|
28
|
+
"^[a-f0-9]{12}$": {
|
|
29
|
+
"$ref": "#/definitions/project"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"additionalProperties": false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"definitions": {
|
|
36
|
+
"project": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "A registered CLEO project with metadata and access timestamps.",
|
|
39
|
+
"required": ["hash", "path", "name", "lastAccess"],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"properties": {
|
|
42
|
+
"hash": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^[a-f0-9]{12}$",
|
|
45
|
+
"description": "12-character hexadecimal identifier. MUST match object key. Generated via generate_project_hash() (stable SHA256 of path)."
|
|
46
|
+
},
|
|
47
|
+
"path": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 1,
|
|
50
|
+
"description": "Absolute filesystem path to project root. MUST contain .cleo/todo.json to be valid."
|
|
51
|
+
},
|
|
52
|
+
"name": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"maxLength": 64,
|
|
57
|
+
"description": "Human-readable project identifier. MUST be unique across all registered projects. Lowercase with hyphens allowed."
|
|
58
|
+
},
|
|
59
|
+
"aliases": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$",
|
|
64
|
+
"minLength": 1,
|
|
65
|
+
"maxLength": 32
|
|
66
|
+
},
|
|
67
|
+
"uniqueItems": true,
|
|
68
|
+
"default": [],
|
|
69
|
+
"description": "Alternative names for project resolution. MUST NOT conflict with any project names."
|
|
70
|
+
},
|
|
71
|
+
"lastAccess": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"format": "date-time",
|
|
74
|
+
"description": "ISO 8601 timestamp of last read operation. Used for pruning inactive projects."
|
|
75
|
+
},
|
|
76
|
+
"taskCount": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"minimum": 0,
|
|
79
|
+
"default": 0,
|
|
80
|
+
"description": "Number of tasks in project. Cached for quick reference."
|
|
81
|
+
},
|
|
82
|
+
"checksum": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"pattern": "^[a-f0-9]{16}$",
|
|
85
|
+
"description": "SHA-256 truncated hash of project's todo.json tasks array. Used for cache invalidation."
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|