@ryuenn3123/agentic-senior-core 3.0.37 → 3.0.39
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/.agent-context/prompts/bootstrap-design.md +109 -146
- package/.agent-context/rules/frontend-architecture.md +92 -108
- package/.agent-context/state/README.md +26 -0
- package/.agent-context/state/architecture-map.md +32 -17
- package/.agent-context/state/dependency-map.md +31 -22
- package/.cursor/mcp.json +10 -0
- package/.cursor/rules/agentic-senior-core.mdc +48 -0
- package/.cursorrules +22 -88
- package/.gemini/instructions.md +25 -16
- package/.github/copilot-instructions.md +25 -16
- package/.github/instructions/agentic-senior-core.instructions.md +47 -0
- package/.instructions.md +98 -207
- package/.windsurf/rules/agentic-senior-core.md +43 -0
- package/.windsurfrules +22 -88
- package/AGENTS.md +23 -26
- package/CLAUDE.md +43 -0
- package/CONTRIBUTING.md +7 -2
- package/GEMINI.md +43 -0
- package/README.md +25 -7
- package/lib/cli/backup.mjs +4 -4
- package/lib/cli/commands/init/project-context.mjs +101 -0
- package/lib/cli/commands/init/runtime-environment.mjs +59 -0
- package/lib/cli/commands/init/setup-decisions.mjs +83 -0
- package/lib/cli/commands/init.mjs +33 -250
- package/lib/cli/commands/optimize.mjs +1 -1
- package/lib/cli/commands/upgrade.mjs +34 -16
- package/lib/cli/compiler.mjs +59 -17
- package/lib/cli/constants.mjs +5 -0
- package/lib/cli/detector.mjs +4 -0
- package/lib/cli/init-detection-flow.mjs +9 -1
- package/lib/cli/init-selection.mjs +0 -5
- package/lib/cli/preflight.mjs +3 -3
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +789 -0
- package/lib/cli/project-scaffolder/design-contract.mjs +119 -924
- package/lib/cli/project-scaffolder/prompt-builders.mjs +69 -84
- package/lib/cli/project-scaffolder.mjs +0 -2
- package/lib/cli/utils/filesystem.mjs +79 -0
- package/lib/cli/utils/managed-surface.mjs +237 -0
- package/lib/cli/utils/prompting.mjs +44 -0
- package/lib/cli/utils.mjs +33 -335
- package/package.json +21 -2
- package/scripts/bump-version.mjs +15 -13
- package/scripts/clean-local-artifacts.mjs +76 -0
- package/scripts/docs-quality-drift-report.mjs +5 -0
- package/scripts/frontend-usability-audit.mjs +23 -19
- package/scripts/governance-weekly-report.mjs +37 -15
- package/scripts/single-source-lazy-loading-audit.mjs +24 -0
- package/scripts/sync-thin-adapters.mjs +99 -129
- package/scripts/v3-purge-audit.mjs +5 -0
- package/scripts/validate/config.mjs +10 -0
- package/scripts/validate/coverage-checks.mjs +55 -0
- package/scripts/validate.mjs +20 -0
- package/.agent-context/marketplace/trust-tiers.json +0 -114
- package/.agent-context/state/benchmark-analysis.json +0 -431
- package/.agent-context/state/benchmark-evidence-bundle.json +0 -1040
- package/.agent-context/state/benchmark-history.json +0 -75
- package/.agent-context/state/benchmark-trend-report.csv +0 -5
- package/.agent-context/state/benchmark-trend-report.json +0 -140
- package/.agent-context/state/benchmark-writer-judge-matrix.json +0 -462
- package/.agent-context/state/memory-continuity-benchmark.json +0 -132
- package/.agent-context/state/onboarding-report.json +0 -102
- package/.agent-context/state/quality-trend-report.json +0 -89
- package/.agent-context/state/token-optimization-benchmark.json +0 -130
- package/.agent-context/state/weekly-governance-report.json +0 -329
- package/lib/cli/compatibility.mjs +0 -124
- package/scripts/validate-evidence-bundle.mjs +0 -76
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"generatedAt": "2026-04-25T09:59:20.980Z",
|
|
3
|
-
"reportName": "weekly-governance-report",
|
|
4
|
-
"methodology": {
|
|
5
|
-
"qualityTrendSource": "state-file",
|
|
6
|
-
"qualityTrendGeneratedAt": "2026-04-11T12:21:35.779Z",
|
|
7
|
-
"commitWindowDays": 7,
|
|
8
|
-
"requiredVerifiedDomains": [
|
|
9
|
-
"canonical-instructions",
|
|
10
|
-
"frontend-design-contract",
|
|
11
|
-
"frontend-architecture",
|
|
12
|
-
"backend-architecture",
|
|
13
|
-
"backend-security",
|
|
14
|
-
"backend-data-access",
|
|
15
|
-
"backend-error-handling",
|
|
16
|
-
"backend-api-contract",
|
|
17
|
-
"backend-testing",
|
|
18
|
-
"backend-performance",
|
|
19
|
-
"backend-idempotency",
|
|
20
|
-
"backend-risk-map",
|
|
21
|
-
"pr-checklist",
|
|
22
|
-
"architecture-review",
|
|
23
|
-
"mcp-server",
|
|
24
|
-
"state-continuity"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"qualitySignals": {
|
|
28
|
-
"governanceHealth": {
|
|
29
|
-
"availableGateCount": 3,
|
|
30
|
-
"passedGateCount": 3,
|
|
31
|
-
"gatePassRatePercent": 100
|
|
32
|
-
},
|
|
33
|
-
"rejectionCategories": [],
|
|
34
|
-
"tokenEfficiency": {
|
|
35
|
-
"isAvailable": true,
|
|
36
|
-
"generatedAt": "2026-04-11T06:14:10.052Z",
|
|
37
|
-
"averageNativeSavingsPercent": 83.64,
|
|
38
|
-
"averageRtkSavingsPercent": 18.95,
|
|
39
|
-
"scenarioCount": 3
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"skillTrust": {
|
|
43
|
-
"domains": [
|
|
44
|
-
{
|
|
45
|
-
"domain": "architecture-review",
|
|
46
|
-
"tier": "verified",
|
|
47
|
-
"score": 100,
|
|
48
|
-
"sourcePath": ".agent-context/review-checklists/architecture-review.md"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"domain": "backend-api-contract",
|
|
52
|
-
"tier": "verified",
|
|
53
|
-
"score": 100,
|
|
54
|
-
"sourcePath": ".agent-context/rules/api-docs.md"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"domain": "backend-architecture",
|
|
58
|
-
"tier": "verified",
|
|
59
|
-
"score": 100,
|
|
60
|
-
"sourcePath": ".agent-context/rules/architecture.md"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"domain": "backend-data-access",
|
|
64
|
-
"tier": "verified",
|
|
65
|
-
"score": 100,
|
|
66
|
-
"sourcePath": ".agent-context/rules/database-design.md"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"domain": "backend-error-handling",
|
|
70
|
-
"tier": "verified",
|
|
71
|
-
"score": 100,
|
|
72
|
-
"sourcePath": ".agent-context/rules/error-handling.md"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"domain": "backend-idempotency",
|
|
76
|
-
"tier": "verified",
|
|
77
|
-
"score": 100,
|
|
78
|
-
"sourcePath": ".agent-context/rules/event-driven.md"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"domain": "backend-performance",
|
|
82
|
-
"tier": "verified",
|
|
83
|
-
"score": 100,
|
|
84
|
-
"sourcePath": ".agent-context/rules/performance.md"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"domain": "backend-risk-map",
|
|
88
|
-
"tier": "verified",
|
|
89
|
-
"score": 100,
|
|
90
|
-
"sourcePath": ".agent-context/state/architecture-map.md"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"domain": "backend-security",
|
|
94
|
-
"tier": "verified",
|
|
95
|
-
"score": 100,
|
|
96
|
-
"sourcePath": ".agent-context/rules/security.md"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"domain": "backend-testing",
|
|
100
|
-
"tier": "verified",
|
|
101
|
-
"score": 100,
|
|
102
|
-
"sourcePath": ".agent-context/rules/testing.md"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"domain": "canonical-instructions",
|
|
106
|
-
"tier": "verified",
|
|
107
|
-
"score": 100,
|
|
108
|
-
"sourcePath": ".instructions.md"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"domain": "frontend-architecture",
|
|
112
|
-
"tier": "verified",
|
|
113
|
-
"score": 100,
|
|
114
|
-
"sourcePath": ".agent-context/rules/frontend-architecture.md"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"domain": "frontend-design-contract",
|
|
118
|
-
"tier": "verified",
|
|
119
|
-
"score": 100,
|
|
120
|
-
"sourcePath": ".agent-context/prompts/bootstrap-design.md"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"domain": "mcp-server",
|
|
124
|
-
"tier": "verified",
|
|
125
|
-
"score": 100,
|
|
126
|
-
"sourcePath": "scripts/mcp-server.mjs"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"domain": "pr-checklist",
|
|
130
|
-
"tier": "verified",
|
|
131
|
-
"score": 100,
|
|
132
|
-
"sourcePath": ".agent-context/review-checklists/pr-checklist.md"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"domain": "state-continuity",
|
|
136
|
-
"tier": "verified",
|
|
137
|
-
"score": 100,
|
|
138
|
-
"sourcePath": ".agent-context/state"
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
"tierCounts": {
|
|
142
|
-
"verified": 16,
|
|
143
|
-
"community": 0,
|
|
144
|
-
"experimental": 0
|
|
145
|
-
},
|
|
146
|
-
"requiredVerifiedDomains": [
|
|
147
|
-
"canonical-instructions",
|
|
148
|
-
"frontend-design-contract",
|
|
149
|
-
"frontend-architecture",
|
|
150
|
-
"backend-architecture",
|
|
151
|
-
"backend-security",
|
|
152
|
-
"backend-data-access",
|
|
153
|
-
"backend-error-handling",
|
|
154
|
-
"backend-api-contract",
|
|
155
|
-
"backend-testing",
|
|
156
|
-
"backend-performance",
|
|
157
|
-
"backend-idempotency",
|
|
158
|
-
"backend-risk-map",
|
|
159
|
-
"pr-checklist",
|
|
160
|
-
"architecture-review",
|
|
161
|
-
"mcp-server",
|
|
162
|
-
"state-continuity"
|
|
163
|
-
],
|
|
164
|
-
"requiredVerifiedDomainFailures": [],
|
|
165
|
-
"allRequiredVerified": true
|
|
166
|
-
},
|
|
167
|
-
"backendGovernance": {
|
|
168
|
-
"status": "verified",
|
|
169
|
-
"summary": "Backend governance is verified across architecture, security, data access, error handling, API contracts, testing, performance, idempotency, and risk-map surfaces.",
|
|
170
|
-
"requiredSurfaceCount": 9,
|
|
171
|
-
"verifiedSurfaceCount": 9,
|
|
172
|
-
"missingSurfaceNames": [],
|
|
173
|
-
"coverage": [
|
|
174
|
-
{
|
|
175
|
-
"constraint": "Layered architecture and separation of concerns",
|
|
176
|
-
"status": "covered",
|
|
177
|
-
"sourcePaths": [
|
|
178
|
-
".agent-context/rules/architecture.md",
|
|
179
|
-
".agent-context/review-checklists/architecture-review.md"
|
|
180
|
-
],
|
|
181
|
-
"signal": "Transport, application, domain, and infrastructure boundaries are explicit."
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"constraint": "Global backend/API rule routing",
|
|
185
|
-
"status": "strengthened",
|
|
186
|
-
"sourcePaths": [
|
|
187
|
-
".instructions.md",
|
|
188
|
-
".agent-context/rules/architecture.md",
|
|
189
|
-
".agent-context/prompts/refactor.md"
|
|
190
|
-
],
|
|
191
|
-
"signal": "Backend/API governance routes by problem domain and stays stack-agnostic; no stack-specific governance adapters are created."
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"constraint": "Zero-trust input validation",
|
|
195
|
-
"status": "strengthened",
|
|
196
|
-
"sourcePaths": [
|
|
197
|
-
".agent-context/rules/security.md",
|
|
198
|
-
".agent-context/review-checklists/pr-checklist.md"
|
|
199
|
-
],
|
|
200
|
-
"signal": "User-controlled body, query, params, headers, cookies, files, webhooks, and job payloads must be validated before service logic."
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"constraint": "Data access performance and integrity",
|
|
204
|
-
"status": "strengthened",
|
|
205
|
-
"sourcePaths": [
|
|
206
|
-
".agent-context/rules/database-design.md",
|
|
207
|
-
".agent-context/rules/performance.md",
|
|
208
|
-
".agent-context/state/architecture-map.md"
|
|
209
|
-
],
|
|
210
|
-
"signal": "Backend reads must avoid N+1 and unbounded list responses; multi-write mutations need transaction or recovery evidence."
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"constraint": "Distributed consistency and outbox safety",
|
|
214
|
-
"status": "strengthened",
|
|
215
|
-
"sourcePaths": [
|
|
216
|
-
".agent-context/rules/event-driven.md",
|
|
217
|
-
".agent-context/rules/database-design.md",
|
|
218
|
-
".agent-context/rules/microservices.md"
|
|
219
|
-
],
|
|
220
|
-
"signal": "Dual-write flows need outbox or equivalent replay safety, and cross-service consistency must define saga, compensation, or recovery behavior instead of defaulting to two-phase commit."
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"constraint": "Safe centralized API errors",
|
|
224
|
-
"status": "strengthened",
|
|
225
|
-
"sourcePaths": [
|
|
226
|
-
".agent-context/rules/error-handling.md",
|
|
227
|
-
".agent-context/rules/api-docs.md"
|
|
228
|
-
],
|
|
229
|
-
"signal": "HTTP/API responses use safe machine-readable error shapes, may align with RFC 9457 Problem Details, and preserve safe trace/correlation identifiers without leaking internals."
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"constraint": "Sensitive mutation idempotency",
|
|
233
|
-
"status": "strengthened",
|
|
234
|
-
"sourcePaths": [
|
|
235
|
-
".agent-context/rules/api-docs.md",
|
|
236
|
-
".agent-context/rules/testing.md",
|
|
237
|
-
".agent-context/rules/event-driven.md"
|
|
238
|
-
],
|
|
239
|
-
"signal": "Payments, orders, status changes, and other risky mutations must document and test duplicate-submit behavior."
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"constraint": "API contract and behavior testing",
|
|
243
|
-
"status": "strengthened",
|
|
244
|
-
"sourcePaths": [
|
|
245
|
-
".agent-context/rules/testing.md",
|
|
246
|
-
".agent-context/review-checklists/pr-checklist.md"
|
|
247
|
-
],
|
|
248
|
-
"signal": "API tests cover validation, auth, documented error shapes, pagination defaults, empty states, and mutation retry safety."
|
|
249
|
-
}
|
|
250
|
-
],
|
|
251
|
-
"developmentFocus": [
|
|
252
|
-
{
|
|
253
|
-
"focus": "Keep backend guidance global and stack-agnostic.",
|
|
254
|
-
"reason": "The repo should enforce architecture, security, API, data, error, event, and testing thinking without building Nest, Laravel, FastAPI, Express, Go, or other stack-specific governance adapters."
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"focus": "Use framework facts only when implementing inside an existing project.",
|
|
258
|
-
"reason": "LLMs can apply current ecosystem knowledge directly; governance should route the relevant global constraints instead of acting as a stack detector."
|
|
259
|
-
}
|
|
260
|
-
]
|
|
261
|
-
},
|
|
262
|
-
"commitSignals": {
|
|
263
|
-
"windowDays": 7,
|
|
264
|
-
"commitCount": 30,
|
|
265
|
-
"releaseCommitCount": 18,
|
|
266
|
-
"rollbackCommitCount": 1,
|
|
267
|
-
"releaseFrequencyPercent": 60,
|
|
268
|
-
"rollbackFrequencyPercent": 3.33,
|
|
269
|
-
"error": null
|
|
270
|
-
},
|
|
271
|
-
"releaseReadiness": {
|
|
272
|
-
"isReady": true,
|
|
273
|
-
"blockers": [],
|
|
274
|
-
"summary": "Weekly governance posture is ready for maintenance releases with frontend and backend governance surfaces verified."
|
|
275
|
-
},
|
|
276
|
-
"artifact": {
|
|
277
|
-
"path": "E:\\Project\\Agentic-Senior-Core\\.agent-context\\state\\weekly-governance-report.json",
|
|
278
|
-
"writeMode": "stdout-and-file"
|
|
279
|
-
},
|
|
280
|
-
"history": [
|
|
281
|
-
{
|
|
282
|
-
"generatedAt": "2026-04-11T12:14:52.483Z",
|
|
283
|
-
"readinessStatus": "blocked",
|
|
284
|
-
"blockerCount": 1,
|
|
285
|
-
"gatePassRatePercent": 100,
|
|
286
|
-
"verifiedSkillDomainCount": 1,
|
|
287
|
-
"releaseFrequencyPercent": 38.89,
|
|
288
|
-
"rollbackFrequencyPercent": 5.56
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"generatedAt": "2026-04-11T12:19:25.182Z",
|
|
292
|
-
"readinessStatus": "ready",
|
|
293
|
-
"blockerCount": 0,
|
|
294
|
-
"gatePassRatePercent": 100,
|
|
295
|
-
"verifiedSkillDomainCount": 5,
|
|
296
|
-
"releaseFrequencyPercent": 38.89,
|
|
297
|
-
"rollbackFrequencyPercent": 5.56
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"generatedAt": "2026-04-11T12:21:37.776Z",
|
|
301
|
-
"readinessStatus": "ready",
|
|
302
|
-
"blockerCount": 0,
|
|
303
|
-
"gatePassRatePercent": 100,
|
|
304
|
-
"verifiedSkillDomainCount": 5,
|
|
305
|
-
"releaseFrequencyPercent": 38.89,
|
|
306
|
-
"rollbackFrequencyPercent": 5.56
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"generatedAt": "2026-04-25T06:41:17.654Z",
|
|
310
|
-
"readinessStatus": "ready",
|
|
311
|
-
"blockerCount": 0,
|
|
312
|
-
"gatePassRatePercent": 100,
|
|
313
|
-
"verifiedSkillDomainCount": 16,
|
|
314
|
-
"backendVerifiedSurfaceCount": 9,
|
|
315
|
-
"releaseFrequencyPercent": 60,
|
|
316
|
-
"rollbackFrequencyPercent": 3.33
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"generatedAt": "2026-04-25T09:59:20.980Z",
|
|
320
|
-
"readinessStatus": "ready",
|
|
321
|
-
"blockerCount": 0,
|
|
322
|
-
"gatePassRatePercent": 100,
|
|
323
|
-
"verifiedSkillDomainCount": 16,
|
|
324
|
-
"backendVerifiedSurfaceCount": 9,
|
|
325
|
-
"releaseFrequencyPercent": 60,
|
|
326
|
-
"rollbackFrequencyPercent": 3.33
|
|
327
|
-
}
|
|
328
|
-
]
|
|
329
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { platform, version } from 'node:process';
|
|
4
|
-
|
|
5
|
-
import { pathExists } from './utils.mjs';
|
|
6
|
-
|
|
7
|
-
export const SKILL_COMPATIBILITY_MANIFEST_FILE_NAME = 'compatibility-manifest.json';
|
|
8
|
-
|
|
9
|
-
export function getCurrentPlatformLabel() {
|
|
10
|
-
if (platform === 'win32') {
|
|
11
|
-
return 'windows';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (platform === 'darwin') {
|
|
15
|
-
return 'macos';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return 'linux';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function parseNodeMajorVersion(rawVersionString = version) {
|
|
22
|
-
const normalizedVersionString = String(rawVersionString || '').trim();
|
|
23
|
-
const numericVersion = normalizedVersionString.startsWith('v')
|
|
24
|
-
? normalizedVersionString.slice(1)
|
|
25
|
-
: normalizedVersionString;
|
|
26
|
-
|
|
27
|
-
const majorSegment = numericVersion.split('.')[0];
|
|
28
|
-
const parsedMajorVersion = Number.parseInt(majorSegment, 10);
|
|
29
|
-
return Number.isNaN(parsedMajorVersion) ? null : parsedMajorVersion;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function parseNodeMinimumMajor(rawNodeMinimum) {
|
|
33
|
-
const normalizedNodeMinimum = String(rawNodeMinimum || '').trim();
|
|
34
|
-
if (!normalizedNodeMinimum) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const majorSegment = normalizedNodeMinimum.split('.')[0];
|
|
39
|
-
const parsedMajorVersion = Number.parseInt(majorSegment, 10);
|
|
40
|
-
return Number.isNaN(parsedMajorVersion) ? null : parsedMajorVersion;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function readSkillDomainCompatibilityManifest(targetDirectoryPath, skillDomainName) {
|
|
44
|
-
const compatibilityManifestPath = path.join(
|
|
45
|
-
targetDirectoryPath,
|
|
46
|
-
'.agent-context',
|
|
47
|
-
'skills',
|
|
48
|
-
skillDomainName,
|
|
49
|
-
SKILL_COMPATIBILITY_MANIFEST_FILE_NAME
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
if (!(await pathExists(compatibilityManifestPath))) {
|
|
53
|
-
return {
|
|
54
|
-
exists: false,
|
|
55
|
-
compatibilityManifestPath,
|
|
56
|
-
parsedManifest: null,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
const compatibilityManifestContent = await fs.readFile(compatibilityManifestPath, 'utf8');
|
|
62
|
-
return {
|
|
63
|
-
exists: true,
|
|
64
|
-
compatibilityManifestPath,
|
|
65
|
-
parsedManifest: JSON.parse(compatibilityManifestContent),
|
|
66
|
-
};
|
|
67
|
-
} catch (error) {
|
|
68
|
-
return {
|
|
69
|
-
exists: true,
|
|
70
|
-
compatibilityManifestPath,
|
|
71
|
-
parsedManifest: null,
|
|
72
|
-
parseError: error instanceof Error ? error.message : String(error),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export async function evaluateSkillDomainCompatibility(targetDirectoryPath, skillDomainNames) {
|
|
78
|
-
const uniqueSkillDomainNames = Array.from(new Set(skillDomainNames || []));
|
|
79
|
-
const compatibilityWarnings = [];
|
|
80
|
-
|
|
81
|
-
const currentPlatformLabel = getCurrentPlatformLabel();
|
|
82
|
-
const currentNodeMajorVersion = parseNodeMajorVersion(version);
|
|
83
|
-
|
|
84
|
-
for (const skillDomainName of uniqueSkillDomainNames) {
|
|
85
|
-
const manifestResult = await readSkillDomainCompatibilityManifest(targetDirectoryPath, skillDomainName);
|
|
86
|
-
|
|
87
|
-
if (!manifestResult.exists) {
|
|
88
|
-
compatibilityWarnings.push(
|
|
89
|
-
`Domain ${skillDomainName} has no ${SKILL_COMPATIBILITY_MANIFEST_FILE_NAME}; compatibility cannot be verified.`
|
|
90
|
-
);
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!manifestResult.parsedManifest) {
|
|
95
|
-
compatibilityWarnings.push(
|
|
96
|
-
`Domain ${skillDomainName} has invalid ${SKILL_COMPATIBILITY_MANIFEST_FILE_NAME}: ${manifestResult.parseError || 'Unknown parse error'}.`
|
|
97
|
-
);
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const manifestPlatforms = Array.isArray(manifestResult.parsedManifest.platforms)
|
|
102
|
-
? manifestResult.parsedManifest.platforms
|
|
103
|
-
: [];
|
|
104
|
-
|
|
105
|
-
if (manifestPlatforms.length > 0 && !manifestPlatforms.includes(currentPlatformLabel)) {
|
|
106
|
-
compatibilityWarnings.push(
|
|
107
|
-
`Domain ${skillDomainName} does not list platform ${currentPlatformLabel} in ${SKILL_COMPATIBILITY_MANIFEST_FILE_NAME}.`
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const minimumNodeMajorVersion = parseNodeMinimumMajor(manifestResult.parsedManifest.nodeMin);
|
|
112
|
-
if (
|
|
113
|
-
typeof minimumNodeMajorVersion === 'number'
|
|
114
|
-
&& typeof currentNodeMajorVersion === 'number'
|
|
115
|
-
&& currentNodeMajorVersion < minimumNodeMajorVersion
|
|
116
|
-
) {
|
|
117
|
-
compatibilityWarnings.push(
|
|
118
|
-
`Domain ${skillDomainName} requires Node.js >= ${minimumNodeMajorVersion}, current major version is ${currentNodeMajorVersion}.`
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return compatibilityWarnings;
|
|
124
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Validates the structure and content of an evidence bundle for an artifact.
|
|
6
|
-
* Target artifact directory must be provided as an argument.
|
|
7
|
-
*/
|
|
8
|
-
export async function validateEvidenceBundle(artifactPath) {
|
|
9
|
-
const evidenceDirPath = path.join(artifactPath, '.evidence');
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
const stats = await fs.stat(evidenceDirPath);
|
|
13
|
-
if (!stats.isDirectory()) {
|
|
14
|
-
return { passed: false, error: '.evidence is not a directory' };
|
|
15
|
-
}
|
|
16
|
-
} catch {
|
|
17
|
-
return { passed: false, error: 'Missing .evidence directory' };
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const requiredFiles = [
|
|
21
|
-
'compatibility-manifest.json',
|
|
22
|
-
'test-report.json',
|
|
23
|
-
'sbom-excerpt.json'
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
for (const fileName of requiredFiles) {
|
|
27
|
-
try {
|
|
28
|
-
await fs.stat(path.join(evidenceDirPath, fileName));
|
|
29
|
-
} catch {
|
|
30
|
-
return { passed: false, error: `Missing required evidence file: ${fileName}` };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Validate compatibility manifest structure
|
|
35
|
-
try {
|
|
36
|
-
const manifestData = JSON.parse(await fs.readFile(path.join(evidenceDirPath, 'compatibility-manifest.json'), 'utf8'));
|
|
37
|
-
if (!manifestData.ides || !Array.isArray(manifestData.ides)) {
|
|
38
|
-
return { passed: false, error: 'compatibility-manifest.json is missing the "ides" array' };
|
|
39
|
-
}
|
|
40
|
-
} catch (err) {
|
|
41
|
-
return { passed: false, error: `Invalid compatibility-manifest.json: ${err.message}` };
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Validate test report structure
|
|
45
|
-
try {
|
|
46
|
-
const testReportData = JSON.parse(await fs.readFile(path.join(evidenceDirPath, 'test-report.json'), 'utf8'));
|
|
47
|
-
if (typeof testReportData.passed !== 'boolean' || typeof testReportData.total !== 'number') {
|
|
48
|
-
return { passed: false, error: 'test-report.json must contain boolean "passed" and numeric "total"' };
|
|
49
|
-
}
|
|
50
|
-
} catch (err) {
|
|
51
|
-
return { passed: false, error: `Invalid test-report.json: ${err.message}` };
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return { passed: true, error: null };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Allow CLI usage
|
|
58
|
-
if (process.argv[1] && process.argv[1] === new URL(import.meta.url).pathname || process.argv[1] === import.meta.filename) {
|
|
59
|
-
const targetDir = process.argv[2];
|
|
60
|
-
if (!targetDir) {
|
|
61
|
-
console.error('Usage: node validate-evidence-bundle.mjs <target-directory>');
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
validateEvidenceBundle(path.resolve(targetDir))
|
|
66
|
-
.then(result => {
|
|
67
|
-
if (result.passed) {
|
|
68
|
-
console.log('[OK] Evidence bundle is valid.');
|
|
69
|
-
process.exit(0);
|
|
70
|
-
} else {
|
|
71
|
-
console.error(`[FAIL] Evidence bundle validation failed: ${result.error}`);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
.catch(console.error);
|
|
76
|
-
}
|