specky-sdd 3.0.0 → 3.1.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 (105) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/README.md +194 -177
  3. package/SECURITY.md +77 -2
  4. package/dist/constants.d.ts +4 -1
  5. package/dist/constants.d.ts.map +1 -1
  6. package/dist/constants.js +7 -1
  7. package/dist/constants.js.map +1 -1
  8. package/dist/index.js +26 -4
  9. package/dist/index.js.map +1 -1
  10. package/dist/schemas/context.d.ts +9 -0
  11. package/dist/schemas/context.d.ts.map +1 -0
  12. package/dist/schemas/context.js +10 -0
  13. package/dist/schemas/context.js.map +1 -0
  14. package/dist/schemas/metrics.d.ts +9 -0
  15. package/dist/schemas/metrics.d.ts.map +1 -0
  16. package/dist/schemas/metrics.js +10 -0
  17. package/dist/schemas/metrics.js.map +1 -0
  18. package/dist/schemas/routing.d.ts +9 -0
  19. package/dist/schemas/routing.d.ts.map +1 -0
  20. package/dist/schemas/routing.js +21 -0
  21. package/dist/schemas/routing.js.map +1 -0
  22. package/dist/services/audit-logger.d.ts +30 -0
  23. package/dist/services/audit-logger.d.ts.map +1 -0
  24. package/dist/services/audit-logger.js +64 -0
  25. package/dist/services/audit-logger.js.map +1 -0
  26. package/dist/services/cognitive-debt-engine.d.ts +22 -0
  27. package/dist/services/cognitive-debt-engine.d.ts.map +1 -0
  28. package/dist/services/cognitive-debt-engine.js +52 -0
  29. package/dist/services/cognitive-debt-engine.js.map +1 -0
  30. package/dist/services/context-tiering-engine.d.ts +38 -0
  31. package/dist/services/context-tiering-engine.d.ts.map +1 -0
  32. package/dist/services/context-tiering-engine.js +66 -0
  33. package/dist/services/context-tiering-engine.js.map +1 -0
  34. package/dist/services/intent-drift-engine.d.ts +41 -0
  35. package/dist/services/intent-drift-engine.d.ts.map +1 -0
  36. package/dist/services/intent-drift-engine.js +101 -0
  37. package/dist/services/intent-drift-engine.js.map +1 -0
  38. package/dist/services/metrics-generator.d.ts +42 -0
  39. package/dist/services/metrics-generator.d.ts.map +1 -0
  40. package/dist/services/metrics-generator.js +200 -0
  41. package/dist/services/metrics-generator.js.map +1 -0
  42. package/dist/services/model-routing-engine.d.ts +38 -0
  43. package/dist/services/model-routing-engine.d.ts.map +1 -0
  44. package/dist/services/model-routing-engine.js +127 -0
  45. package/dist/services/model-routing-engine.js.map +1 -0
  46. package/dist/services/state-machine.d.ts +6 -1
  47. package/dist/services/state-machine.d.ts.map +1 -1
  48. package/dist/services/state-machine.js +33 -0
  49. package/dist/services/state-machine.js.map +1 -1
  50. package/dist/services/template-engine.d.ts +5 -2
  51. package/dist/services/template-engine.d.ts.map +1 -1
  52. package/dist/services/template-engine.js +19 -4
  53. package/dist/services/template-engine.js.map +1 -1
  54. package/dist/services/test-result-parser.d.ts +23 -0
  55. package/dist/services/test-result-parser.d.ts.map +1 -0
  56. package/dist/services/test-result-parser.js +90 -0
  57. package/dist/services/test-result-parser.js.map +1 -0
  58. package/dist/services/test-traceability-mapper.d.ts +37 -0
  59. package/dist/services/test-traceability-mapper.d.ts.map +1 -0
  60. package/dist/services/test-traceability-mapper.js +102 -0
  61. package/dist/services/test-traceability-mapper.js.map +1 -0
  62. package/dist/tools/analysis.d.ts +2 -1
  63. package/dist/tools/analysis.d.ts.map +1 -1
  64. package/dist/tools/analysis.js +25 -1
  65. package/dist/tools/analysis.js.map +1 -1
  66. package/dist/tools/context.d.ts +9 -0
  67. package/dist/tools/context.d.ts.map +1 -0
  68. package/dist/tools/context.js +86 -0
  69. package/dist/tools/context.js.map +1 -0
  70. package/dist/tools/metrics.d.ts +11 -0
  71. package/dist/tools/metrics.d.ts.map +1 -0
  72. package/dist/tools/metrics.js +105 -0
  73. package/dist/tools/metrics.js.map +1 -0
  74. package/dist/tools/pipeline.d.ts.map +1 -1
  75. package/dist/tools/pipeline.js +21 -0
  76. package/dist/tools/pipeline.js.map +1 -1
  77. package/dist/tools/response-builder.d.ts.map +1 -1
  78. package/dist/tools/response-builder.js +4 -0
  79. package/dist/tools/response-builder.js.map +1 -1
  80. package/dist/tools/routing.d.ts +7 -0
  81. package/dist/tools/routing.d.ts.map +1 -0
  82. package/dist/tools/routing.js +67 -0
  83. package/dist/tools/routing.js.map +1 -0
  84. package/dist/tools/testing.d.ts +3 -1
  85. package/dist/tools/testing.d.ts.map +1 -1
  86. package/dist/tools/testing.js +47 -3
  87. package/dist/tools/testing.js.map +1 -1
  88. package/dist/tools/utility.d.ts +2 -1
  89. package/dist/tools/utility.d.ts.map +1 -1
  90. package/dist/tools/utility.js +51 -1
  91. package/dist/tools/utility.js.map +1 -1
  92. package/dist/types.d.ts +16 -0
  93. package/dist/types.d.ts.map +1 -1
  94. package/dist/utils/context-helper.d.ts +13 -0
  95. package/dist/utils/context-helper.d.ts.map +1 -0
  96. package/dist/utils/context-helper.js +14 -0
  97. package/dist/utils/context-helper.js.map +1 -0
  98. package/dist/utils/routing-helper.d.ts +16 -0
  99. package/dist/utils/routing-helper.d.ts.map +1 -0
  100. package/dist/utils/routing-helper.js +16 -0
  101. package/dist/utils/routing-helper.js.map +1 -0
  102. package/hooks/release-gate.md +82 -0
  103. package/hooks/spec-quality.md +55 -0
  104. package/hooks/task-tracer.md +63 -0
  105. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,48 @@ All notable changes to Specky are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.0] - 2026-04-12
9
+
10
+ ### Intelligence Layer (Specs 003–007)
11
+
12
+ #### Model Routing Guidance (Spec 003)
13
+ - **`sdd_model_routing`** (NEW tool #54): Returns the full 10-phase model routing decision table with optimal model, mode, extended thinking settings, arXiv evidence, and cost savings calculator
14
+ - **`model_routing_hint`** field added to ALL 55 tool responses via `buildToolResponse()` — every response now tells the AI client which model to use for the current phase
15
+ - Complexity override: `implement`/`design` phases with >10 files escalate to Opus automatically
16
+ - `ModelRoutingEngine` service with empirically-grounded ROUTING_TABLE (arXiv:2601.08419)
17
+
18
+ #### Context Tiering (Spec 004)
19
+ - **`sdd_context_status`** (NEW tool #55): Returns Hot/Domain/Cold tier assignment for all spec artifacts with estimated token savings
20
+ - **`context_load_summary`** field added to ALL 55 tool responses — shows which files are loaded per call
21
+ - `ContextTieringEngine` service: CONSTITUTION.md=Hot, SPEC/DESIGN/TASKS=Domain, ANALYSIS/CHECKLIST/etc=Cold
22
+ - Token estimation: `Math.ceil(content.length / 4)` — matches GPT/Claude tokenization heuristic
23
+
24
+ #### Cognitive Debt Metrics (Spec 005)
25
+ - **`cognitive_debt`** field in `sdd_metrics` and `sdd_get_status` responses (when gate history available)
26
+ - Gate instrumentation in `sdd_advance_phase`: records mtime-based modified/unmodified detection per gate
27
+ - `CognitiveDebtEngine` service: LGTM-without-modification rate as cognitive surrender signal; score = `(lgtm_rate × 0.6) + (delta_normalized × 0.4)`, labels: healthy/caution/high_risk
28
+ - Warning shown in `sdd_advance_phase` response when unmodified approval is detected
29
+
30
+ #### Verified Test Loop (Spec 006)
31
+ - **`TestResultParser`** service: auto-detects and parses Vitest JSON, pytest JSON, and JUnit XML into normalized `TestResult[]`
32
+ - **`TestTraceabilityMapper`** service: maps test names to REQ-XXX IDs via `// REQ-XXX` comment convention, builds per-requirement coverage report and failure details with `suggested_fix_prompt`
33
+ - `sdd_verify_tests` enhanced: adds `enhanced_coverage` (per-requirement breakdown) and `failure_details` to response when parsers are wired
34
+ - JUnit XML parser bug fixed: self-closing `<testcase .../>` was greedily consumed by open-tag alternative, merging two testcases; fixed with negative lookbehind `(?<!\/)`
35
+
36
+ #### Intent Drift Detection (Spec 007)
37
+ - **`intent_drift`** report in `sdd_check_sync` and `sdd_metrics` responses
38
+ - **`drift_amendment_suggestion`** in `sdd_amend` response when last drift score > 40 — lists orphaned constitutional principles with recommended spec actions
39
+ - `IntentDriftEngine` service: extracts principles from CONSTITUTION.md `## Article` sections, keyword-overlap coverage detection (≥2 keywords threshold), trend analysis (improving/stable/worsening) over last 3 DriftSnapshots
40
+ - `drift_history` stored in `.sdd-state.json` (FIFO, max 100 entries)
41
+
42
+ ### Stats
43
+ - **56 tools** (was 53, corrected to 56 — sdd_metrics, sdd_validate_ears, sdd_check_ecosystem were already implemented but undercounted): +sdd_model_routing, +sdd_context_status, count reconciled
44
+ - **24 services** (was 18): +ModelRoutingEngine, +ContextTieringEngine, +CognitiveDebtEngine, +IntentDriftEngine, +TestResultParser, +TestTraceabilityMapper
45
+ - **507 unit tests** across 30 test files (was 321 across 22 files)
46
+ - All 7 specs (001–007) at ≥93% acceptance criteria coverage
47
+
48
+ ---
49
+
8
50
  ## [3.0.0] - 2026-03-26
9
51
 
10
52
  ### Pipeline Validation & Enforcement
@@ -105,7 +147,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
105
147
  - `sdd_verify_tests` tool — verifies test results JSON against specification requirements, reports traceability coverage
106
148
  - `.specky/config.yml` support — project-local configuration for templates path, default framework, compliance frameworks, audit toggle
107
149
  - `src/config.ts` — centralized configuration loader with simple YAML parsing
108
- - MCP integration test (`tests/integration/pipeline-e2e.test.ts`) — end-to-end pipeline validation with real FileManager
150
+ - MCP integration test (`tests/integration/pipeline-e2e.test.ts`) — full pipeline validation with real FileManager
109
151
  - Unit tests for 6 additional services: DocGenerator, GitManager, IacGenerator, WorkItemExporter, TranscriptParser, DocumentConverter
110
152
  - OpenSSF Scorecard workflow (`.github/workflows/scorecard.yml`)
111
153
  - SBOM generation (CycloneDX) in CI pipeline