@agent-ix/quoin 0.15.1 → 0.19.2

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.
Files changed (125) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/default-modules.yaml +15 -6
  4. package/dist/advisor/advise.d.ts +14 -1
  5. package/dist/advisor/advise.d.ts.map +1 -1
  6. package/dist/advisor/methods.d.ts +11 -1
  7. package/dist/advisor/methods.d.ts.map +1 -1
  8. package/dist/{advisor-D35K3_iI.js → advisor-a9axb4Jl.js} +21 -8
  9. package/dist/assurance/graph.d.ts +79 -0
  10. package/dist/assurance/graph.d.ts.map +1 -0
  11. package/dist/assurance/index.d.ts +9 -0
  12. package/dist/assurance/index.d.ts.map +1 -0
  13. package/dist/assurance/render.d.ts +3 -0
  14. package/dist/assurance/render.d.ts.map +1 -0
  15. package/dist/auditor/audit.d.ts +37 -5
  16. package/dist/auditor/audit.d.ts.map +1 -1
  17. package/dist/auditor/combinatorial.d.ts +53 -0
  18. package/dist/auditor/combinatorial.d.ts.map +1 -0
  19. package/dist/auditor/index.d.ts +1 -1
  20. package/dist/auditor/index.d.ts.map +1 -1
  21. package/dist/auditor-W2jFinr6.js +188 -0
  22. package/dist/{base-CtpwIg4M.js → base-BE20w0jY.js} +1 -1
  23. package/dist/cli.js +1 -1
  24. package/dist/combinatorial-Cq01XfhV.js +80 -0
  25. package/dist/commands/advise.d.ts +16 -0
  26. package/dist/commands/advise.d.ts.map +1 -0
  27. package/dist/commands/advise.js +164 -0
  28. package/dist/commands/assurance.d.ts +14 -0
  29. package/dist/commands/assurance.d.ts.map +1 -0
  30. package/dist/commands/assurance.js +179 -0
  31. package/dist/commands/catalog/list.js +2 -2
  32. package/dist/commands/catalog/methods.js +3 -3
  33. package/dist/commands/catalog/show.js +2 -2
  34. package/dist/commands/catalog/validate.js +2 -2
  35. package/dist/commands/completeness.d.ts +16 -0
  36. package/dist/commands/completeness.d.ts.map +1 -0
  37. package/dist/commands/completeness.js +49 -0
  38. package/dist/commands/config/doctor.js +1 -1
  39. package/dist/commands/config/edit.js +1 -1
  40. package/dist/commands/config/get.js +1 -1
  41. package/dist/commands/config/set.js +1 -1
  42. package/dist/commands/evidence/affirm.d.ts.map +1 -1
  43. package/dist/commands/evidence/affirm.js +36 -50
  44. package/dist/commands/evidence/audit.d.ts +11 -0
  45. package/dist/commands/evidence/audit.d.ts.map +1 -1
  46. package/dist/commands/evidence/audit.js +60 -154
  47. package/dist/commands/evidence/baseline.d.ts +14 -0
  48. package/dist/commands/evidence/baseline.d.ts.map +1 -0
  49. package/dist/commands/evidence/baseline.js +79 -0
  50. package/dist/commands/evidence/gc.js +2 -2
  51. package/dist/commands/evidence/index.d.ts.map +1 -1
  52. package/dist/commands/evidence/index.js +4 -2
  53. package/dist/commands/evidence/record.d.ts +3 -0
  54. package/dist/commands/evidence/record.d.ts.map +1 -1
  55. package/dist/commands/evidence/record.js +97 -53
  56. package/dist/commands/matrix.js +1 -1
  57. package/dist/commands/module/ensure-defaults.js +3 -3
  58. package/dist/commands/module/install.js +2 -2
  59. package/dist/commands/module/list.js +2 -2
  60. package/dist/commands/module/remove.js +2 -2
  61. package/dist/commands/review.js +1 -1
  62. package/dist/commands/to-plan.js +1 -1
  63. package/dist/commands/update.js +2 -2
  64. package/dist/commands/write.js +3 -3
  65. package/dist/completeness/assess.d.ts +82 -0
  66. package/dist/completeness/assess.d.ts.map +1 -0
  67. package/dist/completeness/bundle.d.ts +52 -0
  68. package/dist/completeness/bundle.d.ts.map +1 -0
  69. package/dist/completeness/declarations.d.ts +46 -0
  70. package/dist/completeness/declarations.d.ts.map +1 -0
  71. package/dist/completeness/index.d.ts +11 -0
  72. package/dist/completeness/index.d.ts.map +1 -0
  73. package/dist/completeness/run.d.ts +35 -0
  74. package/dist/completeness/run.d.ts.map +1 -0
  75. package/dist/completeness-BeqcskAI.js +228 -0
  76. package/dist/evidence/adapters/agent-eval.d.ts +26 -0
  77. package/dist/evidence/adapters/agent-eval.d.ts.map +1 -0
  78. package/dist/evidence/adapters/audit-script.d.ts +25 -0
  79. package/dist/evidence/adapters/audit-script.d.ts.map +1 -0
  80. package/dist/evidence/adapters/cargo-mutants.d.ts +3 -0
  81. package/dist/evidence/adapters/cargo-mutants.d.ts.map +1 -0
  82. package/dist/evidence/adapters/junit.d.ts +17 -0
  83. package/dist/evidence/adapters/junit.d.ts.map +1 -0
  84. package/dist/evidence/adapters/registry.d.ts +63 -0
  85. package/dist/evidence/adapters/registry.d.ts.map +1 -0
  86. package/dist/evidence/adapters/sarif.d.ts +35 -0
  87. package/dist/evidence/adapters/sarif.d.ts.map +1 -0
  88. package/dist/evidence/adapters/sbom.d.ts +35 -0
  89. package/dist/evidence/adapters/sbom.d.ts.map +1 -0
  90. package/dist/evidence/adapters/types.d.ts +55 -0
  91. package/dist/evidence/adapters/types.d.ts.map +1 -0
  92. package/dist/evidence/index.d.ts +11 -1
  93. package/dist/evidence/index.d.ts.map +1 -1
  94. package/dist/evidence/record.d.ts +6 -0
  95. package/dist/evidence/record.d.ts.map +1 -1
  96. package/dist/evidence/store.d.ts +124 -8
  97. package/dist/evidence/store.d.ts.map +1 -1
  98. package/dist/evidence/types.d.ts +110 -5
  99. package/dist/evidence/types.d.ts.map +1 -1
  100. package/dist/evidence-FRF9RN77.js +595 -0
  101. package/dist/{flow-command-BSMqxass.js → flow-command-BrzzKBo9.js} +1 -1
  102. package/dist/index.js +6 -6
  103. package/dist/{modules-Ckfaq5p4.js → modules-_FQTZ3gx.js} +2 -2
  104. package/dist/{plugins-CLuXx2Jr.js → plugins-Q1MtCIE5.js} +1 -1
  105. package/dist/quire/contract.d.ts +1 -1
  106. package/dist/quire/contract.d.ts.map +1 -1
  107. package/dist/quire/exec.d.ts +44 -0
  108. package/dist/quire/exec.d.ts.map +1 -0
  109. package/dist/quire/index.d.ts +1 -0
  110. package/dist/quire/index.d.ts.map +1 -1
  111. package/dist/{quire-MbMdffPh.js → quire-Dis3ky5t.js} +316 -262
  112. package/dist/{version-By2YFRZQ.js → version-D0l3nDPZ.js} +1 -1
  113. package/dist/{write-8JJ8Dumo.js → write-CMA6BDUq.js} +1 -1
  114. package/package.json +2 -1
  115. package/skills/spec-evidence-analysis/SKILL.md +27 -11
  116. package/skills/spec-fuzz/SKILL.md +94 -0
  117. package/skills/spec-fuzz/assets/templates/atheris.py.md +74 -0
  118. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +83 -0
  119. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +76 -0
  120. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +51 -0
  121. package/skills/spec-fuzz/references/step-1-select-obligations.md +47 -0
  122. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +55 -0
  123. package/skills/spec-fuzz/references/step-3-emit-targets.md +65 -0
  124. package/skills/spec-fuzz/references/step-4-report.md +56 -0
  125. package/dist/evidence-BvUyw-Yv.js +0 -171
@@ -1,81 +1,67 @@
1
- import { n as e, t } from "../../quire-MbMdffPh.js";
2
- import { t as n } from "../../base-CtpwIg4M.js";
3
- import { c as r, r as i, u as a } from "../../evidence-BvUyw-Yv.js";
4
- import { Flags as o } from "@oclif/core";
5
- import { execFileSync as s } from "node:child_process";
1
+ import { i as e, n as t, o as n, t as r } from "../../quire-Dis3ky5t.js";
2
+ import { t as i } from "../../base-BE20w0jY.js";
3
+ import { _ as a, m as o, o as s } from "../../evidence-FRF9RN77.js";
4
+ import { Flags as c } from "@oclif/core";
5
+ import { execFileSync as l } from "node:child_process";
6
6
  //#region src/commands/evidence/affirm.ts
7
- var c = class c extends n {
7
+ var u = class u extends i {
8
8
  static summary = "Re-affirm a binding after the statement it was made against changed.";
9
9
  static description = "A reworded acceptance criterion changes its content hash, which makes every\nbinding on it SUSPECT until somebody says the evidence still discharges the new\nwording. This is that act.\n\nAuto-bind, explicit affirmation: first discharge binds without asking, because\nrequiring a signature on something the evidence already proves puts a gate in\nfront of the common case and teaches people to click through it. Re-affirmation\nis the judgement call, so it stays explicit — and it is recorded with who, at\nwhich commit, and optionally why.\n\nRe-running the test does NOT clear suspicion. If it did, the suspect state would\nclear itself on the next CI run and the detector would never fire.";
10
10
  static examples = ["quoin evidence affirm --obligation FR-001-AC-1 --who @reviewer", "quoin evidence affirm --obligation NFR-006-M-2 --who @reviewer --note 'threshold widened deliberately'"];
11
11
  static flags = {
12
- obligation: o.string({
12
+ obligation: c.string({
13
13
  description: "Obligation id whose binding is being re-affirmed.",
14
14
  required: !0
15
15
  }),
16
- who: o.string({
16
+ who: c.string({
17
17
  description: "Who is affirming. Recorded verbatim.",
18
18
  required: !0
19
19
  }),
20
- note: o.string({ description: "Why the evidence still holds." }),
21
- commit: o.string({ description: "Commit of the affirmation. Defaults to HEAD." }),
22
- repo: o.string({
20
+ note: c.string({ description: "Why the evidence still holds." }),
21
+ commit: c.string({ description: "Commit of the affirmation. Defaults to HEAD." }),
22
+ repo: c.string({
23
23
  description: "Repository root.",
24
24
  default: "."
25
25
  }),
26
- module: o.string({ description: "Module directory supplying the traceability model." }),
27
- json: o.boolean({ description: "Emit the outcome as JSON." })
26
+ module: c.string({ description: "Module directory supplying the traceability model." }),
27
+ json: c.boolean({ description: "Emit the outcome as JSON." })
28
28
  };
29
29
  async run() {
30
- let { flags: n } = await this.parse(c), o = e(l());
31
- o && this.error(o.message, { exit: 2 });
32
- let u = [
30
+ let { flags: i } = await this.parse(u), c = n(r());
31
+ c && this.error(c.message, { exit: 2 });
32
+ let d = [
33
33
  "coverage",
34
34
  "--scope",
35
- n.repo,
35
+ i.repo,
36
36
  "--json"
37
37
  ];
38
- n.module && u.push("--module", n.module);
39
- let d = t(s("quire", u, {
40
- encoding: "utf8",
41
- stdio: [
42
- "ignore",
43
- "pipe",
44
- "ignore"
45
- ]
46
- }));
47
- d.ok || this.error(d.error.message, { exit: 2 });
48
- let f = (d.value.obligations ?? []).find((e) => e.id === n.obligation);
49
- f || this.error(`no obligation \`${n.obligation}\` is derived from this spec today. Either the id is wrong, or the requirement it named is gone — in which case the binding should be removed rather than affirmed.`, { exit: 2 });
50
- let p = n.commit ?? s("git", [
38
+ i.module && d.push("--module", i.module);
39
+ let f = e(t(d));
40
+ f.ok || this.error(f.error.message, { exit: 2 });
41
+ let p = (f.value.obligations ?? []).find((e) => e.id === i.obligation);
42
+ p || this.error(`no obligation \`${i.obligation}\` is derived from this spec today. Either the id is wrong, or the requirement it named is gone — in which case the binding should be removed rather than affirmed.`, { exit: 2 });
43
+ let m = i.commit ?? l("git", [
51
44
  "-C",
52
- n.repo,
45
+ i.repo,
53
46
  "rev-parse",
54
47
  "HEAD"
55
- ], { encoding: "utf8" }).trim(), m = r(n.repo).bindings, { bindings: h, found: g } = i(m, n.obligation, f.statement_hash, n.who, p, n.note);
56
- g || this.error(`no binding exists for \`${n.obligation}\`, so there is nothing to affirm. A binding is created when a suite first discharges the obligation (\`quoin evidence record\`).`, { exit: 2 }), a(n.repo, {
48
+ ], { encoding: "utf8" }).trim(), h = o(i.repo).bindings, { bindings: g, found: _ } = s(h, i.obligation, p.statement_hash, i.who, m, i.note);
49
+ _ || this.error(`no binding exists for \`${i.obligation}\`, so there is nothing to affirm. A binding is created when a suite first discharges the obligation (\`quoin evidence record\`).`, { exit: 2 }), a(i.repo, {
57
50
  schemaVersion: 1,
58
- bindings: h
51
+ bindings: g
59
52
  });
60
- let _ = {
61
- obligation: n.obligation,
62
- who: n.who,
63
- commit: p,
64
- statementHash: f.statement_hash
53
+ let v = {
54
+ obligation: i.obligation,
55
+ who: i.who,
56
+ commit: m,
57
+ statementHash: p.statement_hash
65
58
  };
66
- if (n.json) {
67
- this.log(JSON.stringify(_, null, 2));
59
+ if (i.json) {
60
+ this.log(JSON.stringify(v, null, 2));
68
61
  return;
69
62
  }
70
- this.log(`affirmed ${n.obligation} by ${n.who} at ${p.slice(0, 12)} (hash ${f.statement_hash.slice(0, 12)}…)`);
63
+ this.log(`affirmed ${i.obligation} by ${i.who} at ${m.slice(0, 12)} (hash ${p.statement_hash.slice(0, 12)}…)`);
71
64
  }
72
65
  };
73
- function l() {
74
- try {
75
- return s("quire", ["--version"], { encoding: "utf8" });
76
- } catch {
77
- return null;
78
- }
79
- }
80
66
  //#endregion
81
- export { c as default };
67
+ export { u as default };
@@ -9,7 +9,18 @@ export default class EvidenceAudit extends QuoinCommand {
9
9
  ratchet: import('@oclif/core/interfaces').BooleanFlag<boolean>;
10
10
  strict: import('@oclif/core/interfaces').BooleanFlag<boolean>;
11
11
  json: import('@oclif/core/interfaces').BooleanFlag<boolean>;
12
+ "multiplicity-requires": import('@oclif/core/interfaces').OptionFlag<string[] | undefined, import('@oclif/core/interfaces').CustomOptions>;
13
+ "mutation-floor": import('@oclif/core/interfaces').OptionFlag<string[] | undefined, import('@oclif/core/interfaces').CustomOptions>;
12
14
  };
13
15
  run(): Promise<void>;
14
16
  }
17
+ /**
18
+ * `--mutation-floor P0=0.8` → `{ P0: 0.8 }`.
19
+ *
20
+ * Rejected rather than ignored: a malformed entry means the operator asked for
21
+ * a threshold and would otherwise get a clean report saying nothing was below
22
+ * it. A floor that silently does not apply is worse than no floor, because it
23
+ * reads as a passing gate.
24
+ */
25
+ export declare function parseMutationFloor(entries: string[] | undefined, fail: (message: string) => never): Record<string, number> | undefined;
15
26
  //# sourceMappingURL=audit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/audit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAa7C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY;IACrD,MAAM,CAAC,OAAO,SACmD;IACjE,MAAM,CAAC,WAAW,SAcX;IAEP,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;MAYV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6D3B"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/audit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAkB7C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY;IACrD,MAAM,CAAC,OAAO,SACmD;IACjE,MAAM,CAAC,WAAW,SAiBuC;IAEzD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MA0BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoE3B;AAyCD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAuBpC"}
@@ -1,177 +1,81 @@
1
- import { n as e, t } from "../../quire-MbMdffPh.js";
2
- import { t as n } from "../../base-CtpwIg4M.js";
3
- import { a as r, c as i, l as a, o, s } from "../../evidence-BvUyw-Yv.js";
4
- import { t as c } from "../../advisor-D35K3_iI.js";
5
- import { Flags as l } from "@oclif/core";
6
- import { execFileSync as u } from "node:child_process";
7
- //#region src/auditor/audit.ts
8
- function d(e) {
9
- let t = [], n = [], r = new Map(e.bindings.map((e) => [e.obligation, e])), i = new Map(e.runs.map((e) => [e.suite, e]));
10
- for (let a of [...e.obligations].sort((e, t) => e.id.localeCompare(t.id))) {
11
- let o = r.get(a.id);
12
- if (!o) {
13
- t.push({
14
- kind: "undischarged",
15
- obligation: a.id,
16
- severity: "medium",
17
- summary: `no evidence is bound to ${a.id}`
18
- });
19
- continue;
20
- }
21
- if (o.statementHashAtBinding !== a.statement_hash) {
22
- t.push({
23
- kind: "suspect-link",
24
- obligation: a.id,
25
- severity: "high",
26
- summary: `${a.id} was reworded after its evidence was bound (bound against ${o.statementHashAtBinding.slice(0, 12)}…, now ${a.statement_hash.slice(0, 12)}…). Re-affirm or re-verify.`
27
- });
28
- continue;
29
- }
30
- let s = i.get(o.suite);
31
- if (!s) {
32
- t.push({
33
- kind: "stale-evidence",
34
- obligation: a.id,
35
- severity: "high",
36
- summary: `${a.id} is bound to suite ${o.suite}, which has no recorded run. The binding claims evidence that is not in the store.`
37
- });
38
- continue;
39
- }
40
- e.headCommit && s.commit !== e.headCommit && t.push({
41
- kind: "stale-evidence",
42
- obligation: a.id,
43
- severity: "medium",
44
- summary: `${a.id} rests on a ${o.suite} run at ${s.commit.slice(0, 12)}, not at HEAD (${e.headCommit.slice(0, 12)}).`
45
- });
46
- let c = o.symbols.filter((e) => {
47
- let t = s.entries.find((t) => t.symbol === e);
48
- return !t || t.outcome === "skip";
49
- });
50
- if (c.length > 0 && c.length === o.symbols.length) {
51
- t.push({
52
- kind: "vacuous-evidence",
53
- obligation: a.id,
54
- severity: "high",
55
- summary: `every symbol bound to ${a.id} was skipped or absent from the ${o.suite} run: ${c.sort().join(", ")}. The row reads as covered and nothing was verified.`
56
- });
57
- continue;
58
- }
59
- let l = f(a, o, s, e.catalog);
60
- if (l) {
61
- t.push(l);
62
- continue;
63
- }
64
- let u = p(a, o, e);
65
- if (u) {
66
- t.push(u);
67
- continue;
68
- }
69
- n.push(a.id);
70
- }
71
- return t.sort((e, t) => e.obligation.localeCompare(t.obligation) || e.kind.localeCompare(t.kind)), {
72
- findings: t,
73
- healthy: n.sort()
74
- };
75
- }
76
- function f(e, t, n, r) {
77
- if (!r || !e.method) return null;
78
- let i = e.method.trim().toLowerCase(), a = /* @__PURE__ */ new Set();
79
- for (let e of r.methods) e.id.toLowerCase() === i && a.add(e.class), e.class.toLowerCase() === i && a.add(e.class);
80
- if (a.size === 0) return null;
81
- let o = a.has("Test"), s = n.entries.length > 0;
82
- return !o && s ? {
83
- kind: "method-conformance",
84
- obligation: e.id,
85
- severity: "medium",
86
- summary: `${e.id} declares \`${e.method}\` (${[...a].sort().join("/")}) but is discharged by a test run in ${t.suite}. A method that is not a test is not discharged by one.`
87
- } : null;
88
- }
89
- function p(e, t, n) {
90
- let r = n.multiplicityRequires ?? [];
91
- return r.length === 0 || !e.criticality || !r.includes(e.criticality) || new Set(n.bindings.filter((t) => t.obligation === e.id).map((e) => e.suite)).size >= 2 ? null : {
92
- kind: "insufficient-multiplicity",
93
- obligation: e.id,
94
- severity: "medium",
95
- summary: `${e.id} is criticality ${e.criticality}, which requires two independent methods, but all its evidence comes from ${t.suite}.`
96
- };
97
- }
98
- function m(e, t) {
99
- let n = /* @__PURE__ */ new Set([...t.undischarged.map((e) => `undischarged:${e}`), ...t.suspect.map((e) => `suspect-link:${e}`)]);
100
- return e.findings.filter((e) => !n.has(`${e.kind}:${e.obligation}`));
101
- }
102
- //#endregion
1
+ import { i as e, n as t, o as n, t as r } from "../../quire-Dis3ky5t.js";
2
+ import { t as i } from "../../base-BE20w0jY.js";
3
+ import { t as a } from "../../advisor-a9axb4Jl.js";
4
+ import { d as o, f as s, m as c, p as l, u } from "../../evidence-FRF9RN77.js";
5
+ import { r as d, t as f } from "../../auditor-W2jFinr6.js";
6
+ import { Flags as p } from "@oclif/core";
7
+ import { execFileSync as m } from "node:child_process";
103
8
  //#region src/commands/evidence/audit.ts
104
- var h = class r extends n {
9
+ var h = class o extends i {
105
10
  static summary = "Audit the evidence store: suspect links, staleness, vacuity.";
106
- static description = "Reads the store and reports. RUNS NOTHING (ADR-0011 invariant 1) — the\nconsumer's CI refreshes evidence, and an auditor that could re-run a suite could\nalso make a finding disappear by re-running it.\n\nChecks:\n suspect-link the statement changed after the evidence was bound\n stale-evidence bound to a missing run, or to a run behind HEAD\n vacuous-evidence every bound symbol was skipped or absent from the run\n undischarged no evidence is bound at all\n method-conformance a non-test method discharged by a test run\n insufficient-multiplicity criticality demands two independent suites\n\n--ratchet compares against spec/evidence/baseline.json and fails only on NEW\nviolations. A gate that fails on the whole existing backlog gets disabled within\na week.";
11
+ static description = "Reads the store and reports. RUNS NOTHING (ADR-0011 invariant 1) — the\nconsumer's CI refreshes evidence, and an auditor that could re-run a suite could\nalso make a finding disappear by re-running it.\n\nChecks:\n suspect-link the statement changed after the evidence was bound\n stale-evidence bound to a missing run, or to a run behind HEAD\n vacuous-evidence every bound symbol was skipped or absent from the run\n undischarged no evidence is bound at all\n method-conformance evidence of a kind the declared method does not produce\n unknown-method the declared method is in no catalog\n insufficient-multiplicity criticality demands two independent suites\n insufficient-mutation-score criticality demands a mutation score it misses\n unmeasured-mutation-score a demanded mutation score, with none recorded\n\n--ratchet compares against spec/evidence/baseline.json and fails only on NEW\nviolations. A gate that fails on the whole existing backlog gets disabled within\na week. Write that baseline with: quoin evidence baseline";
107
12
  static examples = [
108
13
  "quoin evidence audit",
109
14
  "quoin evidence audit --ratchet --strict",
110
15
  "quoin evidence audit --json"
111
16
  ];
112
17
  static flags = {
113
- repo: l.string({
18
+ repo: p.string({
114
19
  description: "Repository root.",
115
20
  default: "."
116
21
  }),
117
- module: l.string({ description: "Module directory supplying the traceability model." }),
118
- ratchet: l.boolean({ description: "Report only violations absent from the baseline." }),
119
- strict: l.boolean({ description: "Exit 1 when any reported finding remains." }),
120
- json: l.boolean({ description: "Emit the report as JSON." })
22
+ module: p.string({ description: "Module directory supplying the traceability model." }),
23
+ ratchet: p.boolean({ description: "Report only violations absent from the baseline." }),
24
+ strict: p.boolean({ description: "Exit 1 when any reported finding remains." }),
25
+ json: p.boolean({ description: "Emit the report as JSON." }),
26
+ "multiplicity-requires": p.string({
27
+ description: "Criticality values demanding two independent suites. Repeatable. Unset by default: no obligation source in the ecosystem declares a criticality column, so a built-in default could never fire.",
28
+ multiple: !0
29
+ }),
30
+ "mutation-floor": p.string({
31
+ description: "Minimum mutation score per criticality, as <criticality>=<0..1>. Repeatable. Unset by default, for the same reason as --multiplicity-requires: a built-in floor is a rule nobody chose.",
32
+ multiple: !0
33
+ })
121
34
  };
122
35
  async run() {
123
- let { flags: n } = await this.parse(r), a = e(v());
124
- a && this.error(a.message, { exit: 2 });
125
- let o = [
36
+ let { flags: i } = await this.parse(o), s = n(r());
37
+ s && this.error(s.message, { exit: 2 });
38
+ let u = [
126
39
  "coverage",
127
40
  "--scope",
128
- n.repo,
41
+ i.repo,
129
42
  "--json"
130
43
  ];
131
- n.module && o.push("--module", n.module);
132
- let l = t(u("quire", o, {
133
- encoding: "utf8",
134
- stdio: [
135
- "ignore",
136
- "pipe",
137
- "ignore"
138
- ]
139
- }));
140
- l.ok || this.error(l.error.message, { exit: 2 });
141
- let f = d({
142
- obligations: l.value.obligations ?? [],
143
- bindings: i(n.repo).bindings,
144
- runs: g(n.repo),
145
- catalog: c(),
146
- headCommit: _(n.repo),
147
- multiplicityRequires: ["P0"]
148
- }), p = n.ratchet ? s(n.repo) : null, h = p ? m(f, p) : f.findings;
149
- if (n.json) this.log(JSON.stringify({
150
- findings: h,
151
- healthy: f.healthy,
152
- ratchet: n.ratchet
44
+ i.module && u.push("--module", i.module);
45
+ let p = e(t(u));
46
+ p.ok || this.error(p.error.message, { exit: 2 });
47
+ let m = f({
48
+ obligations: p.value.obligations ?? [],
49
+ bindings: c(i.repo).bindings,
50
+ runs: _(i.repo),
51
+ scans: g(i.repo),
52
+ catalog: a(i.module ? [i.module] : void 0),
53
+ headCommit: v(i.repo),
54
+ multiplicityRequires: i["multiplicity-requires"],
55
+ mutationFloor: y(i["mutation-floor"], (e) => this.error(e, { exit: 2 }))
56
+ }), h = i.ratchet ? l(i.repo) : null, b = h ? d(m, h) : m.findings;
57
+ if (i.json) this.log(JSON.stringify({
58
+ findings: b,
59
+ healthy: m.healthy,
60
+ ratchet: i.ratchet
153
61
  }, null, 2));
154
- else if (h.length === 0) this.log(`${f.healthy.length} obligation(s) with healthy evidence; nothing to report`);
62
+ else if (b.length === 0) this.log(`${m.healthy.length} obligation(s) with healthy evidence; nothing to report`);
155
63
  else {
156
- for (let e of h) this.log(`[${e.severity}] ${e.kind}: ${e.summary}`);
157
- this.log(""), this.log(`${h.length} finding(s), ${f.healthy.length} healthy` + (n.ratchet ? " (new violations only)" : ""));
64
+ for (let e of b) this.log(`[${e.severity}] ${e.kind}: ${e.summary}`);
65
+ this.log(""), this.log(`${b.length} finding(s), ${m.healthy.length} healthy` + (i.ratchet ? " (new violations only)" : ""));
158
66
  }
159
- n.strict && h.length > 0 && this.exit(1);
67
+ i.strict && b.length > 0 && this.exit(1);
160
68
  }
161
69
  };
162
70
  function g(e) {
163
- let t = [];
164
- for (let n of r(e)) {
165
- let r = o(e, n).at(-1);
166
- if (!r) continue;
167
- let i = a(e, n, r.replace(/\.json$/, ""));
168
- i && t.push(i);
169
- }
170
- return t;
71
+ return s(e).map((t) => o(e, t)).filter((e) => e !== null);
171
72
  }
172
73
  function _(e) {
74
+ return s(e).map((t) => u(e, t)).filter((e) => e !== null);
75
+ }
76
+ function v(e) {
173
77
  try {
174
- return u("git", [
78
+ return m("git", [
175
79
  "-C",
176
80
  e,
177
81
  "rev-parse",
@@ -181,12 +85,14 @@ function _(e) {
181
85
  return;
182
86
  }
183
87
  }
184
- function v() {
185
- try {
186
- return u("quire", ["--version"], { encoding: "utf8" });
187
- } catch {
188
- return null;
88
+ function y(e, t) {
89
+ if (!e || e.length === 0) return;
90
+ let n = {};
91
+ for (let r of e) {
92
+ let [e, i] = r.split("="), a = Number(i);
93
+ (!e || i === void 0 || Number.isNaN(a)) && t(`--mutation-floor expects <criticality>=<score>, got '${r}'. Example: --mutation-floor P0=0.8`), (a < 0 || a > 1) && t(`--mutation-floor score must be a ratio in [0, 1], got '${i}'. 80% is 0.8, not 80.`), n[e] = a;
189
94
  }
95
+ return n;
190
96
  }
191
97
  //#endregion
192
- export { h as default };
98
+ export { h as default, y as parseMutationFloor };
@@ -0,0 +1,14 @@
1
+ import { QuoinCommand } from '../../base.js';
2
+ export default class EvidenceBaseline 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
+ module: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
9
+ "dry-run": import('@oclif/core/interfaces').BooleanFlag<boolean>;
10
+ json: import('@oclif/core/interfaces').BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=baseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/baseline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAkB7C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,YAAY;IACxD,MAAM,CAAC,OAAO,SAA0D;IACxE,MAAM,CAAC,WAAW,SAU8C;IAEhE,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;;;MASV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiD3B"}
@@ -0,0 +1,79 @@
1
+ import { i as e, n as t, o as n, t as r } from "../../quire-Dis3ky5t.js";
2
+ import { t as i } from "../../base-BE20w0jY.js";
3
+ import { t as a } from "../../advisor-a9axb4Jl.js";
4
+ import { f as o, g as s, m as c, s as l, u } from "../../evidence-FRF9RN77.js";
5
+ import { n as d, t as f } from "../../auditor-W2jFinr6.js";
6
+ import { Flags as p } from "@oclif/core";
7
+ import { execFileSync as m } from "node:child_process";
8
+ //#region src/commands/evidence/baseline.ts
9
+ var h = class o extends i {
10
+ static summary = "Accept the current findings as the ratchet baseline.";
11
+ 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
+ static examples = ["quoin evidence baseline", "quoin evidence baseline --dry-run"];
13
+ static flags = {
14
+ repo: p.string({
15
+ description: "Repository root.",
16
+ default: "."
17
+ }),
18
+ module: p.string({ description: "Module directory supplying the traceability model." }),
19
+ "dry-run": p.boolean({ description: "Print what would be accepted and write nothing." }),
20
+ json: p.boolean({ description: "Emit the outcome as JSON." })
21
+ };
22
+ async run() {
23
+ let { flags: i } = await this.parse(o), u = n(r());
24
+ u && this.error(u.message, { exit: 2 });
25
+ let p = [
26
+ "coverage",
27
+ "--scope",
28
+ i.repo,
29
+ "--json"
30
+ ];
31
+ i.module && p.push("--module", i.module);
32
+ let m = e(t(p));
33
+ m.ok || this.error(m.error.message, { exit: 2 });
34
+ let h = f({
35
+ obligations: m.value.obligations ?? [],
36
+ bindings: c(i.repo).bindings,
37
+ runs: g(i.repo),
38
+ catalog: a(i.module ? [i.module] : void 0),
39
+ headCommit: _(i.repo)
40
+ }).findings.map(d).sort(), v = _(i.repo) ?? "";
41
+ if (i["dry-run"] || s(i.repo, {
42
+ schemaVersion: 1,
43
+ commit: v,
44
+ accepted: h
45
+ }), i.json) {
46
+ this.log(JSON.stringify({
47
+ accepted: h,
48
+ commit: v,
49
+ dryRun: !!i["dry-run"]
50
+ }, null, 2));
51
+ return;
52
+ }
53
+ let y = /* @__PURE__ */ new Map();
54
+ for (let e of h) {
55
+ let t = e.slice(0, e.indexOf(":"));
56
+ y.set(t, (y.get(t) ?? 0) + 1);
57
+ }
58
+ this.log(`${i["dry-run"] ? "would accept" : "accepted"} ${h.length} finding(s) at ${v.slice(0, 12) || "an unknown commit"}`);
59
+ for (let [e, t] of [...y].sort()) this.log(` ${e}: ${t}`);
60
+ i["dry-run"] || this.log(l(i.repo));
61
+ }
62
+ };
63
+ function g(e) {
64
+ return o(e).map((t) => u(e, t)).filter((e) => e !== null);
65
+ }
66
+ function _(e) {
67
+ try {
68
+ return m("git", [
69
+ "-C",
70
+ e,
71
+ "rev-parse",
72
+ "HEAD"
73
+ ], { encoding: "utf8" }).trim();
74
+ } catch {
75
+ return;
76
+ }
77
+ }
78
+ //#endregion
79
+ export { h as default };
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
2
- import { i as t } from "../../evidence-BvUyw-Yv.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
+ import { l as t } from "../../evidence-FRF9RN77.js";
3
3
  import { Flags as n } from "@oclif/core";
4
4
  //#region src/commands/evidence/gc.ts
5
5
  var r = class r extends e {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,MAAM,CAAC,OAAO,SAC2D;IACzE,MAAM,CAAC,WAAW,SAc2C;IAE7D,MAAM,CAAC,QAAQ,WAIb;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,MAAM,CAAC,OAAO,SAC2D;IACzE,MAAM,CAAC,WAAW,SAgB6C;IAE/D,MAAM,CAAC,QAAQ,WAMb;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3B"}
@@ -1,11 +1,13 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
2
  //#region src/commands/evidence/index.ts
3
3
  var t = class t extends e {
4
4
  static summary = "The evidence store — what actually ran, and against which statement.";
5
- static description = "The artifact of record for verification (FR-030). quoin TRANSCRIBES; the\nconsumer's CI executes — nothing here runs a test.\n\nLayout, under spec/evidence/:\n\n suites.md authored suite registry (validated corpus document)\n inspections.md authored inspection acts (validated corpus document)\n bindings.json obligation -> hash-at-binding -> evidence\n baseline.json the accepted violation set the ratchet compares against\n runs/<SUITE-N>/<commit12>.json one file = one run of one suite\n\nSubcommands:\n quoin evidence record transcribe a suite run\n quoin evidence affirm re-affirm a binding after its statement changed\n quoin evidence gc drop run records nothing references";
5
+ static description = "The artifact of record for verification (FR-030). quoin TRANSCRIBES; the\nconsumer's CI executes — nothing here runs a test.\n\nLayout, under spec/evidence/:\n\n suites.md authored suite registry (validated corpus document)\n inspections.md authored inspection acts (validated corpus document)\n bindings.json obligation -> hash-at-binding -> evidence\n baseline.json the accepted violation set the ratchet compares against\n runs/<SUITE-N>/<commit12>.json one file = one run of one suite\n\nSubcommands:\n quoin evidence record transcribe a suite run\n quoin evidence affirm re-affirm a binding after its statement changed\n quoin evidence audit read the store and report\n quoin evidence baseline accept the current findings as the ratchet baseline\n quoin evidence gc drop run records nothing references";
6
6
  static examples = [
7
7
  "quoin evidence record --suite SUITE-001 --commit $(git rev-parse HEAD) --tool 'cargo test' --results run.json",
8
8
  "quoin evidence affirm --obligation FR-001-AC-1 --who @reviewer",
9
+ "quoin evidence audit --ratchet --strict",
10
+ "quoin evidence baseline",
9
11
  "quoin evidence gc --dry-run"
10
12
  ];
11
13
  async run() {
@@ -7,6 +7,9 @@ export default class EvidenceRecord extends QuoinCommand {
7
7
  suite: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
8
8
  commit: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
9
9
  tool: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
10
+ kind: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
11
+ discharges: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
12
+ adapter: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
10
13
  results: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
11
14
  repo: import('@oclif/core/interfaces').OptionFlag<string, import('@oclif/core/interfaces').CustomOptions>;
12
15
  module: import('@oclif/core/interfaces').OptionFlag<string | undefined, import('@oclif/core/interfaces').CustomOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/evidence/record.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACtD,MAAM,CAAC,OAAO,SAAuD;IACrE,MAAM,CAAC,WAAW,SAa2D;IAE7E,MAAM,CAAC,QAAQ,WAEb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;MA4BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyD3B"}
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;CAmK3B"}