specdx 0.4.0 → 0.6.0
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/.claude-plugin/plugin.json +2 -2
- package/README.md +43 -3
- package/dist/{check-PHXXA7VY.js → check-5EA2MTNN.js} +121 -27
- package/dist/check-5EA2MTNN.js.map +1 -0
- package/dist/{chunk-3YXRWQGX.js → chunk-2UUQJ2ER.js} +242 -53
- package/dist/chunk-2UUQJ2ER.js.map +1 -0
- package/dist/{chunk-NAWYG4VV.js → chunk-5XOWCPP2.js} +2 -2
- package/dist/{chunk-2BZIG7OE.js → chunk-BZL2XXMA.js} +14 -14
- package/dist/{chunk-SNQNQ2MP.js → chunk-JGD3BOPH.js} +16 -6
- package/dist/chunk-JGD3BOPH.js.map +1 -0
- package/dist/{chunk-YRQPY5NF.js → chunk-MOYYF7Q6.js} +2 -2
- package/dist/{chunk-OVIKIIR4.js → chunk-QAJZCJUJ.js} +4 -3
- package/dist/chunk-QAJZCJUJ.js.map +1 -0
- package/dist/{chunk-LJTLNXGV.js → chunk-VVZUJ6H4.js} +353 -4
- package/dist/chunk-VVZUJ6H4.js.map +1 -0
- package/dist/{chunk-HCJDCS26.js → chunk-XRWLPU24.js} +10 -1
- package/dist/chunk-XRWLPU24.js.map +1 -0
- package/dist/{diff-6C5LJ7SH.js → diff-ZT6HXHK5.js} +4 -4
- package/dist/dist-6WDWUOCV.js +26 -0
- package/dist/{dist-PK52GA7M.js → dist-A3CWALDC.js} +76 -16
- package/dist/dist-A3CWALDC.js.map +1 -0
- package/dist/{generate-K72WD455.js → generate-M6YKXUDE.js} +5 -5
- package/dist/{generate-story-NUCNYL3I.js → generate-story-BXGNKWC6.js} +4 -4
- package/dist/{generate-test-plan-Z46W3N3B.js → generate-test-plan-PZUNCNN3.js} +3 -3
- package/dist/{graph-4RNURBNP.js → graph-GKXD2IGW.js} +3 -3
- package/dist/index.d.ts +38 -0
- package/dist/index.js +463 -26
- package/dist/index.js.map +1 -1
- package/dist/{lint-2VZPNLE3.js → lint-GZX5C5EQ.js} +93 -14
- package/dist/lint-GZX5C5EQ.js.map +1 -0
- package/dist/main.js +3 -3
- package/dist/{mcp-E6PJWBDQ.js → mcp-VQAYNJQ7.js} +3 -3
- package/dist/{migrate-FKFC7UAO.js → migrate-VASWPA3L.js} +3 -3
- package/dist/{pack-DE4UBTCC.js → pack-DFUCNWVR.js} +4 -4
- package/dist/{ready-K74SLQ24.js → ready-5OFSV2OD.js} +5 -5
- package/dist/{status-IAE3BB77.js → status-5MDODW4N.js} +5 -5
- package/dist/{update-UFOHZEAK.js → update-NFXC45UT.js} +4 -4
- package/dist/{validate-EZHUB5TW.js → validate-LWRLZR3H.js} +3 -3
- package/package.json +5 -4
- package/skills/core/specdx-author-spec/SKILL.md +33 -0
- package/skills/core/specdx-author-spec/references/spec-type-reference.md +57 -0
- package/skills/core/specdx-author-spec/references/step-01-frontmatter.md +66 -0
- package/skills/core/specdx-author-spec/references/step-02-sections.md +111 -0
- package/skills/core/specdx-author-spec/references/step-03-finalize.md +48 -0
- package/skills/core/specdx-onboard/SKILL.md +54 -0
- package/skills/core/specdx-plan-from-spec/SKILL.md +76 -0
- package/skills/core/specdx-pre-commit/SKILL.md +70 -0
- package/skills/core/specdx-review-spec/SKILL.md +81 -0
- package/skills/core/specdx-router/SKILL.md +67 -0
- package/skills/core/specdx-sprint-review/SKILL.md +73 -0
- package/skills/core/specdx-start-task/SKILL.md +62 -0
- package/skills/experimental/specdx-check-drift/SKILL.md +77 -0
- package/skills/experimental/specdx-verify/SKILL.md +85 -0
- package/dist/check-PHXXA7VY.js.map +0 -1
- package/dist/chunk-3YXRWQGX.js.map +0 -1
- package/dist/chunk-HCJDCS26.js.map +0 -1
- package/dist/chunk-LJTLNXGV.js.map +0 -1
- package/dist/chunk-OVIKIIR4.js.map +0 -1
- package/dist/chunk-SNQNQ2MP.js.map +0 -1
- package/dist/dist-PK52GA7M.js.map +0 -1
- package/dist/dist-ROHCFKYT.js +0 -16
- package/dist/lint-2VZPNLE3.js.map +0 -1
- /package/dist/{chunk-NAWYG4VV.js.map → chunk-5XOWCPP2.js.map} +0 -0
- /package/dist/{chunk-2BZIG7OE.js.map → chunk-BZL2XXMA.js.map} +0 -0
- /package/dist/{chunk-YRQPY5NF.js.map → chunk-MOYYF7Q6.js.map} +0 -0
- /package/dist/{diff-6C5LJ7SH.js.map → diff-ZT6HXHK5.js.map} +0 -0
- /package/dist/{dist-ROHCFKYT.js.map → dist-6WDWUOCV.js.map} +0 -0
- /package/dist/{generate-K72WD455.js.map → generate-M6YKXUDE.js.map} +0 -0
- /package/dist/{generate-story-NUCNYL3I.js.map → generate-story-BXGNKWC6.js.map} +0 -0
- /package/dist/{generate-test-plan-Z46W3N3B.js.map → generate-test-plan-PZUNCNN3.js.map} +0 -0
- /package/dist/{graph-4RNURBNP.js.map → graph-GKXD2IGW.js.map} +0 -0
- /package/dist/{mcp-E6PJWBDQ.js.map → mcp-VQAYNJQ7.js.map} +0 -0
- /package/dist/{migrate-FKFC7UAO.js.map → migrate-VASWPA3L.js.map} +0 -0
- /package/dist/{pack-DE4UBTCC.js.map → pack-DFUCNWVR.js.map} +0 -0
- /package/dist/{ready-K74SLQ24.js.map → ready-5OFSV2OD.js.map} +0 -0
- /package/dist/{status-IAE3BB77.js.map → status-5MDODW4N.js.map} +0 -0
- /package/dist/{update-UFOHZEAK.js.map → update-NFXC45UT.js.map} +0 -0
- /package/dist/{validate-EZHUB5TW.js.map → validate-LWRLZR3H.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specdx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Spec-driven development skills for Claude Code",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "umxr",
|
|
7
7
|
"url": "https://github.com/umxr"
|
|
8
8
|
},
|
|
9
|
-
"skills": "./
|
|
9
|
+
"skills": "./skills/core",
|
|
10
10
|
"hooks": "./hooks/hooks.json"
|
|
11
11
|
}
|
package/README.md
CHANGED
|
@@ -93,6 +93,40 @@ lint:
|
|
|
93
93
|
`requires` is what builds the dependency graph, and the graph is what makes
|
|
94
94
|
`diff` able to tell you that changing the PRD stales the test plan.
|
|
95
95
|
|
|
96
|
+
### Linting AGENTS.md and CLAUDE.md
|
|
97
|
+
|
|
98
|
+
specdx also lints the instruction files you already have — no spec suite
|
|
99
|
+
required. In a directory with an `AGENTS.md` or `CLAUDE.md` and no
|
|
100
|
+
`spec.config.yaml` at or above it:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx specdx lint
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
It lints those files alone and says so, in every output format. It checks that
|
|
107
|
+
the file is organised under headings, that every path it names still exists,
|
|
108
|
+
and that it fits a token budget. The middle one is the one that earns its
|
|
109
|
+
keep — a `CLAUDE.md` pointing at a file that moved sends every agent session to
|
|
110
|
+
the wrong place, confidently.
|
|
111
|
+
|
|
112
|
+
The search walks upward, so this fallback is about projects with no spec suite,
|
|
113
|
+
not about directories inside one. Run it in a package of a monorepo whose root
|
|
114
|
+
has a `spec.config.yaml` and specdx uses that config, as it would anywhere else
|
|
115
|
+
in the repo.
|
|
116
|
+
|
|
117
|
+
Once you do have a spec suite, add the `agents` key to lint both together and
|
|
118
|
+
to configure it:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
agents:
|
|
122
|
+
paths: ["AGENTS.md", "CLAUDE.md"]
|
|
123
|
+
max_tokens: 8000
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
These files are not specs. They stay out of the dependency graph, out of
|
|
127
|
+
`pack`, and out of `diff`. In a project *with* a spec suite the `agents` key is
|
|
128
|
+
what switches this on, and the spec presets never promote its findings.
|
|
129
|
+
|
|
96
130
|
**→ [Full configuration reference](docs/configuration.md)** — lint rule
|
|
97
131
|
overrides, custom rules, pack budgets, staleness thresholds, `check` paths.
|
|
98
132
|
|
|
@@ -126,8 +160,14 @@ required sections, cross-references, declared artifacts, and the three sections
|
|
|
126
160
|
|
|
127
161
|
### Claude Code
|
|
128
162
|
|
|
129
|
-
specdx ships as a plugin with **ten skills**. Install it
|
|
130
|
-
|
|
163
|
+
specdx ships as a plugin with **ten skills**. Install it from the marketplace:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
/plugin marketplace add umxr/specdx
|
|
167
|
+
/plugin install specdx@specdx
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Or install it as a dev dependency, and the plugin is discovered automatically:
|
|
131
171
|
|
|
132
172
|
```bash
|
|
133
173
|
npm install -D specdx
|
|
@@ -196,7 +236,7 @@ inline annotations and exits non-zero on failure.
|
|
|
196
236
|
| Command | Description |
|
|
197
237
|
|---------|-------------|
|
|
198
238
|
| `specdx init` | Scaffold a spec suite (`--template lightweight\|bmad\|api-first\|quick\|context`) |
|
|
199
|
-
| `specdx lint` | Lint
|
|
239
|
+
| `specdx lint [path]` | Lint the suite, or just `path` (`--preset`, `--fix`) |
|
|
200
240
|
| `specdx validate` | Validate `spec.config.yaml` |
|
|
201
241
|
| `specdx pack --task <task>` | Pack specs into token-budgeted context (`--copy`, `--full`) |
|
|
202
242
|
| `specdx status` | Spec suite health overview |
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
applyBaseline,
|
|
3
|
+
createBaseline,
|
|
4
|
+
parseBaseline,
|
|
5
|
+
runCheck,
|
|
6
|
+
serializeBaseline
|
|
7
|
+
} from "./chunk-2UUQJ2ER.js";
|
|
4
8
|
import {
|
|
5
9
|
createOutput
|
|
6
10
|
} from "./chunk-NHD44ZYN.js";
|
|
@@ -13,17 +17,20 @@ import {
|
|
|
13
17
|
loadConfig,
|
|
14
18
|
parseSpec,
|
|
15
19
|
resolveGlob
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-JGD3BOPH.js";
|
|
21
|
+
import "./chunk-XRWLPU24.js";
|
|
18
22
|
import "./chunk-5WRI5ZAA.js";
|
|
19
23
|
|
|
20
24
|
// src/commands/experimental/check.ts
|
|
21
25
|
import { defineCommand } from "citty";
|
|
26
|
+
import { readFile, writeFile } from "fs/promises";
|
|
27
|
+
import { isAbsolute, resolve } from "path";
|
|
22
28
|
var FORMATS = ["pretty", "json", "github"];
|
|
29
|
+
var DEFAULT_BASELINE = ".specdx-baseline.json";
|
|
23
30
|
var check_default = defineCommand({
|
|
24
31
|
meta: {
|
|
25
32
|
name: "check",
|
|
26
|
-
description: "Check spec-to-implementation drift. Exit codes: 0 ok, 1 errors found, 3 nothing checkable
|
|
33
|
+
description: "Check spec-to-implementation drift. Exit codes: 0 ok, 1 errors found, 3 nothing checkable, 4 a declared surface could not be read"
|
|
27
34
|
},
|
|
28
35
|
args: {
|
|
29
36
|
...sharedArgs(FORMATS),
|
|
@@ -32,6 +39,18 @@ var check_default = defineCommand({
|
|
|
32
39
|
ai: {
|
|
33
40
|
type: "boolean",
|
|
34
41
|
description: "Use AI to assess findings (requires ANTHROPIC_API_KEY)"
|
|
42
|
+
},
|
|
43
|
+
baseline: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: `Accept the findings recorded in this file; gate only on new ones (default ${DEFAULT_BASELINE})`
|
|
46
|
+
},
|
|
47
|
+
"update-baseline": {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Record the current findings as accepted and write the baseline file"
|
|
50
|
+
},
|
|
51
|
+
"allow-unassessed": {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
description: "Exit 0 even when a declared surface could not be read (default: exit 4)"
|
|
35
54
|
}
|
|
36
55
|
},
|
|
37
56
|
async run({ args }) {
|
|
@@ -62,11 +81,53 @@ var check_default = defineCommand({
|
|
|
62
81
|
};
|
|
63
82
|
logger.debug(`Checking ${specs.length} specs...`);
|
|
64
83
|
const result = await runCheck(specs, configDir, checkConfig);
|
|
84
|
+
const baselineFlag = args.baseline;
|
|
85
|
+
const updateBaseline = Boolean(args["update-baseline"]);
|
|
86
|
+
const baselinePath = typeof baselineFlag === "string" && baselineFlag !== "" ? baselineFlag : DEFAULT_BASELINE;
|
|
87
|
+
const baselineFile = isAbsolute(baselinePath) ? baselinePath : resolve(configDir, baselinePath);
|
|
88
|
+
if (updateBaseline) {
|
|
89
|
+
const baseline = createBaseline(result.findings);
|
|
90
|
+
await writeFile(baselineFile, serializeBaseline(baseline), "utf-8");
|
|
91
|
+
output.info(
|
|
92
|
+
`
|
|
93
|
+
\u2713 recorded ${baseline.entries.length} accepted finding${baseline.entries.length === 1 ? "" : "s"} to ${baselinePath}
|
|
94
|
+
`
|
|
95
|
+
);
|
|
96
|
+
output.info(
|
|
97
|
+
" The coverage score still counts them. Only new findings will fail the build.\n"
|
|
98
|
+
);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
let application = null;
|
|
102
|
+
if (baselineFlag !== void 0) {
|
|
103
|
+
let source;
|
|
104
|
+
try {
|
|
105
|
+
source = await readFile(baselineFile, "utf-8");
|
|
106
|
+
} catch {
|
|
107
|
+
console.error(
|
|
108
|
+
`
|
|
109
|
+
\u2717 baseline file not found: ${baselinePath}
|
|
110
|
+
Create it with: specdx check --update-baseline
|
|
111
|
+
`
|
|
112
|
+
);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
application = applyBaseline(result.findings, parseBaseline(source));
|
|
117
|
+
} catch (err) {
|
|
118
|
+
console.error(`
|
|
119
|
+
\u2717 ${err.message} (${baselinePath})
|
|
120
|
+
`);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const gating = application ? application.remaining : result.findings;
|
|
125
|
+
const exitCode = gating.some((f) => f.severity === "error") ? 1 : !result.score.assessed ? 3 : result.unassessed.length > 0 && !args["allow-unassessed"] ? 4 : 0;
|
|
65
126
|
if (args.ai) {
|
|
66
|
-
const { analyzeWithAi } = await import("./dist-
|
|
127
|
+
const { analyzeWithAi } = await import("./dist-6WDWUOCV.js");
|
|
67
128
|
let aiResult;
|
|
68
129
|
try {
|
|
69
|
-
aiResult = await analyzeWithAi(
|
|
130
|
+
aiResult = await analyzeWithAi(gating, args.spec ?? "full suite check");
|
|
70
131
|
} catch (err) {
|
|
71
132
|
console.error(`
|
|
72
133
|
\u2717 ${err.message}
|
|
@@ -82,7 +143,7 @@ var check_default = defineCommand({
|
|
|
82
143
|
console.log(` AI Assessment: ${aiResult.summary}
|
|
83
144
|
`);
|
|
84
145
|
for (const assessment of aiResult.assessments) {
|
|
85
|
-
const finding =
|
|
146
|
+
const finding = gating[assessment.findingIndex];
|
|
86
147
|
if (!finding) continue;
|
|
87
148
|
const icon = assessment.isRealIssue ? "\u2717" : "\u2713";
|
|
88
149
|
const label = assessment.isRealIssue ? "REAL" : "FALSE POSITIVE";
|
|
@@ -99,8 +160,13 @@ var check_default = defineCommand({
|
|
|
99
160
|
}
|
|
100
161
|
return;
|
|
101
162
|
}
|
|
163
|
+
const baselineReport = application ? {
|
|
164
|
+
path: baselinePath,
|
|
165
|
+
accepted: application.suppressed.length,
|
|
166
|
+
obsolete: application.obsolete
|
|
167
|
+
} : null;
|
|
102
168
|
if (format.format === "json") {
|
|
103
|
-
console.log(JSON.stringify(result, null, 2));
|
|
169
|
+
console.log(JSON.stringify({ ...result, gating, baseline: baselineReport }, null, 2));
|
|
104
170
|
} else if (format.format === "github") {
|
|
105
171
|
console.log(
|
|
106
172
|
`::notice::specdx check \u2014 ${result.score.assessed ? `${result.score.overall}% implementation coverage` : "coverage not assessed \u2014 no checkable surfaces found"}`
|
|
@@ -108,7 +174,17 @@ var check_default = defineCommand({
|
|
|
108
174
|
for (const note of result.notes) {
|
|
109
175
|
console.log(`::notice::${note}`);
|
|
110
176
|
}
|
|
111
|
-
|
|
177
|
+
if (baselineReport) {
|
|
178
|
+
console.log(
|
|
179
|
+
`::notice::${baselineReport.accepted} finding(s) accepted by ${baselineReport.path} \u2014 still counted in coverage, not gating`
|
|
180
|
+
);
|
|
181
|
+
if (baselineReport.obsolete.length > 0) {
|
|
182
|
+
console.log(
|
|
183
|
+
`::notice::${baselineReport.obsolete.length} baseline entr(ies) no longer occur \u2014 re-record with --update-baseline`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
for (const f of gating) {
|
|
112
188
|
const level = f.severity === "error" ? "error" : f.severity === "warn" ? "warning" : "notice";
|
|
113
189
|
const location = f.codeLocation ? ` file=${f.codeLocation.file},line=${f.codeLocation.line}` : "";
|
|
114
190
|
const detail = f.actual ? ` \u2014 ${f.actual}` : "";
|
|
@@ -127,22 +203,37 @@ var check_default = defineCommand({
|
|
|
127
203
|
const fmt = (n) => n === null ? "not scanned" : `${n} found`;
|
|
128
204
|
output.out(` Scanned: framework=${result.scanned.framework ?? "none detected"}`);
|
|
129
205
|
output.out(` routes: ${fmt(result.scanned.codeRoutes)}`);
|
|
130
|
-
|
|
206
|
+
const typesPending = result.scanned.typesPending > 0 ? `, ${result.scanned.typesPending} pending` : "";
|
|
207
|
+
output.out(` types: ${fmt(result.scanned.codeTypes)}${typesPending}`);
|
|
131
208
|
output.out(` tests: ${fmt(result.scanned.codeTests)}`);
|
|
132
209
|
const artifacts = result.scanned.artifacts === null ? "none declared" : `${result.scanned.artifacts} assessed`;
|
|
133
210
|
const pending = result.scanned.artifactsPending > 0 ? `, ${result.scanned.artifactsPending} pending` : "";
|
|
134
211
|
output.out(` artifacts: ${artifacts}${pending}
|
|
135
212
|
`);
|
|
136
213
|
}
|
|
214
|
+
if (baselineReport) {
|
|
215
|
+
output.info(
|
|
216
|
+
` ${baselineReport.accepted} finding${baselineReport.accepted === 1 ? "" : "s"} accepted by ${baselineReport.path} \u2014 counted in coverage above, not gating`
|
|
217
|
+
);
|
|
218
|
+
const stale = baselineReport.obsolete.length;
|
|
219
|
+
if (stale > 0) {
|
|
220
|
+
output.info(
|
|
221
|
+
` ${stale} baseline ${stale === 1 ? "entry no longer occurs" : "entries no longer occur"} \u2014 re-record with --update-baseline`
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
output.info("");
|
|
225
|
+
}
|
|
137
226
|
for (const [category, stats] of Object.entries(result.score.byCategory)) {
|
|
138
227
|
if (stats.total === 0) continue;
|
|
139
|
-
const categoryFindings =
|
|
140
|
-
|
|
141
|
-
)
|
|
142
|
-
const header = ` ${category} (${stats.matched}/${stats.total}):`;
|
|
228
|
+
const categoryFindings = gating.filter((f) => f.category === category.replace(/s$/, ""));
|
|
229
|
+
const advisory = category === "tests" ? " \u2014 advisory, not scored" : "";
|
|
230
|
+
const header = ` ${category} (${stats.matched}/${stats.total})${advisory}:`;
|
|
143
231
|
if (categoryFindings.length === 0) {
|
|
144
232
|
output.info(header);
|
|
145
|
-
|
|
233
|
+
const acceptedHere = application ? application.suppressed.filter((f) => f.category === category.replace(/s$/, "")).length : 0;
|
|
234
|
+
output.info(
|
|
235
|
+
acceptedHere > 0 ? ` \u2713 no new findings (${acceptedHere} accepted by baseline)` : " \u2713 all matched"
|
|
236
|
+
);
|
|
146
237
|
continue;
|
|
147
238
|
}
|
|
148
239
|
output.out(header);
|
|
@@ -153,22 +244,25 @@ var check_default = defineCommand({
|
|
|
153
244
|
output.out(` ${icon} ${f.expected}${detail}${suggestion}`);
|
|
154
245
|
}
|
|
155
246
|
}
|
|
156
|
-
const errors =
|
|
157
|
-
const warnings =
|
|
158
|
-
const info =
|
|
247
|
+
const errors = gating.filter((f) => f.severity === "error").length;
|
|
248
|
+
const warnings = gating.filter((f) => f.severity === "warn").length;
|
|
249
|
+
const info = gating.filter((f) => f.severity === "info").length;
|
|
159
250
|
output.info(`
|
|
160
|
-
${errors} errors, ${warnings} warnings, ${info} info
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
251
|
+
${errors} errors, ${warnings} warnings, ${info} info`);
|
|
252
|
+
if (exitCode === 4) {
|
|
253
|
+
output.info(
|
|
254
|
+
` ${result.unassessed.length} declared surface${result.unassessed.length === 1 ? "" : "s"} could not be read \u2014 the coverage above excludes ${result.unassessed.length === 1 ? "it" : "them"} (exit 4).`
|
|
255
|
+
);
|
|
256
|
+
output.info(" Fix the shapes named above, or pass --allow-unassessed to accept it.");
|
|
257
|
+
}
|
|
258
|
+
output.info("");
|
|
165
259
|
}
|
|
166
|
-
if (
|
|
167
|
-
process.exit(
|
|
260
|
+
if (exitCode !== 0) {
|
|
261
|
+
process.exit(exitCode);
|
|
168
262
|
}
|
|
169
263
|
}
|
|
170
264
|
});
|
|
171
265
|
export {
|
|
172
266
|
check_default as default
|
|
173
267
|
};
|
|
174
|
-
//# sourceMappingURL=check-
|
|
268
|
+
//# sourceMappingURL=check-5EA2MTNN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/experimental/check.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { isAbsolute, resolve } from \"node:path\";\nimport { loadConfig, parseSpec, resolveGlob, createLogger } from \"@specdx/core\";\nimport {\n runCheck,\n applyBaseline,\n createBaseline,\n parseBaseline,\n serializeBaseline,\n} from \"@specdx/check\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport type { CheckConfig, BaselineApplication } from \"@specdx/check\";\nimport { sharedArgs, resolveFormat } from \"../../shared-args.js\";\nimport { createOutput } from \"../../output.js\";\n\nconst FORMATS = [\"pretty\", \"json\", \"github\"] as const;\n\n/** Where a baseline lives when the flag names no path. */\nconst DEFAULT_BASELINE = \".specdx-baseline.json\";\n\nexport default defineCommand({\n meta: {\n name: \"check\",\n description:\n \"Check spec-to-implementation drift. Exit codes: 0 ok, 1 errors found, 3 nothing checkable, 4 a declared surface could not be read\",\n },\n args: {\n ...sharedArgs(FORMATS),\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: \"Use AI to assess findings (requires ANTHROPIC_API_KEY)\",\n },\n baseline: {\n type: \"string\",\n description: `Accept the findings recorded in this file; gate only on new ones (default ${DEFAULT_BASELINE})`,\n },\n \"update-baseline\": {\n type: \"boolean\",\n description: \"Record the current findings as accepted and write the baseline file\",\n },\n \"allow-unassessed\": {\n type: \"boolean\",\n description: \"Exit 0 even when a declared surface could not be read (default: exit 4)\",\n },\n },\n async run({ args }) {\n const format = resolveFormat(args.format, FORMATS);\n if (!format.ok) {\n console.error(`\\n ✗ ${format.message}\\n`);\n process.exit(1);\n }\n\n const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });\n const output = createOutput({ quiet: args.quiet });\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 // Baseline. Only ever narrows what *gates* the build — the score above is\n // computed over every finding, baselined or not, so adopting a baseline on\n // an existing project cannot report it as suddenly complete.\n const baselineFlag = args.baseline;\n const updateBaseline = Boolean(args[\"update-baseline\"]);\n // `--baseline` with no value arrives as boolean true, not \"\", so a string\n // check alone crashed in path.isAbsolute.\n const baselinePath =\n typeof baselineFlag === \"string\" && baselineFlag !== \"\" ? baselineFlag : DEFAULT_BASELINE;\n const baselineFile = isAbsolute(baselinePath) ? baselinePath : resolve(configDir, baselinePath);\n\n if (updateBaseline) {\n const baseline = createBaseline(result.findings);\n await writeFile(baselineFile, serializeBaseline(baseline), \"utf-8\");\n output.info(\n `\\n ✓ recorded ${baseline.entries.length} accepted finding${\n baseline.entries.length === 1 ? \"\" : \"s\"\n } to ${baselinePath}\\n`,\n );\n output.info(\n \" The coverage score still counts them. Only new findings will fail the build.\\n\",\n );\n return;\n }\n\n let application: BaselineApplication | null = null;\n if (baselineFlag !== undefined) {\n let source: string;\n try {\n source = await readFile(baselineFile, \"utf-8\");\n } catch {\n // Silently continuing with no baseline would gate every pre-existing\n // finding and read as a wall of new drift.\n console.error(\n `\\n ✗ baseline file not found: ${baselinePath}\\n` +\n \" Create it with: specdx check --update-baseline\\n\",\n );\n process.exit(1);\n }\n try {\n application = applyBaseline(result.findings, parseBaseline(source));\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message} (${baselinePath})\\n`);\n process.exit(1);\n }\n }\n\n // What gates, and what the report lists. The score stays on every finding.\n const gating = application ? application.remaining : result.findings;\n\n // Decided once, before anything is printed, so the report cannot name an\n // exit code the process does not then use.\n // 1 errors 3 nothing checkable 4 a declared surface could not be read\n const exitCode = gating.some((f) => f.severity === \"error\")\n ? 1\n : !result.score.assessed\n ? 3\n : result.unassessed.length > 0 && !args[\"allow-unassessed\"]\n ? 4\n : 0;\n\n // AI analysis (opt-in)\n if (args.ai) {\n const { analyzeWithAi } = await import(\"@specdx/check\");\n // A missing key is a user error, not a crash. It used to surface as an\n // uncaught Error with the full Node trace through citty, where every\n // other user-error path in the CLI prints \"✗ …\" (audit run 5, F7).\n let aiResult;\n try {\n aiResult = await analyzeWithAi(gating, args.spec ?? \"full suite check\");\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message}\\n`);\n process.exit(1);\n }\n\n if (format.format === \"json\") {\n console.log(JSON.stringify({ ...result, ai: aiResult }, null, 2));\n } else {\n console.log(`\\n specdx check --ai — ${result.score.overall}% coverage\\n`);\n console.log(` AI Assessment: ${aiResult.summary}\\n`);\n\n for (const assessment of aiResult.assessments) {\n // `findingIndex` indexes what was handed to the assessor, which is\n // the gating set — indexing the full list would mislabel findings\n // whenever a baseline suppressed anything.\n const finding = gating[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 const baselineReport = application\n ? {\n path: baselinePath,\n accepted: application.suppressed.length,\n obsolete: application.obsolete,\n }\n : null;\n\n if (format.format === \"json\") {\n console.log(JSON.stringify({ ...result, gating, baseline: baselineReport }, null, 2));\n } else if (format.format === \"github\") {\n // Annotations for CI. A finding about missing code has no file to point\n // at, so the spec ID carries the location instead. The headline always\n // prints: a clean or unassessable run must still say something, or the\n // format is silent for exactly the projects that most need telling.\n console.log(\n `::notice::specdx check — ${\n result.score.assessed\n ? `${result.score.overall}% implementation coverage`\n : \"coverage not assessed — no checkable surfaces found\"\n }`,\n );\n for (const note of result.notes) {\n console.log(`::notice::${note}`);\n }\n if (baselineReport) {\n console.log(\n `::notice::${baselineReport.accepted} finding(s) accepted by ${baselineReport.path} — still counted in coverage, not gating`,\n );\n if (baselineReport.obsolete.length > 0) {\n console.log(\n `::notice::${baselineReport.obsolete.length} baseline entr(ies) no longer occur — re-record with --update-baseline`,\n );\n }\n }\n for (const f of gating) {\n const level =\n f.severity === \"error\" ? \"error\" : f.severity === \"warn\" ? \"warning\" : \"notice\";\n const location = f.codeLocation\n ? ` file=${f.codeLocation.file},line=${f.codeLocation.line}`\n : \"\";\n const detail = f.actual ? ` — ${f.actual}` : \"\";\n console.log(`::${level}${location}::[${f.specId}] ${f.expected}${detail}`);\n }\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 output.info(`\\n specdx check — ${headline}\\n`);\n\n for (const note of result.notes) {\n output.out(` ⚠ ${note}`);\n }\n if (result.notes.length > 0) output.out();\n\n if (args.verbose) {\n const fmt = (n: number | null) => (n === null ? \"not scanned\" : `${n} found`);\n output.out(` Scanned: framework=${result.scanned.framework ?? \"none detected\"}`);\n output.out(` routes: ${fmt(result.scanned.codeRoutes)}`);\n const typesPending =\n result.scanned.typesPending > 0 ? `, ${result.scanned.typesPending} pending` : \"\";\n output.out(` types: ${fmt(result.scanned.codeTypes)}${typesPending}`);\n output.out(` tests: ${fmt(result.scanned.codeTests)}`);\n // \"assessed\", not \"verified\": this counts the assertions considered,\n // and a failed one is reported below. Calling six verified while the\n // next line says 5/6 made the output contradict itself (F6).\n const artifacts =\n result.scanned.artifacts === null\n ? \"none declared\"\n : `${result.scanned.artifacts} assessed`;\n const pending =\n result.scanned.artifactsPending > 0 ? `, ${result.scanned.artifactsPending} pending` : \"\";\n output.out(` artifacts: ${artifacts}${pending}\\n`);\n }\n\n if (baselineReport) {\n output.info(\n ` ${baselineReport.accepted} finding${\n baselineReport.accepted === 1 ? \"\" : \"s\"\n } accepted by ${baselineReport.path} — counted in coverage above, not gating`,\n );\n const stale = baselineReport.obsolete.length;\n if (stale > 0) {\n output.info(\n ` ${stale} baseline ${stale === 1 ? \"entry no longer occurs\" : \"entries no longer occur\"} — re-record with --update-baseline`,\n );\n }\n output.info(\"\");\n }\n\n for (const [category, stats] of Object.entries(result.score.byCategory)) {\n if (stats.total === 0) continue;\n const categoryFindings = gating.filter((f) => f.category === category.replace(/s$/, \"\"));\n // Tests are matched by prose similarity, which is too weak to score on;\n // saying so keeps the arithmetic above explicable.\n const advisory = category === \"tests\" ? \" — advisory, not scored\" : \"\";\n const header = ` ${category} (${stats.matched}/${stats.total})${advisory}:`;\n if (categoryFindings.length === 0) {\n output.info(header);\n // \"all matched\" under a 2/3 header contradicts itself. When a baseline\n // is what emptied the list, the honest line names it.\n const acceptedHere = application\n ? application.suppressed.filter((f) => f.category === category.replace(/s$/, \"\")).length\n : 0;\n output.info(\n acceptedHere > 0\n ? ` ✓ no new findings (${acceptedHere} accepted by baseline)`\n : \" ✓ all matched\",\n );\n continue;\n }\n output.out(header);\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 output.out(` ${icon} ${f.expected}${detail}${suggestion}`);\n }\n }\n\n const errors = gating.filter((f) => f.severity === \"error\").length;\n const warnings = gating.filter((f) => f.severity === \"warn\").length;\n const info = gating.filter((f) => f.severity === \"info\").length;\n output.info(`\\n ${errors} errors, ${warnings} warnings, ${info} info`);\n\n if (exitCode === 4) {\n output.info(\n ` ${result.unassessed.length} declared surface${\n result.unassessed.length === 1 ? \"\" : \"s\"\n } could not be read — the coverage above excludes ${\n result.unassessed.length === 1 ? \"it\" : \"them\"\n } (exit 4).`,\n );\n output.info(\" Fix the shapes named above, or pass --allow-unassessed to accept it.\");\n }\n output.info(\"\");\n }\n\n // Distinct codes so CI cannot mistake \"nothing was checkable\" or \"could not\n // look\" for a pass. An unreadable surface leaves the score's denominator\n // silently, which *raises* the percentage — exiting 0 there is the same\n // conflation issue #6 fixed for the whole-run case, still live per surface.\n if (exitCode !== 0) {\n process.exit(exitCode);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,iBAAiB;AACpC,SAAS,YAAY,eAAe;AAcpC,IAAM,UAAU,CAAC,UAAU,QAAQ,QAAQ;AAG3C,IAAM,mBAAmB;AAEzB,IAAO,gBAAQ,cAAc;AAAA,EAC3B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,GAAG,WAAW,OAAO;AAAA,IACrB,MAAM,EAAE,MAAM,UAAU,aAAa,8BAA8B;AAAA,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