@mmmnt/feature 0.1.4 → 0.1.7
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/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +11 -42
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/fmt.d.ts.map +1 -1
- package/dist/commands/fmt.js +7 -27
- package/dist/commands/fmt.js.map +1 -1
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +7 -46
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/watch.d.ts +3 -0
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +124 -17
- package/dist/commands/watch.js.map +1 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SAAoE;IAE/F,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+ClC"}
|
package/dist/commands/audit.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// `feat audit` —
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// `feat audit` — thin caller over @mmmnt/feat-analyze auditSpec (B1–B3,
|
|
2
|
+
// lifecycle) plus the filesystem-bound checks that belong to the CLI:
|
|
3
|
+
// paired contract + generated test existence.
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { Command, Flags } from "@oclif/core";
|
|
7
7
|
import { parse } from "@mmmnt/feat-core";
|
|
8
|
+
import { auditSpec } from "@mmmnt/feat-analyze";
|
|
8
9
|
import { discoverSpecs } from "../pipeline.js";
|
|
9
|
-
const CODE_TYPES = new Set(["command", "query", "policy", "projection", "saga"]);
|
|
10
10
|
export default class Audit extends Command {
|
|
11
11
|
static description = "Audit all specs: completeness, buildability (B1–B3), lifecycle";
|
|
12
12
|
static flags = {
|
|
@@ -21,8 +21,6 @@ export default class Audit extends Command {
|
|
|
21
21
|
let warnings = 0;
|
|
22
22
|
for (const specAbs of specs) {
|
|
23
23
|
const rel = path.relative(root, specAbs);
|
|
24
|
-
const findings = [];
|
|
25
|
-
const warn = [];
|
|
26
24
|
const parsed = await parse({ spec: rel, config: flags.config });
|
|
27
25
|
if (parsed.status === "ERR") {
|
|
28
26
|
const body = parsed.body;
|
|
@@ -32,49 +30,20 @@ export default class Audit extends Command {
|
|
|
32
30
|
continue;
|
|
33
31
|
}
|
|
34
32
|
const spec = parsed.body;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!spec.construct.some((c) => c.kind === "touches"))
|
|
40
|
-
findings.push("B3: no `touches` change boundary declared");
|
|
41
|
-
// B2: two-way rejects ↔ predicted rejection IDs
|
|
42
|
-
const rejectsIds = new Set(spec.enforce.filter((e) => e.kind === "rejects").map((e) => e.rejectionId));
|
|
43
|
-
const predictedIds = new Set();
|
|
44
|
-
for (const sc of spec.scenarios) {
|
|
45
|
-
const rid = sc.prediction.rejectionId;
|
|
46
|
-
if (!rid)
|
|
47
|
-
continue;
|
|
48
|
-
const ph = /^<(.+)>$/.exec(rid);
|
|
49
|
-
if (ph) {
|
|
50
|
-
for (const row of sc.examples ?? []) {
|
|
51
|
-
const v = row[ph[1]];
|
|
52
|
-
if (typeof v === "string")
|
|
53
|
-
predictedIds.add(v);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else
|
|
57
|
-
predictedIds.add(rid);
|
|
58
|
-
}
|
|
59
|
-
for (const id of predictedIds)
|
|
60
|
-
if (!rejectsIds.has(id))
|
|
61
|
-
findings.push(`B2: predicted rejection '${id}' has no \`rejects ${id} when …\` line`);
|
|
62
|
-
for (const id of rejectsIds)
|
|
63
|
-
if (!predictedIds.has(id))
|
|
64
|
-
findings.push(`B2: \`rejects ${id}\` is never predicted by any scenario`);
|
|
65
|
-
// Paired files
|
|
33
|
+
const result = auditSpec(spec);
|
|
34
|
+
// Paired files (filesystem concerns — the CLI's share of the audit),
|
|
35
|
+
// then the spec-level lifecycle warnings, preserving the original order.
|
|
36
|
+
const warn = [];
|
|
66
37
|
const base = specAbs.slice(0, -".feat".length);
|
|
67
38
|
if (!existsSync(`${base}.contract.json`))
|
|
68
39
|
warn.push("no paired .contract.json");
|
|
69
40
|
const outPath = path.join(path.dirname(specAbs), config.specs.outputPattern.replace("{name}", path.basename(base)));
|
|
70
41
|
if (!existsSync(outPath))
|
|
71
42
|
warn.push("no generated test file — run `feat generate`");
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
warn.push("status draft — not buildable until agreed");
|
|
75
|
-
if (findings.length > 0) {
|
|
43
|
+
warn.push(...result.warnings);
|
|
44
|
+
if (result.errors.length > 0) {
|
|
76
45
|
this.log(`✗ ${rel} (${spec.identity.id}, status ${spec.identity.status})`);
|
|
77
|
-
for (const f of
|
|
46
|
+
for (const f of result.errors)
|
|
78
47
|
this.log(` ERROR ${f}`);
|
|
79
48
|
errors++;
|
|
80
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,sEAAsE;AACtE,8CAA8C;AAE9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAA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,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC3E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM;oBAAE,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAC1D,MAAM,EAAE,CAAC;YACX,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YAC7E,CAAC;YACD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAC3B,QAAQ,EAAE,CAAC;YACb,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,MAAM,aAAa,MAAM,iBAAiB,QAAQ,cAAc,CAAC,CAAC;QAC7F,IAAI,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fmt.d.ts","sourceRoot":"","sources":["../../src/commands/fmt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fmt.d.ts","sourceRoot":"","sources":["../../src/commands/fmt.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,OAAgB,WAAW,SAAuE;IAElG,OAAgB,KAAK;;;MAGnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6BlC"}
|
package/dist/commands/fmt.js
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
// `feat fmt` —
|
|
2
|
-
//
|
|
3
|
-
// (the parser rejects them anyway; fmt reports instead of rewriting).
|
|
4
|
-
// Content-preserving and idempotent; full canonical reprint arrives with the
|
|
5
|
-
// LSP surface. --check reports without writing.
|
|
1
|
+
// `feat fmt` — thin caller over @mmmnt/feat-analyze formatSource (conservative,
|
|
2
|
+
// content-preserving, idempotent). --check reports without writing.
|
|
6
3
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
7
4
|
import path from "node:path";
|
|
8
5
|
import { Command, Flags } from "@oclif/core";
|
|
6
|
+
import { formatSource } from "@mmmnt/feat-analyze";
|
|
9
7
|
import { discoverSpecs } from "../pipeline.js";
|
|
10
|
-
function format(source) {
|
|
11
|
-
const lines = source.split(/\r?\n/).map((l) => l.replace(/[ \t]+$/, ""));
|
|
12
|
-
const out = [];
|
|
13
|
-
let blanks = 0;
|
|
14
|
-
for (const line of lines) {
|
|
15
|
-
if (line === "") {
|
|
16
|
-
blanks++;
|
|
17
|
-
if (blanks > 1)
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
else
|
|
21
|
-
blanks = 0;
|
|
22
|
-
out.push(line);
|
|
23
|
-
}
|
|
24
|
-
while (out.length > 0 && out[out.length - 1] === "")
|
|
25
|
-
out.pop();
|
|
26
|
-
return out.join("\n") + "\n";
|
|
27
|
-
}
|
|
28
8
|
export default class Fmt extends Command {
|
|
29
9
|
static description = "Format .feat files (conservative, content-preserving, idempotent)";
|
|
30
10
|
static flags = {
|
|
@@ -41,18 +21,18 @@ export default class Fmt extends Command {
|
|
|
41
21
|
for (const specAbs of specs) {
|
|
42
22
|
const rel = path.relative(root, specAbs);
|
|
43
23
|
const source = readFileSync(specAbs, "utf8");
|
|
44
|
-
|
|
24
|
+
const result = formatSource(source);
|
|
25
|
+
if (result.hasLeadingTab) {
|
|
45
26
|
this.logToStderr(`✗ ${rel}: tab in leading whitespace (parse error) — fix manually`);
|
|
46
27
|
tabbed++;
|
|
47
28
|
continue;
|
|
48
29
|
}
|
|
49
|
-
|
|
50
|
-
if (formatted !== source) {
|
|
30
|
+
if (result.changed) {
|
|
51
31
|
changed++;
|
|
52
32
|
if (flags.check)
|
|
53
33
|
this.log(`would format ${rel}`);
|
|
54
34
|
else {
|
|
55
|
-
writeFileSync(specAbs, formatted);
|
|
35
|
+
writeFileSync(specAbs, result.formatted);
|
|
56
36
|
this.log(`formatted ${rel}`);
|
|
57
37
|
}
|
|
58
38
|
}
|
package/dist/commands/fmt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fmt.js","sourceRoot":"","sources":["../../src/commands/fmt.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"fmt.js","sourceRoot":"","sources":["../../src/commands/fmt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oEAAoE;AAEpE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAU,WAAW,GAAG,mEAAmE,CAAC;IAElG,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QACzG,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;KACvF,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,G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AI,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,GAAG,CAAC,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,OAAgB,WAAW,SAAqE;IAEhG,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+BlC"}
|
package/dist/commands/lint.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// `feat lint` —
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// beyond parse failures — the B-rules live in `feat audit`).
|
|
1
|
+
// `feat lint` — thin caller over @mmmnt/feat-analyze lintSpec (ADR-0007 rules).
|
|
2
|
+
// Exit 1 only on ERROR-level findings (currently none beyond parse failures —
|
|
3
|
+
// the B-rules live in `feat audit`).
|
|
5
4
|
import { readFileSync } from "node:fs";
|
|
6
5
|
import path from "node:path";
|
|
7
6
|
import { Command, Flags } from "@oclif/core";
|
|
8
7
|
import { parse } from "@mmmnt/feat-core";
|
|
8
|
+
import { lintSpec } from "@mmmnt/feat-analyze";
|
|
9
9
|
import { discoverSpecs } from "../pipeline.js";
|
|
10
10
|
export default class Lint extends Command {
|
|
11
11
|
static description = "Lint all specs: unused declarations, style, lifecycle surfacing";
|
|
@@ -28,53 +28,14 @@ export default class Lint extends Command {
|
|
|
28
28
|
errors++;
|
|
29
29
|
continue;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const findings = [];
|
|
33
|
-
// ADR-0007: declared-but-unused schema = lint warning
|
|
34
|
-
const used = new Set();
|
|
35
|
-
for (const sc of spec.scenarios) {
|
|
36
|
-
if (sc.prediction.response)
|
|
37
|
-
used.add(sc.prediction.response.schemaName);
|
|
38
|
-
for (const svc of Object.values(sc.prediction.services ?? {})) {
|
|
39
|
-
for (const r of svc.records ?? [])
|
|
40
|
-
used.add(r.schemaName);
|
|
41
|
-
for (const r of svc.contains ?? [])
|
|
42
|
-
used.add(r.schemaName);
|
|
43
|
-
}
|
|
44
|
-
for (const seed of sc.given?.seeds ?? [])
|
|
45
|
-
if ("records" in seed)
|
|
46
|
-
for (const r of seed.records)
|
|
47
|
-
if (r.schemaName)
|
|
48
|
-
used.add(r.schemaName);
|
|
49
|
-
}
|
|
50
|
-
for (const entry of spec.contract) {
|
|
51
|
-
if (entry.kind === "stream")
|
|
52
|
-
continue;
|
|
53
|
-
// `input` is used by definition: it is the when-payload's contract.
|
|
54
|
-
if (entry.kind === "input")
|
|
55
|
-
continue;
|
|
56
|
-
if (!used.has(entry.schemaName))
|
|
57
|
-
findings.push(`warn: schema '${entry.schemaName}' is declared but never referenced by a scenario`);
|
|
58
|
-
}
|
|
59
|
-
// Style: duplicate contract declarations
|
|
60
|
-
const seen = new Set();
|
|
61
|
-
for (const entry of spec.contract) {
|
|
62
|
-
if (entry.kind === "stream")
|
|
63
|
-
continue;
|
|
64
|
-
const key = `${entry.kind}:${entry.schemaName}`;
|
|
65
|
-
if (seen.has(key))
|
|
66
|
-
findings.push(`warn: duplicate contract declaration '${entry.kind} ${entry.schemaName}'`);
|
|
67
|
-
seen.add(key);
|
|
68
|
-
}
|
|
69
|
-
if (spec.identity.status === "draft")
|
|
70
|
-
findings.push("info: status draft — not buildable until agreed");
|
|
31
|
+
const findings = lintSpec(parsed.body);
|
|
71
32
|
if (findings.length === 0)
|
|
72
33
|
this.log(`✓ ${rel}`);
|
|
73
34
|
else {
|
|
74
35
|
this.log(`• ${rel}`);
|
|
75
36
|
for (const f of findings) {
|
|
76
|
-
this.log(` ${f}`);
|
|
77
|
-
if (f.
|
|
37
|
+
this.log(` ${f.message}`);
|
|
38
|
+
if (f.level === "warn")
|
|
78
39
|
warnings++;
|
|
79
40
|
}
|
|
80
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,qCAAqC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,MAAM,CAAU,WAAW,GAAG,iEAAiE,CAAC;IAEhG,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;KAC1G,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAA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AAc,QAAQ,cAAc,CAAC,CAAC;QACzF,IAAI,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC"}
|
package/dist/commands/watch.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export default class Watch extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
run: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
src: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
6
9
|
};
|
|
7
10
|
run(): Promise<void>;
|
|
8
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAY7C,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SAAwF;IAEnH,OAAgB,KAAK;;;;;MASnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoIlC"}
|
package/dist/commands/watch.js
CHANGED
|
@@ -1,51 +1,158 @@
|
|
|
1
|
-
// `feat watch` — dev mode: regenerate on .feat/.contract.json/config changes
|
|
2
|
-
|
|
1
|
+
// `feat watch` — dev mode: regenerate on .feat/.contract.json/config changes,
|
|
2
|
+
// optionally run affected suites (--run), optionally emit NDJSON events for
|
|
3
|
+
// machine consumption (--json, implies --run) — the IDE-integration surface.
|
|
4
|
+
import { watch as fsWatch, existsSync, readFileSync, writeFileSync, rmSync } from "node:fs";
|
|
5
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
6
|
import path from "node:path";
|
|
4
7
|
import { Command, Flags } from "@oclif/core";
|
|
8
|
+
import { runTests } from "@mmmnt/feat-runner";
|
|
5
9
|
import { generateAll } from "../pipeline.js";
|
|
6
10
|
export default class Watch extends Command {
|
|
7
|
-
static description = "Watch specs
|
|
11
|
+
static description = "Watch specs, regenerate test files, and (optionally) run affected suites on change";
|
|
8
12
|
static flags = {
|
|
9
13
|
config: Flags.string({ char: "c", description: "Path to feat.config.json", default: "feat.config.json" }),
|
|
14
|
+
run: Flags.boolean({ description: "Run affected generated suites after each regeneration", default: false }),
|
|
15
|
+
json: Flags.boolean({ description: "Emit NDJSON events to stdout (implies --run)", default: false }),
|
|
16
|
+
src: Flags.string({
|
|
17
|
+
multiple: true,
|
|
18
|
+
description: "Additional directory to watch; changes rerun all suites without regeneration (repeatable)",
|
|
19
|
+
default: [],
|
|
20
|
+
}),
|
|
10
21
|
};
|
|
11
22
|
async run() {
|
|
12
23
|
const { flags } = await this.parse(Watch);
|
|
24
|
+
const doRun = flags.run || flags.json;
|
|
13
25
|
const root = process.cwd();
|
|
14
26
|
const config = JSON.parse(readFileSync(path.resolve(root, flags.config), "utf8"));
|
|
27
|
+
const lastHash = new Map();
|
|
28
|
+
const emit = (event) => {
|
|
29
|
+
if (flags.json)
|
|
30
|
+
this.log(JSON.stringify({ ts: new Date().toISOString(), ...event }));
|
|
31
|
+
};
|
|
32
|
+
const say = (msg) => {
|
|
33
|
+
if (!flags.json)
|
|
34
|
+
this.log(`[watch] ${msg}`);
|
|
35
|
+
};
|
|
36
|
+
const runSuites = (targets) => {
|
|
37
|
+
if (targets.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
const jsonOutput = flags.json ? path.join(".feat-watch", `run-${randomUUID()}.json`) : undefined;
|
|
40
|
+
const opts = {
|
|
41
|
+
files: targets.map((t) => path.relative(root, t.outputPath)),
|
|
42
|
+
root,
|
|
43
|
+
quiet: flags.json,
|
|
44
|
+
};
|
|
45
|
+
if (jsonOutput)
|
|
46
|
+
opts.jsonOutput = jsonOutput;
|
|
47
|
+
const result = runTests(opts);
|
|
48
|
+
if (!flags.json) {
|
|
49
|
+
say(result.exitCode === 0 ? "suites green" : "PREDICTION VIOLATIONS (see above)");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let cases = [];
|
|
53
|
+
if (result.jsonPath && existsSync(result.jsonPath)) {
|
|
54
|
+
try {
|
|
55
|
+
const report = JSON.parse(readFileSync(result.jsonPath, "utf8"));
|
|
56
|
+
cases = (report.testResults ?? []).flatMap((f) => (f.assertionResults ?? []).map((a) => {
|
|
57
|
+
const c = {
|
|
58
|
+
suite: (a.ancestorTitles ?? []).join(" › "),
|
|
59
|
+
name: a.title ?? "",
|
|
60
|
+
state: a.status === "passed" ? "passed" : a.status === "failed" ? "failed" : "skipped",
|
|
61
|
+
};
|
|
62
|
+
const msg = (a.failureMessages ?? [])[0];
|
|
63
|
+
if (msg !== undefined)
|
|
64
|
+
c.message = msg;
|
|
65
|
+
return c;
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Malformed report: fall through with empty cases; exitCode still signals.
|
|
70
|
+
}
|
|
71
|
+
rmSync(result.jsonPath, { force: true });
|
|
72
|
+
}
|
|
73
|
+
emit({
|
|
74
|
+
event: "run",
|
|
75
|
+
exitCode: result.exitCode,
|
|
76
|
+
suites: targets.map((t) => ({ spec: path.relative(root, t.specPath), output: path.relative(root, t.outputPath) })),
|
|
77
|
+
cases,
|
|
78
|
+
});
|
|
79
|
+
};
|
|
15
80
|
let running = false;
|
|
16
|
-
let queued =
|
|
17
|
-
const
|
|
81
|
+
let queued = null;
|
|
82
|
+
const cycle = async (reason, regen) => {
|
|
18
83
|
if (running) {
|
|
19
|
-
queued =
|
|
84
|
+
queued = reason;
|
|
20
85
|
return;
|
|
21
86
|
}
|
|
22
87
|
running = true;
|
|
23
88
|
try {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
89
|
+
let targets = [];
|
|
90
|
+
if (regen) {
|
|
91
|
+
const files = await generateAll(root, flags.config);
|
|
92
|
+
const changed = [];
|
|
93
|
+
for (const f of files) {
|
|
94
|
+
const hash = createHash("sha256").update(f.content).digest("hex");
|
|
95
|
+
if (lastHash.get(f.outputPath) !== hash) {
|
|
96
|
+
writeFileSync(f.outputPath, f.content);
|
|
97
|
+
lastHash.set(f.outputPath, hash);
|
|
98
|
+
changed.push({ specPath: f.specPath, outputPath: f.outputPath });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
say(`${reason} — ${files.length} spec(s), ${changed.length} regenerated`);
|
|
102
|
+
emit({
|
|
103
|
+
event: "generate",
|
|
104
|
+
reason,
|
|
105
|
+
files: files.map((f) => ({ spec: path.relative(root, f.specPath), output: path.relative(root, f.outputPath) })),
|
|
106
|
+
changed: changed.map((f) => path.relative(root, f.outputPath)),
|
|
107
|
+
});
|
|
108
|
+
// Startup runs everything; later cycles run only suites whose bytes changed.
|
|
109
|
+
targets = reason === "startup" ? files.map((f) => ({ specPath: f.specPath, outputPath: f.outputPath })) : changed;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// Source change: implementation moved under the specs — rerun everything.
|
|
113
|
+
const files = await generateAll(root, flags.config);
|
|
114
|
+
targets = files.map((f) => ({ specPath: f.specPath, outputPath: f.outputPath }));
|
|
115
|
+
say(`${reason} — source change, rerunning ${targets.length} suite(s)`);
|
|
116
|
+
emit({ event: "source-change", reason });
|
|
117
|
+
}
|
|
118
|
+
if (doRun)
|
|
119
|
+
runSuites(targets);
|
|
28
120
|
}
|
|
29
121
|
catch (e) {
|
|
30
|
-
|
|
122
|
+
say(`${reason} — ERROR ${e.message}`);
|
|
123
|
+
emit({ event: "error", reason, message: e.message });
|
|
31
124
|
}
|
|
32
125
|
finally {
|
|
33
126
|
running = false;
|
|
34
|
-
if (queued) {
|
|
35
|
-
|
|
36
|
-
|
|
127
|
+
if (queued !== null) {
|
|
128
|
+
const next = queued;
|
|
129
|
+
queued = null;
|
|
130
|
+
void cycle(next, true);
|
|
37
131
|
}
|
|
38
132
|
}
|
|
39
133
|
};
|
|
40
|
-
await
|
|
134
|
+
await cycle("startup", true);
|
|
41
135
|
const specsRoot = path.resolve(root, config.specs.dir);
|
|
42
|
-
|
|
136
|
+
say(`watching ${path.relative(root, specsRoot) || "."}/ (Ctrl-C to stop)`);
|
|
43
137
|
fsWatch(specsRoot, { recursive: true }, (_event, filename) => {
|
|
44
138
|
if (!filename)
|
|
45
139
|
return;
|
|
46
140
|
if (filename.endsWith(".feat") || filename.endsWith(".contract.json"))
|
|
47
|
-
void
|
|
141
|
+
void cycle(filename, true);
|
|
48
142
|
});
|
|
143
|
+
for (const dir of flags.src) {
|
|
144
|
+
const abs = path.resolve(root, dir);
|
|
145
|
+
if (!existsSync(abs)) {
|
|
146
|
+
say(`--src ${dir}: directory not found, skipping`);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
say(`watching ${dir}/ (source)`);
|
|
150
|
+
fsWatch(abs, { recursive: true }, (_event, filename) => {
|
|
151
|
+
if (!filename || filename.endsWith(".test.ts"))
|
|
152
|
+
return;
|
|
153
|
+
void cycle(`${dir}/${filename}`, false);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
49
156
|
// Keep the process alive.
|
|
50
157
|
await new Promise(() => { });
|
|
51
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,8EAA8E;
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAE7E,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAA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,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAAE,KAAK,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpG,CAAC,CAAC,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,GAAG,CAAC,SAAS,GAAG,iCAAiC,CAAC,CAAC;gBACnD,SAAS;YACX,CAAC;YACD,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC;YACjC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;gBACrD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;oBAAE,OAAO;gBACvD,KAAK,KAAK,CAAC,GAAG,GAAG,IAAI,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;QACL,CAAC;QACD,0BAA0B;QAC1B,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmmnt/feature",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "The feat CLI — Feature, the quality spine of AI-native delivery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,12 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@oclif/core": "^4.3.0",
|
|
23
|
-
"@mmmnt/feat-core": "^0.1.
|
|
24
|
-
"@mmmnt/feat-derive": "^0.1.
|
|
25
|
-
"@mmmnt/feat-emit-ts": "^0.1.
|
|
26
|
-
"@mmmnt/feat-runtime": "^0.1.
|
|
27
|
-
"@mmmnt/feat-types": "^0.1.
|
|
28
|
-
"@mmmnt/feat-
|
|
23
|
+
"@mmmnt/feat-core": "^0.1.7",
|
|
24
|
+
"@mmmnt/feat-derive": "^0.1.7",
|
|
25
|
+
"@mmmnt/feat-emit-ts": "^0.1.7",
|
|
26
|
+
"@mmmnt/feat-runtime": "^0.1.7",
|
|
27
|
+
"@mmmnt/feat-types": "^0.1.7",
|
|
28
|
+
"@mmmnt/feat-analyze": "^0.1.7",
|
|
29
|
+
"@mmmnt/feat-runner": "^0.1.7"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"vitest": "^3.2.0"
|