@mmmnt/feat-analyze 0.1.7 → 0.1.9
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/LICENSE +16 -23
- package/README.md +221 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026, Moment
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# @mmmnt/feat-analyze
|
|
2
|
+
|
|
3
|
+
**Pure analysis for `.feat` specs: lint, audit and format.** Three functions,
|
|
4
|
+
no filesystem, no process, no CLI. Each takes a parsed spec (or the source text)
|
|
5
|
+
and returns findings you can print, gate on or show in an editor.
|
|
6
|
+
|
|
7
|
+
If you only write `.feat` specs, you do not need this package. The `feat lint`,
|
|
8
|
+
`feat audit` and `feat fmt` commands in
|
|
9
|
+
[`@mmmnt/feature`](https://www.npmjs.com/package/@mmmnt/feature) are thin
|
|
10
|
+
callers over these functions and print the exact strings they return. Use this
|
|
11
|
+
package when you embed the same checks in a service, an editor or a bot.
|
|
12
|
+
|
|
13
|
+
## Where it sits
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
.feat source ──► feat-core (parse) ──► BuiltSpec ──► lintSpec(spec) ──► Finding[]
|
|
17
|
+
│ └───────► auditSpec(spec) ──► { errors, warnings }
|
|
18
|
+
└─────────────────────────────────────────────► formatSource(src) ──► { formatted, changed, hasLeadingTab }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The package depends only on
|
|
22
|
+
[`@mmmnt/feat-types`](https://www.npmjs.com/package/@mmmnt/feat-types), for the
|
|
23
|
+
`BuiltSpec` type. It does not parse. To get a `BuiltSpec`, use
|
|
24
|
+
[`@mmmnt/feat-core`](https://www.npmjs.com/package/@mmmnt/feat-core).
|
|
25
|
+
|
|
26
|
+
What the library leaves to a caller, because it needs the filesystem: whether a
|
|
27
|
+
spec has a paired `<name>.contract.json`, and whether its generated test file
|
|
28
|
+
exists. `feat audit` adds both as warnings.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm install @mmmnt/feat-analyze @mmmnt/feat-core
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Requirements:
|
|
37
|
+
|
|
38
|
+
- Node 20 or later (`engines`).
|
|
39
|
+
- ESM only (`"type": "module"`).
|
|
40
|
+
- `@mmmnt/feat-types` installs with it. `@mmmnt/feat-core` is only needed if you
|
|
41
|
+
parse specs yourself, as below.
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { parseSource } from "@mmmnt/feat-core";
|
|
47
|
+
import { auditSpec, formatSource, lintSpec } from "@mmmnt/feat-analyze";
|
|
48
|
+
import type { BuiltSpec } from "@mmmnt/feat-types";
|
|
49
|
+
|
|
50
|
+
const source = `feat 1.0
|
|
51
|
+
|
|
52
|
+
spec SPEC-USR-001 "CreateUser"
|
|
53
|
+
context Users
|
|
54
|
+
aggregate User
|
|
55
|
+
type command
|
|
56
|
+
status draft
|
|
57
|
+
|
|
58
|
+
construct:
|
|
59
|
+
handler at handlers/create-user.ts
|
|
60
|
+
|
|
61
|
+
enforce:
|
|
62
|
+
rejects DUPLICATE_EMAIL when a user with this email already exists
|
|
63
|
+
rejects INVALID_EMAIL when the address is malformed
|
|
64
|
+
|
|
65
|
+
contract:
|
|
66
|
+
input CreateUserInput
|
|
67
|
+
response UserResponse
|
|
68
|
+
record UserRow
|
|
69
|
+
error ErrorResponse
|
|
70
|
+
|
|
71
|
+
scenario "rejects duplicate email":
|
|
72
|
+
when: CreateUser { email: "alice@example.com" }
|
|
73
|
+
predict rejection DUPLICATE_EMAIL:
|
|
74
|
+
response 409 ErrorResponse { code: "DUPLICATE_EMAIL" }
|
|
75
|
+
database has []
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
const parsed = parseSource(source, { serviceKeys: ["database"], commands: ["CreateUser"], actors: [] });
|
|
79
|
+
if (parsed.status !== "OK") throw new Error(JSON.stringify(parsed.body));
|
|
80
|
+
const spec = parsed.body as unknown as BuiltSpec;
|
|
81
|
+
|
|
82
|
+
console.log(lintSpec(spec));
|
|
83
|
+
console.log(auditSpec(spec));
|
|
84
|
+
console.log(formatSource(source).changed);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
That prints:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
[
|
|
91
|
+
{ level: 'warn', message: "warn: schema 'UserResponse' is declared but never referenced by a scenario" },
|
|
92
|
+
{ level: 'warn', message: "warn: schema 'UserRow' is declared but never referenced by a scenario" },
|
|
93
|
+
{ level: 'info', message: 'info: status draft — not buildable until agreed' }
|
|
94
|
+
]
|
|
95
|
+
{
|
|
96
|
+
errors: [
|
|
97
|
+
'B3: no `touches` change boundary declared',
|
|
98
|
+
'B2: `rejects INVALID_EMAIL` is never predicted by any scenario'
|
|
99
|
+
],
|
|
100
|
+
warnings: [ 'status draft — not buildable until agreed' ]
|
|
101
|
+
}
|
|
102
|
+
false
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## API
|
|
106
|
+
|
|
107
|
+
### `lintSpec(spec: BuiltSpec): Finding[]`
|
|
108
|
+
|
|
109
|
+
Language-quality rules beyond the buildability gate (ADR-0007, ADR-0017).
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
interface Finding {
|
|
113
|
+
level: "error" | "warn" | "info";
|
|
114
|
+
message: string; // already prefixed with its level, e.g. "warn: ..."
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| Rule | Level | Message |
|
|
119
|
+
| --- | --- | --- |
|
|
120
|
+
| A contract schema that no scenario references | `warn` | `warn: schema 'X' is declared but never referenced by a scenario` |
|
|
121
|
+
| A variable that nothing references | `warn` | `warn: variable 'x' is declared but never referenced` |
|
|
122
|
+
| The same `kind schema` declared twice in `contract:` | `warn` | `warn: duplicate contract declaration 'kind X'` |
|
|
123
|
+
| The spec is still a draft | `info` | `info: status draft — not buildable until agreed` |
|
|
124
|
+
|
|
125
|
+
What counts as a reference to a schema: the response schema of a prediction,
|
|
126
|
+
every record schema in a `has` or `contains` list, and every `with <Schema>` on
|
|
127
|
+
an inline seed record. `input` entries are used by definition (they are the
|
|
128
|
+
`when:` payload's contract), and `stream` entries are never checked. A variable
|
|
129
|
+
is referenced when a `${name}` appears anywhere in a scenario, or in the template
|
|
130
|
+
of another variable.
|
|
131
|
+
|
|
132
|
+
Findings come in rule order: schemas, variables, duplicates, status. No rule in
|
|
133
|
+
this release returns `level: "error"`; the type allows it so a future rule can.
|
|
134
|
+
A parse failure is the caller's to report, since there is no spec to lint.
|
|
135
|
+
|
|
136
|
+
### `auditSpec(spec: BuiltSpec): AuditResult`
|
|
137
|
+
|
|
138
|
+
The buildability gate of an `agreed` spec (ADR-0008).
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
interface AuditResult {
|
|
142
|
+
errors: string[]; // B1 to B3: block the gate
|
|
143
|
+
warnings: string[]; // lifecycle surfacing: advisory
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
| Rule | Fails when | Message |
|
|
148
|
+
| --- | --- | --- |
|
|
149
|
+
| **B1** | the spec type is `command`, `query`, `policy`, `projection` or `saga` and there is no `handler at` | ``B1: no `handler at` for a code-producing spec type`` |
|
|
150
|
+
| **B3** | there is no `touches` | ``B3: no `touches` change boundary declared`` |
|
|
151
|
+
| **B2**, predicted | a scenario predicts `rejection X` and no `rejects X when ...` line exists | ``B2: predicted rejection 'X' has no `rejects X when …` line`` |
|
|
152
|
+
| **B2**, declared | a `rejects X` line exists and no scenario predicts it | ``B2: `rejects X` is never predicted by any scenario`` |
|
|
153
|
+
|
|
154
|
+
Errors come in the order B1, B3, B2 (predicted first, then declared). Types
|
|
155
|
+
`infrastructure`, `integration` and `scaffold` are exempt from B1 but not from
|
|
156
|
+
B3. B2 is two-way: every rejection a spec promises is predicted, and every
|
|
157
|
+
predicted rejection is promised. Rejection ids are compared exactly and
|
|
158
|
+
case-sensitively (ADR-0022), so `NotOperator` and `NOT_OPERATOR` are different
|
|
159
|
+
ids.
|
|
160
|
+
|
|
161
|
+
In a scenario outline, a rejection id written as a placeholder (`<code>`) is
|
|
162
|
+
resolved through the `examples:` rows: every string value in that column counts
|
|
163
|
+
as a predicted id.
|
|
164
|
+
|
|
165
|
+
The one warning is `status draft — not buildable until agreed`, for a spec whose
|
|
166
|
+
status is `draft`. An `agreed`, `built` or `verified` spec has none.
|
|
167
|
+
|
|
168
|
+
### `formatSource(source: string): FormatResult`
|
|
169
|
+
|
|
170
|
+
Conservative, content-preserving, idempotent formatting.
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
interface FormatResult {
|
|
174
|
+
formatted: string;
|
|
175
|
+
changed: boolean; // formatted !== source
|
|
176
|
+
hasLeadingTab: boolean; // a line that begins with a tab character
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
It does exactly four things: it strips trailing spaces and tabs from every
|
|
181
|
+
line, collapses any run of blank lines to one, removes blank lines at the end of
|
|
182
|
+
the file, and ends the file with one newline. CRLF line endings become LF. It
|
|
183
|
+
never re-indents, reorders or rewrites a token, and formatting its own output
|
|
184
|
+
changes nothing.
|
|
185
|
+
|
|
186
|
+
`hasLeadingTab` reports a tab as the first character of a line. `feat fmt`
|
|
187
|
+
treats it as an error and leaves that file alone. A space followed by a tab is
|
|
188
|
+
not detected. The parser itself does not reject tab indentation (see
|
|
189
|
+
[`@mmmnt/feat-core`](https://www.npmjs.com/package/@mmmnt/feat-core)).
|
|
190
|
+
|
|
191
|
+
## In the CLI
|
|
192
|
+
|
|
193
|
+
| Command | Calls | Exit codes |
|
|
194
|
+
| --- | --- | --- |
|
|
195
|
+
| `feat lint` | `lintSpec` on every spec | `0`, or `1` if any spec fails to parse. Warnings and notes never fail the run. |
|
|
196
|
+
| `feat audit` | `auditSpec`, plus the paired-file warnings | `0`, or `1` if any spec has an error (a parse failure or a B1, B2 or B3 error). Warnings never fail the run. |
|
|
197
|
+
| `feat fmt` | `formatSource`; `--check` reports without writing | `0`, or `1` with `--check` when any file would change, or when any file has a leading tab. |
|
|
198
|
+
|
|
199
|
+
A configuration error is exit `2`, as everywhere in the toolchain. The library
|
|
200
|
+
itself returns values and never exits.
|
|
201
|
+
|
|
202
|
+
## What changed in 0.1.9
|
|
203
|
+
|
|
204
|
+
No source change in release v0.1.48. The package is republished as 0.1.9 against
|
|
205
|
+
`@mmmnt/feat-types` 0.2.0, with this README; until now it had none.
|
|
206
|
+
|
|
207
|
+
## Specs and decisions
|
|
208
|
+
|
|
209
|
+
- [Grammar reference](https://github.com/mmmnt/feature/blob/main/docs/grammar-reference.md):
|
|
210
|
+
the language the rules apply to
|
|
211
|
+
- [ADR-0022: UpperCamel rejection ids](https://github.com/mmmnt/feature/blob/main/docs/adr/ADR-0022-uppercamel-rejection-ids.md):
|
|
212
|
+
why B2 compares ids exactly
|
|
213
|
+
- ADR-0007 (declared-but-unused lint), ADR-0008 (the buildability rules B1 to
|
|
214
|
+
B3 and the `draft`, `agreed`, `built`, `verified` lifecycle) and ADR-0017 (the
|
|
215
|
+
variable lint) record the rules. ADR-0001 to ADR-0021 are not in the
|
|
216
|
+
repository yet.
|
|
217
|
+
|
|
218
|
+
Part of [Feature](https://github.com/mmmnt/feature), the `.feat` execution
|
|
219
|
+
specification language. Docs: https://github.com/mmmnt/feature/wiki
|
|
220
|
+
|
|
221
|
+
MIT
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,EAAE,CAuDnD;AAID,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,CAmCtD;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,iFAAiF;IACjF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAezD"}
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,31 @@ export function lintSpec(spec) {
|
|
|
35
35
|
if (!used.has(entry.schemaName))
|
|
36
36
|
findings.push({ level: "warn", message: `warn: schema '${entry.schemaName}' is declared but never referenced by a scenario` });
|
|
37
37
|
}
|
|
38
|
+
// ADR-0017: declared-but-unused variable = lint warning (same discipline
|
|
39
|
+
// as schema declarations; the parser already errors on undeclared refs).
|
|
40
|
+
if (spec.variables && spec.variables.length > 0) {
|
|
41
|
+
const referenced = new Set();
|
|
42
|
+
const collect = (v) => {
|
|
43
|
+
if (typeof v === "string") {
|
|
44
|
+
for (const m of v.matchAll(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g))
|
|
45
|
+
referenced.add(m[1]);
|
|
46
|
+
}
|
|
47
|
+
else if (Array.isArray(v))
|
|
48
|
+
v.forEach(collect);
|
|
49
|
+
else if (v !== null && typeof v === "object")
|
|
50
|
+
Object.values(v).forEach(collect);
|
|
51
|
+
};
|
|
52
|
+
collect(spec.scenarios);
|
|
53
|
+
for (const variable of spec.variables) {
|
|
54
|
+
if (variable.definition.kind === "template")
|
|
55
|
+
for (const p of variable.definition.parts)
|
|
56
|
+
if (typeof p === "object")
|
|
57
|
+
referenced.add(p.ref);
|
|
58
|
+
}
|
|
59
|
+
for (const variable of spec.variables)
|
|
60
|
+
if (!referenced.has(variable.name))
|
|
61
|
+
findings.push({ level: "warn", message: `warn: variable '${variable.name}' is declared but never referenced` });
|
|
62
|
+
}
|
|
38
63
|
// Style: duplicate contract declarations
|
|
39
64
|
const seen = new Set();
|
|
40
65
|
for (const entry of spec.contract) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
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AAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAChB,MAAM,EAAE,CAAC;YACT,IAAI,MAAM,GAAG,CAAC;gBAAE,SAAS;QAC3B,CAAC;;YAAM,MAAM,GAAG,CAAC,CAAC;QAClB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IAC/D,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,KAAK,MAAM,EAAE,aAAa,EAAE,CAAC;AACrE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmmnt/feat-analyze",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Pure analysis for .feat specs: lint, audit (B1–B3 buildability), and conservative formatting — no filesystem, no CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mmmnt/feat-types": "^0.
|
|
12
|
+
"@mmmnt/feat-types": "^0.2.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"typescript": "^5.8.0",
|