@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.
- package/dist/admin/import-tasks.d.ts +10 -2
- package/dist/admin/import-tasks.d.ts.map +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/index.js +1890 -504
- 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/internal.d.ts +3 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/nexus/index.d.ts +2 -0
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/transfer-types.d.ts +123 -0
- package/dist/nexus/transfer-types.d.ts.map +1 -0
- package/dist/nexus/transfer.d.ts +31 -0
- package/dist/nexus/transfer.d.ts.map +1 -0
- 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/store/brain-sqlite.d.ts +4 -1
- package/dist/store/brain-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.d.ts +4 -1
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.d.ts +4 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/tasks-schema.d.ts +3 -3
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/validation-schemas.d.ts +5 -4
- package/dist/store/validation-schemas.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/admin/import-tasks.ts +53 -29
- 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/internal.ts +7 -1
- 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 +446 -0
- package/src/nexus/index.ts +14 -0
- package/src/nexus/transfer-types.ts +129 -0
- package/src/nexus/transfer.ts +314 -0
- 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/store/brain-sqlite.ts +7 -3
- package/src/store/nexus-sqlite.ts +7 -3
- package/src/store/sqlite.ts +9 -3
- package/src/store/tasks-schema.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,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"schemaVersion": "1.0.0",
|
|
4
|
+
"$id": "https://cleo-dev.com/schemas/v1/spec-index.schema.json",
|
|
5
|
+
"title": "Claude-TODO Specification Index",
|
|
6
|
+
"description": "Schema for the authoritative specification index. LLM-agent-first design: structured, queryable, schema-validated.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["$schema", "_meta", "authorities", "specs"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "https://cleo-dev.com/schemas/v1/spec-index.schema.json"
|
|
13
|
+
},
|
|
14
|
+
"_meta": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"description": "Index metadata for version tracking and integrity",
|
|
17
|
+
"required": ["version", "lastUpdated", "totalSpecs", "totalReports"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"version": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
22
|
+
"description": "Semantic version of the index format"
|
|
23
|
+
},
|
|
24
|
+
"lastUpdated": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"format": "date",
|
|
27
|
+
"description": "ISO date of last index update"
|
|
28
|
+
},
|
|
29
|
+
"totalSpecs": {
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 0,
|
|
32
|
+
"description": "Count of specification documents"
|
|
33
|
+
},
|
|
34
|
+
"totalReports": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"minimum": 0,
|
|
37
|
+
"description": "Count of implementation reports"
|
|
38
|
+
},
|
|
39
|
+
"checksum": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Optional SHA256 for integrity verification"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"authorities": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Domain to authoritative specification mapping. Query: 'What is the authoritative source for X?'",
|
|
48
|
+
"additionalProperties": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Filename of authoritative spec for this domain"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"specs": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"description": "All specification documents with metadata",
|
|
56
|
+
"items": {
|
|
57
|
+
"$ref": "#/definitions/specEntry"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"reports": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"description": "All implementation reports with progress tracking",
|
|
63
|
+
"items": {
|
|
64
|
+
"$ref": "#/definitions/reportEntry"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"recentChanges": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"description": "Last 20 changes for change tracking",
|
|
70
|
+
"maxItems": 20,
|
|
71
|
+
"items": {
|
|
72
|
+
"$ref": "#/definitions/changeEntry"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"definitions": {
|
|
77
|
+
"specEntry": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"required": ["file", "version", "status", "type", "domain", "synopsis", "lastUpdated"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"file": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^[A-Z0-9-]+\\.(md|json)$",
|
|
84
|
+
"description": "Filename (not path)"
|
|
85
|
+
},
|
|
86
|
+
"version": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Semantic version or version string"
|
|
89
|
+
},
|
|
90
|
+
"status": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": ["DRAFT", "APPROVED", "ACTIVE", "IMMUTABLE", "DEPRECATED", "PLANNING", "IMPLEMENTED"],
|
|
93
|
+
"description": "Document lifecycle status"
|
|
94
|
+
},
|
|
95
|
+
"type": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"enum": ["SPEC", "GUIDELINES", "PLAN"],
|
|
98
|
+
"description": "Document type classification"
|
|
99
|
+
},
|
|
100
|
+
"domain": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Primary domain this spec covers"
|
|
103
|
+
},
|
|
104
|
+
"category": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"enum": ["core-system", "feature", "design-philosophy", "integration", "process"],
|
|
107
|
+
"description": "Organizational category"
|
|
108
|
+
},
|
|
109
|
+
"synopsis": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"maxLength": 200,
|
|
112
|
+
"description": "1-2 sentence purpose summary"
|
|
113
|
+
},
|
|
114
|
+
"lastUpdated": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"format": "date",
|
|
117
|
+
"description": "ISO date of last document update"
|
|
118
|
+
},
|
|
119
|
+
"dependsOn": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {"type": "string"},
|
|
122
|
+
"description": "Specs this document depends on (filenames)"
|
|
123
|
+
},
|
|
124
|
+
"dependedOnBy": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {"type": "string"},
|
|
127
|
+
"description": "Specs that depend on this document (filenames)"
|
|
128
|
+
},
|
|
129
|
+
"implementationReport": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "Filename of associated implementation report"
|
|
132
|
+
},
|
|
133
|
+
"isAuthoritativeFor": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": {"type": "string"},
|
|
136
|
+
"description": "Domains this spec is authoritative for"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"reportEntry": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"required": ["file", "relatedSpec", "progress", "lastUpdated"],
|
|
143
|
+
"properties": {
|
|
144
|
+
"file": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"pattern": "^[A-Z0-9-]+-IMPLEMENTATION-REPORT\\.md$"
|
|
147
|
+
},
|
|
148
|
+
"relatedSpec": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"description": "Filename of the spec this tracks"
|
|
151
|
+
},
|
|
152
|
+
"progress": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Progress indicator (e.g., '85%', '16/18', 'Varies')"
|
|
155
|
+
},
|
|
156
|
+
"phase": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Current implementation phase"
|
|
159
|
+
},
|
|
160
|
+
"lastUpdated": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"format": "date"
|
|
163
|
+
},
|
|
164
|
+
"notes": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"maxLength": 100,
|
|
167
|
+
"description": "Brief status note"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"changeEntry": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"required": ["date", "file", "changeType", "description"],
|
|
174
|
+
"properties": {
|
|
175
|
+
"date": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"format": "date"
|
|
178
|
+
},
|
|
179
|
+
"file": {
|
|
180
|
+
"type": "string"
|
|
181
|
+
},
|
|
182
|
+
"changeType": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"enum": ["Created", "Updated", "StatusChange", "Deprecated"]
|
|
185
|
+
},
|
|
186
|
+
"version": {
|
|
187
|
+
"type": "string"
|
|
188
|
+
},
|
|
189
|
+
"description": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"maxLength": 100
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "CLEO System Flow Atlas Structure",
|
|
4
|
+
"description": "Validates that a System Flow Atlas document contains all required sections",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"title": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"const": "CLEO System Flow Atlas",
|
|
10
|
+
"description": "Document title"
|
|
11
|
+
},
|
|
12
|
+
"version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$",
|
|
15
|
+
"description": "CalVer version (YYYY.M.D)"
|
|
16
|
+
},
|
|
17
|
+
"status": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": ["DRAFT", "REVIEW", "APPROVED", "STABLE", "SUPERSEDED", "ARCHIVED"],
|
|
20
|
+
"description": "Document lifecycle status"
|
|
21
|
+
},
|
|
22
|
+
"sections": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Required sections in the atlas document",
|
|
25
|
+
"properties": {
|
|
26
|
+
"purpose": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"description": "Section 1: Purpose exists"
|
|
29
|
+
},
|
|
30
|
+
"systemDomainMapping": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "Section 2: Four systems mapped to 10 domains"
|
|
33
|
+
},
|
|
34
|
+
"requestFlow": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"description": "Section 3: End-to-end request flow diagram"
|
|
37
|
+
},
|
|
38
|
+
"domainInteractionGraph": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "Section 4: Domain interaction graph"
|
|
41
|
+
},
|
|
42
|
+
"dataStores": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "Section 5: Data stores and ownership boundaries"
|
|
45
|
+
},
|
|
46
|
+
"distillationFlow": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"description": "Section 6: LOOM distillation flow"
|
|
49
|
+
},
|
|
50
|
+
"flowExamples": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Section 7: Query/mutate flow examples"
|
|
53
|
+
},
|
|
54
|
+
"progressiveDisclosure": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Section 8: Progressive disclosure in practice"
|
|
57
|
+
},
|
|
58
|
+
"failureRecovery": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Section 9: Failure and recovery paths"
|
|
61
|
+
},
|
|
62
|
+
"observability": {
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"description": "Section 10: Observability and audit trails"
|
|
65
|
+
},
|
|
66
|
+
"invariants": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Section 11: Canonical invariants"
|
|
69
|
+
},
|
|
70
|
+
"glossary": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Section 12: Glossary"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"required": [
|
|
76
|
+
"purpose",
|
|
77
|
+
"systemDomainMapping",
|
|
78
|
+
"requestFlow",
|
|
79
|
+
"domainInteractionGraph",
|
|
80
|
+
"dataStores",
|
|
81
|
+
"distillationFlow",
|
|
82
|
+
"flowExamples",
|
|
83
|
+
"progressiveDisclosure",
|
|
84
|
+
"failureRecovery",
|
|
85
|
+
"observability",
|
|
86
|
+
"invariants",
|
|
87
|
+
"glossary"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"domains": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"tasks",
|
|
96
|
+
"session",
|
|
97
|
+
"memory",
|
|
98
|
+
"check",
|
|
99
|
+
"pipeline",
|
|
100
|
+
"orchestrate",
|
|
101
|
+
"tools",
|
|
102
|
+
"admin",
|
|
103
|
+
"nexus",
|
|
104
|
+
"sticky"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"minItems": 10,
|
|
108
|
+
"maxItems": 10,
|
|
109
|
+
"uniqueItems": true,
|
|
110
|
+
"description": "All 10 canonical domains MUST be referenced"
|
|
111
|
+
},
|
|
112
|
+
"systems": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"enum": ["BRAIN", "LOOM", "NEXUS", "LAFS"]
|
|
117
|
+
},
|
|
118
|
+
"minItems": 4,
|
|
119
|
+
"maxItems": 4,
|
|
120
|
+
"uniqueItems": true,
|
|
121
|
+
"description": "All 4 conceptual systems MUST be documented"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": ["title", "version", "status", "sections", "domains", "systems"]
|
|
125
|
+
}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Verifies the new AGENTS.md hub injection architecture:
|
|
5
5
|
* 1. Provider files (CLAUDE.md, GEMINI.md) reference @AGENTS.md
|
|
6
|
-
* 2. AGENTS.md references @~/.
|
|
7
|
-
* 3.
|
|
8
|
-
* 4. No
|
|
6
|
+
* 2. Project AGENTS.md references @~/.agents/AGENTS.md (global hub)
|
|
7
|
+
* 3. Global ~/.agents/AGENTS.md references @~/.cleo/templates/CLEO-INJECTION.md
|
|
8
|
+
* 4. No references to @.cleo/templates/AGENT-INJECTION.md anywhere
|
|
9
|
+
* 5. No CLEO:START markers anywhere (CAAMP uses CAAMP:START/END)
|
|
9
10
|
*
|
|
10
11
|
* Since CAAMP functions depend on actual provider installations,
|
|
11
12
|
* they are mocked via vi.mock to isolate the init logic.
|
|
@@ -159,13 +160,13 @@ describe('E2E: injection chain validation (T4694)', () => {
|
|
|
159
160
|
expect(geminiContent).toContain('@AGENTS.md');
|
|
160
161
|
});
|
|
161
162
|
|
|
162
|
-
it('AGENTS.md references @~/.
|
|
163
|
+
it('AGENTS.md references @~/.agents/AGENTS.md (global hub)', async () => {
|
|
163
164
|
await initProject({ name: 'chain-test' });
|
|
164
165
|
|
|
165
166
|
const agentsPath = join(testDir, 'AGENTS.md');
|
|
166
167
|
expect(existsSync(agentsPath)).toBe(true);
|
|
167
168
|
const agentsContent = await readFile(agentsPath, 'utf-8');
|
|
168
|
-
expect(agentsContent).toContain('@~/.
|
|
169
|
+
expect(agentsContent).toContain('@~/.agents/AGENTS.md');
|
|
169
170
|
});
|
|
170
171
|
|
|
171
172
|
it('no references to @.cleo/templates/AGENT-INJECTION.md in generated files', async () => {
|
|
@@ -216,7 +217,7 @@ describe('E2E: injection chain validation (T4694)', () => {
|
|
|
216
217
|
expect(createdStr).toContain('AGENTS.md');
|
|
217
218
|
});
|
|
218
219
|
|
|
219
|
-
it('injection chain: provider -> AGENTS.md -> CLEO-INJECTION.md', async () => {
|
|
220
|
+
it('injection chain: provider -> AGENTS.md -> ~/.agents/AGENTS.md -> CLEO-INJECTION.md', async () => {
|
|
220
221
|
await initProject({ name: 'chain-test' });
|
|
221
222
|
|
|
222
223
|
// Verify the full chain:
|
|
@@ -224,9 +225,9 @@ describe('E2E: injection chain validation (T4694)', () => {
|
|
|
224
225
|
const claudeContent = await readFile(join(testDir, 'CLAUDE.md'), 'utf-8');
|
|
225
226
|
expect(claudeContent).toContain('@AGENTS.md');
|
|
226
227
|
|
|
227
|
-
// AGENTS.md -> @~/.
|
|
228
|
+
// AGENTS.md -> @~/.agents/AGENTS.md (project hub references global hub)
|
|
228
229
|
const agentsContent = await readFile(join(testDir, 'AGENTS.md'), 'utf-8');
|
|
229
|
-
expect(agentsContent).toContain('@~/.
|
|
230
|
+
expect(agentsContent).toContain('@~/.agents/AGENTS.md');
|
|
230
231
|
|
|
231
232
|
// Neither should reference the old AGENT-INJECTION.md pattern
|
|
232
233
|
expect(claudeContent).not.toContain('AGENT-INJECTION.md');
|
|
@@ -241,11 +242,11 @@ describe('E2E: injection chain validation (T4694)', () => {
|
|
|
241
242
|
|
|
242
243
|
await initProject({ name: 'no-provider-test' });
|
|
243
244
|
|
|
244
|
-
// AGENTS.md should still exist and reference
|
|
245
|
+
// AGENTS.md should still exist and reference the global hub
|
|
245
246
|
const agentsPath = join(testDir, 'AGENTS.md');
|
|
246
247
|
expect(existsSync(agentsPath)).toBe(true);
|
|
247
248
|
const agentsContent = await readFile(agentsPath, 'utf-8');
|
|
248
|
-
expect(agentsContent).toContain('@~/.
|
|
249
|
+
expect(agentsContent).toContain('@~/.agents/AGENTS.md');
|
|
249
250
|
});
|
|
250
251
|
|
|
251
252
|
it('updateDocs refreshes injection without full reinit', async () => {
|
|
@@ -17,8 +17,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
17
17
|
import { describe, expect, it } from 'vitest';
|
|
18
18
|
|
|
19
19
|
const thisFile = fileURLToPath(import.meta.url);
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
// Template moved to packages/core/templates/ (was at monorepo root templates/)
|
|
21
|
+
// thisFile is at packages/core/src/__tests__/, go up two levels to reach packages/core/
|
|
22
|
+
const corePackageRoot = resolve(dirname(thisFile), '..', '..');
|
|
23
|
+
const injectionPath = join(corePackageRoot, 'templates', 'CLEO-INJECTION.md');
|
|
22
24
|
|
|
23
25
|
const templateExists = existsSync(injectionPath);
|
|
24
26
|
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extracted from CLI import-tasks command for dispatch layer access.
|
|
5
5
|
*
|
|
6
|
-
* @task T5323, T5328
|
|
6
|
+
* @task T5323, T5328, T046
|
|
7
7
|
* @epic T4545
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { constants as fsConstants } from 'node:fs';
|
|
11
11
|
import { access, readFile } from 'node:fs/promises';
|
|
12
12
|
import type { Task, TaskStatus } from '@cleocode/contracts';
|
|
13
|
+
import type { ImportFromPackageOptions, ImportFromPackageResult } from '../nexus/transfer-types.js';
|
|
13
14
|
import { getAccessor } from '../store/data-accessor.js';
|
|
14
15
|
import type { ExportPackage } from '../store/export.js';
|
|
15
16
|
import {
|
|
@@ -74,25 +75,13 @@ export interface ImportTasksResult {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|
|
77
|
-
* Import tasks from
|
|
78
|
+
* Import tasks from an in-memory ExportPackage with ID remapping.
|
|
79
|
+
* Core logic extracted from importTasksPackage for reuse by transfer engine.
|
|
78
80
|
*/
|
|
79
|
-
export async function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
await access(file, fsConstants.R_OK);
|
|
84
|
-
} catch {
|
|
85
|
-
throw new Error(`Export file not found: ${file}`);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const content = await readFile(file, 'utf-8');
|
|
89
|
-
let exportPkg: ExportPackage;
|
|
90
|
-
try {
|
|
91
|
-
exportPkg = JSON.parse(content) as ExportPackage;
|
|
92
|
-
} catch {
|
|
93
|
-
throw new Error(`Invalid JSON in: ${file}`);
|
|
94
|
-
}
|
|
95
|
-
|
|
81
|
+
export async function importFromPackage(
|
|
82
|
+
exportPkg: ExportPackage,
|
|
83
|
+
options: ImportFromPackageOptions = {},
|
|
84
|
+
): Promise<ImportFromPackageResult> {
|
|
96
85
|
if (exportPkg._meta?.format !== 'cleo-export') {
|
|
97
86
|
throw new Error(
|
|
98
87
|
`Invalid export format (expected 'cleo-export', got '${exportPkg._meta?.format}')`,
|
|
@@ -103,17 +92,17 @@ export async function importTasksPackage(params: ImportTasksParams): Promise<Imp
|
|
|
103
92
|
throw new Error('Export package contains no tasks');
|
|
104
93
|
}
|
|
105
94
|
|
|
106
|
-
const accessor = await getAccessor(
|
|
95
|
+
const accessor = await getAccessor(options.cwd);
|
|
107
96
|
const { tasks: existingTasks } = await accessor.queryTasks({});
|
|
108
97
|
|
|
109
|
-
const onConflict: OnConflict =
|
|
110
|
-
const onMissingDep: OnMissingDep =
|
|
111
|
-
const force =
|
|
112
|
-
const parentId =
|
|
113
|
-
const phaseOverride =
|
|
114
|
-
const addLabel =
|
|
115
|
-
const resetStatus =
|
|
116
|
-
const addProvenance =
|
|
98
|
+
const onConflict: OnConflict = options.onConflict ?? 'fail';
|
|
99
|
+
const onMissingDep: OnMissingDep = options.onMissingDep === 'fail' ? 'fail' : 'strip';
|
|
100
|
+
const force = options.force ?? false;
|
|
101
|
+
const parentId = options.parent;
|
|
102
|
+
const phaseOverride = options.phase;
|
|
103
|
+
const addLabel = options.addLabel;
|
|
104
|
+
const resetStatus = options.resetStatus;
|
|
105
|
+
const addProvenance = options.provenance !== false;
|
|
117
106
|
|
|
118
107
|
if (parentId) {
|
|
119
108
|
const parentExists = existingTasks.some((t) => t.id === parentId);
|
|
@@ -195,7 +184,7 @@ export async function importTasksPackage(params: ImportTasksParams): Promise<Imp
|
|
|
195
184
|
existingIds.add(remapped.id);
|
|
196
185
|
}
|
|
197
186
|
|
|
198
|
-
if (
|
|
187
|
+
if (options.dryRun) {
|
|
199
188
|
return {
|
|
200
189
|
imported: transformed.length,
|
|
201
190
|
skipped: skipped.length,
|
|
@@ -217,3 +206,38 @@ export async function importTasksPackage(params: ImportTasksParams): Promise<Imp
|
|
|
217
206
|
idRemap: idRemapJson,
|
|
218
207
|
};
|
|
219
208
|
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Import tasks from a cross-project export package file with ID remapping.
|
|
212
|
+
* Thin wrapper around importFromPackage that handles file I/O.
|
|
213
|
+
*/
|
|
214
|
+
export async function importTasksPackage(params: ImportTasksParams): Promise<ImportTasksResult> {
|
|
215
|
+
const { file } = params;
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
await access(file, fsConstants.R_OK);
|
|
219
|
+
} catch {
|
|
220
|
+
throw new Error(`Export file not found: ${file}`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const content = await readFile(file, 'utf-8');
|
|
224
|
+
let exportPkg: ExportPackage;
|
|
225
|
+
try {
|
|
226
|
+
exportPkg = JSON.parse(content) as ExportPackage;
|
|
227
|
+
} catch {
|
|
228
|
+
throw new Error(`Invalid JSON in: ${file}`);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return importFromPackage(exportPkg, {
|
|
232
|
+
cwd: params.cwd,
|
|
233
|
+
dryRun: params.dryRun,
|
|
234
|
+
parent: params.parent,
|
|
235
|
+
phase: params.phase,
|
|
236
|
+
addLabel: params.addLabel,
|
|
237
|
+
provenance: params.provenance,
|
|
238
|
+
resetStatus: params.resetStatus,
|
|
239
|
+
onConflict: params.onConflict,
|
|
240
|
+
onMissingDep: params.onMissingDep === 'placeholder' ? 'strip' : params.onMissingDep,
|
|
241
|
+
force: params.force,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacity.test.d.ts","sourceRoot":"","sources":["capacity.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|