@mmmnt/feature 0.1.7 → 0.1.8
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/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +13 -1
- package/dist/commands/report.js.map +1 -1
- package/dist/evidence.d.ts +2 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +98 -0
- package/dist/evidence.js.map +1 -0
- package/package.json +11 -8
- package/schemas/evidence.schema.json +101 -0
|
@@ -4,6 +4,7 @@ export default class Report extends Command {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
junit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
evidence: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
};
|
|
8
9
|
run(): Promise<void>;
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IACzC,OAAgB,WAAW,SAAuD;IAElF,OAAgB,KAAK;;;;MAMnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoClC"}
|
package/dist/commands/report.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
// `feat report` — summarize the last run from the JUnit output (per-scenario,
|
|
2
2
|
// anchors included in test names). --junit prints the raw XML path.
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { Command, Flags } from "@oclif/core";
|
|
6
|
+
import { produceEvidence } from "../evidence.js";
|
|
6
7
|
export default class Report extends Command {
|
|
7
8
|
static description = "Summarize the last feat run from its JUnit output";
|
|
8
9
|
static flags = {
|
|
9
10
|
config: Flags.string({ char: "c", description: "Path to feat.config.json", default: "feat.config.json" }),
|
|
10
11
|
junit: Flags.boolean({ description: "Print the JUnit XML path for CI/Xray import" }),
|
|
12
|
+
evidence: Flags.string({
|
|
13
|
+
description: "Write a feat-evidence/1 bundle (docs/evidence-bundle.md) to this path and exit",
|
|
14
|
+
}),
|
|
11
15
|
};
|
|
12
16
|
async run() {
|
|
13
17
|
const { flags } = await this.parse(Report);
|
|
14
18
|
const root = process.cwd();
|
|
19
|
+
if (flags.evidence) {
|
|
20
|
+
const bundle = await produceEvidence(root, flags.config);
|
|
21
|
+
writeFileSync(path.resolve(root, flags.evidence), JSON.stringify(bundle, null, 2) + "\n");
|
|
22
|
+
const v = bundle.verify.status;
|
|
23
|
+
const r = bundle.run ? bundle.run.status : "absent";
|
|
24
|
+
this.log(`evidence: ${flags.evidence} (specs: ${bundle.specs.length}, verify: ${v}, run: ${r})`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
15
27
|
const config = JSON.parse(readFileSync(path.resolve(root, flags.config), "utf8"));
|
|
16
28
|
const junitPath = config.report?.junitOutput;
|
|
17
29
|
if (!junitPath || !existsSync(path.resolve(root, junitPath))) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,oEAAoE;AAEpE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/commands/report.ts"],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AAC,CAAC,CAAC;YACtB,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAC7H,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,aAAa,KAAK,GAAG,QAAQ,GAAG,MAAM,YAAY,QAAQ,YAAY,MAAM,WAAW,CAAC,CAAC;QAC5G,IAAI,QAAQ,GAAG,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AA6BA,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0ExG"}
|
package/dist/evidence.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Evidence bundle production (feat-evidence/1, schemas/evidence.schema.json).
|
|
2
|
+
// A digest-anchored record of spec state + verification results at a point in
|
|
3
|
+
// time. Free, local, account-less — the account lane signs bundles on
|
|
4
|
+
// ingestion; locally `signature` is null.
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { parse } from "@mmmnt/feat-core";
|
|
10
|
+
import { discoverSpecs, generateAll } from "./pipeline.js";
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
function sha256(content) {
|
|
13
|
+
return `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
14
|
+
}
|
|
15
|
+
function toolchainVersions() {
|
|
16
|
+
const versions = {};
|
|
17
|
+
const own = require("../package.json");
|
|
18
|
+
for (const dep of Object.keys(own.dependencies ?? {})) {
|
|
19
|
+
if (!dep.startsWith("@mmmnt/"))
|
|
20
|
+
continue;
|
|
21
|
+
versions[dep] = require(`${dep}/package.json`).version;
|
|
22
|
+
}
|
|
23
|
+
return versions;
|
|
24
|
+
}
|
|
25
|
+
export async function produceEvidence(root, configPath) {
|
|
26
|
+
const configText = readFileSync(path.resolve(root, configPath), "utf8");
|
|
27
|
+
const config = JSON.parse(configText);
|
|
28
|
+
// Spec inventory
|
|
29
|
+
const specs = [];
|
|
30
|
+
for (const specAbs of discoverSpecs(root, config.specs.dir)) {
|
|
31
|
+
const rel = path.relative(root, specAbs);
|
|
32
|
+
const source = readFileSync(specAbs, "utf8");
|
|
33
|
+
const entry = { path: rel, content_digest: sha256(source) };
|
|
34
|
+
const parsed = await parse({ spec: rel, config: configPath });
|
|
35
|
+
if (parsed.status === "OK") {
|
|
36
|
+
const spec = parsed.body;
|
|
37
|
+
entry.spec_id = spec.identity.id;
|
|
38
|
+
entry.status = spec.identity.status;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
entry.spec_id = "UNPARSEABLE";
|
|
42
|
+
entry.status = "draft";
|
|
43
|
+
entry.parse_error = parsed.body;
|
|
44
|
+
}
|
|
45
|
+
const base = specAbs.slice(0, -".feat".length);
|
|
46
|
+
const outPath = path.join(path.dirname(specAbs), config.specs.outputPattern.replace("{name}", path.basename(base)));
|
|
47
|
+
if (existsSync(outPath))
|
|
48
|
+
entry.generated_digest = sha256(readFileSync(outPath, "utf8"));
|
|
49
|
+
specs.push(entry);
|
|
50
|
+
}
|
|
51
|
+
// Verify (byte-lock semantics; a generation failure is a verify fail, not a crash)
|
|
52
|
+
let verify;
|
|
53
|
+
try {
|
|
54
|
+
const files = await generateAll(root, configPath);
|
|
55
|
+
const mismatched = files
|
|
56
|
+
.filter((f) => !existsSync(f.outputPath) || readFileSync(f.outputPath, "utf8") !== f.content)
|
|
57
|
+
.map((f) => path.relative(root, f.outputPath));
|
|
58
|
+
verify = mismatched.length > 0 ? { status: "fail", mismatched } : { status: "pass" };
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
verify = { status: "fail", mismatched: [] };
|
|
62
|
+
}
|
|
63
|
+
const bundle = {
|
|
64
|
+
contract: "feat-evidence/1",
|
|
65
|
+
produced_at: new Date().toISOString(),
|
|
66
|
+
producer: {
|
|
67
|
+
tool: "@mmmnt/feature",
|
|
68
|
+
version: require("../package.json").version,
|
|
69
|
+
toolchain: toolchainVersions(),
|
|
70
|
+
},
|
|
71
|
+
project: { feat_version: config.featVersion, config_digest: sha256(configText) },
|
|
72
|
+
specs,
|
|
73
|
+
verify,
|
|
74
|
+
signature: null,
|
|
75
|
+
};
|
|
76
|
+
// Run block, when a JUnit artifact exists
|
|
77
|
+
const junitRel = config.report?.junitOutput;
|
|
78
|
+
if (junitRel && existsSync(path.resolve(root, junitRel))) {
|
|
79
|
+
const xml = readFileSync(path.resolve(root, junitRel), "utf8");
|
|
80
|
+
let tests = 0;
|
|
81
|
+
let failures = 0;
|
|
82
|
+
let errors = 0;
|
|
83
|
+
for (const s of xml.matchAll(/<testsuite\b[^>]*tests="(\d+)"[^>]*failures="(\d+)"[^>]*errors="(\d+)"/g)) {
|
|
84
|
+
tests += Number(s[1]);
|
|
85
|
+
failures += Number(s[2]);
|
|
86
|
+
errors += Number(s[3]);
|
|
87
|
+
}
|
|
88
|
+
bundle.run = {
|
|
89
|
+
status: failures + errors > 0 ? "fail" : "pass",
|
|
90
|
+
tests,
|
|
91
|
+
failures,
|
|
92
|
+
errors,
|
|
93
|
+
junit_digest: sha256(xml),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return bundle;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,sEAAsE;AACtE,0CAA0C;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAS,MAAM,CAAC,OAAe;IAC7B,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAA+D,CAAC;IACrG,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,SAAS;QACzC,QAAQ,CAAC,GAAG,CAAC,GAAI,OAAO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,CAAC,CAAC,CAAC,MAAM;YAC/C,KAAK;YACL,QAAQ;YACR,MAAM;YACN,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;SAC1B,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmmnt/feature",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "The feat CLI — Feature, the quality spine of AI-native delivery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"files": [
|
|
12
12
|
"bin",
|
|
13
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"schemas"
|
|
14
15
|
],
|
|
15
16
|
"oclif": {
|
|
16
17
|
"bin": "feat",
|
|
@@ -20,16 +21,18 @@
|
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
23
|
"@oclif/core": "^4.3.0",
|
|
23
|
-
"@mmmnt/feat-core": "^0.1.7",
|
|
24
24
|
"@mmmnt/feat-derive": "^0.1.7",
|
|
25
|
+
"@mmmnt/feat-core": "^0.1.7",
|
|
25
26
|
"@mmmnt/feat-emit-ts": "^0.1.7",
|
|
26
|
-
"@mmmnt/feat-runtime": "^0.1.7",
|
|
27
27
|
"@mmmnt/feat-types": "^0.1.7",
|
|
28
|
-
"@mmmnt/feat-
|
|
29
|
-
"@mmmnt/feat-runner": "^0.1.7"
|
|
28
|
+
"@mmmnt/feat-runtime": "^0.1.7",
|
|
29
|
+
"@mmmnt/feat-runner": "^0.1.7",
|
|
30
|
+
"@mmmnt/feat-analyze": "^0.1.7"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"vitest": "^3.2.0"
|
|
33
|
+
"vitest": "^3.2.0",
|
|
34
|
+
"ajv": "^8.17.0",
|
|
35
|
+
"ajv-formats": "^3.0.0"
|
|
33
36
|
},
|
|
34
37
|
"repository": {
|
|
35
38
|
"type": "git",
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
"access": "public"
|
|
45
48
|
},
|
|
46
49
|
"scripts": {
|
|
47
|
-
"build": "tsc -p tsconfig.json",
|
|
50
|
+
"build": "node scripts/copy-schemas.mjs && tsc -p tsconfig.json",
|
|
48
51
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
49
52
|
"test": "vitest run"
|
|
50
53
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://feat.dev/schemas/evidence.json",
|
|
4
|
+
"title": "Feat evidence bundle (feat-evidence/1)",
|
|
5
|
+
"description": "A self-contained, digest-anchored record of a project's spec state and verification results at a point in time. Produced locally and freely by `feat report --evidence` (capability); accounts accrue attested bundles as a ledger (evidence).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["contract", "produced_at", "producer", "project", "specs", "verify"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"contract": { "const": "feat-evidence/1" },
|
|
11
|
+
"produced_at": { "type": "string", "format": "date-time" },
|
|
12
|
+
"producer": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["tool", "version", "toolchain"],
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"tool": { "const": "@mmmnt/feature" },
|
|
18
|
+
"version": { "type": "string" },
|
|
19
|
+
"toolchain": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Resolved @mmmnt package versions in effect when the bundle was produced.",
|
|
22
|
+
"additionalProperties": { "type": "string" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"project": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["feat_version", "config_digest"],
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"properties": {
|
|
31
|
+
"feat_version": { "type": "string", "description": "The language version pragma from feat.config.json." },
|
|
32
|
+
"config_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"specs": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"description": "Inventory of every discovered spec at production time.",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["path", "spec_id", "status", "content_digest"],
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"path": { "type": "string", "description": "Project-root-relative spec path." },
|
|
44
|
+
"spec_id": { "type": "string" },
|
|
45
|
+
"status": { "enum": ["draft", "agreed", "built", "verified"] },
|
|
46
|
+
"content_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
47
|
+
"generated_digest": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"pattern": "^sha256:[0-9a-f]{64}$",
|
|
50
|
+
"description": "Digest of the committed generated test file, when present."
|
|
51
|
+
},
|
|
52
|
+
"parse_error": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "Present when the spec does not parse; such bundles still record the inventory honestly.",
|
|
55
|
+
"required": ["code", "message"],
|
|
56
|
+
"additionalProperties": true,
|
|
57
|
+
"properties": { "code": { "type": "string" }, "message": { "type": "string" } }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"verify": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"description": "The spec↔test byte-lock result (`feat verify` semantics) at production time.",
|
|
65
|
+
"required": ["status"],
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"status": { "enum": ["pass", "fail"] },
|
|
69
|
+
"mismatched": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": { "type": "string" },
|
|
72
|
+
"description": "Generated files that differ from their specs (fail only)."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"run": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"description": "The most recent `feat run` result, from its JUnit output. Absent when no run artifact exists.",
|
|
79
|
+
"required": ["status", "tests", "failures", "errors", "junit_digest"],
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"properties": {
|
|
82
|
+
"status": { "enum": ["pass", "fail"] },
|
|
83
|
+
"tests": { "type": "integer", "minimum": 0 },
|
|
84
|
+
"failures": { "type": "integer", "minimum": 0 },
|
|
85
|
+
"errors": { "type": "integer", "minimum": 0 },
|
|
86
|
+
"junit_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"signature": {
|
|
90
|
+
"type": ["object", "null"],
|
|
91
|
+
"description": "Attestation envelope. Null for locally produced bundles; the account lane signs on ingestion (key infrastructure is account-side).",
|
|
92
|
+
"required": ["alg", "key_id", "value"],
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"properties": {
|
|
95
|
+
"alg": { "type": "string" },
|
|
96
|
+
"key_id": { "type": "string" },
|
|
97
|
+
"value": { "type": "string" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|