specdx 0.4.0-alpha.7 → 0.4.0-alpha.9
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/{changelog-IP7PNCWG.js → changelog-XUVHY3QK.js} +4 -4
- package/dist/{check-UFMPBHJ4.js → check-4FSSC6HN.js} +10 -7
- package/dist/check-4FSSC6HN.js.map +1 -0
- package/dist/{chunk-RVVQKLNL.js → chunk-7JXW2GTJ.js} +107 -14
- package/dist/chunk-7JXW2GTJ.js.map +1 -0
- package/dist/{chunk-EMMWQV52.js → chunk-AKNPCB37.js} +2 -2
- package/dist/{chunk-KAWB5K44.js → chunk-DAZCOUVK.js} +2 -2
- package/dist/{chunk-LDV7UXZ7.js → chunk-IHTYAW7C.js} +2 -2
- package/dist/{chunk-UKSPVBYC.js → chunk-N77RNV7J.js} +130 -8
- package/dist/chunk-N77RNV7J.js.map +1 -0
- package/dist/{chunk-YYMQPWSZ.js → chunk-SRZ33RJP.js} +2 -2
- package/dist/chunk-SRZ33RJP.js.map +1 -0
- package/dist/{diff-EJJSEI5Z.js → diff-OXZ34NU4.js} +4 -4
- package/dist/{dist-UAS5655D.js → dist-4DIRTBJH.js} +9 -7
- package/dist/dist-4DIRTBJH.js.map +1 -0
- package/dist/dist-RL2DT3ZE.js +15 -0
- package/dist/{explain-NLWMVXFQ.js → explain-QBV3AESQ.js} +3 -3
- package/dist/{generate-ORC5WQ4Z.js → generate-7GNPT2WJ.js} +3 -3
- package/dist/{generate-story-RQ6L5C3O.js → generate-story-EFHGINHA.js} +3 -3
- package/dist/{generate-test-plan-7MDFBSQN.js → generate-test-plan-BO7444RG.js} +3 -3
- package/dist/{graph-CXFIP6ZA.js → graph-5XINV7PT.js} +3 -3
- package/dist/index.js +126 -16
- package/dist/index.js.map +1 -1
- package/dist/{lint-UW7DVZAS.js → lint-PTMWMLDQ.js} +17 -6
- package/dist/lint-PTMWMLDQ.js.map +1 -0
- package/dist/main.js +16 -16
- package/dist/main.js.map +1 -1
- package/dist/{mcp-56I3BENN.js → mcp-BGFAPM6G.js} +2 -2
- package/dist/{migrate-S7PFFBYI.js → migrate-4KF6GHLO.js} +3 -3
- package/dist/{pack-2N5KF75X.js → pack-DSOODXAN.js} +4 -4
- package/dist/{ready-BHLNDART.js → ready-6DNKIHP6.js} +38 -15
- package/dist/ready-6DNKIHP6.js.map +1 -0
- package/dist/skills/specdx-verify.md +11 -0
- package/dist/{status-R6MALIAF.js → status-WZK247CI.js} +12 -6
- package/dist/status-WZK247CI.js.map +1 -0
- package/dist/{update-S54E2Y4J.js → update-JTNSYX3B.js} +4 -4
- package/dist/validate-LBDYWUDX.js +86 -0
- package/dist/validate-LBDYWUDX.js.map +1 -0
- package/package.json +3 -3
- package/dist/check-UFMPBHJ4.js.map +0 -1
- package/dist/chunk-RVVQKLNL.js.map +0 -1
- package/dist/chunk-UKSPVBYC.js.map +0 -1
- package/dist/chunk-YYMQPWSZ.js.map +0 -1
- package/dist/dist-U7CZLXM5.js +0 -11
- package/dist/dist-UAS5655D.js.map +0 -1
- package/dist/lint-UW7DVZAS.js.map +0 -1
- package/dist/ready-BHLNDART.js.map +0 -1
- package/dist/status-R6MALIAF.js.map +0 -1
- package/dist/validate-3ZDFA3MM.js +0 -49
- package/dist/validate-3ZDFA3MM.js.map +0 -1
- /package/dist/{changelog-IP7PNCWG.js.map → changelog-XUVHY3QK.js.map} +0 -0
- /package/dist/{chunk-EMMWQV52.js.map → chunk-AKNPCB37.js.map} +0 -0
- /package/dist/{chunk-KAWB5K44.js.map → chunk-DAZCOUVK.js.map} +0 -0
- /package/dist/{chunk-LDV7UXZ7.js.map → chunk-IHTYAW7C.js.map} +0 -0
- /package/dist/{diff-EJJSEI5Z.js.map → diff-OXZ34NU4.js.map} +0 -0
- /package/dist/{dist-U7CZLXM5.js.map → dist-RL2DT3ZE.js.map} +0 -0
- /package/dist/{explain-NLWMVXFQ.js.map → explain-QBV3AESQ.js.map} +0 -0
- /package/dist/{generate-ORC5WQ4Z.js.map → generate-7GNPT2WJ.js.map} +0 -0
- /package/dist/{generate-story-RQ6L5C3O.js.map → generate-story-EFHGINHA.js.map} +0 -0
- /package/dist/{generate-test-plan-7MDFBSQN.js.map → generate-test-plan-BO7444RG.js.map} +0 -0
- /package/dist/{graph-CXFIP6ZA.js.map → graph-5XINV7PT.js.map} +0 -0
- /package/dist/{mcp-56I3BENN.js.map → mcp-BGFAPM6G.js.map} +0 -0
- /package/dist/{migrate-S7PFFBYI.js.map → migrate-4KF6GHLO.js.map} +0 -0
- /package/dist/{pack-2N5KF75X.js.map → pack-DSOODXAN.js.map} +0 -0
- /package/dist/{update-S54E2Y4J.js.map → update-JTNSYX3B.js.map} +0 -0
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
DEFAULT_DIFF_CONFIG,
|
|
3
3
|
DiffError,
|
|
4
4
|
diffBetweenRefs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SRZ33RJP.js";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-IHTYAW7C.js";
|
|
9
|
+
import "./chunk-7JXW2GTJ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/changelog.ts
|
|
12
12
|
import { defineCommand } from "citty";
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
changelog_default as default,
|
|
91
91
|
runChangelog
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=changelog-
|
|
93
|
+
//# sourceMappingURL=changelog-XUVHY3QK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCheck
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N77RNV7J.js";
|
|
4
4
|
import {
|
|
5
5
|
sharedArgs
|
|
6
6
|
} from "./chunk-GAM4MXPC.js";
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
loadConfig,
|
|
10
10
|
parseSpec,
|
|
11
11
|
resolveGlob
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-IHTYAW7C.js";
|
|
13
|
+
import "./chunk-7JXW2GTJ.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/check.ts
|
|
16
16
|
import { defineCommand } from "citty";
|
|
@@ -49,7 +49,7 @@ var check_default = defineCommand({
|
|
|
49
49
|
logger.debug(`Checking ${specs.length} specs...`);
|
|
50
50
|
const result = await runCheck(specs, configDir, checkConfig);
|
|
51
51
|
if (args.ai) {
|
|
52
|
-
const { analyzeWithAi } = await import("./dist-
|
|
52
|
+
const { analyzeWithAi } = await import("./dist-RL2DT3ZE.js");
|
|
53
53
|
const aiResult = await analyzeWithAi(result.findings, args.spec ?? "full suite check");
|
|
54
54
|
if (args.format === "json") {
|
|
55
55
|
console.log(JSON.stringify({ ...result, ai: aiResult }, null, 2));
|
|
@@ -93,7 +93,10 @@ var check_default = defineCommand({
|
|
|
93
93
|
console.log(` Scanned: framework=${result.scanned.framework ?? "none detected"}`);
|
|
94
94
|
console.log(` routes: ${fmt(result.scanned.codeRoutes)}`);
|
|
95
95
|
console.log(` types: ${fmt(result.scanned.codeTypes)}`);
|
|
96
|
-
console.log(` tests: ${fmt(result.scanned.codeTests)}
|
|
96
|
+
console.log(` tests: ${fmt(result.scanned.codeTests)}`);
|
|
97
|
+
const artifacts = result.scanned.artifacts === null ? "none declared" : `${result.scanned.artifacts} verified`;
|
|
98
|
+
const pending = result.scanned.artifactsPending > 0 ? `, ${result.scanned.artifactsPending} pending` : "";
|
|
99
|
+
console.log(` artifacts: ${artifacts}${pending}
|
|
97
100
|
`);
|
|
98
101
|
}
|
|
99
102
|
for (const [category, stats] of Object.entries(result.score.byCategory)) {
|
|
@@ -103,7 +106,7 @@ var check_default = defineCommand({
|
|
|
103
106
|
(f) => f.category === category.replace(/s$/, "")
|
|
104
107
|
);
|
|
105
108
|
for (const f of categoryFindings) {
|
|
106
|
-
const icon = f.
|
|
109
|
+
const icon = f.severity === "error" ? "\u2717" : f.severity === "warn" ? "\u26A0" : "\u2139";
|
|
107
110
|
const detail = f.actual ? ` \u2014 ${f.actual}` : "";
|
|
108
111
|
const suggestion = f.suggestion ? ` (${f.suggestion})` : "";
|
|
109
112
|
console.log(` ${icon} ${f.expected}${detail}${suggestion}`);
|
|
@@ -130,4 +133,4 @@ var check_default = defineCommand({
|
|
|
130
133
|
export {
|
|
131
134
|
check_default as default
|
|
132
135
|
};
|
|
133
|
-
//# sourceMappingURL=check-
|
|
136
|
+
//# sourceMappingURL=check-4FSSC6HN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/check.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { loadConfig, parseSpec, resolveGlob, createLogger } from \"@specdx/core\";\nimport { runCheck } from \"@specdx/check\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport type { CheckConfig } from \"@specdx/check\";\nimport { sharedArgs } from \"../shared-args.js\";\n\nexport default defineCommand({\n meta: {\n name: \"check\",\n description:\n \"[experimental] Check spec-to-implementation drift. Exit codes: 0 ok, 1 errors found, 3 nothing checkable (coverage not assessed)\",\n },\n args: {\n ...sharedArgs,\n spec: { type: \"string\", description: \"Check a specific spec by ID\" },\n framework: { type: \"string\", description: \"Framework override: express, hono, nextjs\" },\n ai: {\n type: \"boolean\",\n description: \"[experimental] Use AI to assess findings (requires ANTHROPIC_API_KEY)\",\n },\n },\n async run({ args }) {\n const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n logger.debug(\"Loading specs...\");\n\n // Resolve and parse all specs\n const specs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const paths = await resolveGlob(entry.path, configDir);\n for (const p of paths) {\n const spec = await parseSpec(p);\n if (args.spec && spec.frontmatter.id !== args.spec) continue;\n specs.push(spec);\n }\n }\n\n const checkConfig: CheckConfig = {\n ...config.check,\n ...(args.framework ? { framework: args.framework as CheckConfig[\"framework\"] } : {}),\n };\n\n logger.debug(`Checking ${specs.length} specs...`);\n const result = await runCheck(specs, configDir, checkConfig);\n\n // AI analysis (opt-in)\n if (args.ai) {\n const { analyzeWithAi } = await import(\"@specdx/check\");\n const aiResult = await analyzeWithAi(result.findings, args.spec ?? \"full suite check\");\n\n if (args.format === \"json\") {\n console.log(JSON.stringify({ ...result, ai: aiResult }, null, 2));\n } else {\n console.log(`\\n sdx check --ai — ${result.score.overall}% coverage\\n`);\n console.log(` AI Assessment: ${aiResult.summary}\\n`);\n\n for (const assessment of aiResult.assessments) {\n const finding = result.findings[assessment.findingIndex];\n if (!finding) continue;\n const icon = assessment.isRealIssue ? \"✗\" : \"✓\";\n const label = assessment.isRealIssue ? \"REAL\" : \"FALSE POSITIVE\";\n console.log(` ${icon} [${label}] ${finding.expected}`);\n console.log(` ${assessment.reasoning}`);\n if (assessment.suggestedFix) {\n console.log(` Fix: ${assessment.suggestedFix}`);\n }\n }\n console.log();\n }\n\n if (aiResult.assessments.some((a) => a.isRealIssue)) {\n process.exit(1);\n }\n return;\n }\n\n if (args.format === \"json\") {\n console.log(JSON.stringify(result, null, 2));\n } else {\n // Pretty format\n const headline = result.score.assessed\n ? `${result.score.overall}% implementation coverage`\n : \"coverage not assessed — no checkable surfaces found\";\n console.log(`\\n sdx check — ${headline}\\n`);\n\n for (const note of result.notes) {\n console.log(` ⚠ ${note}`);\n }\n if (result.notes.length > 0) console.log();\n\n if (args.verbose) {\n const fmt = (n: number | null) => (n === null ? \"not scanned\" : `${n} found`);\n console.log(` Scanned: framework=${result.scanned.framework ?? \"none detected\"}`);\n console.log(` routes: ${fmt(result.scanned.codeRoutes)}`);\n console.log(` types: ${fmt(result.scanned.codeTypes)}`);\n console.log(` tests: ${fmt(result.scanned.codeTests)}`);\n const artifacts =\n result.scanned.artifacts === null\n ? \"none declared\"\n : `${result.scanned.artifacts} verified`;\n const pending =\n result.scanned.artifactsPending > 0 ? `, ${result.scanned.artifactsPending} pending` : \"\";\n console.log(` artifacts: ${artifacts}${pending}\\n`);\n }\n\n for (const [category, stats] of Object.entries(result.score.byCategory)) {\n if (stats.total === 0) continue;\n console.log(` ${category} (${stats.matched}/${stats.total}):`);\n const categoryFindings = result.findings.filter(\n (f) => f.category === category.replace(/s$/, \"\"),\n );\n for (const f of categoryFindings) {\n const icon = f.severity === \"error\" ? \"✗\" : f.severity === \"warn\" ? \"⚠\" : \"ℹ\";\n const detail = f.actual ? ` — ${f.actual}` : \"\";\n const suggestion = f.suggestion ? ` (${f.suggestion})` : \"\";\n console.log(` ${icon} ${f.expected}${detail}${suggestion}`);\n }\n if (categoryFindings.length === 0) {\n console.log(\" ✓ all matched\");\n }\n }\n\n const errors = result.findings.filter((f) => f.severity === \"error\").length;\n const warnings = result.findings.filter((f) => f.severity === \"warn\").length;\n const info = result.findings.filter((f) => f.severity === \"info\").length;\n console.log(`\\n ${errors} errors, ${warnings} warnings, ${info} info\\n`);\n }\n\n if (result.findings.some((f) => f.severity === \"error\")) {\n process.exit(1);\n }\n // Distinct exit code so CI cannot mistake \"nothing was checkable\" for a pass\n if (!result.score.assessed) {\n process.exit(3);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAO9B,IAAO,gBAAQ,cAAc;AAAA,EAC3B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,GAAG;AAAA,IACH,MAAM,EAAE,MAAM,UAAU,aAAa,8BAA8B;AAAA,IACnE,WAAW,EAAE,MAAM,UAAU,aAAa,4CAA4C;AAAA,IACtF,IAAI;AAAA,MACF,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,SAAS,aAAa,EAAE,OAAO,KAAK,OAAO,SAAS,KAAK,Q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@@ var base_spec_default = {
|
|
|
41
41
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
42
42
|
type: "object",
|
|
43
43
|
properties: {
|
|
44
|
-
id: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
id: {
|
|
45
|
+
type: "string",
|
|
46
|
+
minLength: 1
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: [
|
|
51
|
+
"prd",
|
|
52
|
+
"technical-design",
|
|
53
|
+
"user-story",
|
|
54
|
+
"test-plan",
|
|
55
|
+
"adr",
|
|
56
|
+
"api-contract",
|
|
57
|
+
"epic",
|
|
58
|
+
"quick-spec",
|
|
59
|
+
"project-context"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
title: {
|
|
63
|
+
type: "string",
|
|
64
|
+
minLength: 1
|
|
65
|
+
},
|
|
66
|
+
status: {
|
|
67
|
+
type: "string",
|
|
68
|
+
enum: [
|
|
69
|
+
"draft",
|
|
70
|
+
"review",
|
|
71
|
+
"approved",
|
|
72
|
+
"superseded"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
version: {
|
|
76
|
+
type: "string"
|
|
77
|
+
},
|
|
78
|
+
created: {
|
|
79
|
+
type: "string",
|
|
80
|
+
format: "date"
|
|
81
|
+
},
|
|
82
|
+
updated: {
|
|
83
|
+
type: "string",
|
|
84
|
+
format: "date"
|
|
85
|
+
},
|
|
86
|
+
authors: {
|
|
87
|
+
type: "array",
|
|
88
|
+
items: {
|
|
89
|
+
type: "string"
|
|
90
|
+
},
|
|
91
|
+
minItems: 1
|
|
92
|
+
},
|
|
93
|
+
tags: {
|
|
94
|
+
type: "array",
|
|
95
|
+
items: {
|
|
96
|
+
type: "string"
|
|
97
|
+
},
|
|
98
|
+
default: []
|
|
99
|
+
},
|
|
53
100
|
references: {
|
|
54
101
|
type: "array",
|
|
55
102
|
items: {
|
|
56
103
|
type: "object",
|
|
57
104
|
properties: {
|
|
58
|
-
id: {
|
|
59
|
-
|
|
105
|
+
id: {
|
|
106
|
+
type: "string"
|
|
107
|
+
},
|
|
108
|
+
relationship: {
|
|
109
|
+
type: "string",
|
|
110
|
+
enum: [
|
|
111
|
+
"implemented-by",
|
|
112
|
+
"decomposed-into",
|
|
113
|
+
"depends-on",
|
|
114
|
+
"supersedes",
|
|
115
|
+
"related-to"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
required: [
|
|
120
|
+
"id",
|
|
121
|
+
"relationship"
|
|
122
|
+
],
|
|
123
|
+
additionalProperties: false
|
|
124
|
+
},
|
|
125
|
+
default: []
|
|
126
|
+
},
|
|
127
|
+
artifacts: {
|
|
128
|
+
type: "array",
|
|
129
|
+
items: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
path: {
|
|
133
|
+
type: "string",
|
|
134
|
+
minLength: 1
|
|
135
|
+
},
|
|
136
|
+
exports: {
|
|
137
|
+
type: "array",
|
|
138
|
+
items: {
|
|
139
|
+
type: "string",
|
|
140
|
+
minLength: 1
|
|
141
|
+
}
|
|
142
|
+
}
|
|
60
143
|
},
|
|
61
|
-
required: [
|
|
144
|
+
required: [
|
|
145
|
+
"path"
|
|
146
|
+
],
|
|
62
147
|
additionalProperties: false
|
|
63
148
|
},
|
|
64
149
|
default: []
|
|
65
150
|
}
|
|
66
151
|
},
|
|
67
|
-
required: [
|
|
152
|
+
required: [
|
|
153
|
+
"id",
|
|
154
|
+
"type",
|
|
155
|
+
"title",
|
|
156
|
+
"status",
|
|
157
|
+
"version",
|
|
158
|
+
"created",
|
|
159
|
+
"authors"
|
|
160
|
+
],
|
|
68
161
|
additionalProperties: true
|
|
69
162
|
};
|
|
70
163
|
|
|
@@ -336,4 +429,4 @@ export {
|
|
|
336
429
|
validateSpec,
|
|
337
430
|
validateConfig
|
|
338
431
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
432
|
+
//# sourceMappingURL=chunk-7JXW2GTJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../schema/src/types.ts","../../schema/src/sections.ts","../../schema/src/validator.ts","../../schema/dist/schemas/base-spec.json","../../schema/dist/schemas/config.json","../../schema/dist/schemas/prd.json","../../schema/dist/schemas/technical-design.json","../../schema/dist/schemas/user-story.json","../../schema/dist/schemas/test-plan.json","../../schema/dist/schemas/adr.json","../../schema/dist/schemas/api-contract.json","../../schema/dist/schemas/epic.json","../../schema/dist/schemas/quick-spec.json","../../schema/dist/schemas/project-context.json"],"sourcesContent":["export const SPEC_TYPES = [\n \"prd\",\n \"technical-design\",\n \"user-story\",\n \"test-plan\",\n \"adr\",\n \"api-contract\",\n \"epic\",\n \"quick-spec\",\n \"project-context\",\n] as const;\nexport type SpecType = (typeof SPEC_TYPES)[number];\n\nexport const SPEC_STATUSES = [\"draft\", \"review\", \"approved\", \"superseded\"] as const;\nexport type SpecStatus = (typeof SPEC_STATUSES)[number];\n\nexport interface SpecReference {\n id: string;\n relationship: \"implemented-by\" | \"decomposed-into\" | \"depends-on\" | \"supersedes\" | \"related-to\";\n}\n\n/** A checkable implementation artifact declared by a spec (issue #15). */\nexport interface SpecArtifact {\n /** Project-root-relative file path that must exist. */\n path: string;\n /** Names that must be exported from the file. */\n exports?: string[];\n}\n\nexport interface BaseSpec {\n id: string;\n type: SpecType;\n title: string;\n status: SpecStatus;\n version: string;\n created: string;\n updated?: string;\n authors: string[];\n tags?: string[];\n references?: SpecReference[];\n artifacts?: SpecArtifact[];\n}\n\nexport interface PrdSpec extends BaseSpec {\n type: \"prd\";\n}\nexport interface TechnicalDesignSpec extends BaseSpec {\n type: \"technical-design\";\n}\nexport interface UserStorySpec extends BaseSpec {\n type: \"user-story\";\n story_id: string;\n priority: \"critical\" | \"high\" | \"medium\" | \"low\";\n estimate: string;\n}\nexport interface TestPlanSpec extends BaseSpec {\n type: \"test-plan\";\n}\nexport interface AdrSpec extends BaseSpec {\n type: \"adr\";\n}\nexport interface ApiContractSpec extends BaseSpec {\n type: \"api-contract\";\n}\n\nexport interface EpicSpec extends BaseSpec {\n type: \"epic\";\n epic_id: string;\n priority: \"critical\" | \"high\" | \"medium\" | \"low\";\n}\n\nexport interface QuickSpecSpec extends BaseSpec {\n type: \"quick-spec\";\n}\n\nexport interface ProjectContextSpec extends BaseSpec {\n type: \"project-context\";\n}\n\nexport type Spec =\n | PrdSpec\n | TechnicalDesignSpec\n | UserStorySpec\n | TestPlanSpec\n | AdrSpec\n | ApiContractSpec\n | EpicSpec\n | QuickSpecSpec\n | ProjectContextSpec;\n\nexport interface SpecEntry {\n path: string;\n type: SpecType;\n required?: boolean;\n requires?: string[];\n owner?: string;\n}\n\nexport interface PackCompressionConfig {\n strip_boilerplate?: boolean;\n stable_days?: number;\n collapse_resolved_adrs?: boolean;\n}\n\nexport interface PackConfig {\n max_tokens?: number;\n format?: \"xml\" | \"markdown\" | \"json\";\n compression?: PackCompressionConfig;\n boilerplate_sections?: string[];\n}\n\nexport interface SdxConfig {\n version: string;\n project?: { name?: string; description?: string };\n specs: Record<string, SpecEntry>;\n lint?: {\n extends?: string;\n rules?: Record<string, unknown>;\n ignore?: string[];\n };\n pack?: PackConfig;\n diff?: {\n baseline_ref?: string;\n staleness_threshold_days?: number;\n ignore_paths?: string[];\n };\n ci?: {\n block_on?: (\"error\" | \"warn\" | \"info\")[];\n post_comment?: boolean;\n update_badge?: boolean;\n trigger_paths?: string[];\n };\n check?: {\n framework?: \"auto\" | \"express\" | \"hono\" | \"nextjs\";\n routes_dir?: string;\n app_dir?: string;\n types_dir?: string;\n tests_dir?: string;\n ignore?: string[];\n };\n}\n","import type { SpecType } from \"./types.js\";\n\nexport const REQUIRED_SECTIONS: Record<SpecType, string[]> = {\n prd: [\"Problem Statement\", \"Goals\", \"Non-Goals\", \"Features\", \"Success Criteria\"],\n \"technical-design\": [\n \"Overview\",\n \"Architecture\",\n \"Data Model\",\n \"API Design\",\n \"Dependencies\",\n \"Risks\",\n \"Open Questions\",\n ],\n \"user-story\": [\"Description\", \"Acceptance Criteria\", \"Dependencies\", \"Notes\"],\n \"test-plan\": [\"Scope\", \"Test Cases\", \"Coverage Matrix\", \"Edge Cases\"],\n adr: [\"Context\", \"Decision\", \"Status\", \"Consequences\"],\n \"api-contract\": [\"Endpoints\", \"Request/Response Schemas\", \"Auth\", \"Error Codes\"],\n epic: [\"Overview\", \"Stories\", \"Acceptance Criteria\", \"Dependencies\"],\n \"quick-spec\": [\"Intent\", \"Boundaries\", \"Tasks\"],\n \"project-context\": [\"Technology Stack\", \"Critical Implementation Rules\", \"Coding Patterns\"],\n};\n","import { Ajv as AjvClass, type ErrorObject } from \"ajv\";\nimport { SPEC_TYPES, type SpecType } from \"./types.js\";\n\nimport baseSpecSchema from \"./schemas/base-spec.json\" with { type: \"json\" };\nimport configSchema from \"./schemas/config.json\" with { type: \"json\" };\nimport prdSchema from \"./schemas/prd.json\" with { type: \"json\" };\nimport technicalDesignSchema from \"./schemas/technical-design.json\" with { type: \"json\" };\nimport userStorySchema from \"./schemas/user-story.json\" with { type: \"json\" };\nimport testPlanSchema from \"./schemas/test-plan.json\" with { type: \"json\" };\nimport adrSchema from \"./schemas/adr.json\" with { type: \"json\" };\nimport apiContractSchema from \"./schemas/api-contract.json\" with { type: \"json\" };\nimport epicSchema from \"./schemas/epic.json\" with { type: \"json\" };\nimport quickSpecSchema from \"./schemas/quick-spec.json\" with { type: \"json\" };\nimport projectContextSchema from \"./schemas/project-context.json\" with { type: \"json\" };\n\n// addFormats is CJS-only; access via the namespace default at runtime\n// The type cast is needed because TypeScript's NodeNext resolution exposes\n// the CJS module as a namespace without a callable default signature.\nimport * as addFormatsNs from \"ajv-formats\";\ntype AddFormatsPlugin = (ajv: AjvClass, formats?: unknown) => AjvClass;\nconst addFormats = ((addFormatsNs as unknown as { default?: AddFormatsPlugin }).default ??\n (addFormatsNs as unknown as AddFormatsPlugin)) as AddFormatsPlugin;\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ErrorObject[] | null;\n}\n\n// The JSON schemas duplicate the spec-type enum for editor and schema-store\n// consumers. At runtime SPEC_TYPES is the single source of truth: the enums are\n// overwritten before compilation so the JSON copies can never drift from the\n// TypeScript types (see issue #2 — a stale enum shipped in 0.4.0-alpha.2).\nconst runtimeBaseSpecSchema = structuredClone(baseSpecSchema);\nruntimeBaseSpecSchema.properties.type.enum = [...SPEC_TYPES];\nconst runtimeConfigSchema = structuredClone(configSchema);\nruntimeConfigSchema.properties.specs.additionalProperties.properties.type.enum = [...SPEC_TYPES];\n\nconst ajv = new AjvClass({ allErrors: true, strict: true });\naddFormats(ajv, [\"date\"]);\najv.addSchema(runtimeBaseSpecSchema);\n\nconst specValidators: Record<string, ReturnType<typeof ajv.compile>> = {\n prd: ajv.compile(prdSchema),\n \"technical-design\": ajv.compile(technicalDesignSchema),\n \"user-story\": ajv.compile(userStorySchema),\n \"test-plan\": ajv.compile(testPlanSchema),\n adr: ajv.compile(adrSchema),\n \"api-contract\": ajv.compile(apiContractSchema),\n epic: ajv.compile(epicSchema),\n \"quick-spec\": ajv.compile(quickSpecSchema),\n \"project-context\": ajv.compile(projectContextSchema),\n};\n\nconst configValidator = ajv.compile(runtimeConfigSchema);\n\nexport function validateSpec(type: SpecType, data: Record<string, unknown>): ValidationResult {\n const validate = specValidators[type];\n if (!validate) {\n return { valid: false, errors: [{ message: `Unknown spec type: \"${type}\"` } as ErrorObject] };\n }\n const valid = validate(data);\n return { valid: !!valid, errors: valid ? null : (validate.errors ?? null) };\n}\n\nexport function validateConfig(data: Record<string, unknown>): ValidationResult {\n const valid = configValidator(data);\n return { valid: !!valid, errors: valid ? null : (configValidator.errors ?? null) };\n}\n","{\n \"$id\": \"base-spec\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"prd\",\n \"technical-design\",\n \"user-story\",\n \"test-plan\",\n \"adr\",\n \"api-contract\",\n \"epic\",\n \"quick-spec\",\n \"project-context\"\n ]\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\n \"draft\",\n \"review\",\n \"approved\",\n \"superseded\"\n ]\n },\n \"version\": {\n \"type\": \"string\"\n },\n \"created\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"updated\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"authors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"minItems\": 1\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"default\": []\n },\n \"references\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"relationship\": {\n \"type\": \"string\",\n \"enum\": [\n \"implemented-by\",\n \"decomposed-into\",\n \"depends-on\",\n \"supersedes\",\n \"related-to\"\n ]\n }\n },\n \"required\": [\n \"id\",\n \"relationship\"\n ],\n \"additionalProperties\": false\n },\n \"default\": []\n },\n \"artifacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"exports\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n }\n },\n \"required\": [\n \"path\"\n ],\n \"additionalProperties\": false\n },\n \"default\": []\n }\n },\n \"required\": [\n \"id\",\n \"type\",\n \"title\",\n \"status\",\n \"version\",\n \"created\",\n \"authors\"\n ],\n \"additionalProperties\": true\n}\n","{\n \"$id\": \"sdx-config\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"version\": { \"type\": \"string\" },\n \"project\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" }\n },\n \"additionalProperties\": false\n },\n \"specs\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"prd\", \"technical-design\", \"user-story\", \"test-plan\", \"adr\", \"api-contract\", \"epic\", \"quick-spec\", \"project-context\"] },\n \"required\": { \"type\": \"boolean\", \"default\": false },\n \"requires\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"owner\": { \"type\": \"string\" }\n },\n \"required\": [\"path\", \"type\"],\n \"additionalProperties\": false\n }\n },\n \"lint\": {\n \"type\": \"object\",\n \"properties\": {\n \"extends\": { \"type\": \"string\" },\n \"rules\": { \"type\": \"object\" },\n \"ignore\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"pack\": {\n \"type\": \"object\",\n \"properties\": {\n \"max_tokens\": { \"type\": \"integer\", \"minimum\": 1 },\n \"format\": { \"type\": \"string\", \"enum\": [\"xml\", \"markdown\", \"json\"] },\n \"compression\": {\n \"type\": \"object\",\n \"properties\": {\n \"strip_boilerplate\": { \"type\": \"boolean\" },\n \"stable_days\": { \"type\": \"integer\", \"minimum\": 0 },\n \"collapse_resolved_adrs\": { \"type\": \"boolean\" }\n },\n \"additionalProperties\": false\n },\n \"boilerplate_sections\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n },\n \"diff\": {\n \"type\": \"object\",\n \"properties\": {\n \"baseline_ref\": { \"type\": \"string\", \"default\": \"main\" },\n \"staleness_threshold_days\": { \"type\": \"integer\", \"minimum\": 1, \"default\": 14 },\n \"ignore_paths\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"ci\": {\n \"type\": \"object\",\n \"properties\": {\n \"block_on\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"error\", \"warn\", \"info\"] }\n },\n \"post_comment\": { \"type\": \"boolean\", \"default\": true },\n \"update_badge\": { \"type\": \"boolean\", \"default\": true },\n \"trigger_paths\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n },\n \"check\": {\n \"type\": \"object\",\n \"properties\": {\n \"framework\": {\n \"type\": \"string\",\n \"enum\": [\"auto\", \"express\", \"hono\", \"nextjs\"]\n },\n \"routes_dir\": { \"type\": \"string\" },\n \"app_dir\": { \"type\": \"string\" },\n \"types_dir\": { \"type\": \"string\" },\n \"tests_dir\": { \"type\": \"string\" },\n \"ignore\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n }\n },\n \"required\": [\"version\", \"specs\"],\n \"additionalProperties\": false\n}\n","{\n \"$id\": \"prd\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"prd\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"technical-design\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"technical-design\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"user-story\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"user-story\" },\n \"story_id\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"string\", \"enum\": [\"critical\", \"high\", \"medium\", \"low\"] },\n \"estimate\": { \"type\": \"string\" }\n },\n \"required\": [\"type\", \"story_id\", \"priority\", \"estimate\"]\n }\n ]\n}\n","{\n \"$id\": \"test-plan\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"test-plan\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"adr\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"adr\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"api-contract\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"api-contract\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"epic\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"epic\" },\n \"epic_id\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"string\", \"enum\": [\"critical\", \"high\", \"medium\", \"low\"] }\n },\n \"required\": [\"type\", \"epic_id\", \"priority\"]\n }\n ]\n}\n","{\n \"$id\": \"quick-spec\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"quick-spec\" }\n },\n \"required\": [\"type\"]\n }\n ]\n}\n","{\n \"$id\": \"project-context\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"project-context\" }\n },\n \"required\": [\"type\"]\n }\n ]\n}\n"],"mappings":";AAAO,IAAM,aAAa;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;ACPK,IAAM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 @@
|
|
|
1
1
|
import {
|
|
2
2
|
countTokens
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHTYAW7C.js";
|
|
4
4
|
|
|
5
5
|
// ../pack/dist/resolver.js
|
|
6
6
|
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
@@ -664,4 +664,4 @@ function pack(specs, options, packConfig, graph) {
|
|
|
664
664
|
export {
|
|
665
665
|
pack
|
|
666
666
|
};
|
|
667
|
-
//# sourceMappingURL=chunk-
|
|
667
|
+
//# sourceMappingURL=chunk-AKNPCB37.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REQUIRED_SECTIONS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7JXW2GTJ.js";
|
|
4
4
|
|
|
5
5
|
// ../lint/dist/engine.js
|
|
6
6
|
function createLintEngine(options) {
|
|
@@ -493,4 +493,4 @@ export {
|
|
|
493
493
|
createLintEngine,
|
|
494
494
|
getPreset
|
|
495
495
|
};
|
|
496
|
-
//# sourceMappingURL=chunk-
|
|
496
|
+
//# sourceMappingURL=chunk-DAZCOUVK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateConfig,
|
|
3
3
|
validateSpec
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7JXW2GTJ.js";
|
|
5
5
|
|
|
6
6
|
// ../core/dist/config.js
|
|
7
7
|
import { readFile } from "fs/promises";
|
|
@@ -347,4 +347,4 @@ export {
|
|
|
347
347
|
resolveGlob,
|
|
348
348
|
createLogger
|
|
349
349
|
};
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
350
|
+
//# sourceMappingURL=chunk-IHTYAW7C.js.map
|
|
@@ -866,9 +866,118 @@ function matchTests(specCases, codeTests, specId) {
|
|
|
866
866
|
return findings;
|
|
867
867
|
}
|
|
868
868
|
|
|
869
|
+
// ../check/dist/artifacts.js
|
|
870
|
+
import { existsSync as existsSync7 } from "fs";
|
|
871
|
+
import { join as join8 } from "path";
|
|
872
|
+
var ENFORCED_STATUSES = /* @__PURE__ */ new Set(["approved"]);
|
|
873
|
+
function artifactsEnforced(status) {
|
|
874
|
+
return typeof status === "string" && ENFORCED_STATUSES.has(status);
|
|
875
|
+
}
|
|
876
|
+
function parseArtifacts(spec) {
|
|
877
|
+
const raw = spec.frontmatter.artifacts;
|
|
878
|
+
if (!Array.isArray(raw))
|
|
879
|
+
return [];
|
|
880
|
+
const out = [];
|
|
881
|
+
for (const item of raw) {
|
|
882
|
+
if (!item || typeof item !== "object")
|
|
883
|
+
continue;
|
|
884
|
+
const decl = item;
|
|
885
|
+
if (typeof decl.path !== "string" || decl.path.length === 0)
|
|
886
|
+
continue;
|
|
887
|
+
const exports = Array.isArray(decl.exports) ? decl.exports.filter((e) => typeof e === "string" && e.length > 0) : void 0;
|
|
888
|
+
out.push({ path: decl.path, exports });
|
|
889
|
+
}
|
|
890
|
+
return out;
|
|
891
|
+
}
|
|
892
|
+
async function getExportedNames(filePath) {
|
|
893
|
+
try {
|
|
894
|
+
const { Project } = await import("ts-morph");
|
|
895
|
+
const project = new Project({
|
|
896
|
+
skipAddingFilesFromTsConfig: true,
|
|
897
|
+
compilerOptions: { allowJs: true }
|
|
898
|
+
});
|
|
899
|
+
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
900
|
+
return new Set(sourceFile.getExportedDeclarations().keys());
|
|
901
|
+
} catch {
|
|
902
|
+
return null;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
async function checkArtifacts(specs, projectDir, tsMorphAvailable) {
|
|
906
|
+
const findings = [];
|
|
907
|
+
const notes = [];
|
|
908
|
+
let total = 0;
|
|
909
|
+
let pending = 0;
|
|
910
|
+
let skippedExports = 0;
|
|
911
|
+
for (const spec of specs) {
|
|
912
|
+
const specId = String(spec.frontmatter.id);
|
|
913
|
+
const status = spec.frontmatter.status;
|
|
914
|
+
const enforced = artifactsEnforced(status);
|
|
915
|
+
for (const artifact of parseArtifacts(spec)) {
|
|
916
|
+
const absolute = join8(projectDir, artifact.path);
|
|
917
|
+
if (!existsSync7(absolute)) {
|
|
918
|
+
if (enforced) {
|
|
919
|
+
total += 1;
|
|
920
|
+
findings.push({
|
|
921
|
+
type: "missing",
|
|
922
|
+
category: "artifact",
|
|
923
|
+
specId,
|
|
924
|
+
expected: `file "${artifact.path}"`,
|
|
925
|
+
severity: "error",
|
|
926
|
+
suggestion: `Create ${artifact.path} or update the artifacts list in ${specId}.`
|
|
927
|
+
});
|
|
928
|
+
} else {
|
|
929
|
+
pending += 1;
|
|
930
|
+
findings.push({
|
|
931
|
+
type: "pending",
|
|
932
|
+
category: "artifact",
|
|
933
|
+
specId,
|
|
934
|
+
expected: `file "${artifact.path}"`,
|
|
935
|
+
severity: "info",
|
|
936
|
+
suggestion: `planned by ${specId} (status: ${String(status)}) \u2014 not yet implemented; enforced once the spec is approved.`
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
total += 1;
|
|
942
|
+
if (!artifact.exports || artifact.exports.length === 0)
|
|
943
|
+
continue;
|
|
944
|
+
if (!tsMorphAvailable) {
|
|
945
|
+
skippedExports += artifact.exports.length;
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
const exported = await getExportedNames(absolute);
|
|
949
|
+
if (exported === null) {
|
|
950
|
+
skippedExports += artifact.exports.length;
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
for (const name of artifact.exports) {
|
|
954
|
+
total += 1;
|
|
955
|
+
if (!exported.has(name)) {
|
|
956
|
+
findings.push({
|
|
957
|
+
type: "missing",
|
|
958
|
+
category: "artifact",
|
|
959
|
+
specId,
|
|
960
|
+
codeLocation: { file: artifact.path, line: 1 },
|
|
961
|
+
expected: `export "${name}" from ${artifact.path}`,
|
|
962
|
+
severity: "error",
|
|
963
|
+
suggestion: `Export ${name} from ${artifact.path} or update the artifacts list in ${specId}.`
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
if (skippedExports > 0) {
|
|
970
|
+
notes.push(`artifact export checks skipped for ${skippedExports} export(s): ts-morph is not available or the file could not be parsed.`);
|
|
971
|
+
}
|
|
972
|
+
if (pending > 0) {
|
|
973
|
+
notes.push(`${pending} declared artifact(s) pending: planned by specs that are not yet approved. They are excluded from the score and become enforceable when the spec status changes to approved.`);
|
|
974
|
+
}
|
|
975
|
+
return { findings, total, checked: total, pending, notes };
|
|
976
|
+
}
|
|
977
|
+
|
|
869
978
|
// ../check/dist/score.js
|
|
870
979
|
function computeScore(findings, totals) {
|
|
871
|
-
const missingByCategory = { route: 0, type: 0, test: 0 };
|
|
980
|
+
const missingByCategory = { route: 0, type: 0, test: 0, artifact: 0 };
|
|
872
981
|
for (const f of findings) {
|
|
873
982
|
if (f.type === "missing" || f.type === "mismatch") {
|
|
874
983
|
missingByCategory[f.category] = (missingByCategory[f.category] ?? 0) + 1;
|
|
@@ -877,7 +986,8 @@ function computeScore(findings, totals) {
|
|
|
877
986
|
const categoryMap = {
|
|
878
987
|
routes: { total: totals.routes, categoryKey: "route" },
|
|
879
988
|
types: { total: totals.types, categoryKey: "type" },
|
|
880
|
-
tests: { total: totals.tests, categoryKey: "test" }
|
|
989
|
+
tests: { total: totals.tests, categoryKey: "test" },
|
|
990
|
+
artifacts: { total: totals.artifacts, categoryKey: "artifact" }
|
|
881
991
|
};
|
|
882
992
|
const byCategory = {};
|
|
883
993
|
let totalItems = 0;
|
|
@@ -898,7 +1008,7 @@ function computeScore(findings, totals) {
|
|
|
898
1008
|
|
|
899
1009
|
// ../check/dist/detect-framework.js
|
|
900
1010
|
import { readFile as readFile2 } from "fs/promises";
|
|
901
|
-
import { join as
|
|
1011
|
+
import { join as join9 } from "path";
|
|
902
1012
|
var FRAMEWORK_PACKAGES = [
|
|
903
1013
|
["express", "express"],
|
|
904
1014
|
["hono", "hono"],
|
|
@@ -907,7 +1017,7 @@ var FRAMEWORK_PACKAGES = [
|
|
|
907
1017
|
async function detectFramework(projectDir) {
|
|
908
1018
|
let pkg;
|
|
909
1019
|
try {
|
|
910
|
-
const content = await readFile2(
|
|
1020
|
+
const content = await readFile2(join9(projectDir, "package.json"), "utf-8");
|
|
911
1021
|
pkg = JSON.parse(content);
|
|
912
1022
|
} catch {
|
|
913
1023
|
return null;
|
|
@@ -973,15 +1083,25 @@ async function runCheck(specs, projectDir, config = {}) {
|
|
|
973
1083
|
findings.push(...matchTests(specCases, codeTests, spec.frontmatter.id));
|
|
974
1084
|
}
|
|
975
1085
|
}
|
|
976
|
-
const
|
|
1086
|
+
const artifactResult = await checkArtifacts(specs, projectDir, tsMorphAvailable);
|
|
1087
|
+
findings.push(...artifactResult.findings);
|
|
1088
|
+
notes.push(...artifactResult.notes);
|
|
1089
|
+
const score = computeScore(findings, {
|
|
1090
|
+
routes: routeTotal,
|
|
1091
|
+
types: typeTotal,
|
|
1092
|
+
tests: testTotal,
|
|
1093
|
+
artifacts: artifactResult.total
|
|
1094
|
+
});
|
|
977
1095
|
const errors = findings.filter((f) => f.severity === "error").length;
|
|
978
1096
|
const warnings = findings.filter((f) => f.severity === "warn").length;
|
|
979
|
-
const summary = score.assessed ? `${score.overall}% implementation coverage \u2014 ${errors} errors, ${warnings} warnings` : "coverage not assessed \u2014 no checkable surfaces found (no spec'd routes, types, or
|
|
1097
|
+
const summary = score.assessed ? `${score.overall}% implementation coverage \u2014 ${errors} errors, ${warnings} warnings` : "coverage not assessed \u2014 no checkable surfaces found (no spec'd routes, types, test cases, or declared artifacts)";
|
|
980
1098
|
const scanned = {
|
|
981
1099
|
framework: framework ?? null,
|
|
982
1100
|
codeRoutes: codeRouteCount,
|
|
983
1101
|
codeTypes: codeTypeCount,
|
|
984
|
-
codeTests: codeTestCount
|
|
1102
|
+
codeTests: codeTestCount,
|
|
1103
|
+
artifacts: artifactResult.total > 0 ? artifactResult.checked : null,
|
|
1104
|
+
artifactsPending: artifactResult.pending
|
|
985
1105
|
};
|
|
986
1106
|
return { findings, score, summary, scanned, notes };
|
|
987
1107
|
}
|
|
@@ -1057,8 +1177,10 @@ Only output the JSON array, no other text.`;
|
|
|
1057
1177
|
}
|
|
1058
1178
|
|
|
1059
1179
|
export {
|
|
1180
|
+
parseArtifacts,
|
|
1181
|
+
checkArtifacts,
|
|
1060
1182
|
detectFramework,
|
|
1061
1183
|
runCheck,
|
|
1062
1184
|
analyzeWithAi
|
|
1063
1185
|
};
|
|
1064
|
-
//# sourceMappingURL=chunk-
|
|
1186
|
+
//# sourceMappingURL=chunk-N77RNV7J.js.map
|