@agent-ix/quoin 0.21.8 → 0.22.5
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/default-modules.yaml +18 -2
- package/dist/{advisor-COB2SuIj.js → advisor-BkgwDKvQ.js} +1 -1
- package/dist/auditor/audit.d.ts +23 -18
- package/dist/auditor/audit.d.ts.map +1 -1
- package/dist/auditor/index.d.ts +2 -1
- package/dist/auditor/index.d.ts.map +1 -1
- package/dist/{auditor-ww0MC62a.js → auditor-C3bSmPD_.js} +82 -65
- package/dist/{base-DNieRzIg.js → base-CqKNs2Kd.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/advise.js +16 -15
- package/dist/commands/assurance.d.ts.map +1 -1
- package/dist/commands/assurance.js +84 -61
- package/dist/commands/catalog/list.js +2 -2
- package/dist/commands/catalog/methods.js +3 -3
- package/dist/commands/catalog/show.js +2 -2
- package/dist/commands/catalog/validate.js +2 -2
- package/dist/commands/completeness.js +2 -2
- package/dist/commands/config/doctor.d.ts.map +1 -1
- package/dist/commands/config/doctor.js +3 -3
- package/dist/commands/config/edit.d.ts.map +1 -1
- package/dist/commands/config/edit.js +3 -3
- package/dist/commands/config/get.js +1 -1
- package/dist/commands/config/set.js +1 -1
- package/dist/commands/evidence/affirm.js +6 -5
- package/dist/commands/evidence/audit.d.ts.map +1 -1
- package/dist/commands/evidence/audit.js +57 -45
- package/dist/commands/evidence/baseline.d.ts.map +1 -1
- package/dist/commands/evidence/baseline.js +52 -42
- package/dist/commands/evidence/gc.js +3 -2
- package/dist/commands/evidence/index.js +1 -1
- package/dist/commands/evidence/inspect-mocks.d.ts +16 -0
- package/dist/commands/evidence/inspect-mocks.d.ts.map +1 -0
- package/dist/commands/evidence/inspect-mocks.js +49 -0
- package/dist/commands/evidence/record.d.ts +1 -0
- package/dist/commands/evidence/record.d.ts.map +1 -1
- package/dist/commands/evidence/record.js +42 -31
- package/dist/commands/matrix.js +1 -1
- package/dist/commands/measurement/index.d.ts +7 -0
- package/dist/commands/measurement/index.d.ts.map +1 -0
- package/dist/commands/measurement/index.js +11 -0
- package/dist/commands/measurement/record.d.ts +10 -0
- package/dist/commands/measurement/record.d.ts.map +1 -0
- package/dist/commands/measurement/record.js +35 -0
- package/dist/commands/module/ensure-defaults.js +3 -3
- package/dist/commands/module/install.js +2 -2
- package/dist/commands/module/list.js +2 -2
- package/dist/commands/module/remove.js +2 -2
- package/dist/commands/report.d.ts +15 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +70 -0
- package/dist/commands/review.js +1 -1
- package/dist/commands/to-plan.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/validate.d.ts +13 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +123 -0
- package/dist/commands/write.js +3 -3
- package/dist/{completeness-F657dxMp.js → completeness-DamWradt.js} +1 -1
- package/dist/evidence/index.d.ts +3 -2
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/mock-inspection.d.ts +16 -0
- package/dist/evidence/mock-inspection.d.ts.map +1 -0
- package/dist/evidence/store.d.ts +11 -1
- package/dist/evidence/store.d.ts.map +1 -1
- package/dist/evidence/types.d.ts +31 -0
- package/dist/evidence/types.d.ts.map +1 -1
- package/dist/{evidence-BA5vyZJk.js → evidence-DD0CHzJ0.js} +246 -316
- package/dist/{flow-command-D1vJU-7a.js → flow-command-BfFNY0Rv.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -8
- package/dist/measurement/compare.d.ts +4 -0
- package/dist/measurement/compare.d.ts.map +1 -0
- package/dist/measurement/index.d.ts +9 -0
- package/dist/measurement/index.d.ts.map +1 -0
- package/dist/measurement/plans.d.ts +4 -0
- package/dist/measurement/plans.d.ts.map +1 -0
- package/dist/measurement/portfolio.d.ts +48 -0
- package/dist/measurement/portfolio.d.ts.map +1 -0
- package/dist/measurement/profiles.d.ts +9 -0
- package/dist/measurement/profiles.d.ts.map +1 -0
- package/dist/measurement/report.d.ts +44 -0
- package/dist/measurement/report.d.ts.map +1 -0
- package/dist/measurement/store.d.ts +7 -0
- package/dist/measurement/store.d.ts.map +1 -0
- package/dist/measurement/types.d.ts +83 -0
- package/dist/measurement/types.d.ts.map +1 -0
- package/dist/measurement/validate.d.ts +9 -0
- package/dist/measurement/validate.d.ts.map +1 -0
- package/dist/measurement-CzB74Q07.js +595 -0
- package/dist/{modules-BWyZ7kVN.js → modules-ez9httBA.js} +2 -2
- package/dist/{plugins-Czi2OyDB.js → plugins-C-ta0llj.js} +1 -1
- package/dist/quire/contract.d.ts +11 -12
- package/dist/quire/contract.d.ts.map +1 -1
- package/dist/quire/exec.d.ts +10 -0
- package/dist/quire/exec.d.ts.map +1 -1
- package/dist/quire/index.d.ts +2 -2
- package/dist/quire/index.d.ts.map +1 -1
- package/dist/quire/types.d.ts +119 -1
- package/dist/quire/types.d.ts.map +1 -1
- package/dist/{quire-UzoK3Azf.js → quire-D8tCpgyA.js} +526 -499
- package/dist/schemas/coverage-v1.schema.json +919 -105
- package/dist/schemas/properties-v1.schema.json +25 -0
- package/dist/store--2sAv12X.js +219 -0
- package/dist/validators/gates.d.ts +18 -0
- package/dist/validators/gates.d.ts.map +1 -0
- package/dist/validators/index.d.ts +2 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/{version-G_RI6TD4.js → version-Dg0e6CZU.js} +1 -1
- package/dist/{write-BJ9rTVAS.js → write-DElwS9xc.js} +1 -1
- package/package.json +22 -16
- package/skills/assurance-status-report/SKILL.md +135 -0
- package/skills/assurance-status-report/references/report-contract.md +110 -0
- package/skills/spec-architecture-evaluation/SKILL.md +30 -0
|
@@ -1,79 +1,89 @@
|
|
|
1
|
-
import { i as e, n as t, o as n, t as r } from "../../quire-
|
|
2
|
-
import { t as i } from "../../base-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { i as e, n as t, o as n, t as r } from "../../quire-D8tCpgyA.js";
|
|
2
|
+
import { t as i } from "../../base-CqKNs2Kd.js";
|
|
3
|
+
import { f as a, g as o, n as s, o as c, u as l } from "../../store--2sAv12X.js";
|
|
4
|
+
import { t as u } from "../../advisor-BkgwDKvQ.js";
|
|
5
|
+
import { n as d, t as f } from "../../auditor-C3bSmPD_.js";
|
|
6
|
+
import { n as p } from "../../evidence-DD0CHzJ0.js";
|
|
7
|
+
import { Flags as m } from "@oclif/core";
|
|
8
|
+
import { execFileSync as h } from "node:child_process";
|
|
8
9
|
//#region src/commands/evidence/baseline.ts
|
|
9
|
-
var
|
|
10
|
+
var g = class c extends i {
|
|
10
11
|
static summary = "Accept the current findings as the ratchet baseline.";
|
|
11
12
|
static description = "Writes spec/evidence/baseline.json: every finding the audit reports right now,\nas <kind>:<obligation>, plus the commit it was accepted at.\n\n`--ratchet` reads this file and fails only on findings NOT in it. Without it,\na first run of the gate reports the entire existing backlog and gets switched\noff within a week — so accepting a baseline is the deliberate act that makes\nthe ratchet usable, and its diff is the record of what was accepted and by whom.\n\nRe-run this at a release to move the ratchet forward. Never run it to make a\nnew failure go away: the diff is reviewed, and a baseline that grows between\nreleases is the gate quietly being disabled one entry at a time.";
|
|
12
13
|
static examples = ["quoin evidence baseline", "quoin evidence baseline --dry-run"];
|
|
13
14
|
static flags = {
|
|
14
|
-
repo:
|
|
15
|
+
repo: m.string({
|
|
15
16
|
description: "Repository root.",
|
|
16
17
|
default: "."
|
|
17
18
|
}),
|
|
18
|
-
module:
|
|
19
|
-
"dry-run":
|
|
20
|
-
json:
|
|
19
|
+
module: m.string({ description: "Module directory supplying the traceability model." }),
|
|
20
|
+
"dry-run": m.boolean({ description: "Print what would be accepted and write nothing." }),
|
|
21
|
+
json: m.boolean({ description: "Emit the outcome as JSON." })
|
|
21
22
|
};
|
|
22
23
|
async run() {
|
|
23
|
-
let { flags: i } = await this.parse(
|
|
24
|
-
|
|
25
|
-
let
|
|
24
|
+
let { flags: i } = await this.parse(c), l = n(r());
|
|
25
|
+
l && this.error(l.message, { exit: 2 });
|
|
26
|
+
let m = [
|
|
26
27
|
"coverage",
|
|
27
28
|
"--scope",
|
|
28
29
|
i.repo,
|
|
29
30
|
"--json"
|
|
30
31
|
];
|
|
31
|
-
i.module &&
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
obligations:
|
|
36
|
-
bindings:
|
|
37
|
-
runs:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
i.module && m.push("--module", i.module);
|
|
33
|
+
let h = e(t(m));
|
|
34
|
+
h.ok || this.error(h.error.message, { exit: 2 });
|
|
35
|
+
let g = v(i.repo), y = p(i.repo, g), b = f({
|
|
36
|
+
obligations: h.value.obligations ?? [],
|
|
37
|
+
bindings: a(i.repo).bindings,
|
|
38
|
+
runs: _(i.repo),
|
|
39
|
+
injections: y.injections,
|
|
40
|
+
mockInspectionSuites: y.suites,
|
|
41
|
+
catalog: u(i.module ? [i.module] : void 0),
|
|
42
|
+
headCommit: g
|
|
43
|
+
}).findings.map(d).sort(), x = g ?? "";
|
|
44
|
+
if (i["dry-run"] || o(i.repo, {
|
|
42
45
|
schemaVersion: 1,
|
|
43
|
-
commit:
|
|
44
|
-
accepted:
|
|
46
|
+
commit: x,
|
|
47
|
+
accepted: b
|
|
45
48
|
}), i.json) {
|
|
46
49
|
this.log(JSON.stringify({
|
|
47
|
-
accepted:
|
|
48
|
-
commit:
|
|
50
|
+
accepted: b,
|
|
51
|
+
commit: x,
|
|
49
52
|
dryRun: !!i["dry-run"]
|
|
50
53
|
}, null, 2));
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
53
|
-
let
|
|
54
|
-
for (let e of
|
|
56
|
+
let S = /* @__PURE__ */ new Map();
|
|
57
|
+
for (let e of b) {
|
|
55
58
|
let t = e.slice(0, e.indexOf(":"));
|
|
56
|
-
|
|
59
|
+
S.set(t, (S.get(t) ?? 0) + 1);
|
|
57
60
|
}
|
|
58
|
-
this.log(`${i["dry-run"] ? "would accept" : "accepted"} ${
|
|
59
|
-
for (let [e, t] of [...
|
|
60
|
-
i["dry-run"] || this.log(
|
|
61
|
+
this.log(`${i["dry-run"] ? "would accept" : "accepted"} ${b.length} finding(s) at ${x.slice(0, 12) || "an unknown commit"}`);
|
|
62
|
+
for (let [e, t] of [...S].sort()) this.log(` ${e}: ${t}`);
|
|
63
|
+
i["dry-run"] || this.log(s(i.repo));
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
|
-
function g(e) {
|
|
64
|
-
return l(e).map((t) => d(e, t)).filter((e) => e !== null);
|
|
65
|
-
}
|
|
66
66
|
function _(e) {
|
|
67
|
+
return l(e).map((t) => c(e, t)).filter((e) => e !== null);
|
|
68
|
+
}
|
|
69
|
+
function v(e) {
|
|
67
70
|
try {
|
|
68
|
-
return
|
|
71
|
+
return h("git", [
|
|
69
72
|
"-C",
|
|
70
73
|
e,
|
|
71
74
|
"rev-parse",
|
|
72
75
|
"HEAD"
|
|
73
|
-
], {
|
|
76
|
+
], {
|
|
77
|
+
encoding: "utf8",
|
|
78
|
+
stdio: [
|
|
79
|
+
"ignore",
|
|
80
|
+
"pipe",
|
|
81
|
+
"ignore"
|
|
82
|
+
]
|
|
83
|
+
}).trim();
|
|
74
84
|
} catch {
|
|
75
85
|
return;
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
//#endregion
|
|
79
|
-
export {
|
|
89
|
+
export { g as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../../base-
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { a as t } from "../../store--2sAv12X.js";
|
|
3
|
+
import "../../evidence-DD0CHzJ0.js";
|
|
3
4
|
import { Flags as n } from "@oclif/core";
|
|
4
5
|
//#region src/commands/evidence/gc.ts
|
|
5
6
|
var r = class r extends e {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QuoinCommand } from '../../base.js';
|
|
2
|
+
export default class EvidenceInspectMocks extends QuoinCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
suite: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
8
|
+
commit: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
9
|
+
repo: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
10
|
+
timestamp: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
|
|
11
|
+
"dry-run": import('@oclif/core/interfaces').BooleanFlag<boolean>;
|
|
12
|
+
json: import('@oclif/core/interfaces').BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=inspect-mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect-mocks.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/inspect-mocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D,MAAM,CAAC,OAAO,SACkD;IAChE,MAAM,CAAC,WAAW,SAMsD;IAExE,MAAM,CAAC,QAAQ,WAEb;IAEF,MAAM,CAAC,KAAK;;;;;;;MAiBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+B3B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as e } from "../../version-Dg0e6CZU.js";
|
|
2
|
+
import { t } from "../../base-CqKNs2Kd.js";
|
|
3
|
+
import { v as n } from "../../store--2sAv12X.js";
|
|
4
|
+
import { t as r } from "../../evidence-DD0CHzJ0.js";
|
|
5
|
+
import { Flags as i } from "@oclif/core";
|
|
6
|
+
//#region src/commands/evidence/inspect-mocks.ts
|
|
7
|
+
var a = class a extends t {
|
|
8
|
+
static summary = "Inspect test source and record explicit mock substitutions.";
|
|
9
|
+
static description = "Scans source for explicit stand-in constructors used by test symbols and records\nthe observation for one suite at one commit. It runs no test and assigns no\nverdict: evidence audit independently decides whether an injected identifier\noverlaps the behaviour an obligation claims to verify.\n\nRecord an empty inspection too. That is how audit distinguishes \"looked and\nfound no relevant injections\" from \"nobody looked\" (agent-ix/quoin#204).";
|
|
10
|
+
static examples = ["quoin evidence inspect-mocks --suite SUITE-001 --commit $(git rev-parse HEAD)"];
|
|
11
|
+
static flags = {
|
|
12
|
+
suite: i.string({
|
|
13
|
+
description: "Suite id whose test source is being inspected.",
|
|
14
|
+
required: !0
|
|
15
|
+
}),
|
|
16
|
+
commit: i.string({
|
|
17
|
+
description: "Full commit sha whose source is being inspected.",
|
|
18
|
+
required: !0
|
|
19
|
+
}),
|
|
20
|
+
repo: i.string({
|
|
21
|
+
description: "Repository root.",
|
|
22
|
+
default: "."
|
|
23
|
+
}),
|
|
24
|
+
timestamp: i.string({ description: "ISO-8601 inspection time. Defaults to now." }),
|
|
25
|
+
"dry-run": i.boolean({ description: "Inspect and report without writing an observation record." }),
|
|
26
|
+
json: i.boolean({ description: "Emit the record outcome as JSON." })
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
let { flags: t } = await this.parse(a), i = r(t.repo, t.suite), o = t["dry-run"] ? null : n(t.repo, {
|
|
30
|
+
schemaVersion: 1,
|
|
31
|
+
suite: t.suite,
|
|
32
|
+
commit: t.commit,
|
|
33
|
+
tool: `quoin mock-inspection ${e()}`,
|
|
34
|
+
timestamp: t.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
35
|
+
injections: i
|
|
36
|
+
});
|
|
37
|
+
if (t.json) {
|
|
38
|
+
this.log(JSON.stringify({
|
|
39
|
+
path: o,
|
|
40
|
+
injections: i
|
|
41
|
+
}, null, 2));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.log(`${t["dry-run"] ? "inspected" : "recorded mock inspection"} ${t.suite} @ ${t.commit.slice(0, 12)}` + (o ? ` -> ${o}` : " (dry run; wrote nothing)")), this.log(` injections: ${i.length}`);
|
|
45
|
+
for (let e of i) this.log(` ${e.path ?? "(unknown)"}:${e.line ?? 0} ${e.symbol} injects ${e.injects.join(", ")}`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { a as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/record.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAoB7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,MAAM,CAAC,OAAO,SAAuD;IACrE,MAAM,CAAC,WAAW,SAcc;IAEhC,MAAM,CAAC,QAAQ,WAEb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;MAoDV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/record.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAoB7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,MAAM,CAAC,OAAO,SAAuD;IACrE,MAAM,CAAC,WAAW,SAcc;IAEhC,MAAM,CAAC,QAAQ,WAEb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;MAoDV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoL3B;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI9D"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { i as e, n as t, o as n, t as r } from "../../quire-
|
|
2
|
-
import { t as i } from "../../base-
|
|
3
|
-
import { a, b as o,
|
|
1
|
+
import { i as e, n as t, o as n, t as r } from "../../quire-D8tCpgyA.js";
|
|
2
|
+
import { t as i } from "../../base-CqKNs2Kd.js";
|
|
3
|
+
import { _ as a, b as o, f as s, r as c } from "../../store--2sAv12X.js";
|
|
4
|
+
import { a as l, i as u, o as d, r as f, s as p } from "../../evidence-DD0CHzJ0.js";
|
|
4
5
|
import { readFileSync as m } from "node:fs";
|
|
5
6
|
import { Flags as h } from "@oclif/core";
|
|
6
7
|
//#region src/commands/evidence/record.ts
|
|
7
8
|
var g = class u extends i {
|
|
8
9
|
static summary = "Transcribe one suite run into the evidence store.";
|
|
9
10
|
static description = "Records ONE run of ONE suite at ONE commit, then binds every obligation that\nrun discharged, stamping the statement hash as it stands now.\n\nquoin transcribes; the consumer's CI executes (ADR-0011 invariant 1). This\ncommand runs no test and judges no result — recording a FAILING run is as\nlegitimate as recording a passing one, and more useful, because a suite that\nstopped passing is exactly what a freshness check needs to see.\n\n--results takes normalized entries:\n\n {\"entries\": [{\"symbol\": \"tests::tc001\", \"outcome\": \"pass\", \"traceIds\": [\"FR-001-AC-1\"]}]}\n\n--adapter selects a format reader. Without it the suite's --tool picks one, and\nfailing that the normalized shape above is assumed. An adapter transcribes; it\nruns nothing and judges nothing.";
|
|
10
|
-
static examples = ["quoin evidence record --suite SUITE-001 --commit $(git rev-parse HEAD) --tool 'cargo test' --results run.json"];
|
|
11
|
+
static examples = ["quoin evidence record --suite SUITE-001 --commit $(git rev-parse HEAD) --tool 'cargo test 1.94.1' --results run.json"];
|
|
11
12
|
static flags = {
|
|
12
13
|
suite: h.string({
|
|
13
14
|
description: "Suite id from spec/evidence/suites.md (e.g. SUITE-001).",
|
|
@@ -43,7 +44,9 @@ var g = class u extends i {
|
|
|
43
44
|
json: h.boolean({ description: "Emit the outcome as JSON." })
|
|
44
45
|
};
|
|
45
46
|
async run() {
|
|
46
|
-
let { flags: i } = await this.parse(u)
|
|
47
|
+
let { flags: i } = await this.parse(u);
|
|
48
|
+
_(i.tool) || this.error("--tool must include an immutable version (for example `vitest 3.2.4` or `scanner git:<full-sha>`)", { exit: 2 });
|
|
49
|
+
let f = n(r());
|
|
47
50
|
f && this.error(f.message, { exit: 2 });
|
|
48
51
|
let h = [
|
|
49
52
|
"coverage",
|
|
@@ -52,78 +55,86 @@ var g = class u extends i {
|
|
|
52
55
|
"--json"
|
|
53
56
|
];
|
|
54
57
|
i.module && h.push("--module", i.module);
|
|
55
|
-
let g = t(h),
|
|
56
|
-
|
|
57
|
-
let
|
|
58
|
+
let g = t(h), b = e(g);
|
|
59
|
+
b.ok || this.error(`${b.error.message}\n${b.error.errors.slice(0, 10).join("\n")}`, { exit: 2 });
|
|
60
|
+
let x = l({
|
|
58
61
|
adapter: i.adapter,
|
|
59
62
|
tool: i.tool
|
|
60
63
|
});
|
|
61
|
-
if (
|
|
62
|
-
let e = i.results === "-" ? m(0, "utf8") : m(i.results, "utf8"), t =
|
|
64
|
+
if (x) {
|
|
65
|
+
let e = i.results === "-" ? m(0, "utf8") : m(i.results, "utf8"), t = x.parse(e), n = t.tool;
|
|
66
|
+
n !== void 0 && n !== i.tool && n !== v(i.tool) && this.error(`result tool identity ${JSON.stringify(n)} does not match --tool ${JSON.stringify(i.tool)}`, { exit: 2 });
|
|
67
|
+
let r = o(i.repo, {
|
|
63
68
|
schemaVersion: 1,
|
|
64
69
|
suite: i.suite,
|
|
65
70
|
commit: i.commit,
|
|
66
|
-
tool:
|
|
71
|
+
tool: i.tool,
|
|
67
72
|
...i.kind === void 0 ? {} : { evidenceKind: i.kind },
|
|
68
73
|
timestamp: i.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
69
74
|
...t.ruleset === void 0 ? {} : { ruleset: t.ruleset },
|
|
70
75
|
...t.rulesEvaluated === void 0 ? {} : { rulesEvaluated: t.rulesEvaluated },
|
|
71
76
|
findings: t.findings
|
|
72
|
-
}),
|
|
73
|
-
if (
|
|
74
|
-
let e = new Map(
|
|
75
|
-
for (let n of [...
|
|
77
|
+
}), l = t.rulesEvaluated === 0, u = (i.discharges ?? "").split(",").map((e) => e.trim()).filter((e) => e !== ""), f = [], p = [];
|
|
78
|
+
if (u.length > 0 && !l) {
|
|
79
|
+
let e = new Map(d(b.value).map((e) => [e.id, e])), t = s(i.repo).bindings;
|
|
80
|
+
for (let n of [...u].sort()) {
|
|
76
81
|
let r = e.get(n);
|
|
77
82
|
if (!r) {
|
|
78
|
-
|
|
83
|
+
p.push(n);
|
|
79
84
|
continue;
|
|
80
85
|
}
|
|
81
|
-
let a =
|
|
86
|
+
let a = c(t, {
|
|
82
87
|
obligation: n,
|
|
83
88
|
statementHashAtBinding: r.statement_hash,
|
|
84
89
|
suite: i.suite,
|
|
85
90
|
commit: i.commit,
|
|
86
91
|
symbols: []
|
|
87
92
|
});
|
|
88
|
-
t = a.bindings, a.created &&
|
|
93
|
+
t = a.bindings, a.created && f.push(n);
|
|
89
94
|
}
|
|
90
|
-
|
|
95
|
+
a(i.repo, { bindings: t });
|
|
91
96
|
}
|
|
92
97
|
if (i.json) {
|
|
93
98
|
this.log(JSON.stringify({
|
|
94
|
-
scanPath:
|
|
99
|
+
scanPath: r,
|
|
95
100
|
findings: t.findings,
|
|
96
|
-
bound:
|
|
97
|
-
unknown:
|
|
101
|
+
bound: f,
|
|
102
|
+
unknown: p
|
|
98
103
|
}, null, 2));
|
|
99
104
|
return;
|
|
100
105
|
}
|
|
101
|
-
this.log(`recorded scan ${i.suite} @ ${i.commit.slice(0, 12)} → ${
|
|
106
|
+
this.log(`recorded scan ${i.suite} @ ${i.commit.slice(0, 12)} → ${r}`), this.log(` bound: ${f.length}`), p.length > 0 && this.log(` discharges no such obligation: ${p.sort().join(", ")}`), l && u.length > 0 && this.log(" bound nothing: the scan evaluated no rules, so it found nothing because it looked for nothing"), this.log(` findings: ${t.findings.length}` + (t.rulesEvaluated === void 0 ? " (the tool reported no rule count, so this cannot be told from a scan with no rules enabled)" : ` over ${t.rulesEvaluated} rules evaluated`));
|
|
102
107
|
return;
|
|
103
108
|
}
|
|
104
|
-
let
|
|
109
|
+
let S = y(i.results, {
|
|
105
110
|
adapter: i.adapter,
|
|
106
111
|
tool: i.tool
|
|
107
|
-
}),
|
|
112
|
+
}), C = p({
|
|
108
113
|
repo: i.repo,
|
|
109
114
|
suite: i.suite,
|
|
110
115
|
commit: i.commit,
|
|
111
116
|
tool: i.tool,
|
|
112
117
|
evidenceKind: i.kind,
|
|
113
118
|
timestamp: i.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
114
|
-
entries:
|
|
115
|
-
obligations:
|
|
119
|
+
entries: S,
|
|
120
|
+
obligations: d(b.value)
|
|
116
121
|
});
|
|
117
122
|
if (i.json) {
|
|
118
|
-
this.log(JSON.stringify(
|
|
123
|
+
this.log(JSON.stringify(C, null, 2));
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
121
|
-
this.log(`recorded ${i.suite} @ ${i.commit.slice(0, 12)} → ${
|
|
126
|
+
this.log(`recorded ${i.suite} @ ${i.commit.slice(0, 12)} → ${C.runPath}`), this.log(` bound: ${C.bound.length}`), C.suspect.length > 0 && this.log(` suspect (statement changed since binding, re-affirm to clear): ${C.suspect.join(", ")}`), C.unmatched.length > 0 && this.log(` unmatched trace ids (tagged in the suite, stated by no obligation): ${C.unmatched.join(", ")}`);
|
|
122
127
|
}
|
|
123
128
|
};
|
|
124
|
-
function _(e
|
|
129
|
+
function _(e) {
|
|
130
|
+
return /(?:^|[\s/@])(?:v?\d+(?:\.\d+)+(?:[-+][0-9A-Za-z.-]+)?|git:[0-9a-f]{40}|sha256:[0-9a-f]{64})(?:$|[\s,)])/i.test(e);
|
|
131
|
+
}
|
|
132
|
+
function v(e) {
|
|
133
|
+
return e.trim().split(/\s+/, 1)[0];
|
|
134
|
+
}
|
|
135
|
+
function y(e, t) {
|
|
125
136
|
let n = m(e === "-" ? 0 : e, "utf8");
|
|
126
137
|
return u(t).parse(n).entries;
|
|
127
138
|
}
|
|
128
139
|
//#endregion
|
|
129
|
-
export { g as default };
|
|
140
|
+
export { g as default, _ as isVersionedToolIdentity };
|
package/dist/commands/matrix.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/measurement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,YAAY;IACxD,MAAM,CAAC,OAAO,SAAmD;IACjE,MAAM,CAAC,WAAW,SAE0D;IAEtE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAM3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
//#region src/commands/measurement/index.ts
|
|
3
|
+
var t = class t extends e {
|
|
4
|
+
static summary = "Record and inspect versioned QA measurements.";
|
|
5
|
+
static description = "Measurement collections connect raw producer output to active\nMeasurementPlans. Use `quoin measurement record` to persist one complete producer\ninvocation; use `quoin report` for current state, comparisons, and series.";
|
|
6
|
+
async run() {
|
|
7
|
+
await this.parse(t), this.log(t.description);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QuoinCommand } from '../../base.js';
|
|
2
|
+
export default class MeasurementRecord extends QuoinCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
repo: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
6
|
+
input: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/measurement/record.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY;IACzD,MAAM,CAAC,OAAO,SAA+D;IAC7E,MAAM,CAAC,KAAK;;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { h as t } from "../../measurement-CzB74Q07.js";
|
|
3
|
+
import { readFileSync as n } from "node:fs";
|
|
4
|
+
import { Flags as r } from "@oclif/core";
|
|
5
|
+
//#region src/commands/measurement/record.ts
|
|
6
|
+
var i = class i extends e {
|
|
7
|
+
static summary = "Atomically record one plan-validated producer invocation.";
|
|
8
|
+
static flags = {
|
|
9
|
+
repo: r.string({
|
|
10
|
+
description: "Repository root.",
|
|
11
|
+
default: "."
|
|
12
|
+
}),
|
|
13
|
+
input: r.string({
|
|
14
|
+
description: "Collection JSON path, or - for stdin.",
|
|
15
|
+
required: !0
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
let { flags: e } = await this.parse(i), r = e.input === "-" ? n(0, "utf8") : n(e.input, "utf8"), a;
|
|
20
|
+
try {
|
|
21
|
+
a = JSON.parse(r);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
24
|
+
this.error(`measurement input is not JSON: ${t}`, { exit: 2 });
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
this.log(t(e.repo, a));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
30
|
+
this.error(t, { exit: 2 });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { i as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../../base-
|
|
2
|
-
import { r as t } from "../../plugins-
|
|
3
|
-
import { n } from "../../modules-
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { r as t } from "../../plugins-C-ta0llj.js";
|
|
3
|
+
import { n } from "../../modules-ez9httBA.js";
|
|
4
4
|
//#region src/commands/module/ensure-defaults.ts
|
|
5
5
|
var r = class r extends e {
|
|
6
6
|
static summary = "Idempotently install the default spec module set.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../base-
|
|
2
|
-
import { n as t } from "../../plugins-
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { n as t } from "../../plugins-C-ta0llj.js";
|
|
3
3
|
import { Args as n } from "@oclif/core";
|
|
4
4
|
//#region src/commands/module/install.ts
|
|
5
5
|
var r = class r extends e {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../base-
|
|
2
|
-
import { r as t } from "../../plugins-
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { r as t } from "../../plugins-C-ta0llj.js";
|
|
3
3
|
//#region src/commands/module/list.ts
|
|
4
4
|
var n = class n extends e {
|
|
5
5
|
static summary = "List installed spec modules.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../base-
|
|
2
|
-
import { a as t } from "../../plugins-
|
|
1
|
+
import { t as e } from "../../base-CqKNs2Kd.js";
|
|
2
|
+
import { a as t } from "../../plugins-C-ta0llj.js";
|
|
3
3
|
import { Args as n } from "@oclif/core";
|
|
4
4
|
//#region src/commands/module/remove.ts
|
|
5
5
|
var r = class r extends e {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QuoinCommand } from '../base.js';
|
|
2
|
+
export default class Report extends QuoinCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
repo: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
8
|
+
portfolio: import('@oclif/core/interfaces').OptionFlag<string[] | undefined, import('@oclif/core/interfaces').CustomOptions>;
|
|
9
|
+
since: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
|
|
10
|
+
series: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
|
|
11
|
+
format: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAc1C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAY;IAC9C,MAAM,CAAC,OAAO,SAA+D;IAC7E,MAAM,CAAC,WAAW,SACyD;IAC3E,MAAM,CAAC,QAAQ,WAKb;IACF,MAAM,CAAC,KAAK;;;;;;MAeV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqD3B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { t as e } from "../base-CqKNs2Kd.js";
|
|
2
|
+
import { a as t, c as n, d as r, i, l as a, n as o, r as s, s as c, u as l } from "../measurement-CzB74Q07.js";
|
|
3
|
+
import { i as u } from "../store--2sAv12X.js";
|
|
4
|
+
import { Flags as d } from "@oclif/core";
|
|
5
|
+
//#region src/commands/report.ts
|
|
6
|
+
var f = class f extends e {
|
|
7
|
+
static summary = "Render QA plans and measurements from the evidence store.";
|
|
8
|
+
static description = "A deterministic store view. It accepts no typed values and runs no\nmeasurement producer. Plans with no records remain visible as not_computed.";
|
|
9
|
+
static examples = [
|
|
10
|
+
"quoin report",
|
|
11
|
+
"quoin report --since abc123 --format json",
|
|
12
|
+
"quoin report --series finding_recall --format json",
|
|
13
|
+
"quoin report --portfolio ../quoin --portfolio ../quire-rs"
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
repo: d.string({
|
|
17
|
+
description: "Repository root.",
|
|
18
|
+
default: "."
|
|
19
|
+
}),
|
|
20
|
+
portfolio: d.string({
|
|
21
|
+
description: "Repository root to include; repeat for a portfolio view.",
|
|
22
|
+
multiple: !0
|
|
23
|
+
}),
|
|
24
|
+
since: d.string({ description: "Compare the named source revision to latest." }),
|
|
25
|
+
series: d.string({ description: "Render the history of one metric." }),
|
|
26
|
+
format: d.string({
|
|
27
|
+
description: "Output format.",
|
|
28
|
+
options: ["human", "json"],
|
|
29
|
+
default: "human"
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
let { flags: e } = await this.parse(f);
|
|
34
|
+
e.since && e.series && this.error("--since and --series are mutually exclusive", { exit: 2 });
|
|
35
|
+
try {
|
|
36
|
+
if (e.portfolio?.length) {
|
|
37
|
+
(e.since || e.series) && this.error("--portfolio cannot be combined with --since or --series", { exit: 2 });
|
|
38
|
+
let t = o(e.portfolio);
|
|
39
|
+
this.log(e.format === "json" ? i(t).trimEnd() : s(t));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (e.series) {
|
|
43
|
+
let t = r(e.repo, e.series);
|
|
44
|
+
this.log(e.format === "json" ? u(t).trimEnd() : p(e.series, t));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.since) {
|
|
48
|
+
let t = c(e.repo, e.since);
|
|
49
|
+
this.log(e.format === "json" ? u(t).trimEnd() : n(t));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let d = t(e.repo);
|
|
53
|
+
this.log(e.format === "json" ? l(d).trimEnd() : a(d));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
56
|
+
this.error(t, { exit: 2 });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function p(e, t) {
|
|
61
|
+
let n = [`# ${e} series`, ""];
|
|
62
|
+
if (t.length === 0) return `${n.join("\n")}not_computed: no records\n`;
|
|
63
|
+
for (let e of t) {
|
|
64
|
+
let t = e.observation;
|
|
65
|
+
n.push(`- ${String(e.timestamp)} ${String(t.state)} ${String(t.value)} ${String(t.unit)} (source ${String(e.sourceRevision)}, tool ${String(e.toolIdentity)} ${String(e.toolVersion)}, corpus ${String(e.corpusRevision)}, gaps ${String(e.corpusGaps)}, config ${String(e.configDigest)})`);
|
|
66
|
+
}
|
|
67
|
+
return n.push(""), n.join("\n");
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { f as default };
|
package/dist/commands/review.js
CHANGED
package/dist/commands/to-plan.js
CHANGED
package/dist/commands/update.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../version-
|
|
2
|
-
import { t } from "../base-
|
|
1
|
+
import { t as e } from "../version-Dg0e6CZU.js";
|
|
2
|
+
import { t } from "../base-CqKNs2Kd.js";
|
|
3
3
|
import { runSelfUpdate as n } from "@agent-ix/ix-cli-core";
|
|
4
4
|
import { Flags as r } from "@oclif/core";
|
|
5
5
|
//#region src/commands/update.ts
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuoinCommand } from '../base.js';
|
|
2
|
+
export default class Validate extends QuoinCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
repo: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
|
|
8
|
+
strict: import('@oclif/core/interfaces').BooleanFlag<boolean>;
|
|
9
|
+
json: import('@oclif/core/interfaces').BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,MAAM,CAAC,OAAO,SAA8D;IAC5E,MAAM,CAAC,WAAW,SAIqD;IAEvE,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;MAIV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB3B"}
|