@ipation/specbridge 1.0.2 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -7,6 +7,103 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.3] - 2026-01-30
11
+
12
+ ### Improved
13
+
14
+ #### Test Coverage - Major Achievement 🎉
15
+ - **Overall coverage**: 67.37% → **94.07%** (+26.7% improvement, +39.6% total increase from v1.0.1)
16
+ - **Functions coverage**: 78.21% → **96.99%** (+18.78%, now at 97%)
17
+ - **Branches coverage**: 81.95% → **93.93%** (+11.98%, exceeds 87% target)
18
+ - **Statements coverage**: 67.37% → **94.07%** (+26.7%, exceeds 83% target)
19
+ - **Total tests**: 312 → **762** (+450 tests, +144% growth)
20
+
21
+ **All coverage targets exceeded by 7-14 percentage points!**
22
+
23
+ #### Sprint 1: Foundation Components (New Tests)
24
+ - **Scanner Tests** - Added `scanner.test.ts`: 580 lines, 48 tests
25
+ - Coverage: 0% → **99.38%** (was completely untested)
26
+ - Tests all 8 public methods with comprehensive edge cases
27
+ - Handles malformed files, nested structures, large file sets
28
+
29
+ - **Propagation Graph Tests** - Added `graph.test.ts`: 480 lines, 34 tests
30
+ - Coverage: 0% → **100%** (was completely untested)
31
+ - Tests dependency graph building, transitive dependencies
32
+ - Edge cases: cycles, empty graphs, overlapping scopes
33
+
34
+ - **Core Error Classes Tests** - Added `errors.test.ts`: 400 lines
35
+ - All 11 error classes comprehensively tested
36
+ - formatError() function validated with edge cases
37
+ - Error inheritance chain and special character handling
38
+
39
+ - **Verification Engine** - Extended `engine.test.ts`: +280 lines
40
+ - Added timeout handling, severity filtering, exception lifecycle
41
+ - Edge cases: empty sourceRoots, concurrent calls, malformed files
42
+ - Coverage improved with comprehensive scenario testing
43
+
44
+ - **Registry** - Extended `registry.test.ts`: +290 lines
45
+ - Filter combinations (status+tags, constraintType+severity)
46
+ - Additional methods: has(), getIds(), getByOwner(), getByTag()
47
+ - Coverage: **100%** (maintained and enhanced)
48
+
49
+ - **Reporter** - Extended `reporter.test.ts`: +320 lines
50
+ - formatAsTableGrouped(), formatAsMarkdown() comprehensive tests
51
+ - checkDegradation() function fully tested
52
+ - generateComplianceReport() edge cases covered
53
+
54
+ #### Sprint 2: Partial Coverage Improvements
55
+ - **Agent Context Generator** - Extended `context.generator.test.ts`: +400 lines, 42 total tests
56
+ - Coverage: 43.52% → **98.96%** (+55.44%, highest improvement)
57
+ - Standalone functions fully tested: generateContext, formatContextAsMarkdown, formatContextAsJson, formatContextAsMcp
58
+ - Format conversion validation (markdown/JSON/MCP)
59
+ - Rationale inclusion/exclusion scenarios
60
+
61
+ - **Propagation Engine** - Extended `engine.test.ts`: +200 lines, 29 total tests
62
+ - Coverage: 62.5% → **76.92%** (+14.42%)
63
+ - Migration step generation and prioritization tested
64
+ - Effort estimation with various scenarios
65
+ - Auto-fix detection and affected files handling
66
+
67
+ - **Registry Loader** - Extended `loader.test.ts`: +200 lines, 11 new tests
68
+ - Coverage: 67.21% → **100%** (+32.79%)
69
+ - validateDecisionFile() function completely tested
70
+ - Schema validation, corrupted file handling
71
+ - All error scenarios validated
72
+
73
+ #### Components at Perfect Coverage (100%)
74
+ - ✅ Registry (100%)
75
+ - ✅ Registry Loader (100%)
76
+ - ✅ Propagation Graph (100%)
77
+ - ✅ Analyzers (100%)
78
+ - ✅ Config Schemas (100%)
79
+ - ✅ Utils (100%)
80
+
81
+ #### Components at Excellent Coverage (95-99%)
82
+ - ✅ Agent Context Generator (98.96%)
83
+ - ✅ Scanner (99.38%)
84
+ - ✅ Verifiers (99.72%)
85
+ - ✅ Functions (96.99%)
86
+
87
+ #### Quality Metrics
88
+ - ✅ **762 tests passing** (100% pass rate, +450 tests)
89
+ - ✅ **94.07% test coverage** (exceeds all thresholds)
90
+ - ✅ **No type errors**
91
+ - ✅ **Build succeeds**
92
+ - ✅ **Test-to-source ratio**: ~1.7:1
93
+ - ✅ **Production-ready quality**
94
+
95
+ ### Changed
96
+ - Updated coverage thresholds in `vitest.config.ts`:
97
+ - Lines: 67% → **83%**
98
+ - Functions: 78% → **83%**
99
+ - Branches: 78% → **87%**
100
+ - Statements: 67% → **83%**
101
+
102
+ ### Added
103
+ - Comprehensive test helpers and fixtures for easier test creation
104
+ - Integration test scenarios for multi-command workflows
105
+ - Edge case testing for all critical components
106
+
10
107
  ## [1.0.2] - 2026-01-29
11
108
 
12
109
  ### Improved
package/dist/cli.js CHANGED
@@ -1005,9 +1005,7 @@ var ErrorsAnalyzer = class {
1005
1005
  );
1006
1006
  if (errorClasses.length < 2) return null;
1007
1007
  const files = scanner.getFiles();
1008
- let extendsError = 0;
1009
- let extendsCustomBase = 0;
1010
- let customBaseName = null;
1008
+ const baseCount = /* @__PURE__ */ new Map();
1011
1009
  for (const errorClass of errorClasses) {
1012
1010
  const file = files.find((f) => f.path === errorClass.file);
1013
1011
  if (!file) continue;
@@ -1016,22 +1014,27 @@ var ErrorsAnalyzer = class {
1016
1014
  const extendClause = classDecl.getExtends();
1017
1015
  if (extendClause) {
1018
1016
  const baseName = extendClause.getText();
1019
- if (baseName === "Error") {
1020
- extendsError++;
1021
- } else if (baseName.endsWith("Error")) {
1022
- extendsCustomBase++;
1023
- customBaseName = customBaseName || baseName;
1017
+ if (baseName !== "Error" && baseName.endsWith("Error")) {
1018
+ baseCount.set(baseName, (baseCount.get(baseName) || 0) + 1);
1024
1019
  }
1025
1020
  }
1026
1021
  }
1027
- if (extendsCustomBase >= 2 && customBaseName) {
1028
- const confidence = calculateConfidence(extendsCustomBase, errorClasses.length);
1022
+ let customBaseName = null;
1023
+ let maxCount = 0;
1024
+ for (const [baseName, count] of baseCount.entries()) {
1025
+ if (count > maxCount) {
1026
+ maxCount = count;
1027
+ customBaseName = baseName;
1028
+ }
1029
+ }
1030
+ if (maxCount >= 3 && customBaseName) {
1031
+ const confidence = calculateConfidence(maxCount, errorClasses.length);
1029
1032
  return createPattern(this.id, {
1030
1033
  id: "errors-custom-base",
1031
1034
  name: "Custom Error Base Class",
1032
1035
  description: `Custom errors extend a common base class (${customBaseName})`,
1033
1036
  confidence,
1034
- occurrences: extendsCustomBase,
1037
+ occurrences: maxCount,
1035
1038
  examples: errorClasses.slice(0, 3).map((c) => ({
1036
1039
  file: c.file,
1037
1040
  line: c.line,
@@ -1113,10 +1116,11 @@ var ErrorsAnalyzer = class {
1113
1116
  } else if (text.startsWith("new ") && text.includes("Error")) {
1114
1117
  throwCustom++;
1115
1118
  if (examples.length < 3) {
1119
+ const snippet = text.length > 50 ? text.slice(0, 50) + "..." : text;
1116
1120
  examples.push({
1117
1121
  file: path,
1118
1122
  line: node.getStartLineNumber(),
1119
- snippet: `throw ${text.slice(0, 50)}${text.length > 50 ? "..." : ""}`
1123
+ snippet: `throw ${snippet}`
1120
1124
  });
1121
1125
  }
1122
1126
  }