speckeeper 0.18.3 → 0.19.1
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/README.md +21 -15
- package/cli-contract.yaml +12 -50
- package/dist/{config-api-Cb0MQ5Z3.d.ts → config-api-BVPg8Ewm.d.ts} +1 -11
- package/dist/dsl/index.d.ts +2 -2
- package/dist/external/insight-provider.d.ts +1 -1
- package/dist/external/insight-provider.js +3 -3
- package/dist/index.d.ts +5 -4
- package/dist/index.js +15 -82
- package/dist/{relation-C3TpA8D3.d.ts → relation-FGdEl6Yg.d.ts} +2 -1
- package/dist/speckeeper.bundle.mjs +491 -605
- package/docs/cli-reference.md +10 -14
- package/docs/design/cli-commands.md +10 -20
- package/docs/design/functional-requirements.md +3 -3
- package/docs/design/nonfunctional-requirements.md +3 -2
- package/docs/design/test-refs.md +30 -5
- package/docs/design/usecases.md +2 -2
- package/docs/framework_requirements_spec.md +15 -18
- package/docs/model-guide.md +4 -12
- package/package.json +5 -5
- package/specs/index.json +96 -80
package/docs/cli-reference.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript-first specification validation framework — validate design consistency, external SSOT integrity, and traceability with type-safe TypeScript DSL. Supports design lint, external source checks (OpenAPI, DDL, annotations), drift detection, impact analysis, and scaffolding from Mermaid flowcharts.
|
|
4
4
|
|
|
5
|
-
**Version:** 0.
|
|
5
|
+
**Version:** 0.19.1
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
@@ -88,7 +88,7 @@ speckeeper init --format yaml
|
|
|
88
88
|
|
|
89
89
|
Generate docs/ and specs/ from TypeScript models.
|
|
90
90
|
|
|
91
|
-
Loads the design TypeScript models and generates machine-readable specs/
|
|
91
|
+
Loads the design TypeScript models and generates the machine-readable specs/ and the human-readable docs/ output.
|
|
92
92
|
|
|
93
93
|
**Usage:**
|
|
94
94
|
|
|
@@ -96,7 +96,7 @@ Loads the design TypeScript models and generates machine-readable specs/ output
|
|
|
96
96
|
speckeeper build
|
|
97
97
|
```
|
|
98
98
|
```
|
|
99
|
-
speckeeper build --
|
|
99
|
+
speckeeper build --output ./out
|
|
100
100
|
```
|
|
101
101
|
```
|
|
102
102
|
speckeeper build --verbose
|
|
@@ -107,9 +107,7 @@ speckeeper build --verbose
|
|
|
107
107
|
| Option | Aliases | Required | Default | Description |
|
|
108
108
|
|---|---|---|---|---|
|
|
109
109
|
| `--config` | -c | No | | Path to config file. |
|
|
110
|
-
| `--output` | -o | No | `"."` | Base
|
|
111
|
-
| `--format` | -f | No | `"both"` | Output format: markdown, json, both. |
|
|
112
|
-
| `--watch` | -w | No | `false` | Watch for changes and auto-regenerate. |
|
|
110
|
+
| `--output` | -o | No | `"."` | Base directory the docs/ and specs/ trees are written under. |
|
|
113
111
|
| `--verbose` | -v | No | `false` | Show detailed output. |
|
|
114
112
|
|
|
115
113
|
#### Exit Codes
|
|
@@ -225,17 +223,17 @@ Validates specifications against actual implementation artifacts using a global
|
|
|
225
223
|
speckeeper check
|
|
226
224
|
```
|
|
227
225
|
```
|
|
228
|
-
speckeeper check
|
|
226
|
+
speckeeper check openapi --verbose
|
|
229
227
|
```
|
|
230
228
|
```
|
|
231
|
-
speckeeper check
|
|
229
|
+
speckeeper check --coverage
|
|
232
230
|
```
|
|
233
231
|
|
|
234
232
|
#### Arguments
|
|
235
233
|
|
|
236
234
|
| Name | Required | Description |
|
|
237
235
|
|---|---|---|
|
|
238
|
-
| `type` | No |
|
|
236
|
+
| `type` | No | Source type to scan: the type of a configured source (built in: openapi, ddl, annotation), or all, the default. |
|
|
239
237
|
|
|
240
238
|
#### Options
|
|
241
239
|
|
|
@@ -284,16 +282,14 @@ speckeeper new entity
|
|
|
284
282
|
|
|
285
283
|
| Name | Required | Description |
|
|
286
284
|
|---|---|---|
|
|
287
|
-
| `type` | Yes | Element type to create. |
|
|
285
|
+
| `type` | Yes | Element type to create: the ID of a model the config registers. |
|
|
288
286
|
|
|
289
287
|
#### Options
|
|
290
288
|
|
|
291
289
|
| Option | Aliases | Required | Default | Description |
|
|
292
290
|
|---|---|---|---|---|
|
|
293
|
-
| `--kind` | -k | No | | Sub-kind (e.g. functional, non-functional for requirements). |
|
|
294
291
|
| `--name` | -n | No | | Name of the element. |
|
|
295
292
|
| `--output` | -o | No | | Output directory path. |
|
|
296
|
-
| `--template` | -t | No | | Path to template file. |
|
|
297
293
|
| `--dry-run` | | No | `false` | Preview generated file content without writing. |
|
|
298
294
|
|
|
299
295
|
#### Exit Codes
|
|
@@ -302,7 +298,7 @@ speckeeper new entity
|
|
|
302
298
|
|
|
303
299
|
- **stdout:** format=`text`
|
|
304
300
|
|
|
305
|
-
**Exit 1:** Creation failed.
|
|
301
|
+
**Exit 1:** Creation failed (the type is not a model the config registers, or the file exists).
|
|
306
302
|
|
|
307
303
|
- **stderr:** format=`text`
|
|
308
304
|
|
|
@@ -1817,7 +1813,7 @@ speckeeper impact ENT-ORDER --format json | speckeeper explain-impact --adapter
|
|
|
1817
1813
|
|
|
1818
1814
|
- **stderr:** format=`text`
|
|
1819
1815
|
|
|
1820
|
-
**Exit 2:**
|
|
1816
|
+
**Exit 2:** Input error (no input on stdin, or an invalid argument).
|
|
1821
1817
|
|
|
1822
1818
|
- **stderr:** format=`text`
|
|
1823
1819
|
|
|
@@ -39,9 +39,7 @@ speckeeper build [options]
|
|
|
39
39
|
| Name | Kind | Type | Required | Default | Description |
|
|
40
40
|
|------|------|------|----------|---------|-------------|
|
|
41
41
|
| -c, --config | option | path | | - | Path to config file |
|
|
42
|
-
| -o, --output | option | path | | . |
|
|
43
|
-
| -f, --format | option | enum (markdown, json, both) | | both | Output format |
|
|
44
|
-
| -w, --watch | option | boolean | | false | Watch file changes and auto-regenerate |
|
|
42
|
+
| -o, --output | option | path | | . | Base directory the docs/ and specs/ trees are written under |
|
|
45
43
|
| -v, --verbose | option | boolean | | false | Show detailed output |
|
|
46
44
|
|
|
47
45
|
### Examples
|
|
@@ -49,8 +47,6 @@ speckeeper build [options]
|
|
|
49
47
|
```bash
|
|
50
48
|
speckeeper build
|
|
51
49
|
speckeeper build --output ./dist
|
|
52
|
-
speckeeper build --format markdown
|
|
53
|
-
speckeeper build --watch
|
|
54
50
|
```
|
|
55
51
|
|
|
56
52
|
### Exit Codes
|
|
@@ -95,8 +91,7 @@ speckeeper lint --format json
|
|
|
95
91
|
| Code | Description |
|
|
96
92
|
|------|-------------|
|
|
97
93
|
| 0 | No issues |
|
|
98
|
-
| 1 | Errors found |
|
|
99
|
-
| 2 | Warnings found (in strict mode) |
|
|
94
|
+
| 1 | Errors found, or warnings with --strict |
|
|
100
95
|
|
|
101
96
|
---
|
|
102
97
|
|
|
@@ -151,7 +146,7 @@ speckeeper check [options]
|
|
|
151
146
|
|
|
152
147
|
| Name | Kind | Type | Required | Default | Description |
|
|
153
148
|
|------|------|------|----------|---------|-------------|
|
|
154
|
-
| <type> | argument |
|
|
149
|
+
| <type> | argument | string | | - | Source type to scan, the type of a configured source, or all (the default) |
|
|
155
150
|
| -c, --config | option | path | | - | Path to config file |
|
|
156
151
|
| --strict | option | boolean | | false | Treat warnings as errors |
|
|
157
152
|
| -v, --verbose | option | boolean | | false | Show detailed output |
|
|
@@ -162,10 +157,8 @@ speckeeper check [options]
|
|
|
162
157
|
```bash
|
|
163
158
|
speckeeper check
|
|
164
159
|
speckeeper check openapi
|
|
165
|
-
speckeeper check
|
|
166
|
-
speckeeper check
|
|
167
|
-
speckeeper check external-ssot --verbose
|
|
168
|
-
speckeeper check test --coverage
|
|
160
|
+
speckeeper check annotation --verbose
|
|
161
|
+
speckeeper check --coverage
|
|
169
162
|
```
|
|
170
163
|
|
|
171
164
|
### Exit Codes
|
|
@@ -173,8 +166,7 @@ speckeeper check test --coverage
|
|
|
173
166
|
| Code | Description |
|
|
174
167
|
|------|-------------|
|
|
175
168
|
| 0 | Consistency OK |
|
|
176
|
-
| 1 | Consistency error |
|
|
177
|
-
| 2 | External SSOT file not found |
|
|
169
|
+
| 1 | Consistency error, or an external SSOT file not found |
|
|
178
170
|
|
|
179
171
|
---
|
|
180
172
|
|
|
@@ -226,17 +218,15 @@ speckeeper new [options]
|
|
|
226
218
|
|
|
227
219
|
| Name | Kind | Type | Required | Default | Description |
|
|
228
220
|
|------|------|------|----------|---------|-------------|
|
|
229
|
-
| <type> | argument |
|
|
230
|
-
| -k, --kind | option | string | | - | Sub-kind (e.g., functional, non-functional for requirements) |
|
|
221
|
+
| <type> | argument | string | ✓ | - | Element type to create, the ID of a model the config registers |
|
|
231
222
|
| -n, --name | option | string | | - | Name of the element |
|
|
232
223
|
| -o, --output | option | path | | - | Output directory path |
|
|
233
|
-
| -t, --template | option | path | | - | Path to template file |
|
|
234
224
|
| --dry-run | option | boolean | | false | Preview generated file content without writing |
|
|
235
225
|
|
|
236
226
|
### Examples
|
|
237
227
|
|
|
238
228
|
```bash
|
|
239
|
-
speckeeper new requirement --
|
|
229
|
+
speckeeper new requirement --name "User Login"
|
|
240
230
|
speckeeper new entity --dry-run
|
|
241
231
|
```
|
|
242
232
|
|
|
@@ -409,8 +399,7 @@ speckeeper impact ENT-ORDER --format json | speckeeper explain-impact --adapter
|
|
|
409
399
|
|------|-------------|
|
|
410
400
|
| 0 | Explanation completed |
|
|
411
401
|
| 1 | Unexpected error |
|
|
412
|
-
| 2 |
|
|
413
|
-
| 3 | No input on stdin |
|
|
402
|
+
| 2 | Input error (no input on stdin, or an invalid argument) |
|
|
414
403
|
| 10 | Completed with blocking findings |
|
|
415
404
|
| 11 | Runtime dependency missing |
|
|
416
405
|
| 12 | LLM provider or adapter error |
|
|
@@ -740,6 +729,7 @@ speckeeper extract [options]
|
|
|
740
729
|
| <commands> | argument | string | | - | Command IDs to extract, in dot notation |
|
|
741
730
|
| -a, --all | option | boolean | | false | Extract all commands |
|
|
742
731
|
| --include-meta | option | boolean | | true | Include extraction metadata |
|
|
732
|
+
| --no-include-meta | option | boolean | | - | Leave out the extraction metadata |
|
|
743
733
|
| -F, --format | option | enum (yaml, json) | | yaml | Output format |
|
|
744
734
|
|
|
745
735
|
### Examples
|
|
@@ -414,7 +414,7 @@ Since consistency checks are implemented per model, filter by model name
|
|
|
414
414
|
### Acceptance Criteria
|
|
415
415
|
|
|
416
416
|
- **FR-602-01**: speckeeper check runs external SSOT consistency check for all models [test]
|
|
417
|
-
- **FR-602-02**: speckeeper check [type]
|
|
417
|
+
- **FR-602-02**: speckeeper check [type] scans only the configured sources of that type (openapi, ddl, annotation, or a custom source type) [test]
|
|
418
418
|
- **FR-602-03**: Type argument corresponds to check categories, not model IDs [review]
|
|
419
419
|
- **FR-602-04**: Only models with externalChecker are targeted [test]
|
|
420
420
|
|
|
@@ -473,8 +473,8 @@ To consolidate check logic with model definitions, reducing management overhead
|
|
|
473
473
|
|
|
474
474
|
- **FR-605-01**: Scaffold does not generate _checkers/ directory [test]
|
|
475
475
|
- **FR-605-02**: Verification logic is included in _models/ model definitions [test]
|
|
476
|
-
- **FR-605-03**: speckeeper check
|
|
477
|
-
- **FR-605-04**: speckeeper check
|
|
476
|
+
- **FR-605-03**: speckeeper check uses verification logic from _models/ model definitions only [test]
|
|
477
|
+
- **FR-605-04**: speckeeper check does not reference _checkers/ directory [test]
|
|
478
478
|
- **FR-605-05**: Checker template functions (src/scaffold/templates/checkers/) are removed; checker logic moves to core DSL (src/core/dsl/) [test]
|
|
479
479
|
|
|
480
480
|
---
|
|
@@ -205,8 +205,8 @@ To ensure all acceptance criteria are covered by test cases and maintain spec-te
|
|
|
205
205
|
|
|
206
206
|
- **NFR-013-01**: TestRef definitions (TEST-020~025) exist in design/test-refs.yaml for each CLI test file [test]
|
|
207
207
|
- **NFR-013-02**: TestRefs are linked to corresponding command IDs via implementsCommand [test]
|
|
208
|
-
- **NFR-013-03**: speckeeper check
|
|
209
|
-
- **NFR-013-04**: speckeeper check
|
|
208
|
+
- **NFR-013-03**: speckeeper check succeeds for all TestRefs [test]
|
|
209
|
+
- **NFR-013-04**: speckeeper check --coverage achieves 100% for target acceptance criteria [test]
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
@@ -223,6 +223,7 @@ To ensure specification, DSL contract, and generated implementation stay synchro
|
|
|
223
223
|
### Acceptance Criteria
|
|
224
224
|
|
|
225
225
|
- **NFR-014-01**: All command definitions in design/cli-commands.yaml match cli-contract.yaml and generated code (parameters, subcommands, exit codes) [test]
|
|
226
|
+
- **NFR-014-02**: The CLI rejects an option or argument value outside the values cli-contract.yaml declares for it (enum, integer, minimum) before the command runs, and ends with the contract's input-error exit (2 where the command declares it, 1 otherwise) [test]
|
|
226
227
|
|
|
227
228
|
---
|
|
228
229
|
|
package/docs/design/test-refs.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
| TEST-045 | Check command source filtering verification test | vitest | 1 |
|
|
35
35
|
| TEST-050 | Scan diagnostic severity and opt-in deep validation verification test | vitest | 7 |
|
|
36
36
|
| TEST-051 | Absent spec ID warning verification test | vitest | 3 |
|
|
37
|
-
| TEST-070 | Common lint item verification test | vitest |
|
|
37
|
+
| TEST-070 | Common lint item verification test | vitest | 4 |
|
|
38
38
|
| TEST-071 | Core-provided test verification logic test | vitest | 1 |
|
|
39
39
|
| TEST-072 | External SSOT reference interface test | vitest | 1 |
|
|
40
40
|
| TEST-073 | External SSOT constraint check test | vitest | 2 |
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
| TEST-080 | LLM-backed command verification test (prompt construction, --show-prompt, report format, proposed link schema) | vitest | 5 |
|
|
48
48
|
| TEST-081 | Command performance verification test at the declared requirement, file and entity scale | vitest | 1 |
|
|
49
49
|
| TEST-082 | Per-target LLM review verification test (declaration, context, packet hash, judge, credentials, output schema, incremental runs, verifier, records, lint gate, emit/ingest, rebaseline) | vitest | 15 |
|
|
50
|
+
| TEST-083 | Contract value check verification test (values outside what cli-contract.yaml declares are rejected before a command runs) | vitest | 1 |
|
|
50
51
|
|
|
51
52
|
---
|
|
52
53
|
|
|
@@ -107,6 +108,7 @@
|
|
|
107
108
|
| Acceptance Criteria ID | Pattern | Description |
|
|
108
109
|
|------------------------|---------|-------------|
|
|
109
110
|
| FR-104-08 | `FR-104-08.*modelLevel configuration` | modelLevel setting test |
|
|
111
|
+
| FR-104-08 | `FR-104-08 reports a relation whose target level the modelLevel of the models does not allow` | The modelLevel of the models drives lint's relation level check |
|
|
110
112
|
| FR-104-09 | `FR-104-09.*level.*property` | level property retrieval test |
|
|
111
113
|
|
|
112
114
|
---
|
|
@@ -300,7 +302,7 @@
|
|
|
300
302
|
|
|
301
303
|
| Acceptance Criteria ID | Pattern | Description |
|
|
302
304
|
|------------------------|---------|-------------|
|
|
303
|
-
| FR-104-01 | `FR-104-01.*
|
|
305
|
+
| FR-104-01 | `FR-104-01.*model types the config registers` | Element types are the models the config registers |
|
|
304
306
|
|
|
305
307
|
---
|
|
306
308
|
|
|
@@ -867,6 +869,7 @@
|
|
|
867
869
|
- FR-101
|
|
868
870
|
- FR-102
|
|
869
871
|
- FR-401
|
|
872
|
+
- FR-701
|
|
870
873
|
|
|
871
874
|
### Test Case Patterns
|
|
872
875
|
|
|
@@ -880,6 +883,8 @@
|
|
|
880
883
|
| FR-102-03 | `FR-102-03 prohibits a TBD once the gate reaches its deadline phase` | A TBD is allowed before its deadline phase and prohibited at it |
|
|
881
884
|
| FR-401-05 | `FR-401-05 reports every slot left unresolved at the specified phase` | Every TBD still unresolved at the specified phase is reported |
|
|
882
885
|
| FR-401-06 | `FR-401-06 detects an element that takes part in no relation` | Orphan elements are detected |
|
|
886
|
+
| FR-401-04 | `FR-401-04 reports a cycle through one-way relations and names its path` | Lint reports a cycle through one-way relations |
|
|
887
|
+
| FR-701-05 | `FR-701-05 reports a relation whose source is not more concrete than its target` | Lint reports a relation the level constraint of its type does not allow |
|
|
883
888
|
|
|
884
889
|
---
|
|
885
890
|
|
|
@@ -980,7 +985,7 @@
|
|
|
980
985
|
| Acceptance Criteria ID | Pattern | Description |
|
|
981
986
|
|------------------------|---------|-------------|
|
|
982
987
|
| FR-605-02 | `FR-605-02 the registered models declare the verification logic themselves` | The registered models carry the verification logic in their own definitions |
|
|
983
|
-
| FR-605-03 | `FR-605-03 check
|
|
988
|
+
| FR-605-03 | `FR-605-03 check reports exactly what the declared checkers report` | The check command reports only what the model-declared checkers produce |
|
|
984
989
|
| FR-1017-01 | `FR-1017-01 uses the path each spec configures` | A configured source path is the path the checker resolves |
|
|
985
990
|
| FR-1017-02 | `FR-1017-02 falls back to a hardcoded default when the spec configures no path` | Without a configured path the checker uses its hardcoded default |
|
|
986
991
|
|
|
@@ -1199,8 +1204,8 @@
|
|
|
1199
1204
|
| FR-1200-03 | `FR-1200-03 lets defineReviewOutput add only extra fields, and records them under extra` | lets defineReviewOutput add only extra fields, and records them under extra |
|
|
1200
1205
|
| FR-1201-01 | `FR-1201-01 accepts an async provider and hashes the files it reports` | accepts an async provider and hashes the files it reports |
|
|
1201
1206
|
| FR-1201-02 | `FR-1201-02 the relations provider follows the impact traversal with depth, relation types and an edge filter, in a stable order` | the relations provider follows the impact traversal with depth, relation types and an edge filter, in a stable order |
|
|
1202
|
-
| FR-1202-01 | `FR-1202-01 NFR-017-01 the same specs and config give the same hash regardless of order, line endings and
|
|
1203
|
-
| NFR-017-01 | `FR-1202-01 NFR-017-01 the same specs and config give the same hash regardless of order, line endings and
|
|
1207
|
+
| FR-1202-01 | `FR-1202-01 NFR-017-01 the same specs and config give the same hash regardless of order, line endings, concurrency and where the checkout is` | the same specs and config give the same hash regardless of order, line endings, concurrency and where the checkout is |
|
|
1208
|
+
| NFR-017-01 | `FR-1202-01 NFR-017-01 the same specs and config give the same hash regardless of order, line endings, concurrency and where the checkout is` | the same specs and config give the same hash regardless of order, line endings, concurrency and where the checkout is |
|
|
1204
1209
|
| FR-1202-02 | `FR-1202-02 --show-packet prints the packet without calling the LLM` | --show-packet prints the packet without calling the LLM |
|
|
1205
1210
|
| FR-1202-03 | `FR-1202-03 records the judge signature apart from the packet hash, which does not depend on the model` | records the judge signature apart from the packet hash, which does not depend on the model |
|
|
1206
1211
|
| FR-1203-01 | `FR-1203-01 creates each adapter without tools and with an empty temporary working directory` | creates each adapter without tools and with an empty temporary working directory |
|
|
@@ -1234,3 +1239,23 @@
|
|
|
1234
1239
|
| FR-1212-02 | `FR-1212-02 needs --reason and leaves targets without a record alone` | needs --reason and leaves targets without a record alone |
|
|
1235
1240
|
|
|
1236
1241
|
---
|
|
1242
|
+
|
|
1243
|
+
## TEST-083: Contract value check verification test (values outside what cli-contract.yaml declares are rejected before a command runs)
|
|
1244
|
+
|
|
1245
|
+
### Test Source
|
|
1246
|
+
|
|
1247
|
+
- **Path**: `test/cli/declared-values.test.ts`
|
|
1248
|
+
- **Framework**: vitest
|
|
1249
|
+
|
|
1250
|
+
### Verified Requirements
|
|
1251
|
+
|
|
1252
|
+
- NFR-014
|
|
1253
|
+
|
|
1254
|
+
### Test Case Patterns
|
|
1255
|
+
|
|
1256
|
+
| Acceptance Criteria ID | Pattern | Description |
|
|
1257
|
+
|------------------------|---------|-------------|
|
|
1258
|
+
| NFR-014-02 | `NFR-014-02 .* rejects a value it does not declare with the input-error exit` | Every value the contract restricts is rejected outside its declaration |
|
|
1259
|
+
| NFR-014-02 | `NFR-014-02 .* ends with (exit 1|the input-error exit 2)` | The CLI ends an undeclared value with the contract's input-error exit |
|
|
1260
|
+
|
|
1261
|
+
---
|
package/docs/design/usecases.md
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
### Main Flow
|
|
69
69
|
|
|
70
|
-
1. Run speckeeper check
|
|
70
|
+
1. Run speckeeper check
|
|
71
71
|
2. Load OpenAPI/DDL files
|
|
72
72
|
3. Verify requirement-external SSOT consistency
|
|
73
73
|
4. Display verification results
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
|
|
108
108
|
### Main Flow
|
|
109
109
|
|
|
110
|
-
1. Run speckeeper check contract
|
|
110
|
+
1. Run speckeeper check with the contract definitions configured as sources
|
|
111
111
|
2. Compare implementation and contract definition
|
|
112
112
|
3. Report if violations exist
|
|
113
113
|
|
|
@@ -110,13 +110,12 @@ Design artifacts (API specifications, screen specifications, DB schemas, etc.) a
|
|
|
110
110
|
│ ⑦ embedoc build : docs/ marker update │
|
|
111
111
|
├─────────────────────────────────────────────────────────────────┤
|
|
112
112
|
│ Phase 3: ci:verify (Reconciliation) │
|
|
113
|
-
│ ⑧ speckeeper check
|
|
114
|
-
│ ⑨ speckeeper check
|
|
115
|
-
│ ⑩ speckeeper check test --coverage : Coverage verification │
|
|
113
|
+
│ ⑧ speckeeper check : External SSOT consistency │
|
|
114
|
+
│ ⑨ speckeeper check --coverage : Coverage verification │
|
|
116
115
|
│ - TestRef → Requirement (acceptanceCriteria) │
|
|
117
116
|
│ - Requirement → UseCase (satisfies) │
|
|
118
117
|
│ - Component → Requirement (implements) │
|
|
119
|
-
│ - Entity → Artifact (
|
|
118
|
+
│ - Entity → Artifact (traces) │
|
|
120
119
|
└─────────────────────────────────────────────────────────────────┘
|
|
121
120
|
↓ Reference ↓ Consistency check
|
|
122
121
|
┌────────────────────────────────┐ ┌────────────────────────────────┐
|
|
@@ -215,8 +214,7 @@ src/ # Application implementation code (not managed by speckeeper)
|
|
|
215
214
|
- `lint` (Design consistency)
|
|
216
215
|
- `build` (Generate docs/specs)
|
|
217
216
|
- `drift` (Detect manual edits to artifacts)
|
|
218
|
-
- `check
|
|
219
|
-
- `check contract` (Contract consistency, can be omitted when using external SSOT)
|
|
217
|
+
- `check` (External SSOT consistency check)
|
|
220
218
|
<!--@embedoc:end-->
|
|
221
219
|
|
|
222
220
|
---
|
|
@@ -553,7 +551,7 @@ All external SSOT consistency checks are uniformly composed of existence, type,
|
|
|
553
551
|
Provide CLI command to execute external SSOT consistency check
|
|
554
552
|
|
|
555
553
|
- **FR-602-01**: speckeeper check runs external SSOT consistency check for all models [test]
|
|
556
|
-
- **FR-602-02**: speckeeper check [type]
|
|
554
|
+
- **FR-602-02**: speckeeper check [type] scans only the configured sources of that type (openapi, ddl, annotation, or a custom source type) [test]
|
|
557
555
|
- **FR-602-03**: Type argument corresponds to check categories, not model IDs [review]
|
|
558
556
|
- **FR-602-04**: Only models with externalChecker are targeted [test]
|
|
559
557
|
|
|
@@ -563,12 +561,10 @@ Provide CLI command to execute external SSOT consistency check
|
|
|
563
561
|
# External SSOT consistency check for all models
|
|
564
562
|
speckeeper check
|
|
565
563
|
|
|
566
|
-
#
|
|
567
|
-
speckeeper check
|
|
568
|
-
speckeeper check
|
|
569
|
-
speckeeper check
|
|
570
|
-
speckeeper check test # Test reference consistency
|
|
571
|
-
speckeeper check contract # Contract consistency
|
|
564
|
+
# Scan the sources of one type only
|
|
565
|
+
speckeeper check openapi # OpenAPI sources only
|
|
566
|
+
speckeeper check ddl # DDL sources only
|
|
567
|
+
speckeeper check annotation # Annotated code and tests only
|
|
572
568
|
```
|
|
573
569
|
|
|
574
570
|
#### FR-603: External Checker
|
|
@@ -669,8 +665,8 @@ External SSOT and test verification logic is integrated into _models/ definition
|
|
|
669
665
|
|
|
670
666
|
- **FR-605-01**: Scaffold does not generate _checkers/ directory [test]
|
|
671
667
|
- **FR-605-02**: Verification logic is included in _models/ model definitions [test]
|
|
672
|
-
- **FR-605-03**: speckeeper check
|
|
673
|
-
- **FR-605-04**: speckeeper check
|
|
668
|
+
- **FR-605-03**: speckeeper check uses verification logic from _models/ model definitions only [test]
|
|
669
|
+
- **FR-605-04**: speckeeper check does not reference _checkers/ directory [test]
|
|
674
670
|
- **FR-605-05**: Checker template functions (src/scaffold/templates/checkers/) are removed; checker logic moves to core DSL (src/core/dsl/) [test]
|
|
675
671
|
|
|
676
672
|
Implement actual validation logic for externalOpenAPIChecker and externalSqlSchemaChecker, replacing stubs with real file parsing and verification
|
|
@@ -850,6 +846,7 @@ Business+Domain → Requirements → Design (Policy) → Detailed Design/Impleme
|
|
|
850
846
|
| `satisfies` | L1,L2,L3 | L0,L1 | A.level >= B.level | Design satisfies business/requirements |
|
|
851
847
|
| `refines` | L1,L2,L3 | L0,L1 | A.level > B.level | Requirements refine business, design refines requirements |
|
|
852
848
|
| `verifies` | any | L0,L1 | - | Tests verify business/requirements |
|
|
849
|
+
| `verifiedBy` | any | L2,L3 | - | Spec is verified by test code |
|
|
853
850
|
| `dependsOn` | any | any | A.level >= B.level | Same level or concrete→abstract |
|
|
854
851
|
| `uses` | any | any | - | Runtime reference (no level constraint) |
|
|
855
852
|
| `includes` | any | any | same level | Inclusion within same level |
|
|
@@ -871,7 +868,7 @@ Business+Domain → Requirements → Design (Policy) → Detailed Design/Impleme
|
|
|
871
868
|
Circular references are detected under the following conditions:
|
|
872
869
|
|
|
873
870
|
1. **Direct cycle**: A implements B, B implements A
|
|
874
|
-
2. **Indirect cycle**: A→B→C→A (any combination of relation types)
|
|
871
|
+
2. **Indirect cycle**: A→B→C→A (any combination of one-way relation types; relatedTo and traces link both ways by definition and do not form a cycle)
|
|
875
872
|
3. **Level violation cycle**: Concrete→Abstract→Concrete (level returns)
|
|
876
873
|
|
|
877
874
|
```
|
|
@@ -1040,12 +1037,12 @@ Can be distributed as npm package
|
|
|
1040
1037
|
|
|
1041
1038
|
Refer to `acceptanceCriteria` defined in each requirement (FR-*, NFR-*, CR-*).
|
|
1042
1039
|
|
|
1043
|
-
Verification of acceptance criteria is automated with `speckeeper check
|
|
1040
|
+
Verification of acceptance criteria is automated with `speckeeper check --coverage`,
|
|
1044
1041
|
which confirms that acceptance criteria with `verificationMethod: test` are covered by `TestRef`.
|
|
1045
1042
|
|
|
1046
1043
|
```bash
|
|
1047
1044
|
# Check acceptance criteria coverage
|
|
1048
|
-
npx speckeeper check
|
|
1045
|
+
npx speckeeper check --coverage
|
|
1049
1046
|
```
|
|
1050
1047
|
|
|
1051
1048
|
---
|
package/docs/model-guide.md
CHANGED
|
@@ -49,7 +49,7 @@ Below are examples of models actually defined in the speckeeper project.
|
|
|
49
49
|
|
|
50
50
|
### CLICommand Model (with External SSOT Checker)
|
|
51
51
|
|
|
52
|
-
<!--@embedoc:code_snippet file="design/_models/cli-command.ts" start="
|
|
52
|
+
<!--@embedoc:code_snippet file="design/_models/cli-command.ts" start="384" end="503" lang="typescript" title="design/_models/cli-command.ts (excerpt)" no_source="true"-->
|
|
53
53
|
**design/_models/cli-command.ts (excerpt)**
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
@@ -214,7 +214,7 @@ All models extend the `Model` base class from `src/core/model.ts`.
|
|
|
214
214
|
|
|
215
215
|
### Type Definitions
|
|
216
216
|
|
|
217
|
-
<!--@embedoc:code_snippet file="src/core/model.ts" start="
|
|
217
|
+
<!--@embedoc:code_snippet file="src/core/model.ts" start="25" end="84" lang="typescript" title="src/core/model.ts (Type Definitions)" no_source="true"-->
|
|
218
218
|
**src/core/model.ts (Type Definitions)**
|
|
219
219
|
|
|
220
220
|
```typescript
|
|
@@ -283,7 +283,7 @@ export interface CheckResult {
|
|
|
283
283
|
|
|
284
284
|
### Model Class
|
|
285
285
|
|
|
286
|
-
<!--@embedoc:code_snippet file="src/core/model.ts" start="
|
|
286
|
+
<!--@embedoc:code_snippet file="src/core/model.ts" start="251" end="298" lang="typescript" title="src/core/model.ts (Model Class Properties)" no_source="true"-->
|
|
287
287
|
**src/core/model.ts (Model Class Properties)**
|
|
288
288
|
|
|
289
289
|
```typescript
|
|
@@ -351,15 +351,7 @@ Defines the abstraction level of a model:
|
|
|
351
351
|
|
|
352
352
|
### Relation Types
|
|
353
353
|
|
|
354
|
-
|
|
355
|
-
|------|----------------------|-------------|
|
|
356
|
-
| `implements` | spec→external | Spec is implemented as external artifact (OpenAPI, DDL) |
|
|
357
|
-
| `satisfies` | L1→L0 | Satisfies a use case |
|
|
358
|
-
| `refines` | Same level or lower | Refinement |
|
|
359
|
-
| `verifiedBy` | spec→test | Spec is verified by external test code |
|
|
360
|
-
| `verifies` | test→implementation | Test verifies implementation code (external, no checker generated) |
|
|
361
|
-
| `dependsOn` | None | Dependency |
|
|
362
|
-
| `relatedTo` | None | Association |
|
|
354
|
+
Each relation type allows only some levels for its source and target, and `speckeeper lint` reports a relation that joins other levels (`relation-level`). The levels each type allows are listed in the README's [Relation Types](../README.md#relation-types).
|
|
363
355
|
|
|
364
356
|
---
|
|
365
357
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speckeeper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "TypeScript-first specification validation framework with external SSOT integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"ci": "npm run ci:validate && npm run ci:generate && npm run ci:verify",
|
|
56
56
|
"ci:validate": "npm run typecheck && npm run lint && npm run lint:design && npm run build && npm run bundle && npx speckeeper lint && npm run test:run",
|
|
57
57
|
"ci:generate": "embedoc build",
|
|
58
|
-
"ci:verify": "npx speckeeper check
|
|
58
|
+
"ci:verify": "npx speckeeper check && npx speckeeper check --coverage",
|
|
59
59
|
"test:ci": "vitest run",
|
|
60
60
|
"test:bundle": "vitest run --config vitest.bundle.config.ts"
|
|
61
61
|
},
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
"@types/node-sql-parser": "^1.0.0",
|
|
99
99
|
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
100
100
|
"@typescript-eslint/parser": "^8.65.0",
|
|
101
|
-
"@vitest/coverage-v8": "^4.1.
|
|
101
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
102
102
|
"agent-contracts": "^0.35.5",
|
|
103
103
|
"agent-contracts-runtime": "^0.36.13",
|
|
104
104
|
"chalk": "^6.0.0",
|
|
105
|
-
"cli-contracts": "^0.
|
|
105
|
+
"cli-contracts": "^0.35.0",
|
|
106
106
|
"commander": "^15.0.0",
|
|
107
107
|
"esbuild": "^0.28.1",
|
|
108
108
|
"eslint": "^10.8.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"tsup": "^8.5.1",
|
|
111
111
|
"typescript": "^6.0.3",
|
|
112
112
|
"typescript-eslint": "^8.65.0",
|
|
113
|
-
"vitest": "^4.1.
|
|
113
|
+
"vitest": "^4.1.12"
|
|
114
114
|
},
|
|
115
115
|
"overrides": {
|
|
116
116
|
"js-yaml": "^4.3.2",
|