specdx 0.4.0-alpha.9 → 0.4.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.
Files changed (114) hide show
  1. package/.claude-plugin/plugin.json +7 -2
  2. package/README.md +259 -0
  3. package/dist/{check-4FSSC6HN.js → check-PHXXA7VY.js} +68 -30
  4. package/dist/check-PHXXA7VY.js.map +1 -0
  5. package/dist/chunk-2BZIG7OE.js +185 -0
  6. package/dist/chunk-2BZIG7OE.js.map +1 -0
  7. package/dist/{chunk-N77RNV7J.js → chunk-3YXRWQGX.js} +217 -42
  8. package/dist/chunk-3YXRWQGX.js.map +1 -0
  9. package/dist/chunk-5WRI5ZAA.js +31 -0
  10. package/dist/chunk-DMGABJ6T.js +41 -0
  11. package/dist/chunk-DMGABJ6T.js.map +1 -0
  12. package/dist/{chunk-7JXW2GTJ.js → chunk-HCJDCS26.js} +9 -2
  13. package/dist/chunk-HCJDCS26.js.map +1 -0
  14. package/dist/chunk-LJTLNXGV.js +835 -0
  15. package/dist/chunk-LJTLNXGV.js.map +1 -0
  16. package/dist/chunk-NAWYG4VV.js +2846 -0
  17. package/dist/chunk-NAWYG4VV.js.map +1 -0
  18. package/dist/chunk-NHD44ZYN.js +20 -0
  19. package/dist/chunk-NHD44ZYN.js.map +1 -0
  20. package/dist/chunk-OVIKIIR4.js +103 -0
  21. package/dist/chunk-OVIKIIR4.js.map +1 -0
  22. package/dist/{chunk-IHTYAW7C.js → chunk-SNQNQ2MP.js} +111 -7
  23. package/dist/chunk-SNQNQ2MP.js.map +1 -0
  24. package/dist/{chunk-AKNPCB37.js → chunk-YRQPY5NF.js} +32 -12
  25. package/dist/chunk-YRQPY5NF.js.map +1 -0
  26. package/dist/diff-6C5LJ7SH.js +200 -0
  27. package/dist/diff-6C5LJ7SH.js.map +1 -0
  28. package/dist/{dist-4DIRTBJH.js → dist-PK52GA7M.js} +43 -20
  29. package/dist/dist-PK52GA7M.js.map +1 -0
  30. package/dist/{dist-RL2DT3ZE.js → dist-ROHCFKYT.js} +3 -2
  31. package/dist/dist-ROHCFKYT.js.map +1 -0
  32. package/dist/generate-K72WD455.js +21 -0
  33. package/dist/generate-K72WD455.js.map +1 -0
  34. package/dist/{generate-story-EFHGINHA.js → generate-story-NUCNYL3I.js} +43 -19
  35. package/dist/generate-story-NUCNYL3I.js.map +1 -0
  36. package/dist/{generate-test-plan-BO7444RG.js → generate-test-plan-Z46W3N3B.js} +61 -11
  37. package/dist/generate-test-plan-Z46W3N3B.js.map +1 -0
  38. package/dist/{graph-5XINV7PT.js → graph-4RNURBNP.js} +49 -11
  39. package/dist/graph-4RNURBNP.js.map +1 -0
  40. package/dist/index.d.ts +275 -0
  41. package/dist/index.js +2660 -371
  42. package/dist/index.js.map +1 -1
  43. package/dist/{lint-PTMWMLDQ.js → lint-2VZPNLE3.js} +46 -18
  44. package/dist/lint-2VZPNLE3.js.map +1 -0
  45. package/dist/main.js +10 -229
  46. package/dist/main.js.map +1 -1
  47. package/dist/mcp-E6PJWBDQ.js +35 -0
  48. package/dist/mcp-E6PJWBDQ.js.map +1 -0
  49. package/dist/{migrate-4KF6GHLO.js → migrate-FKFC7UAO.js} +21 -9
  50. package/dist/migrate-FKFC7UAO.js.map +1 -0
  51. package/dist/{pack-DSOODXAN.js → pack-DE4UBTCC.js} +41 -13
  52. package/dist/pack-DE4UBTCC.js.map +1 -0
  53. package/dist/{ready-6DNKIHP6.js → ready-K74SLQ24.js} +55 -14
  54. package/dist/ready-K74SLQ24.js.map +1 -0
  55. package/dist/skills/{specdx-author-spec.md → core/specdx-author-spec/SKILL.md} +10 -6
  56. package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-01-frontmatter.md +1 -1
  57. package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-02-sections.md +41 -0
  58. package/dist/skills/{specdx-onboard.md → core/specdx-onboard/SKILL.md} +8 -3
  59. package/dist/skills/{specdx-plan-from-spec.md → core/specdx-plan-from-spec/SKILL.md} +5 -1
  60. package/dist/skills/{specdx-pre-commit.md → core/specdx-pre-commit/SKILL.md} +16 -2
  61. package/dist/skills/{specdx-review-spec.md → core/specdx-review-spec/SKILL.md} +5 -1
  62. package/dist/skills/core/specdx-router/SKILL.md +67 -0
  63. package/dist/skills/{specdx-sprint-review.md → core/specdx-sprint-review/SKILL.md} +6 -2
  64. package/dist/skills/{specdx-start-task.md → core/specdx-start-task/SKILL.md} +5 -1
  65. package/dist/skills/{specdx-check-drift.md → experimental/specdx-check-drift/SKILL.md} +10 -4
  66. package/dist/skills/{specdx-verify.md → experimental/specdx-verify/SKILL.md} +6 -2
  67. package/dist/skills-36SRUEMR.js +121 -0
  68. package/dist/skills-36SRUEMR.js.map +1 -0
  69. package/dist/{status-WZK247CI.js → status-IAE3BB77.js} +63 -32
  70. package/dist/status-IAE3BB77.js.map +1 -0
  71. package/dist/{update-JTNSYX3B.js → update-UFOHZEAK.js} +22 -12
  72. package/dist/update-UFOHZEAK.js.map +1 -0
  73. package/dist/{validate-LBDYWUDX.js → validate-EZHUB5TW.js} +36 -17
  74. package/dist/validate-EZHUB5TW.js.map +1 -0
  75. package/hooks/hooks.json +12 -6
  76. package/hooks/session-start +35 -3
  77. package/package.json +28 -13
  78. package/dist/changelog-XUVHY3QK.js +0 -93
  79. package/dist/changelog-XUVHY3QK.js.map +0 -1
  80. package/dist/check-4FSSC6HN.js.map +0 -1
  81. package/dist/chunk-7JXW2GTJ.js.map +0 -1
  82. package/dist/chunk-AKNPCB37.js.map +0 -1
  83. package/dist/chunk-DAZCOUVK.js +0 -496
  84. package/dist/chunk-DAZCOUVK.js.map +0 -1
  85. package/dist/chunk-GAM4MXPC.js +0 -15
  86. package/dist/chunk-GAM4MXPC.js.map +0 -1
  87. package/dist/chunk-IHTYAW7C.js.map +0 -1
  88. package/dist/chunk-N77RNV7J.js.map +0 -1
  89. package/dist/chunk-SRZ33RJP.js +0 -1147
  90. package/dist/chunk-SRZ33RJP.js.map +0 -1
  91. package/dist/diff-OXZ34NU4.js +0 -107
  92. package/dist/diff-OXZ34NU4.js.map +0 -1
  93. package/dist/dist-4DIRTBJH.js.map +0 -1
  94. package/dist/explain-QBV3AESQ.js +0 -109
  95. package/dist/explain-QBV3AESQ.js.map +0 -1
  96. package/dist/generate-7GNPT2WJ.js +0 -13
  97. package/dist/generate-7GNPT2WJ.js.map +0 -1
  98. package/dist/generate-story-EFHGINHA.js.map +0 -1
  99. package/dist/generate-test-plan-BO7444RG.js.map +0 -1
  100. package/dist/graph-5XINV7PT.js.map +0 -1
  101. package/dist/lint-PTMWMLDQ.js.map +0 -1
  102. package/dist/mcp-BGFAPM6G.js +0 -17
  103. package/dist/mcp-BGFAPM6G.js.map +0 -1
  104. package/dist/migrate-4KF6GHLO.js.map +0 -1
  105. package/dist/pack-DSOODXAN.js.map +0 -1
  106. package/dist/ready-6DNKIHP6.js.map +0 -1
  107. package/dist/skills-3GBBWZW2.js +0 -93
  108. package/dist/skills-3GBBWZW2.js.map +0 -1
  109. package/dist/status-WZK247CI.js.map +0 -1
  110. package/dist/update-JTNSYX3B.js.map +0 -1
  111. package/dist/validate-LBDYWUDX.js.map +0 -1
  112. /package/dist/{dist-RL2DT3ZE.js.map → chunk-5WRI5ZAA.js.map} +0 -0
  113. /package/dist/skills/{spec-type-reference.md → core/specdx-author-spec/references/spec-type-reference.md} +0 -0
  114. /package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-03-finalize.md +0 -0
@@ -1,496 +0,0 @@
1
- import {
2
- REQUIRED_SECTIONS
3
- } from "./chunk-7JXW2GTJ.js";
4
-
5
- // ../lint/dist/engine.js
6
- function createLintEngine(options) {
7
- return {
8
- lint(specs) {
9
- const diagnostics = [];
10
- for (const spec of specs) {
11
- for (const rule of options.rules) {
12
- const results = rule.run({
13
- spec,
14
- allSpecs: specs,
15
- config: options.config,
16
- graph: options.graph
17
- });
18
- diagnostics.push(...results);
19
- }
20
- }
21
- return {
22
- diagnostics,
23
- hasErrors: diagnostics.some((d) => d.severity === "error"),
24
- hasWarnings: diagnostics.some((d) => d.severity === "warn")
25
- };
26
- }
27
- };
28
- }
29
-
30
- // ../lint/dist/rules/valid-frontmatter.js
31
- var validFrontmatterRule = {
32
- id: "structure/valid-frontmatter",
33
- description: "Frontmatter matches the schema for the declared spec type",
34
- severity: "error",
35
- run(context) {
36
- if (context.spec.valid)
37
- return [];
38
- const errors = context.spec.validationErrors ?? [];
39
- return errors.map((err) => ({
40
- ruleId: "structure/valid-frontmatter",
41
- severity: "error",
42
- message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,
43
- filePath: context.spec.filePath
44
- }));
45
- }
46
- };
47
-
48
- // ../lint/dist/rules/required-sections.js
49
- var requiredSectionsRule = {
50
- id: "structure/required-sections",
51
- description: "Spec body contains all required sections for its type",
52
- severity: "error",
53
- run(context) {
54
- const ext = context.spec.filePath.split(".").pop()?.toLowerCase();
55
- if (ext === "yaml" || ext === "yml")
56
- return [];
57
- const specType = context.spec.frontmatter.type;
58
- const required = REQUIRED_SECTIONS[specType];
59
- if (!required)
60
- return [];
61
- const missing = required.filter((s) => !context.spec.sections.includes(s));
62
- return missing.map((section) => ({
63
- ruleId: "structure/required-sections",
64
- severity: "error",
65
- message: `Missing required section: "${section}"`,
66
- filePath: context.spec.filePath,
67
- section
68
- }));
69
- }
70
- };
71
-
72
- // ../lint/dist/rules/valid-references.js
73
- var validReferencesRule = {
74
- id: "structure/valid-references",
75
- description: "All references in frontmatter point to specs that exist in the suite",
76
- severity: "error",
77
- run(context) {
78
- const refs = context.spec.frontmatter.references;
79
- if (!refs || refs.length === 0)
80
- return [];
81
- const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));
82
- return refs.filter((ref) => !allIds.has(ref.id)).map((ref) => ({
83
- ruleId: "structure/valid-references",
84
- severity: "error",
85
- message: `Reference "${ref.id}" does not match any spec in the suite`,
86
- filePath: context.spec.filePath
87
- }));
88
- }
89
- };
90
-
91
- // ../lint/dist/rules/no-circular-deps.js
92
- var noCircularDepsRule = {
93
- id: "structure/no-circular-deps",
94
- description: "The dependency graph has no cycles",
95
- severity: "error",
96
- run() {
97
- return [];
98
- }
99
- };
100
-
101
- // ../lint/dist/rules/story-coverage.js
102
- var FEATURE_PATTERN = /\*\*F\d+\*\*:\s*(.+)/g;
103
- var storyCoverageRule = {
104
- id: "completeness/story-coverage",
105
- description: "Every feature listed in a PRD has at least one corresponding user story",
106
- severity: "warn",
107
- run(context) {
108
- if (context.spec.frontmatter.type !== "prd")
109
- return [];
110
- const features = [];
111
- let match;
112
- const re = new RegExp(FEATURE_PATTERN.source, "g");
113
- while ((match = re.exec(context.spec.content)) !== null) {
114
- features.push(match[1].trim());
115
- }
116
- if (features.length === 0)
117
- return [];
118
- const stories = context.allSpecs.filter((s) => s.frontmatter.type === "user-story");
119
- const storyContent = stories.map((s) => s.content + " " + s.frontmatter.title).join(" ");
120
- return features.filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase())).map((feature) => ({
121
- ruleId: "completeness/story-coverage",
122
- severity: "warn",
123
- message: `Feature "${feature}" has no corresponding user story`,
124
- filePath: context.spec.filePath
125
- }));
126
- }
127
- };
128
-
129
- // ../lint/dist/rules/staleness-check.js
130
- var stalenessCheckRule = {
131
- id: "freshness/staleness-check",
132
- description: "Warns if a spec hasn't been updated since its upstream dependency changed",
133
- severity: "warn",
134
- run(context) {
135
- const refs = context.spec.frontmatter.references;
136
- if (!refs || refs.length === 0)
137
- return [];
138
- const specUpdated = context.spec.frontmatter.updated ?? context.spec.frontmatter.created;
139
- const specDate = new Date(specUpdated);
140
- const diagnostics = [];
141
- for (const ref of refs) {
142
- if (ref.relationship !== "depends-on" && ref.relationship !== "implemented-by")
143
- continue;
144
- const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);
145
- if (!upstream)
146
- continue;
147
- const upstreamUpdated = upstream.frontmatter.updated ?? upstream.frontmatter.created;
148
- const upstreamDate = new Date(upstreamUpdated);
149
- if (upstreamDate > specDate) {
150
- diagnostics.push({
151
- ruleId: "freshness/staleness-check",
152
- severity: "warn",
153
- message: `Potentially stale: upstream "${upstream.frontmatter.id}" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,
154
- filePath: context.spec.filePath
155
- });
156
- }
157
- }
158
- return diagnostics;
159
- }
160
- };
161
-
162
- // ../lint/dist/rules/no-vague-language.js
163
- var DEFAULT_VAGUE_PATTERNS = [
164
- "as appropriate",
165
- "handle edge cases",
166
- "as needed",
167
- "etc\\.",
168
- "TBD",
169
- "TODO",
170
- "and so on",
171
- "various",
172
- "somehow",
173
- "straightforward",
174
- "obviously",
175
- "simply",
176
- "just need to"
177
- ];
178
- var noVagueLanguageRule = {
179
- id: "clarity/no-vague-language",
180
- description: "Flags known ambiguous phrases",
181
- severity: "warn",
182
- run(context) {
183
- if (!context.spec.content)
184
- return [];
185
- const diagnostics = [];
186
- for (const pattern of DEFAULT_VAGUE_PATTERNS) {
187
- const regex = new RegExp(`\\b${pattern}`, "gi");
188
- let match;
189
- while ((match = regex.exec(context.spec.content)) !== null) {
190
- diagnostics.push({
191
- ruleId: "clarity/no-vague-language",
192
- severity: "warn",
193
- message: `Vague language: "${match[0]}"`,
194
- filePath: context.spec.filePath
195
- });
196
- }
197
- }
198
- return diagnostics;
199
- }
200
- };
201
-
202
- // ../lint/dist/rules/single-project-context.js
203
- var singleProjectContextRule = {
204
- id: "structure/single-project-context",
205
- description: "Only one project-context spec should exist per suite",
206
- severity: "warn",
207
- run(context) {
208
- if (context.spec.frontmatter.type !== "project-context")
209
- return [];
210
- const contextSpecs = context.allSpecs.filter((s) => s.frontmatter.type === "project-context");
211
- if (contextSpecs.length > 1) {
212
- return [
213
- {
214
- ruleId: "structure/single-project-context",
215
- severity: "warn",
216
- message: `Multiple project-context specs found (${contextSpecs.length}). Only one should exist per suite.`,
217
- filePath: context.spec.filePath
218
- }
219
- ];
220
- }
221
- return [];
222
- }
223
- };
224
-
225
- // ../lint/dist/rules/terminology.js
226
- function normalizeCompound(term) {
227
- return term.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]/g, " ").toLowerCase().trim();
228
- }
229
- function extractCompoundTerms(content) {
230
- const terms = [];
231
- const camelCaseRegex = /\b[a-zA-Z]*[a-z][A-Z][a-zA-Z]*\b/g;
232
- let match;
233
- while ((match = camelCaseRegex.exec(content)) !== null) {
234
- terms.push(match[0]);
235
- }
236
- const hyphenatedRegex = /\b[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)+\b/g;
237
- while ((match = hyphenatedRegex.exec(content)) !== null) {
238
- terms.push(match[0]);
239
- }
240
- return terms;
241
- }
242
- var terminologyRule = {
243
- id: "consistency/terminology",
244
- description: "Detects terminology drift (e.g., user-profile vs UserProfile vs user profile) across specs",
245
- severity: "warn",
246
- run(context) {
247
- if (context.spec !== context.allSpecs[0])
248
- return [];
249
- const termMap = /* @__PURE__ */ new Map();
250
- for (const spec of context.allSpecs) {
251
- if (!spec.content)
252
- continue;
253
- const terms = extractCompoundTerms(spec.content);
254
- for (const term of terms) {
255
- const normalized = normalizeCompound(term);
256
- if (!normalized.includes(" "))
257
- continue;
258
- if (!termMap.has(normalized)) {
259
- termMap.set(normalized, /* @__PURE__ */ new Set());
260
- }
261
- termMap.get(normalized).add(term);
262
- }
263
- }
264
- const diagnostics = [];
265
- for (const [normalized, variants] of termMap) {
266
- if (variants.size >= 2) {
267
- const variantList = [...variants].join(", ");
268
- diagnostics.push({
269
- ruleId: "consistency/terminology",
270
- severity: "warn",
271
- message: `Inconsistent terminology for "${normalized}": found variants [${variantList}]. Standardize terminology across specs.`,
272
- filePath: context.spec.filePath
273
- });
274
- }
275
- }
276
- return diagnostics;
277
- }
278
- };
279
-
280
- // ../lint/dist/rules/edge-case-coverage.js
281
- var EDGE_CASE_KEYWORDS = [
282
- "error",
283
- "invalid",
284
- "empty",
285
- "timeout",
286
- "fails",
287
- "failure",
288
- "boundary",
289
- "edge case",
290
- "null",
291
- "undefined",
292
- "reject",
293
- "unauthorized",
294
- "forbidden",
295
- "404",
296
- "500",
297
- "missing",
298
- "malformed",
299
- "overflow",
300
- "duplicate",
301
- "graceful",
302
- "fall back",
303
- "fallback",
304
- "crash",
305
- "nonexistent",
306
- "corrupt"
307
- ];
308
- var edgeCaseCoverageRule = {
309
- id: "completeness/edge-case-coverage",
310
- description: "Flag user stories or test plans that don't mention error states or edge cases",
311
- severity: "warn",
312
- run(context) {
313
- const type = context.spec.frontmatter.type;
314
- if (type !== "user-story" && type !== "test-plan")
315
- return [];
316
- const content = context.spec.content.toLowerCase();
317
- const hasEdgeCases = EDGE_CASE_KEYWORDS.some((kw) => content.includes(kw));
318
- if (hasEdgeCases)
319
- return [];
320
- return [
321
- {
322
- ruleId: "completeness/edge-case-coverage",
323
- severity: "warn",
324
- message: "No error states or edge cases mentioned. Consider adding error handling, boundary conditions, or failure mode scenarios.",
325
- filePath: context.spec.filePath
326
- }
327
- ];
328
- }
329
- };
330
-
331
- // ../lint/dist/rules/naming-conventions.js
332
- var namingConventionsRule = {
333
- id: "consistency/naming-conventions",
334
- description: "Enforce consistent naming conventions across specs",
335
- severity: "warn",
336
- run(context) {
337
- const { spec } = context;
338
- const type = spec.frontmatter.type;
339
- const diagnostics = [];
340
- if (type === "prd") {
341
- const sectionParts = spec.content.split(/^(?=## )/m);
342
- const featuresSection = sectionParts.find((p) => /^## Features\b/.test(p));
343
- if (featuresSection) {
344
- const bullets = featuresSection.match(/^- .+$/gm) ?? [];
345
- for (const bullet of bullets) {
346
- if (bullet.match(/^- \*\*F\d+\*\*:/) === null && bullet.trim().length > 2) {
347
- diagnostics.push({
348
- ruleId: "consistency/naming-conventions",
349
- severity: "warn",
350
- message: `PRD feature missing feature ID pattern (**F<N>**:): "${bullet.slice(0, 60)}"`,
351
- filePath: spec.filePath
352
- });
353
- }
354
- }
355
- }
356
- }
357
- if (type === "user-story") {
358
- const id = spec.frontmatter.id;
359
- if (!id.startsWith("story-")) {
360
- diagnostics.push({
361
- ruleId: "consistency/naming-conventions",
362
- severity: "warn",
363
- message: `User story ID "${id}" should start with "story-" (e.g., "story-${id}")`,
364
- filePath: spec.filePath
365
- });
366
- }
367
- }
368
- if (type === "api-contract") {
369
- const endpointRe = /^###\s+(GET|POST|PUT|PATCH|DELETE)\s+(\S+)/gm;
370
- let match;
371
- while ((match = endpointRe.exec(spec.content)) !== null) {
372
- const path = match[2];
373
- if (/\/[a-z]+[A-Z]/.test(path)) {
374
- diagnostics.push({
375
- ruleId: "consistency/naming-conventions",
376
- severity: "warn",
377
- message: `Endpoint path "${path}" uses camelCase \u2014 use kebab-case instead (e.g., "${path.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}")`,
378
- filePath: spec.filePath
379
- });
380
- }
381
- }
382
- }
383
- return diagnostics;
384
- }
385
- };
386
-
387
- // ../lint/dist/rules/threat-coverage.js
388
- var STOPWORDS = /* @__PURE__ */ new Set(["the", "and", "for", "with", "from", "that", "this", "into", "via"]);
389
- function extractThreats(content) {
390
- const parts = content.split(/^(?=## )/m);
391
- const threats = [];
392
- for (const part of parts) {
393
- if (!/^##\s+(Threats|Security)\b/i.test(part))
394
- continue;
395
- const bullets = part.match(/^- .+$/gm) ?? [];
396
- threats.push(...bullets.map((b) => b.slice(2).trim()));
397
- }
398
- return threats;
399
- }
400
- function extractKeyTerms(text) {
401
- return text.toLowerCase().split(/\W+/).filter((w) => w.length > 3).filter((w) => !STOPWORDS.has(w));
402
- }
403
- var threatCoverageRule = {
404
- id: "security/threat-coverage",
405
- description: "Technical design specs must address threats identified in other specs",
406
- severity: "warn",
407
- run(context) {
408
- if (context.spec.frontmatter.type !== "technical-design")
409
- return [];
410
- const allThreats = [];
411
- for (const spec of context.allSpecs) {
412
- if (spec.filePath === context.spec.filePath)
413
- continue;
414
- allThreats.push(...extractThreats(spec.content));
415
- }
416
- if (allThreats.length === 0)
417
- return [];
418
- const techContent = context.spec.content.toLowerCase();
419
- const diagnostics = [];
420
- for (const threat of allThreats) {
421
- const keyTerms = extractKeyTerms(threat);
422
- const covered = keyTerms.some((term) => techContent.includes(term));
423
- if (!covered) {
424
- diagnostics.push({
425
- ruleId: "security/threat-coverage",
426
- severity: "warn",
427
- message: `Threat not addressed in technical design: "${threat}". Ensure the design covers this threat.`,
428
- filePath: context.spec.filePath
429
- });
430
- }
431
- }
432
- return diagnostics;
433
- }
434
- };
435
-
436
- // ../lint/dist/rules/ambiguity-score-ai.js
437
- var ambiguityScoreAiRule = {
438
- id: "clarity/ambiguity-score-ai",
439
- description: "AI-powered ambiguity detection (requires ANTHROPIC_API_KEY)",
440
- severity: "info",
441
- run(context) {
442
- if (!process.env["ANTHROPIC_API_KEY"])
443
- return [];
444
- return [
445
- {
446
- ruleId: "clarity/ambiguity-score-ai",
447
- severity: "info",
448
- message: "AI ambiguity analysis available \u2014 run `sdx check --ai` for LLM-powered ambiguity detection",
449
- filePath: context.spec.filePath
450
- }
451
- ];
452
- }
453
- };
454
-
455
- // ../lint/dist/rules/index.js
456
- var structureRules = [
457
- validFrontmatterRule,
458
- requiredSectionsRule,
459
- validReferencesRule,
460
- noCircularDepsRule,
461
- singleProjectContextRule
462
- ];
463
- var contentRules = [
464
- storyCoverageRule,
465
- stalenessCheckRule,
466
- noVagueLanguageRule,
467
- terminologyRule,
468
- edgeCaseCoverageRule,
469
- namingConventionsRule,
470
- threatCoverageRule,
471
- ambiguityScoreAiRule
472
- ];
473
- var allBuiltinRules = [...structureRules, ...contentRules];
474
-
475
- // ../lint/dist/presets.js
476
- function getPreset(name) {
477
- switch (name) {
478
- case "minimal":
479
- return structureRules;
480
- case "recommended":
481
- return allBuiltinRules;
482
- case "strict":
483
- return allBuiltinRules.map((rule) => ({ ...rule, severity: "error" }));
484
- default:
485
- throw new Error(`Unknown preset: "${name}". Use "minimal", "recommended", or "strict", or resolve external presets via resolvePreset() from @specdx/core.`);
486
- }
487
- }
488
-
489
- // ../lint/dist/custom-rule-loader.js
490
- import { pathToFileURL } from "url";
491
-
492
- export {
493
- createLintEngine,
494
- getPreset
495
- };
496
- //# sourceMappingURL=chunk-DAZCOUVK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../lint/src/engine.ts","../../lint/src/rules/valid-frontmatter.ts","../../lint/src/rules/required-sections.ts","../../lint/src/rules/valid-references.ts","../../lint/src/rules/no-circular-deps.ts","../../lint/src/rules/story-coverage.ts","../../lint/src/rules/staleness-check.ts","../../lint/src/rules/no-vague-language.ts","../../lint/src/rules/single-project-context.ts","../../lint/src/rules/terminology.ts","../../lint/src/rules/edge-case-coverage.ts","../../lint/src/rules/naming-conventions.ts","../../lint/src/rules/threat-coverage.ts","../../lint/src/rules/ambiguity-score-ai.ts","../../lint/src/rules/index.ts","../../lint/src/presets.ts","../../lint/src/custom-rule-loader.ts"],"sourcesContent":["import type { ParsedSpec, DependencyGraph } from \"@specdx/core\";\nimport type { SdxConfig } from \"@specdx/schema\";\nimport type { LintRule, LintResults, Diagnostic } from \"./types.js\";\n\nexport interface LintEngineOptions {\n rules: LintRule[];\n config?: SdxConfig;\n graph?: DependencyGraph;\n}\n\nexport interface LintEngine {\n lint(specs: ParsedSpec[]): LintResults;\n}\n\nexport function createLintEngine(options: LintEngineOptions): LintEngine {\n return {\n lint(specs: ParsedSpec[]): LintResults {\n const diagnostics: Diagnostic[] = [];\n for (const spec of specs) {\n for (const rule of options.rules) {\n const results = rule.run({\n spec,\n allSpecs: specs,\n config: options.config,\n graph: options.graph,\n });\n diagnostics.push(...results);\n }\n }\n return {\n diagnostics,\n hasErrors: diagnostics.some((d) => d.severity === \"error\"),\n hasWarnings: diagnostics.some((d) => d.severity === \"warn\"),\n };\n },\n };\n}\n","import type { LintRule } from \"../types.js\";\n\nexport const validFrontmatterRule: LintRule = {\n id: \"structure/valid-frontmatter\",\n description: \"Frontmatter matches the schema for the declared spec type\",\n severity: \"error\",\n run(context) {\n if (context.spec.valid) return [];\n const errors = context.spec.validationErrors ?? [];\n return errors.map((err) => ({\n ruleId: \"structure/valid-frontmatter\",\n severity: \"error\" as const,\n message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\nimport type { SpecType } from \"@specdx/schema\";\n\nexport const requiredSectionsRule: LintRule = {\n id: \"structure/required-sections\",\n description: \"Spec body contains all required sections for its type\",\n severity: \"error\",\n run(context) {\n // Skip YAML specs (no markdown body)\n const ext = context.spec.filePath.split(\".\").pop()?.toLowerCase();\n if (ext === \"yaml\" || ext === \"yml\") return [];\n\n const specType = context.spec.frontmatter.type as SpecType;\n const required = REQUIRED_SECTIONS[specType];\n if (!required) return [];\n\n const missing = required.filter((s) => !context.spec.sections.includes(s));\n return missing.map((section) => ({\n ruleId: \"structure/required-sections\",\n severity: \"error\" as const,\n message: `Missing required section: \"${section}\"`,\n filePath: context.spec.filePath,\n section,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const validReferencesRule: LintRule = {\n id: \"structure/valid-references\",\n description: \"All references in frontmatter point to specs that exist in the suite\",\n severity: \"error\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || refs.length === 0) return [];\n const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));\n return refs\n .filter((ref) => !allIds.has(ref.id))\n .map((ref) => ({\n ruleId: \"structure/valid-references\",\n severity: \"error\" as const,\n message: `Reference \"${ref.id}\" does not match any spec in the suite`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const noCircularDepsRule: LintRule = {\n id: \"structure/no-circular-deps\",\n description: \"The dependency graph has no cycles\",\n severity: \"error\",\n run() {\n // Cycle detection happens in buildGraph() — if graph construction succeeds, it's acyclic.\n // GraphErrors are surfaced as diagnostics by the lint command, not by this rule.\n return [];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst FEATURE_PATTERN = /\\*\\*F\\d+\\*\\*:\\s*(.+)/g;\n\nexport const storyCoverageRule: LintRule = {\n id: \"completeness/story-coverage\",\n description: \"Every feature listed in a PRD has at least one corresponding user story\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"prd\") return [];\n const features: string[] = [];\n let match;\n const re = new RegExp(FEATURE_PATTERN.source, \"g\");\n while ((match = re.exec(context.spec.content)) !== null) {\n features.push(match[1]!.trim());\n }\n if (features.length === 0) return [];\n const stories = context.allSpecs.filter((s) => s.frontmatter.type === \"user-story\");\n const storyContent = stories.map((s) => s.content + \" \" + s.frontmatter.title).join(\" \");\n return features\n .filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase()))\n .map((feature) => ({\n ruleId: \"completeness/story-coverage\",\n severity: \"warn\" as const,\n message: `Feature \"${feature}\" has no corresponding user story`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const stalenessCheckRule: LintRule = {\n id: \"freshness/staleness-check\",\n description: \"Warns if a spec hasn't been updated since its upstream dependency changed\",\n severity: \"warn\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || (refs as unknown[]).length === 0) return [];\n const specUpdated =\n (context.spec.frontmatter.updated as string | undefined) ??\n (context.spec.frontmatter.created as string);\n const specDate = new Date(specUpdated);\n const diagnostics = [];\n for (const ref of refs as Array<{ id: string; relationship: string }>) {\n if (ref.relationship !== \"depends-on\" && ref.relationship !== \"implemented-by\") continue;\n const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);\n if (!upstream) continue;\n const upstreamUpdated =\n (upstream.frontmatter.updated as string | undefined) ??\n (upstream.frontmatter.created as string);\n const upstreamDate = new Date(upstreamUpdated);\n if (upstreamDate > specDate) {\n diagnostics.push({\n ruleId: \"freshness/staleness-check\",\n severity: \"warn\" as const,\n message: `Potentially stale: upstream \"${upstream.frontmatter.id}\" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst DEFAULT_VAGUE_PATTERNS = [\n \"as appropriate\",\n \"handle edge cases\",\n \"as needed\",\n \"etc\\\\.\",\n \"TBD\",\n \"TODO\",\n \"and so on\",\n \"various\",\n \"somehow\",\n \"straightforward\",\n \"obviously\",\n \"simply\",\n \"just need to\",\n];\n\nexport const noVagueLanguageRule: LintRule = {\n id: \"clarity/no-vague-language\",\n description: \"Flags known ambiguous phrases\",\n severity: \"warn\",\n run(context) {\n if (!context.spec.content) return [];\n const diagnostics = [];\n for (const pattern of DEFAULT_VAGUE_PATTERNS) {\n const regex = new RegExp(`\\\\b${pattern}`, \"gi\");\n let match;\n while ((match = regex.exec(context.spec.content)) !== null) {\n diagnostics.push({\n ruleId: \"clarity/no-vague-language\",\n severity: \"warn\" as const,\n message: `Vague language: \"${match[0]}\"`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const singleProjectContextRule: LintRule = {\n id: \"structure/single-project-context\",\n description: \"Only one project-context spec should exist per suite\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"project-context\") return [];\n\n const contextSpecs = context.allSpecs.filter((s) => s.frontmatter.type === \"project-context\");\n\n if (contextSpecs.length > 1) {\n return [\n {\n ruleId: \"structure/single-project-context\",\n severity: \"warn\" as const,\n message: `Multiple project-context specs found (${contextSpecs.length}). Only one should exist per suite.`,\n filePath: context.spec.filePath,\n },\n ];\n }\n\n return [];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nfunction normalizeCompound(term: string): string {\n // Split camelCase: \"UserProfile\" → \"user profile\"\n // Split hyphens/underscores: \"user-profile\" → \"user profile\"\n return term\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/[-_]/g, \" \")\n .toLowerCase()\n .trim();\n}\n\nfunction extractCompoundTerms(content: string): string[] {\n const terms: string[] = [];\n\n // Extract camelCase words (e.g., UserProfile, userProfile)\n const camelCaseRegex = /\\b[a-zA-Z]*[a-z][A-Z][a-zA-Z]*\\b/g;\n let match;\n while ((match = camelCaseRegex.exec(content)) !== null) {\n terms.push(match[0]);\n }\n\n // Extract hyphenated words (e.g., user-profile, my-component)\n const hyphenatedRegex = /\\b[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)+\\b/g;\n while ((match = hyphenatedRegex.exec(content)) !== null) {\n terms.push(match[0]);\n }\n\n return terms;\n}\n\nexport const terminologyRule: LintRule = {\n id: \"consistency/terminology\",\n description:\n \"Detects terminology drift (e.g., user-profile vs UserProfile vs user profile) across specs\",\n severity: \"warn\",\n run(context) {\n // Only run on the first spec to avoid duplicate diagnostics\n if (context.spec !== context.allSpecs[0]) return [];\n\n // Build a map: normalized form → Set of original forms found across all specs\n const termMap = new Map<string, Set<string>>();\n\n for (const spec of context.allSpecs) {\n if (!spec.content) continue;\n const terms = extractCompoundTerms(spec.content);\n for (const term of terms) {\n const normalized = normalizeCompound(term);\n // Only track multi-word normalized forms (skip single words)\n if (!normalized.includes(\" \")) continue;\n if (!termMap.has(normalized)) {\n termMap.set(normalized, new Set());\n }\n termMap.get(normalized)!.add(term);\n }\n }\n\n const diagnostics = [];\n\n for (const [normalized, variants] of termMap) {\n if (variants.size >= 2) {\n const variantList = [...variants].join(\", \");\n diagnostics.push({\n ruleId: \"consistency/terminology\",\n severity: \"warn\" as const,\n message: `Inconsistent terminology for \"${normalized}\": found variants [${variantList}]. Standardize terminology across specs.`,\n filePath: context.spec.filePath,\n });\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst EDGE_CASE_KEYWORDS = [\n \"error\",\n \"invalid\",\n \"empty\",\n \"timeout\",\n \"fails\",\n \"failure\",\n \"boundary\",\n \"edge case\",\n \"null\",\n \"undefined\",\n \"reject\",\n \"unauthorized\",\n \"forbidden\",\n \"404\",\n \"500\",\n \"missing\",\n \"malformed\",\n \"overflow\",\n \"duplicate\",\n \"graceful\",\n \"fall back\",\n \"fallback\",\n \"crash\",\n \"nonexistent\",\n \"corrupt\",\n];\n\nexport const edgeCaseCoverageRule: LintRule = {\n id: \"completeness/edge-case-coverage\",\n description: \"Flag user stories or test plans that don't mention error states or edge cases\",\n severity: \"warn\",\n run(context) {\n const type = context.spec.frontmatter.type as string;\n if (type !== \"user-story\" && type !== \"test-plan\") return [];\n\n const content = context.spec.content.toLowerCase();\n const hasEdgeCases = EDGE_CASE_KEYWORDS.some((kw) => content.includes(kw));\n\n if (hasEdgeCases) return [];\n\n return [\n {\n ruleId: \"completeness/edge-case-coverage\",\n severity: \"warn\" as const,\n message:\n \"No error states or edge cases mentioned. Consider adding error handling, boundary conditions, or failure mode scenarios.\",\n filePath: context.spec.filePath,\n },\n ];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const namingConventionsRule: LintRule = {\n id: \"consistency/naming-conventions\",\n description: \"Enforce consistent naming conventions across specs\",\n severity: \"warn\",\n run(context) {\n const { spec } = context;\n const type = spec.frontmatter.type as string;\n const diagnostics = [];\n\n if (type === \"prd\") {\n // Split content into sections and find the Features section\n const sectionParts = spec.content.split(/^(?=## )/m);\n const featuresSection = sectionParts.find((p) => /^## Features\\b/.test(p));\n if (featuresSection) {\n const bullets = featuresSection.match(/^- .+$/gm) ?? [];\n for (const bullet of bullets) {\n if (bullet.match(/^- \\*\\*F\\d+\\*\\*:/) === null && bullet.trim().length > 2) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `PRD feature missing feature ID pattern (**F<N>**:): \"${bullet.slice(0, 60)}\"`,\n filePath: spec.filePath,\n });\n }\n }\n }\n }\n\n if (type === \"user-story\") {\n const id = spec.frontmatter.id as string;\n if (!id.startsWith(\"story-\")) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `User story ID \"${id}\" should start with \"story-\" (e.g., \"story-${id}\")`,\n filePath: spec.filePath,\n });\n }\n }\n\n if (type === \"api-contract\") {\n // Check endpoints for camelCase path segments\n const endpointRe = /^###\\s+(GET|POST|PUT|PATCH|DELETE)\\s+(\\S+)/gm;\n let match;\n while ((match = endpointRe.exec(spec.content)) !== null) {\n const path = match[2]!;\n if (/\\/[a-z]+[A-Z]/.test(path)) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `Endpoint path \"${path}\" uses camelCase — use kebab-case instead (e.g., \"${path.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase()}\")`,\n filePath: spec.filePath,\n });\n }\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst STOPWORDS = new Set([\"the\", \"and\", \"for\", \"with\", \"from\", \"that\", \"this\", \"into\", \"via\"]);\n\nfunction extractThreats(content: string): string[] {\n // Split into sections at each ## heading, then filter for Threats/Security\n const parts = content.split(/^(?=## )/m);\n const threats: string[] = [];\n for (const part of parts) {\n if (!/^##\\s+(Threats|Security)\\b/i.test(part)) continue;\n const bullets = part.match(/^- .+$/gm) ?? [];\n threats.push(...bullets.map((b) => b.slice(2).trim()));\n }\n return threats;\n}\n\nfunction extractKeyTerms(text: string): string[] {\n return text\n .toLowerCase()\n .split(/\\W+/)\n .filter((w) => w.length > 3)\n .filter((w) => !STOPWORDS.has(w));\n}\n\nexport const threatCoverageRule: LintRule = {\n id: \"security/threat-coverage\",\n description: \"Technical design specs must address threats identified in other specs\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"technical-design\") return [];\n\n const allThreats: string[] = [];\n for (const spec of context.allSpecs) {\n if (spec.filePath === context.spec.filePath) continue;\n allThreats.push(...extractThreats(spec.content));\n }\n\n if (allThreats.length === 0) return [];\n\n const techContent = context.spec.content.toLowerCase();\n const diagnostics = [];\n\n for (const threat of allThreats) {\n const keyTerms = extractKeyTerms(threat);\n const covered = keyTerms.some((term) => techContent.includes(term));\n if (!covered) {\n diagnostics.push({\n ruleId: \"security/threat-coverage\",\n severity: \"warn\" as const,\n message: `Threat not addressed in technical design: \"${threat}\". Ensure the design covers this threat.`,\n filePath: context.spec.filePath,\n });\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const ambiguityScoreAiRule: LintRule = {\n id: \"clarity/ambiguity-score-ai\",\n description: \"AI-powered ambiguity detection (requires ANTHROPIC_API_KEY)\",\n severity: \"info\",\n run(context) {\n if (!process.env[\"ANTHROPIC_API_KEY\"]) return [];\n\n return [\n {\n ruleId: \"clarity/ambiguity-score-ai\",\n severity: \"info\" as const,\n message:\n \"AI ambiguity analysis available — run `sdx check --ai` for LLM-powered ambiguity detection\",\n filePath: context.spec.filePath,\n },\n ];\n },\n};\n","import { validFrontmatterRule } from \"./valid-frontmatter.js\";\nimport { requiredSectionsRule } from \"./required-sections.js\";\nimport { validReferencesRule } from \"./valid-references.js\";\nimport { noCircularDepsRule } from \"./no-circular-deps.js\";\nimport { storyCoverageRule } from \"./story-coverage.js\";\nimport { stalenessCheckRule } from \"./staleness-check.js\";\nimport { noVagueLanguageRule } from \"./no-vague-language.js\";\nimport { singleProjectContextRule } from \"./single-project-context.js\";\nimport { terminologyRule } from \"./terminology.js\";\nimport { edgeCaseCoverageRule } from \"./edge-case-coverage.js\";\nimport { namingConventionsRule } from \"./naming-conventions.js\";\nimport { threatCoverageRule } from \"./threat-coverage.js\";\nimport { ambiguityScoreAiRule } from \"./ambiguity-score-ai.js\";\nimport type { LintRule } from \"../types.js\";\n\nexport const structureRules: LintRule[] = [\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n singleProjectContextRule,\n];\n\nexport const contentRules: LintRule[] = [\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n terminologyRule,\n edgeCaseCoverageRule,\n namingConventionsRule,\n threatCoverageRule,\n ambiguityScoreAiRule,\n];\n\nexport const allBuiltinRules: LintRule[] = [...structureRules, ...contentRules];\n\nexport {\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n singleProjectContextRule,\n terminologyRule,\n edgeCaseCoverageRule,\n namingConventionsRule,\n threatCoverageRule,\n ambiguityScoreAiRule,\n};\n","import type { LintRule } from \"./types.js\";\nimport { structureRules, allBuiltinRules } from \"./rules/index.js\";\n\nexport function getPreset(name: string): LintRule[] {\n switch (name) {\n case \"minimal\":\n return structureRules;\n case \"recommended\":\n return allBuiltinRules;\n case \"strict\":\n return allBuiltinRules.map((rule) => ({ ...rule, severity: \"error\" as const }));\n default:\n throw new Error(\n `Unknown preset: \"${name}\". Use \"minimal\", \"recommended\", or \"strict\", or resolve external presets via resolvePreset() from @specdx/core.`,\n );\n }\n}\n","import { pathToFileURL } from \"node:url\";\nimport type { LintRule } from \"./types.js\";\n\nexport async function loadCustomRule(filePath: string): Promise<LintRule> {\n const module = await import(pathToFileURL(filePath).href);\n const rule = module.default ?? module.rule;\n if (!rule || !rule.id || !rule.run) {\n throw new Error(\n `Custom rule at ${filePath} must export a default LintRule with id and run function`,\n );\n }\n return rule as LintRule;\n}\n"],"mappings":";;;;;AAcM,SAAU,iBAAiB,SAA0B;AACzD,SAAO;IACL,KAAK,OAAmB;AACtB,YAAM,cAA4B,CAAA;AAClC,iBAAW,QAAQ,OAAO;AACxB,mBAAW,QAAQ,QAAQ,OAAO;AAChC,gBAAM,UAAU,KAAK,IAAI;YACvB;YACA,UAAU;YACV,QAAQ,QAAQ;YAChB,OAAO,QAAQ;WAChB;AACD,sBAAY,KAAK,GAAG,OAAO;QAC7B;MACF;AACA,aAAO;QACL;QACA,WAAW,YAAY,KAAK,CAAC,MAAM,EAAE,aAAa,OAAO;QACzD,aAAa,YAAY,KAAK,CAAC,MAAM,EAAE,aAAa,MAAM;;IAE9D;;AAEJ;;;AClCO,IAAM,uBAAiC;EAC5C,IAAI;EACJ,aAAa;EACb,UAAU;EACV,IAAI,SAAO;AACT,QAAI,QAAQ,KAAK;AAAO,aAAO,CAAA;AAC/B,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@
1
- // src/shared-args.ts
2
- var sharedArgs = {
3
- quiet: { type: "boolean", description: "Suppress info output", alias: ["q"] },
4
- verbose: { type: "boolean", description: "Enable debug output", alias: ["V"] },
5
- format: {
6
- type: "string",
7
- description: "Output format (pretty, json, github)",
8
- default: "pretty"
9
- }
10
- };
11
-
12
- export {
13
- sharedArgs
14
- };
15
- //# sourceMappingURL=chunk-GAM4MXPC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared-args.ts"],"sourcesContent":["export const sharedArgs = {\n quiet: { type: \"boolean\" as const, description: \"Suppress info output\", alias: [\"q\"] },\n verbose: { type: \"boolean\" as const, description: \"Enable debug output\", alias: [\"V\"] },\n format: {\n type: \"string\" as const,\n description: \"Output format (pretty, json, github)\",\n default: \"pretty\",\n },\n};\n"],"mappings":";AAAO,IAAM,aAAa;AAAA,EACxB,OAAO,EAAE,MAAM,WAAoB,aAAa,wBAAwB,OAAO,CAAC,GAAG,EAAE;AAAA,EACrF,SAAS,EAAE,MAAM,WAAoB,aAAa,uBAAuB,OAAO,CAAC,GAAG,EAAE;AAAA,EACtF,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../core/src/config.ts","../../core/src/parser.ts","../../core/src/tokens.ts","../../core/src/graph.ts","../../core/src/glob.ts","../../core/src/logger.ts","../../core/src/preset.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { join, dirname } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { validateConfig, type SdxConfig } from \"@specdx/schema\";\n\nexport class ConfigError extends Error {\n constructor(\n message: string,\n public readonly errors?: unknown[],\n ) {\n super(message);\n this.name = \"ConfigError\";\n }\n}\n\nconst CONFIG_FILENAME = \"spec.config.yaml\";\n\nexport async function loadConfig(filePath?: string, searchFrom?: string): Promise<SdxConfig> {\n const resolvedPath = filePath ?? (await findConfig(searchFrom ?? process.cwd()));\n if (!resolvedPath) {\n throw new ConfigError(`No ${CONFIG_FILENAME} found. Run 'sdx init' to create one.`);\n }\n\n let raw: string;\n try {\n raw = await readFile(resolvedPath, \"utf-8\");\n } catch {\n throw new ConfigError(`Cannot read config file: ${resolvedPath}`);\n }\n\n let data: Record<string, unknown>;\n try {\n data = parseYaml(raw) as Record<string, unknown>;\n } catch (err) {\n throw new ConfigError(`Invalid YAML in ${resolvedPath}: ${(err as Error).message}`);\n }\n\n const result = validateConfig(data);\n if (!result.valid) {\n throw new ConfigError(`Invalid config in ${resolvedPath}`, result.errors ?? undefined);\n }\n\n return data as unknown as SdxConfig;\n}\n\nasync function findConfig(from: string): Promise<string | undefined> {\n let dir = from;\n while (true) {\n const candidate = join(dir, CONFIG_FILENAME);\n try {\n await readFile(candidate, \"utf-8\");\n return candidate;\n } catch {\n const parent = dirname(dir);\n if (parent === dir) return undefined;\n dir = parent;\n }\n }\n}\n","import { readFile } from \"node:fs/promises\";\nimport { extname } from \"node:path\";\nimport * as grayMatterNs from \"gray-matter\";\nimport { parse as parseYaml } from \"yaml\";\nimport { unified } from \"unified\";\nimport remarkParse from \"remark-parse\";\nimport { visit } from \"unist-util-visit\";\nimport { validateSpec, type ValidationResult } from \"@specdx/schema\";\nimport type { BaseSpec, SpecType } from \"@specdx/schema\";\nimport { countTokens } from \"./tokens.js\";\n\n// gray-matter is CJS — its callable default is exposed via .default in an ESM context\ntype GrayMatterFn = (input: string) => { data: Record<string, unknown>; content: string };\nconst matter = ((grayMatterNs as unknown as { default?: GrayMatterFn }).default ??\n (grayMatterNs as unknown as GrayMatterFn)) as GrayMatterFn;\n\nexport class ParseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ParseError\";\n }\n}\n\nexport interface ParsedSection {\n heading: string;\n content: string;\n tokens: number;\n}\n\nexport interface ParsedSpec {\n filePath: string;\n frontmatter: BaseSpec & Record<string, unknown>;\n content: string;\n sections: string[];\n parsedSections: ParsedSection[];\n valid: boolean;\n validationErrors: ValidationResult[\"errors\"];\n}\n\nexport async function parseSpec(filePath: string): Promise<ParsedSpec> {\n let raw: string;\n try {\n raw = await readFile(filePath, \"utf-8\");\n } catch {\n throw new ParseError(`Cannot read spec file: ${filePath}`);\n }\n\n return parseSpecFromString(raw, filePath);\n}\n\nexport function parseSpecFromString(content: string, filePath: string): Promise<ParsedSpec> {\n const ext = extname(filePath).toLowerCase();\n if (ext === \".yaml\" || ext === \".yml\") {\n return Promise.resolve(parseYamlSpec(filePath, content));\n }\n return Promise.resolve(parseMarkdownSpec(filePath, content));\n}\n\nfunction parseMarkdownSpec(filePath: string, raw: string): ParsedSpec {\n const { data, content } = matter(raw);\n const parsedSections = extractParsedSections(content);\n const sections = parsedSections.map((s) => s.heading).filter(Boolean);\n const frontmatter = data as BaseSpec & Record<string, unknown>;\n const specType = frontmatter.type as SpecType | undefined;\n\n let valid = false;\n let validationErrors: ValidationResult[\"errors\"] = null;\n if (specType) {\n const result = validateSpec(specType, data);\n valid = result.valid;\n validationErrors = result.errors;\n }\n\n return { filePath, frontmatter, content, sections, parsedSections, valid, validationErrors };\n}\n\nfunction parseYamlSpec(filePath: string, raw: string): ParsedSpec {\n let data: Record<string, unknown>;\n try {\n data = parseYaml(raw) as Record<string, unknown>;\n } catch (err) {\n throw new ParseError(`Invalid YAML in ${filePath}: ${(err as Error).message}`);\n }\n\n const frontmatter = data as BaseSpec & Record<string, unknown>;\n const specType = frontmatter.type as SpecType | undefined;\n\n let valid = false;\n let validationErrors: ValidationResult[\"errors\"] = null;\n if (specType) {\n const result = validateSpec(specType, data);\n valid = result.valid;\n validationErrors = result.errors;\n }\n\n return {\n filePath,\n frontmatter,\n content: \"\",\n sections: [],\n parsedSections: [],\n valid,\n validationErrors,\n };\n}\n\nfunction extractParsedSections(markdown: string): ParsedSection[] {\n const tree = unified().use(remarkParse).parse(markdown);\n\n const h2s: { heading: string; startOffset: number; endOffset: number }[] = [];\n\n visit(tree, \"heading\", (node) => {\n if (node.depth === 2) {\n const text = (node.children as Array<{ type: string; value?: string }>)\n .filter((c) => c.type === \"text\")\n .map((c) => c.value ?? \"\")\n .join(\"\");\n h2s.push({\n heading: text,\n startOffset: node.position!.start.offset as number,\n endOffset: node.position!.end.offset as number,\n });\n }\n });\n\n const sections: ParsedSection[] = [];\n\n // Preamble: content before first H2\n const firstH2 = h2s[0];\n const firstOffset = firstH2 ? firstH2.startOffset : markdown.length;\n const preamble = markdown.slice(0, firstOffset).trim();\n if (preamble) {\n sections.push({ heading: \"\", content: preamble, tokens: countTokens(preamble) });\n }\n\n // Each H2 section: content AFTER the heading line, up to the next H2 (or end)\n for (let i = 0; i < h2s.length; i++) {\n const current = h2s[i]!;\n const next = h2s[i + 1];\n const end = next ? next.startOffset : markdown.length;\n const content = markdown.slice(current.endOffset, end).trim();\n sections.push({\n heading: current.heading,\n content,\n tokens: countTokens(content),\n });\n }\n\n return sections;\n}\n","import { encodingForModel } from \"js-tiktoken\";\n\nlet encoder: ReturnType<typeof encodingForModel> | undefined;\n\nfunction getEncoder() {\n if (!encoder) encoder = encodingForModel(\"gpt-4o\");\n return encoder;\n}\n\nexport function countTokens(text: string): number {\n if (!text) return 0;\n return getEncoder().encode(text).length;\n}\n","import type { SdxConfig } from \"@specdx/schema\";\n\nexport class GraphError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"GraphError\";\n }\n}\n\nexport interface Edge {\n from: string;\n to: string;\n}\n\nexport interface DependencyGraph {\n nodes: string[];\n edges: Edge[];\n topologicalSort(): string[];\n getDownstream(nodeId: string): string[];\n getUpstream(nodeId: string): string[];\n}\n\nexport function buildGraph(config: SdxConfig): DependencyGraph {\n const specNames = Object.keys(config.specs);\n const adjacency = new Map<string, string[]>();\n const reverseAdj = new Map<string, string[]>();\n const edges: Edge[] = [];\n\n for (const name of specNames) {\n adjacency.set(name, []);\n reverseAdj.set(name, []);\n }\n\n for (const [name, entry] of Object.entries(config.specs)) {\n if (!entry.requires) continue;\n for (const dep of entry.requires) {\n if (!adjacency.has(dep)) {\n throw new GraphError(\n `Spec \"${name}\" requires \"${dep}\", which does not exist in the config.`,\n );\n }\n adjacency.get(dep)!.push(name);\n reverseAdj.get(name)!.push(dep);\n edges.push({ from: dep, to: name });\n }\n }\n\n // Kahn's algorithm for cycle detection + topological sort\n const inDegree = new Map<string, number>();\n for (const name of specNames) inDegree.set(name, reverseAdj.get(name)!.length);\n\n const queue: string[] = [];\n for (const [name, degree] of inDegree) {\n if (degree === 0) queue.push(name);\n }\n\n const sorted: string[] = [];\n while (queue.length > 0) {\n const node = queue.shift()!;\n sorted.push(node);\n for (const neighbor of adjacency.get(node)!) {\n const newDegree = inDegree.get(neighbor)! - 1;\n inDegree.set(neighbor, newDegree);\n if (newDegree === 0) queue.push(neighbor);\n }\n }\n\n if (sorted.length !== specNames.length) {\n const remaining = specNames.filter((n) => !sorted.includes(n));\n throw new GraphError(`Circular dependency detected involving: ${remaining.join(\", \")}`);\n }\n\n return {\n nodes: specNames,\n edges,\n topologicalSort: () => [...sorted],\n getDownstream(nodeId: string): string[] {\n const visited = new Set<string>();\n const stack = [nodeId];\n while (stack.length > 0) {\n const current = stack.pop()!;\n for (const neighbor of adjacency.get(current) ?? []) {\n if (!visited.has(neighbor)) {\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n }\n return [...visited];\n },\n getUpstream(nodeId: string): string[] {\n const visited = new Set<string>();\n const stack = [nodeId];\n while (stack.length > 0) {\n const current = stack.pop()!;\n for (const dep of reverseAdj.get(current) ?? []) {\n if (!visited.has(dep)) {\n visited.add(dep);\n stack.push(dep);\n }\n }\n }\n return [...visited];\n },\n };\n}\n\n/** A relationship edge declared in a spec's frontmatter `references`. */\nexport interface ReferenceEdge {\n fromId: string;\n toId: string;\n relationship: string;\n}\n\n/**\n * Reference relationships that imply a dependency, and its direction.\n * Structural relationships (`decomposed-into`, `supersedes`) are deliberately\n * excluded: a parent decomposed into children does not make the children\n * build-depend on the parent (issue #13).\n */\nconst DEPENDENCY_RELATIONSHIPS: Record<string, \"self-requires-target\" | \"target-requires-self\"> = {\n \"depends-on\": \"self-requires-target\",\n \"implemented-by\": \"target-requires-self\",\n};\n\n/**\n * Collect relationship edges declared in spec frontmatter `references` fields.\n * Edges point from the declaring spec's id to the referenced spec's id.\n */\nexport function collectReferenceEdges(\n specs: { frontmatter: Record<string, unknown> }[],\n): ReferenceEdge[] {\n const edges: ReferenceEdge[] = [];\n for (const spec of specs) {\n const fromId = spec.frontmatter.id;\n if (typeof fromId !== \"string\") continue;\n const refs = spec.frontmatter.references;\n if (!Array.isArray(refs)) continue;\n for (const ref of refs) {\n if (ref && typeof ref === \"object\" && \"id\" in ref) {\n const r = ref as { id: unknown; relationship?: unknown };\n if (typeof r.id === \"string\") {\n edges.push({\n fromId,\n toId: r.id,\n relationship: typeof r.relationship === \"string\" ? r.relationship : \"related-to\",\n });\n }\n }\n }\n }\n return edges;\n}\n\n/**\n * Find dependency-implying frontmatter references that the config-level\n * `requires` graph does not reflect. `idToEntry` maps spec frontmatter ids to\n * config entry keys. References within the same entry (e.g. story-to-story\n * under one glob) and references to unmapped ids are skipped — reference\n * existence itself is the `structure/valid-references` lint rule's concern.\n */\nexport interface UnreflectedReference {\n edge: ReferenceEdge;\n requiringEntry: string;\n requiredEntry: string;\n /** True when adding the suggested requires edge would create a cycle. */\n createsCycle: boolean;\n}\n\nexport function findUnreflectedReferences(\n referenceEdges: ReferenceEdge[],\n idToEntry: Map<string, string>,\n graph: DependencyGraph,\n): UnreflectedReference[] {\n const configEdges = new Set(graph.edges.map((e) => `${e.from}→${e.to}`));\n const missing: UnreflectedReference[] = [];\n\n for (const edge of referenceEdges) {\n const direction = DEPENDENCY_RELATIONSHIPS[edge.relationship];\n if (!direction) continue;\n\n const selfEntry = idToEntry.get(edge.fromId);\n const targetEntry = idToEntry.get(edge.toId);\n if (!selfEntry || !targetEntry || selfEntry === targetEntry) continue;\n\n const requiringEntry = direction === \"self-requires-target\" ? selfEntry : targetEntry;\n const requiredEntry = direction === \"self-requires-target\" ? targetEntry : selfEntry;\n\n // Config edges point dependency → dependent\n if (!configEdges.has(`${requiredEntry}→${requiringEntry}`)) {\n // The suggested edge closes a cycle when the required entry is already\n // downstream of the requiring one (issue #13) — never recommend it.\n const createsCycle = graph.getDownstream(requiringEntry).includes(requiredEntry);\n missing.push({ edge, requiringEntry, requiredEntry, createsCycle });\n }\n }\n\n return missing;\n}\n","import { glob } from \"tinyglobby\";\nimport { join, isAbsolute } from \"node:path\";\n\nexport async function resolveGlob(pattern: string, baseDir: string): Promise<string[]> {\n const absolutePattern = isAbsolute(pattern) ? pattern : join(baseDir, pattern);\n return glob([absolutePattern], { absolute: true });\n}\n","import { createConsola, type ConsolaInstance } from \"consola\";\n\nexport type LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nexport interface LoggerOptions {\n quiet?: boolean;\n verbose?: boolean;\n}\n\nexport interface Logger extends ConsolaInstance {\n level: number;\n}\n\nexport function createLogger(options?: LoggerOptions): Logger {\n let level = 3; // info\n if (options?.quiet) level = 1; // only errors\n if (options?.verbose) level = 4; // debug\n return createConsola({ level }) as Logger;\n}\n","import { readFile } from \"node:fs/promises\";\nimport { resolve, isAbsolute } from \"node:path\";\nimport { ConfigError } from \"./config.js\";\n\nconst BUILTINS = [\"minimal\", \"recommended\", \"strict\"];\n\n/**\n * Resolve a preset name to its config content.\n * Returns null for built-in presets (handled by @specdx/lint).\n * Resolves local file paths and npm package names.\n */\nexport async function resolvePreset(\n name: string,\n cwd = process.cwd(),\n): Promise<Record<string, unknown> | null> {\n if (BUILTINS.includes(name)) {\n return null;\n }\n\n // Try local file path\n const localPath = isAbsolute(name) ? name : resolve(cwd, name);\n try {\n const content = await readFile(localPath, \"utf-8\");\n const { default: yaml } = await import(\"yaml\");\n return yaml.parse(content) as Record<string, unknown>;\n } catch {\n // Not a local file, try npm\n }\n\n // Try npm package\n try {\n const mod = (await import(name)) as { default?: Record<string, unknown> };\n return (mod.default ?? mod) as Record<string, unknown>;\n } cat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