@ipation/specbridge 1.0.1 → 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 +141 -0
- package/README.md +13 -1
- package/dist/cli.js +16 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,147 @@ 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
|
+
|
|
107
|
+
## [1.0.2] - 2026-01-29
|
|
108
|
+
|
|
109
|
+
### Improved
|
|
110
|
+
|
|
111
|
+
#### Test Coverage
|
|
112
|
+
- **Overall coverage**: 54.34% → **67.37%** (+24% improvement)
|
|
113
|
+
- **Functions coverage**: 74.43% → **78.21%** (+5.08%)
|
|
114
|
+
- **Branches coverage**: 71.07% → **81.95%** (+15.3%)
|
|
115
|
+
- **Total tests**: 170 → **312** (+142 tests, +83.5% growth)
|
|
116
|
+
|
|
117
|
+
#### Verification Verifiers (Critical)
|
|
118
|
+
- **Module coverage**: 15.98% → **99.72%** 🎉
|
|
119
|
+
- Added `naming.test.ts` - 27 tests, 0% → 100% coverage
|
|
120
|
+
- Added `imports.test.ts` - 27 tests, 5.95% → 100% coverage
|
|
121
|
+
- Added `errors.test.ts` - 31 tests, 4.8% → 99.03% coverage
|
|
122
|
+
- Added `regex.test.ts` - 27 tests, 36.84% → 100% coverage
|
|
123
|
+
|
|
124
|
+
#### Inference Analyzers
|
|
125
|
+
- Added `base.test.ts` - 30 tests, 10% → 100% coverage
|
|
126
|
+
- Tests for `createPattern()`, `calculateConfidence()`, `extractSnippet()` helpers
|
|
127
|
+
|
|
128
|
+
#### Quality Metrics
|
|
129
|
+
- ✅ **312 tests passing** (100% pass rate)
|
|
130
|
+
- ✅ **67.37% test coverage** (exceeds 67% threshold)
|
|
131
|
+
- ✅ **No type errors**
|
|
132
|
+
- ✅ **Build succeeds**
|
|
133
|
+
- ✅ **Pre-commit hooks pass**
|
|
134
|
+
|
|
135
|
+
### Changed
|
|
136
|
+
- Updated coverage thresholds in `vitest.config.ts`:
|
|
137
|
+
- Lines: 54% → 67%
|
|
138
|
+
- Functions: 65% → 78%
|
|
139
|
+
- Branches: 65% → 78%
|
|
140
|
+
- Statements: 54% → 67%
|
|
141
|
+
|
|
142
|
+
## [1.0.1] - 2026-01-29
|
|
143
|
+
|
|
144
|
+
### Fixed
|
|
145
|
+
- Address 5 critical issues in v1.0.0 codebase
|
|
146
|
+
- Self-dogfooding implementation
|
|
147
|
+
|
|
148
|
+
### Added
|
|
149
|
+
- Applied SpecBridge to itself for validation
|
|
150
|
+
|
|
10
151
|
## [1.0.0] - 2026-01-29
|
|
11
152
|
|
|
12
153
|
### 🎉 First Stable Release
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/nouatzi/specbridge/actions)
|
|
4
4
|
[](https://www.npmjs.com/package/@ipation/specbridge)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://nodejs.org)
|
|
7
7
|
|
|
8
8
|
**Architecture Decision Runtime** - Transform architectural decisions into executable, verifiable constraints.
|
|
9
9
|
|
|
@@ -100,6 +100,18 @@ specbridge context src/api/auth.ts
|
|
|
100
100
|
|
|
101
101
|
Generates architectural context in Markdown format for AI code assistants.
|
|
102
102
|
|
|
103
|
+
## Dogfooding
|
|
104
|
+
|
|
105
|
+
SpecBridge uses itself to enforce its own architectural decisions! We verify:
|
|
106
|
+
|
|
107
|
+
- ✅ Error handling patterns (all errors extend SpecBridgeError)
|
|
108
|
+
- ✅ ESM import conventions (.js extensions required)
|
|
109
|
+
- ✅ Naming conventions (PascalCase/camelCase)
|
|
110
|
+
- ✅ TypeScript strict mode settings
|
|
111
|
+
- ✅ Domain-driven module structure
|
|
112
|
+
|
|
113
|
+
See our [Dogfooding Guide](docs/dogfooding-guide.md) to learn how we use SpecBridge on itself, or explore our decision files in `.specbridge/decisions/` as real-world examples.
|
|
114
|
+
|
|
103
115
|
## Decision File Format
|
|
104
116
|
|
|
105
117
|
Decisions are stored as YAML files in `.specbridge/decisions/`:
|
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
|
-
|
|
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
|
|
1020
|
-
|
|
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
|
-
|
|
1028
|
-
|
|
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:
|
|
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 ${
|
|
1123
|
+
snippet: `throw ${snippet}`
|
|
1120
1124
|
});
|
|
1121
1125
|
}
|
|
1122
1126
|
}
|