@agent-ix/quoin 0.21.9 → 0.23.1

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 (244) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/default-modules.yaml +18 -2
  4. package/dist/{advisor-BiKhR9Yp.js → advisor-B0rESCx1.js} +1 -1
  5. package/dist/auditor/audit.d.ts +23 -18
  6. package/dist/auditor/audit.d.ts.map +1 -1
  7. package/dist/auditor/index.d.ts +2 -1
  8. package/dist/auditor/index.d.ts.map +1 -1
  9. package/dist/{auditor-ww0MC62a.js → auditor-Dd3i9Aqx.js} +82 -65
  10. package/dist/{base-W7vrLi5E.js → base-gAClyCNd.js} +1 -1
  11. package/dist/change-assurance/attestations.d.ts +7 -0
  12. package/dist/change-assurance/attestations.d.ts.map +1 -0
  13. package/dist/change-assurance/index.d.ts +14 -0
  14. package/dist/change-assurance/index.d.ts.map +1 -0
  15. package/dist/change-assurance/integrity.d.ts +11 -0
  16. package/dist/change-assurance/integrity.d.ts.map +1 -0
  17. package/dist/change-assurance/records.d.ts +22 -0
  18. package/dist/change-assurance/records.d.ts.map +1 -0
  19. package/dist/change-assurance/schema-assets.d.ts +8 -0
  20. package/dist/change-assurance/schema-assets.d.ts.map +1 -0
  21. package/dist/change-assurance/store.d.ts +18 -0
  22. package/dist/change-assurance/store.d.ts.map +1 -0
  23. package/dist/change-assurance/types.d.ts +180 -0
  24. package/dist/change-assurance/types.d.ts.map +1 -0
  25. package/dist/change-assurance/verify.d.ts +4 -0
  26. package/dist/change-assurance/verify.d.ts.map +1 -0
  27. package/dist/change-assurance-CyKLPeKa.js +1236 -0
  28. package/dist/cli.js +1 -1
  29. package/dist/commands/advise.js +27 -26
  30. package/dist/commands/assurance.d.ts.map +1 -1
  31. package/dist/commands/assurance.js +84 -61
  32. package/dist/commands/catalog/list.js +2 -2
  33. package/dist/commands/catalog/methods.js +3 -3
  34. package/dist/commands/catalog/show.js +2 -2
  35. package/dist/commands/catalog/validate.js +2 -2
  36. package/dist/commands/change-assurance/common.d.ts +37 -0
  37. package/dist/commands/change-assurance/common.d.ts.map +1 -0
  38. package/dist/commands/change-assurance/index.d.ts +8 -0
  39. package/dist/commands/change-assurance/index.d.ts.map +1 -0
  40. package/dist/commands/change-assurance/index.js +12 -0
  41. package/dist/commands/change-assurance/intake.d.ts +15 -0
  42. package/dist/commands/change-assurance/intake.d.ts.map +1 -0
  43. package/dist/commands/change-assurance/intake.js +53 -0
  44. package/dist/commands/change-assurance/receipt.d.ts +21 -0
  45. package/dist/commands/change-assurance/receipt.d.ts.map +1 -0
  46. package/dist/commands/change-assurance/receipt.js +99 -0
  47. package/dist/commands/change-assurance/recover.d.ts +13 -0
  48. package/dist/commands/change-assurance/recover.d.ts.map +1 -0
  49. package/dist/commands/change-assurance/recover.js +29 -0
  50. package/dist/commands/change-assurance/schema.d.ts +13 -0
  51. package/dist/commands/change-assurance/schema.d.ts.map +1 -0
  52. package/dist/commands/change-assurance/schema.js +40 -0
  53. package/dist/commands/change-assurance/seal-attestation.d.ts +15 -0
  54. package/dist/commands/change-assurance/seal-attestation.d.ts.map +1 -0
  55. package/dist/commands/change-assurance/seal-attestation.js +58 -0
  56. package/dist/commands/change-assurance/seal-record.d.ts +14 -0
  57. package/dist/commands/change-assurance/seal-record.d.ts.map +1 -0
  58. package/dist/commands/change-assurance/seal-record.js +53 -0
  59. package/dist/commands/change-assurance/verify-receipt.d.ts +13 -0
  60. package/dist/commands/change-assurance/verify-receipt.d.ts.map +1 -0
  61. package/dist/commands/change-assurance/verify-receipt.js +41 -0
  62. package/dist/commands/completeness.js +2 -2
  63. package/dist/commands/config/doctor.d.ts.map +1 -1
  64. package/dist/commands/config/doctor.js +3 -3
  65. package/dist/commands/config/edit.d.ts.map +1 -1
  66. package/dist/commands/config/edit.js +3 -3
  67. package/dist/commands/config/get.js +1 -1
  68. package/dist/commands/config/set.js +1 -1
  69. package/dist/commands/evidence/affirm.js +17 -16
  70. package/dist/commands/evidence/audit.d.ts.map +1 -1
  71. package/dist/commands/evidence/audit.js +55 -43
  72. package/dist/commands/evidence/baseline.d.ts.map +1 -1
  73. package/dist/commands/evidence/baseline.js +50 -40
  74. package/dist/commands/evidence/gc.js +3 -2
  75. package/dist/commands/evidence/index.js +1 -1
  76. package/dist/commands/evidence/inspect-mocks.d.ts +16 -0
  77. package/dist/commands/evidence/inspect-mocks.d.ts.map +1 -0
  78. package/dist/commands/evidence/inspect-mocks.js +49 -0
  79. package/dist/commands/evidence/record.d.ts +1 -0
  80. package/dist/commands/evidence/record.d.ts.map +1 -1
  81. package/dist/commands/evidence/record.js +48 -33
  82. package/dist/commands/graph/change-impact.d.ts +16 -0
  83. package/dist/commands/graph/change-impact.d.ts.map +1 -0
  84. package/dist/commands/graph/change-impact.js +29 -0
  85. package/dist/commands/graph/churn.d.ts +14 -0
  86. package/dist/commands/graph/churn.d.ts.map +1 -0
  87. package/dist/commands/graph/churn.js +15 -0
  88. package/dist/commands/graph/common.d.ts +16 -0
  89. package/dist/commands/graph/common.d.ts.map +1 -0
  90. package/dist/commands/graph/fan-out.d.ts +14 -0
  91. package/dist/commands/graph/fan-out.d.ts.map +1 -0
  92. package/dist/commands/graph/fan-out.js +15 -0
  93. package/dist/commands/graph/index.d.ts +8 -0
  94. package/dist/commands/graph/index.d.ts.map +1 -0
  95. package/dist/commands/graph/index.js +12 -0
  96. package/dist/commands/matrix.js +1 -1
  97. package/dist/commands/measurement/index.d.ts +7 -0
  98. package/dist/commands/measurement/index.d.ts.map +1 -0
  99. package/dist/commands/measurement/index.js +11 -0
  100. package/dist/commands/measurement/intervention.d.ts +11 -0
  101. package/dist/commands/measurement/intervention.d.ts.map +1 -0
  102. package/dist/commands/measurement/intervention.js +31 -0
  103. package/dist/commands/measurement/operational-release.d.ts +11 -0
  104. package/dist/commands/measurement/operational-release.d.ts.map +1 -0
  105. package/dist/commands/measurement/operational-release.js +31 -0
  106. package/dist/commands/measurement/record.d.ts +10 -0
  107. package/dist/commands/measurement/record.d.ts.map +1 -0
  108. package/dist/commands/measurement/record.js +36 -0
  109. package/dist/commands/module/ensure-defaults.js +3 -3
  110. package/dist/commands/module/install.js +2 -2
  111. package/dist/commands/module/list.js +2 -2
  112. package/dist/commands/module/remove.js +2 -2
  113. package/dist/commands/report.d.ts +19 -0
  114. package/dist/commands/report.d.ts.map +1 -0
  115. package/dist/commands/report.js +96 -0
  116. package/dist/commands/review.js +1 -1
  117. package/dist/commands/to-plan.js +1 -1
  118. package/dist/commands/update.js +2 -2
  119. package/dist/commands/validate.d.ts +13 -0
  120. package/dist/commands/validate.d.ts.map +1 -0
  121. package/dist/commands/validate.js +123 -0
  122. package/dist/commands/write.js +3 -3
  123. package/dist/common-B1ZJ8CSO.js +36 -0
  124. package/dist/common-DTrmnvL-.js +35 -0
  125. package/dist/{completeness-BQDxME0a.js → completeness-BzBuNq6w.js} +1 -1
  126. package/dist/evidence/adapters/contract-conformance.d.ts +16 -0
  127. package/dist/evidence/adapters/contract-conformance.d.ts.map +1 -0
  128. package/dist/evidence/adapters/differential-report.d.ts +18 -0
  129. package/dist/evidence/adapters/differential-report.d.ts.map +1 -0
  130. package/dist/evidence/adapters/registry.d.ts.map +1 -1
  131. package/dist/evidence/adapters/types.d.ts +31 -0
  132. package/dist/evidence/adapters/types.d.ts.map +1 -1
  133. package/dist/evidence/index.d.ts +7 -3
  134. package/dist/evidence/index.d.ts.map +1 -1
  135. package/dist/evidence/mock-inspection.d.ts +16 -0
  136. package/dist/evidence/mock-inspection.d.ts.map +1 -0
  137. package/dist/evidence/store.d.ts +11 -1
  138. package/dist/evidence/store.d.ts.map +1 -1
  139. package/dist/evidence/types.d.ts +31 -0
  140. package/dist/evidence/types.d.ts.map +1 -1
  141. package/dist/evidence-OyqpqHLS.js +614 -0
  142. package/dist/{flow-command-C_dUJNm-.js → flow-command-CCRTE5Oe.js} +7 -7
  143. package/dist/graph-analysis/analysis.d.ts +106 -0
  144. package/dist/graph-analysis/analysis.d.ts.map +1 -0
  145. package/dist/graph-analysis/index.d.ts +6 -0
  146. package/dist/graph-analysis/index.d.ts.map +1 -0
  147. package/dist/graph-analysis/input.d.ts +33 -0
  148. package/dist/graph-analysis/input.d.ts.map +1 -0
  149. package/dist/graph-analysis/load.d.ts +21 -0
  150. package/dist/graph-analysis/load.d.ts.map +1 -0
  151. package/dist/graph-analysis/render.d.ts +4 -0
  152. package/dist/graph-analysis/render.d.ts.map +1 -0
  153. package/dist/graph-analysis-IWaoJJSN.js +657 -0
  154. package/dist/index.d.ts +2 -0
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js +11 -8
  157. package/dist/measurement/agent-eval-intervention.d.ts +6 -0
  158. package/dist/measurement/agent-eval-intervention.d.ts.map +1 -0
  159. package/dist/measurement/atomic-file.d.ts +5 -0
  160. package/dist/measurement/atomic-file.d.ts.map +1 -0
  161. package/dist/measurement/compare.d.ts +4 -0
  162. package/dist/measurement/compare.d.ts.map +1 -0
  163. package/dist/measurement/date-time.d.ts +3 -0
  164. package/dist/measurement/date-time.d.ts.map +1 -0
  165. package/dist/measurement/github-release-operational.d.ts +7 -0
  166. package/dist/measurement/github-release-operational.d.ts.map +1 -0
  167. package/dist/measurement/graph-adapters.d.ts +304 -0
  168. package/dist/measurement/graph-adapters.d.ts.map +1 -0
  169. package/dist/measurement/graph-portfolio-load.d.ts +3 -0
  170. package/dist/measurement/graph-portfolio-load.d.ts.map +1 -0
  171. package/dist/measurement/graph-portfolio.d.ts +158 -0
  172. package/dist/measurement/graph-portfolio.d.ts.map +1 -0
  173. package/dist/measurement/index.d.ts +22 -0
  174. package/dist/measurement/index.d.ts.map +1 -0
  175. package/dist/measurement/intervention-report.d.ts +24 -0
  176. package/dist/measurement/intervention-report.d.ts.map +1 -0
  177. package/dist/measurement/intervention-schema.d.ts +144 -0
  178. package/dist/measurement/intervention-schema.d.ts.map +1 -0
  179. package/dist/measurement/intervention-types.d.ts +105 -0
  180. package/dist/measurement/intervention-types.d.ts.map +1 -0
  181. package/dist/measurement/intervention.d.ts +16 -0
  182. package/dist/measurement/intervention.d.ts.map +1 -0
  183. package/dist/measurement/operational-report.d.ts +17 -0
  184. package/dist/measurement/operational-report.d.ts.map +1 -0
  185. package/dist/measurement/operational-schema.d.ts +461 -0
  186. package/dist/measurement/operational-schema.d.ts.map +1 -0
  187. package/dist/measurement/operational-types.d.ts +121 -0
  188. package/dist/measurement/operational-types.d.ts.map +1 -0
  189. package/dist/measurement/operational.d.ts +13 -0
  190. package/dist/measurement/operational.d.ts.map +1 -0
  191. package/dist/measurement/plans.d.ts +6 -0
  192. package/dist/measurement/plans.d.ts.map +1 -0
  193. package/dist/measurement/portfolio.d.ts +54 -0
  194. package/dist/measurement/portfolio.d.ts.map +1 -0
  195. package/dist/measurement/profiles.d.ts +9 -0
  196. package/dist/measurement/profiles.d.ts.map +1 -0
  197. package/dist/measurement/report.d.ts +48 -0
  198. package/dist/measurement/report.d.ts.map +1 -0
  199. package/dist/measurement/schemas/operational-evidence-v1.schema.json.d.ts +384 -0
  200. package/dist/measurement/store.d.ts +14 -0
  201. package/dist/measurement/store.d.ts.map +1 -0
  202. package/dist/measurement/types.d.ts +85 -0
  203. package/dist/measurement/types.d.ts.map +1 -0
  204. package/dist/measurement/validate.d.ts +9 -0
  205. package/dist/measurement/validate.d.ts.map +1 -0
  206. package/dist/measurement-j8sDSqx5.js +2980 -0
  207. package/dist/{modules-Cn9Htfp0.js → modules-DDQkKC4l.js} +2 -2
  208. package/dist/{plugins-Byi1bWLD.js → plugins-CHpYhpEI.js} +1 -1
  209. package/dist/quire/assurance.d.ts +109 -0
  210. package/dist/quire/assurance.d.ts.map +1 -0
  211. package/dist/quire/contract.d.ts +12 -12
  212. package/dist/quire/contract.d.ts.map +1 -1
  213. package/dist/quire/exec.d.ts +10 -0
  214. package/dist/quire/exec.d.ts.map +1 -1
  215. package/dist/quire/index.d.ts +4 -3
  216. package/dist/quire/index.d.ts.map +1 -1
  217. package/dist/quire/types.d.ts +119 -1
  218. package/dist/quire/types.d.ts.map +1 -1
  219. package/dist/quire/validate.d.ts +5 -0
  220. package/dist/quire/validate.d.ts.map +1 -1
  221. package/dist/{quire-UzoK3Azf.js → quire-BsVj1xIR.js} +533 -499
  222. package/dist/schema-assets-HZWo_iFN.js +233 -0
  223. package/dist/schemas/assurance-v1.schema.json +225 -0
  224. package/dist/schemas/change-assurance-record-v1.schema.json +234 -0
  225. package/dist/schemas/coverage-v1.schema.json +919 -105
  226. package/dist/schemas/operational-evidence-v1.schema.json +381 -0
  227. package/dist/schemas/proof-attestation-v1.schema.json +96 -0
  228. package/dist/schemas/properties-v1.schema.json +25 -0
  229. package/dist/schemas/verification-receipt-v1.schema.json +208 -0
  230. package/dist/validators/gates.d.ts +18 -0
  231. package/dist/validators/gates.d.ts.map +1 -0
  232. package/dist/validators/index.d.ts +2 -0
  233. package/dist/validators/index.d.ts.map +1 -0
  234. package/dist/{version-BMXhyIie.js → version-CMxMIh5g.js} +1 -1
  235. package/dist/{write-BDxILTLC.js → write-CGTI0dRO.js} +1 -1
  236. package/package.json +26 -16
  237. package/skills/assurance-status-report/SKILL.md +135 -0
  238. package/skills/assurance-status-report/references/report-contract.md +110 -0
  239. package/skills/gap-analysis/references/step-4-underspecified-code.md +36 -7
  240. package/skills/gap-analysis/references/step-5-semantic-review.md +2 -2
  241. package/skills/gap-analysis/references/step-6-specreview-artifact.md +6 -5
  242. package/skills/spec-architecture-evaluation/SKILL.md +30 -0
  243. package/skills/spec-fuzz/SKILL.md +7 -6
  244. package/dist/evidence-BA5vyZJk.js +0 -603
@@ -0,0 +1,614 @@
1
+ import { C as e, T as t, _ as n, g as r, m as i, o as a, x as o } from "./schema-assets-HZWo_iFN.js";
2
+ import { readFileSync as s, readdirSync as c } from "node:fs";
3
+ import { extname as l, join as u, relative as d } from "node:path";
4
+ //#region src/evidence/record.ts
5
+ function f(t) {
6
+ let n = e(t.repo, {
7
+ schemaVersion: 1,
8
+ suite: t.suite,
9
+ commit: t.commit,
10
+ tool: t.tool,
11
+ evidenceKind: t.evidenceKind,
12
+ timestamp: t.timestamp,
13
+ entries: t.entries
14
+ }), i = new Map(t.obligations.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map();
15
+ for (let e of t.obligations) for (let t of e.target_ids ?? []) i.has(t) || s.set(t, [...s.get(t) ?? [], e]);
16
+ let c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
17
+ for (let e of t.entries) for (let t of e.traceIds ?? []) {
18
+ let n = i.has(t) ? [i.get(t)] : s.get(t) ?? [];
19
+ if (n.length === 0) {
20
+ l.add(t);
21
+ continue;
22
+ }
23
+ if (e.outcome === "pass") for (let t of n) {
24
+ let n = c.get(t.id) ?? [];
25
+ n.push(e.symbol), c.set(t.id, n);
26
+ }
27
+ }
28
+ let u = r(t.repo).bindings, d = [], f = [];
29
+ for (let [e, n] of [...c].sort(([e], [t]) => e === t ? 0 : e < t ? -1 : 1)) {
30
+ let r = i.get(e);
31
+ if (!r) continue;
32
+ let o = a(u, {
33
+ obligation: e,
34
+ statementHashAtBinding: r.statement_hash,
35
+ suite: t.suite,
36
+ commit: t.commit,
37
+ symbols: [...n].sort()
38
+ });
39
+ u = o.bindings, o.created && d.push(e), o.suspect && f.push(e);
40
+ }
41
+ return o(t.repo, { bindings: u }), {
42
+ runPath: n,
43
+ bound: d.sort(),
44
+ suspect: f.sort(),
45
+ unmatched: [...l].sort()
46
+ };
47
+ }
48
+ function p(e) {
49
+ return e.obligations ?? [];
50
+ }
51
+ //#endregion
52
+ //#region src/evidence/adapters/types.ts
53
+ var m = class extends Error {
54
+ adapter;
55
+ constructor(e, t) {
56
+ super(`${e}: ${t}`), this.adapter = e, this.name = "AdapterError";
57
+ }
58
+ };
59
+ //#endregion
60
+ //#region src/evidence/adapters/cargo-mutants.ts
61
+ function h(e) {
62
+ let t = e.file?.trim(), n = e.function?.function_name?.trim();
63
+ if (t !== void 0 && t !== "" && n !== void 0 && n !== "") return `${t}::${n}`;
64
+ }
65
+ var g = {
66
+ name: "cargo-mutants",
67
+ summary: "cargo-mutants outcomes.json — mutation score per mutated function.",
68
+ tools: ["cargo-mutants", "cargo mutants"],
69
+ parse(e) {
70
+ let n;
71
+ try {
72
+ n = JSON.parse(e);
73
+ } catch (e) {
74
+ throw new m("cargo-mutants", `input is not JSON: ${e.message}`);
75
+ }
76
+ if (!Array.isArray(n.outcomes)) throw new m("cargo-mutants", "no `outcomes` array — expected the contents of mutants.out/outcomes.json");
77
+ let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
78
+ for (let e of n.outcomes) {
79
+ if (e.scenario === "Baseline" || typeof e.scenario != "object") continue;
80
+ let t = e.scenario.Mutant;
81
+ if (t === void 0) continue;
82
+ let n = h(t);
83
+ n !== void 0 && (e.summary === "CaughtMutant" ? r.set(n, (r.get(n) ?? 0) + 1) : (e.summary === "MissedMutant" || e.summary === "Timeout") && i.set(n, (i.get(n) ?? 0) + 1));
84
+ }
85
+ let a = [.../* @__PURE__ */ new Set([...r.keys(), ...i.keys()])].sort();
86
+ if (a.length === 0) throw new m("cargo-mutants", "no viable mutants in the report — nothing was measured");
87
+ return { entries: a.map((e) => {
88
+ let n = r.get(e) ?? 0, a = i.get(e) ?? 0, o = n + a;
89
+ return {
90
+ symbol: e,
91
+ outcome: a === 0 ? "pass" : "fail",
92
+ score: n / o,
93
+ metric: t
94
+ };
95
+ }) };
96
+ }
97
+ }, _ = "quire.contract.conformance-jsonl/v1", v = /* @__PURE__ */ new Map([["match", "pass"], ["mismatch", "fail"]]), y = {
98
+ name: "contract-conformance",
99
+ summary: `Contract conformance JSONL (${_}) — one replayed fixture per line.`,
100
+ tools: [
101
+ "quire-contract-conformance",
102
+ "contract-conformance",
103
+ "quire-contract-ir"
104
+ ],
105
+ parse(e) {
106
+ let t = e.split("\n").filter((e) => e.trim() !== "");
107
+ if (t.length === 0) throw new m("contract-conformance", "input contains no conformance rows; an empty run is not a clean run");
108
+ let n = [];
109
+ return t.forEach((e, t) => {
110
+ let r;
111
+ try {
112
+ r = JSON.parse(e);
113
+ } catch (e) {
114
+ throw new m("contract-conformance", `line ${t + 1} is not JSON: ${e.message}`);
115
+ }
116
+ if (r.protocol !== _) throw new m("contract-conformance", `line ${t + 1} declares protocol ${JSON.stringify(r.protocol)}, expected ${_}`);
117
+ for (let e of [
118
+ "corpus_id",
119
+ "fixture_id",
120
+ "operation"
121
+ ]) if (typeof r[e] != "string" || r[e] === "") throw new m("contract-conformance", `line ${t + 1} has no ${e}`);
122
+ let i = v.get(r.status);
123
+ if (i === void 0) throw new m("contract-conformance", `line ${t + 1} has unknown status ${JSON.stringify(r.status)}`);
124
+ n.push({
125
+ symbol: `${r.corpus_id}::${r.operation}::${r.fixture_id}`,
126
+ outcome: i
127
+ });
128
+ }), { entries: n };
129
+ }
130
+ }, b = /^[a-z0-9][a-z0-9-]*\.differential-summary\/v1$/, ee = /* @__PURE__ */ new Map([
131
+ ["agreement", "pass"],
132
+ ["mismatch", "fail"],
133
+ ["tool-error", "error"]
134
+ ]), te = {
135
+ name: "differential-report",
136
+ summary: "Domain differential summary (<domain>.differential-summary/v1) — engine versus external reference, case by case.",
137
+ tools: [
138
+ "differential-report",
139
+ "tl-mltl",
140
+ "r2u2",
141
+ "c2po"
142
+ ],
143
+ parse(e) {
144
+ let t;
145
+ try {
146
+ t = JSON.parse(e);
147
+ } catch (e) {
148
+ throw new m("differential-report", `input is not JSON: ${e.message}`);
149
+ }
150
+ if (typeof t.schemaVersion != "string" || !b.test(t.schemaVersion)) throw new m("differential-report", `unknown schemaVersion ${JSON.stringify(t.schemaVersion)}; expected <domain>.differential-summary/v1`);
151
+ if (!Array.isArray(t.cases)) throw new m("differential-report", "report has no cases array");
152
+ if (t.cases.length === 0) throw new m("differential-report", "report contains no cases; a comparison that examined nothing is not an agreement");
153
+ let n = [], r = [];
154
+ return t.cases.forEach((e, t) => {
155
+ if (typeof e?.id != "string" || e.id === "") throw new m("differential-report", `case ${t} has no id`);
156
+ if (typeof e.status != "string" || e.status === "") throw new m("differential-report", `case ${e.id} has no status`);
157
+ if (e.status === "unsupported") {
158
+ r.push({
159
+ symbol: e.id,
160
+ state: "unsupported",
161
+ reason: "the external reference does not support this case; that is neither a skip nor an error, and no run-entry outcome carries it"
162
+ });
163
+ return;
164
+ }
165
+ let i = ee.get(e.status);
166
+ if (i === void 0) throw new m("differential-report", `case ${e.id} has unknown status ${JSON.stringify(e.status)}`);
167
+ n.push({
168
+ symbol: e.id,
169
+ outcome: i
170
+ });
171
+ }), r.length > 0 ? {
172
+ entries: n,
173
+ unrepresented: r
174
+ } : { entries: n };
175
+ }
176
+ }, x = /<testcase\b([^>]*?)(\/>|>([\s\S]*?)<\/testcase\s*>)/g, S = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
177
+ function C(e) {
178
+ let t = /* @__PURE__ */ new Map();
179
+ for (let n of e.matchAll(S)) t.set(n[1], w(n[2]));
180
+ return t;
181
+ }
182
+ function w(e) {
183
+ return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&apos;", "'").replaceAll("&amp;", "&");
184
+ }
185
+ function T(e, t) {
186
+ let n = e.trim(), r = t.trim();
187
+ return n === "" ? r : r === "" ? n : n === r ? r : n.endsWith(`::${r}`) || n.endsWith(`.${r}`) ? n.replaceAll(".", "::") : `${n.replaceAll(".", "::")}::${r}`;
188
+ }
189
+ var E = /<property\b([^>]*)\/?>/g;
190
+ function D(e) {
191
+ let t = [];
192
+ for (let n of e.matchAll(E)) {
193
+ let e = C(n[1]), r = e.get("name"), i = e.get("value");
194
+ if (r !== void 0 && i !== void 0 && (r === "trace" || r === "traceIds" || r === "trace_ids")) for (let e of i.split(/[,\s]+/)) e !== "" && t.push(e);
195
+ }
196
+ return t.length > 0 ? t : void 0;
197
+ }
198
+ function O(e) {
199
+ return /<error\b/.test(e) ? "error" : /<failure\b/.test(e) ? "fail" : /<skipped\b/.test(e) ? "skip" : "pass";
200
+ }
201
+ var k = {
202
+ name: "junit",
203
+ summary: "JUnit XML (<testsuite>/<testcase>), as emitted by most runners.",
204
+ tools: [
205
+ "junit",
206
+ "pytest",
207
+ "jest",
208
+ "vitest",
209
+ "gotestsum",
210
+ "surefire"
211
+ ],
212
+ parse(e) {
213
+ let t = [];
214
+ for (let n of e.matchAll(x)) {
215
+ let e = C(n[1]), r = n[3] ?? "", i = T(e.get("classname") ?? "", e.get("name") ?? "");
216
+ if (i === "") continue;
217
+ let a = D(r);
218
+ t.push({
219
+ symbol: i,
220
+ outcome: O(r),
221
+ ...a === void 0 ? {} : { traceIds: a }
222
+ });
223
+ }
224
+ if (t.length === 0) throw new m("junit", "no <testcase> elements found — is this JUnit XML?");
225
+ return { entries: t };
226
+ }
227
+ }, A = /^([A-Za-z0-9._-]+):\s*(OK|FAIL)\b\s*(?:[—-]\s*)?(.*)$/, j = /\(([^)]*)\)[.\s]*$/, M = /\b((?:FR|NFR|StR|US)-\d+-AC-\d+|TC-\d+)\b/g;
228
+ function N(e) {
229
+ let t = j.exec(e);
230
+ if (!t) return;
231
+ let n = [...t[1].matchAll(M)].map((e) => e[1]);
232
+ return n.length > 0 ? n : void 0;
233
+ }
234
+ function P(e) {
235
+ let t = [], n = 0;
236
+ for (let r of e.split("\n")) {
237
+ let e = A.exec(r.trim());
238
+ if (!e) continue;
239
+ let [, i, a, o] = e;
240
+ if (n += 1, a === "OK") continue;
241
+ let s = o.trim(), c = N(s);
242
+ t.push({
243
+ ruleId: i,
244
+ severity: "violation",
245
+ ...s === "" ? {} : { message: s },
246
+ ...c === void 0 ? {} : { traceIds: c }
247
+ });
248
+ }
249
+ if (n === 0) throw new m("audit-script", "no `<name>: OK` or `<name>: FAIL` line found — is this audit-script output?");
250
+ return {
251
+ findings: t,
252
+ tool: "audit-script",
253
+ rulesEvaluated: n
254
+ };
255
+ }
256
+ //#endregion
257
+ //#region src/evidence/adapters/agent-eval.ts
258
+ function F(e) {
259
+ let t;
260
+ try {
261
+ t = JSON.parse(e);
262
+ } catch (e) {
263
+ throw new m("agent-eval", `not JSON: ${e instanceof Error ? e.message : String(e)}`);
264
+ }
265
+ let n = t;
266
+ if (!n || typeof n != "object" || !Array.isArray(n.results)) throw new m("agent-eval", "expected a cli-agent-evals report with a \"results\" array");
267
+ let r = [];
268
+ for (let e of n.results) {
269
+ let t = typeof e.id == "string" ? e.id : null;
270
+ t && r.push({
271
+ symbol: t,
272
+ outcome: e.ok === !0 ? "pass" : "fail",
273
+ traceIds: [t],
274
+ ...I(e)
275
+ });
276
+ }
277
+ if (r.length === 0) throw new m("agent-eval", "no scenario results in the report — did the suite run?");
278
+ return { entries: r };
279
+ }
280
+ function I(e) {
281
+ let t = e.passRate;
282
+ if (typeof t != "string") return {};
283
+ let [n, r] = t.split("/").map(Number);
284
+ return !Number.isFinite(n) || !Number.isFinite(r) || r === 0 ? {} : { score: n / r };
285
+ }
286
+ var L = {
287
+ name: "agent-eval",
288
+ summary: "cli-agent-evals report JSON — one entry per scenario, keyed on the scenario id.",
289
+ tools: [
290
+ "cli-agent-evals",
291
+ "agent-evals",
292
+ "agent-pty"
293
+ ],
294
+ parse: F
295
+ };
296
+ //#endregion
297
+ //#region src/evidence/adapters/sbom.ts
298
+ function R(e) {
299
+ let t;
300
+ try {
301
+ t = JSON.parse(e);
302
+ } catch (e) {
303
+ throw new m("sbom", `not JSON: ${e instanceof Error ? e.message : String(e)}. CycloneDX and SPDX both have JSON serialisations; the tag-value SPDX form is not read here.`);
304
+ }
305
+ if (!t || typeof t != "object") throw new m("sbom", "expected a JSON object");
306
+ let n = t;
307
+ return { entries: z(n) ?? B(n) ?? ne(n) };
308
+ }
309
+ function z(e) {
310
+ return String(e.bomFormat ?? "") === "CycloneDX" ? (Array.isArray(e.components) ? e.components : []).map((e) => {
311
+ let t = e, n = typeof t.purl == "string" ? t.purl : null, r = typeof t.name == "string" ? t.name : null;
312
+ if (!n && !r) return null;
313
+ let i = typeof t.version == "string" ? t.version : null;
314
+ return {
315
+ symbol: n ?? (i ? `${r}@${i}` : r),
316
+ outcome: "pass"
317
+ };
318
+ }).filter((e) => e !== null) : null;
319
+ }
320
+ function B(e) {
321
+ return typeof e.spdxVersion == "string" ? (Array.isArray(e.packages) ? e.packages : []).map((e) => {
322
+ let t = e, n = (Array.isArray(t.externalRefs) ? t.externalRefs : []).map((e) => e).find((e) => String(e.referenceType ?? "") === "purl"), r = n && typeof n.referenceLocator == "string" ? n.referenceLocator : null, i = typeof t.name == "string" ? t.name : null;
323
+ if (!r && !i) return null;
324
+ let a = typeof t.versionInfo == "string" ? t.versionInfo : null;
325
+ return {
326
+ symbol: r ?? (a ? `${i}@${a}` : i),
327
+ outcome: "pass"
328
+ };
329
+ }).filter((e) => e !== null) : null;
330
+ }
331
+ function ne(e) {
332
+ throw new m("sbom", `neither a CycloneDX (\`bomFormat\`) nor an SPDX (\`spdxVersion\`) document — top-level keys: ${Object.keys(e).slice(0, 6).join(", ") || "(none)"}`);
333
+ }
334
+ var V = {
335
+ name: "sbom",
336
+ summary: "CycloneDX or SPDX JSON — one entry per component, so an empty inventory reads as vacuous.",
337
+ tools: [
338
+ "cyclonedx",
339
+ "spdx",
340
+ "syft",
341
+ "cdxgen",
342
+ "cargo-cyclonedx"
343
+ ],
344
+ parse: R
345
+ };
346
+ //#endregion
347
+ //#region src/evidence/adapters/sarif.ts
348
+ function H(e) {
349
+ let t;
350
+ try {
351
+ t = JSON.parse(e);
352
+ } catch (e) {
353
+ throw new m("sarif", `input is not JSON: ${e.message}`);
354
+ }
355
+ if (!Array.isArray(t.runs)) throw new m("sarif", "no `runs` array — expected a SARIF 2.1.0 log");
356
+ if (t.runs.length === 0) throw new m("sarif", "`runs` is empty — a log with no run proves no scan executed");
357
+ let n = [], r = [], i;
358
+ for (let e of t.runs) {
359
+ let t = e.tool?.driver;
360
+ t?.name !== void 0 && t.name !== "" && r.push(t.version === void 0 ? t.name : `${t.name} ${t.version}`), Array.isArray(t?.rules) && (i = (i ?? 0) + t.rules.length);
361
+ for (let t of e.results ?? []) {
362
+ let e = t.ruleId ?? t.rule?.id;
363
+ if (e === void 0 || e === "") continue;
364
+ let r = t.locations?.[0]?.physicalLocation;
365
+ n.push({
366
+ ruleId: e,
367
+ ...t.level === void 0 ? {} : { severity: t.level },
368
+ ...t.message?.text === void 0 ? {} : { message: t.message.text },
369
+ ...r?.artifactLocation?.uri === void 0 ? {} : { path: r.artifactLocation.uri },
370
+ ...r?.region?.startLine === void 0 ? {} : { line: r.region.startLine }
371
+ });
372
+ }
373
+ }
374
+ return {
375
+ findings: n,
376
+ ...r.length === 0 ? {} : { tool: r.join(", ") },
377
+ ...i === void 0 ? {} : { rulesEvaluated: i }
378
+ };
379
+ }
380
+ function U(e) {
381
+ let t;
382
+ try {
383
+ t = JSON.parse(e);
384
+ } catch (e) {
385
+ throw new m("cargo-audit", `input is not JSON: ${e.message}`);
386
+ }
387
+ if (t.vulnerabilities === void 0) throw new m("cargo-audit", "no `vulnerabilities` object — expected `cargo audit --json` output");
388
+ let n = [], r = (e, t) => {
389
+ let r = e.advisory?.id;
390
+ if (r === void 0 || r === "") return;
391
+ let i = e.package;
392
+ n.push({
393
+ ruleId: r,
394
+ severity: t,
395
+ ...e.advisory?.title === void 0 ? {} : { message: e.advisory.title },
396
+ ...i?.name === void 0 ? {} : { path: i.version === void 0 ? i.name : `${i.name}@${i.version}` }
397
+ });
398
+ };
399
+ for (let e of t.vulnerabilities.list ?? []) r(e, "vulnerability");
400
+ for (let [e, n] of Object.entries(t.warnings ?? {})) for (let t of n) r(t, e);
401
+ let i = t.database?.["advisory-count"];
402
+ return {
403
+ findings: n,
404
+ tool: "cargo-audit",
405
+ ...i === void 0 ? {} : { rulesEvaluated: i }
406
+ };
407
+ }
408
+ //#endregion
409
+ //#region src/evidence/adapters/registry.ts
410
+ var W = {
411
+ name: "entries",
412
+ summary: "Normalized {\"entries\": [{symbol, outcome, traceIds?}]} — the default.",
413
+ tools: [],
414
+ parse(e) {
415
+ let t;
416
+ try {
417
+ t = JSON.parse(e);
418
+ } catch (e) {
419
+ throw new m("entries", `input is not JSON: ${e.message}`);
420
+ }
421
+ if (!Array.isArray(t.entries)) throw new m("entries", "expected JSON of the form {\"entries\": [{symbol, outcome, traceIds?}]}");
422
+ return { entries: t.entries };
423
+ }
424
+ }, G = [
425
+ W,
426
+ k,
427
+ g,
428
+ V,
429
+ L,
430
+ y,
431
+ te
432
+ ], K = [
433
+ {
434
+ name: "sarif",
435
+ summary: "SARIF 2.1.0 — semgrep --sarif, CodeQL, ESLint, ZAP via converter.",
436
+ tools: [
437
+ "sarif",
438
+ "semgrep",
439
+ "codeql"
440
+ ],
441
+ parse: H
442
+ },
443
+ {
444
+ name: "audit-script",
445
+ summary: "Architecture-conformance audit scripts: '<name>: OK' / '<name>: FAIL — … (AC-ID)'.",
446
+ tools: [
447
+ "audit-script",
448
+ "make ci",
449
+ "audit-static",
450
+ "import-linter",
451
+ "dependency-cruiser"
452
+ ],
453
+ parse: P
454
+ },
455
+ {
456
+ name: "cargo-audit",
457
+ summary: "cargo audit --json — RUSTSEC advisories and warning kinds.",
458
+ tools: [
459
+ "cargo-audit",
460
+ "cargo audit",
461
+ "cargo-deny",
462
+ "cargo deny"
463
+ ],
464
+ parse: U
465
+ }
466
+ ], q = [...G.map((e) => e.name), ...K.map((e) => e.name)];
467
+ function J(e) {
468
+ if (e.adapter !== void 0 && e.adapter !== "") return K.find((t) => t.name === e.adapter);
469
+ let t = (e.tool ?? "").toLowerCase();
470
+ if (t !== "") return K.find((e) => e.tools.some((e) => t.includes(e)));
471
+ }
472
+ function Y(e) {
473
+ if (e.adapter !== void 0 && e.adapter !== "") {
474
+ let t = G.find((t) => t.name === e.adapter);
475
+ if (t === void 0) throw new m("adapter", `unknown adapter '${e.adapter}'. Available: ${q.join(", ")}`);
476
+ return t;
477
+ }
478
+ let t = (e.tool ?? "").toLowerCase();
479
+ if (t !== "") {
480
+ let e = G.find((e) => e.tools.some((e) => t.includes(e)));
481
+ if (e !== void 0) return e;
482
+ }
483
+ return W;
484
+ }
485
+ //#endregion
486
+ //#region src/evidence/mock-inspection.ts
487
+ var X = /* @__PURE__ */ new Set([
488
+ ".rs",
489
+ ".py",
490
+ ".ts",
491
+ ".tsx",
492
+ ".js",
493
+ ".jsx"
494
+ ]), Z = /* @__PURE__ */ new Set([
495
+ ".git",
496
+ "dist",
497
+ "node_modules",
498
+ "spec",
499
+ "target",
500
+ "vendor"
501
+ ]);
502
+ function re(e, t) {
503
+ if (!t) return {
504
+ injections: [],
505
+ suites: []
506
+ };
507
+ let r = i(e).map((r) => n(e, r, t)).filter((e) => e !== null && e.commit === t);
508
+ return {
509
+ suites: r.map((e) => e.suite).sort($),
510
+ injections: r.flatMap((e) => e.injections).sort((e, t) => $(e.suite, t.suite) || $(e.path ?? "", t.path ?? "") || (e.line ?? 0) - (t.line ?? 0))
511
+ };
512
+ }
513
+ function ie(e, t) {
514
+ let n = [];
515
+ for (let r of ae(e)) {
516
+ let i = s(r, "utf8"), a = oe(i, l(r));
517
+ if (a.length !== 0) for (let o of i.matchAll(/\b([A-Z][A-Za-z0-9_]*(?:(?:::|\.)[A-Za-z_][A-Za-z0-9_]*)+)\s*\(/g)) {
518
+ let s = o[1];
519
+ if (!le(s)) continue;
520
+ let c = se(a, o.index ?? -1);
521
+ c && n.push({
522
+ suite: t,
523
+ symbol: c.symbol,
524
+ injects: [s],
525
+ path: d(e, r),
526
+ line: i.slice(0, o.index).split("\n").length
527
+ });
528
+ }
529
+ }
530
+ let r = /* @__PURE__ */ new Map();
531
+ for (let e of n) {
532
+ let t = `${e.path ?? ""}:${e.line ?? 0}:${e.symbol}`, n = r.get(t);
533
+ n ? n.injects = [.../* @__PURE__ */ new Set([...n.injects, ...e.injects])].sort() : r.set(t, {
534
+ ...e,
535
+ injects: [...e.injects].sort()
536
+ });
537
+ }
538
+ return [...r.values()].sort((e, t) => $(e.path ?? "", t.path ?? "") || (e.line ?? 0) - (t.line ?? 0) || $(e.symbol, t.symbol));
539
+ }
540
+ function ae(e) {
541
+ let t = [], n = (e) => {
542
+ for (let r of c(e, { withFileTypes: !0 })) {
543
+ if (r.isDirectory() && Z.has(r.name)) continue;
544
+ let i = u(e, r.name);
545
+ r.isDirectory() ? n(i) : r.isFile() && X.has(l(i)) && t.push(i);
546
+ }
547
+ };
548
+ return n(e), t.sort($);
549
+ }
550
+ function oe(e, t) {
551
+ let n = [], r = t === ".rs" ? [/#\s*\[\s*test\s*\][\s\S]{0,240}?\bfn\s+([A-Za-z_][A-Za-z0-9_]*)\s*\(/g] : t === ".py" ? [/(?:^|\n)\s*(?:async\s+)?def\s+(test_[A-Za-z0-9_]*)\s*\(/g] : [/\b(?:test|it)\s*\(\s*["'`]([^"'`]+)["'`]/g, /\b(?:async\s+)?function\s+(test[A-Za-z0-9_]*)\s*\(/g];
552
+ for (let i of r) for (let r of e.matchAll(i)) {
553
+ let i = r.index ?? 0, a = t === ".py" ? i + r[0].lastIndexOf(r[1]) : i, o = t === ".py" ? Q(e, a) : ce(e, a + r[0].length);
554
+ n.push({
555
+ at: a,
556
+ end: o,
557
+ symbol: r[1]
558
+ });
559
+ }
560
+ return n.sort((e, t) => e.at - t.at);
561
+ }
562
+ function se(e, t) {
563
+ let n = null;
564
+ for (let r of e) {
565
+ if (r.at > t) break;
566
+ t <= r.end && (n = r);
567
+ }
568
+ return n;
569
+ }
570
+ function Q(e, t) {
571
+ let n = e.lastIndexOf("\n", t) + 1, r = /^\s*/.exec(e.slice(n))?.[0].length ?? 0, i = e.indexOf("\n", t);
572
+ if (i < 0) return e.length;
573
+ for (i += 1; i < e.length;) {
574
+ let t = e.indexOf("\n", i), n = t < 0 ? e.length : t, a = e.slice(i, n);
575
+ if (a.trim() && !a.trimStart().startsWith("#") && (/^\s*/.exec(a)?.[0].length ?? 0) <= r) return i - 1;
576
+ i = n + 1;
577
+ }
578
+ return e.length;
579
+ }
580
+ function ce(e, t) {
581
+ let n = e.indexOf("{", t);
582
+ if (n < 0 || n - t > 500) return t;
583
+ let r = 0, i = null, a = !1, o = !1, s = !1;
584
+ for (let t = n; t < e.length; t += 1) {
585
+ let n = e[t], c = e[t + 1] ?? "";
586
+ if (o) {
587
+ n === "\n" && (o = !1);
588
+ continue;
589
+ }
590
+ if (s) {
591
+ n === "*" && c === "/" && (s = !1, t += 1);
592
+ continue;
593
+ }
594
+ if (i) {
595
+ a ? a = !1 : n === "\\" ? a = !0 : n === i && (i = null);
596
+ continue;
597
+ }
598
+ if (n === "/" && c === "/") o = !0, t += 1;
599
+ else if (n === "/" && c === "*") s = !0, t += 1;
600
+ else if (n === "\"" || n === "'" || n === "`") i = n;
601
+ else if (n === "{") r += 1;
602
+ else if (n === "}" && --r === 0) return t;
603
+ }
604
+ return e.length;
605
+ }
606
+ function le(e) {
607
+ let t = e.split(/::|\./), n = t[0], r = t.at(-1) ?? "";
608
+ return /^(?:mock|fake|stub|spy)/i.test(n) || /^(?:allow|approve|approved|bypass|fake|mock|stub|succeed|success)$/i.test(r);
609
+ }
610
+ function $(e, t) {
611
+ return e === t ? 0 : e < t ? -1 : 1;
612
+ }
613
+ //#endregion
614
+ export { J as a, f as c, Y as i, re as n, F as o, q as r, p as s, ie as t };
@@ -1,10 +1,10 @@
1
- import { a as e, t } from "./base-W7vrLi5E.js";
1
+ import { a as e, t } from "./base-gAClyCNd.js";
2
2
  import { fileURLToPath as n } from "node:url";
3
3
  import { existsSync as r } from "node:fs";
4
4
  import { dirname as i, join as a, resolve as o } from "node:path";
5
5
  import { homedir as s } from "node:os";
6
- import { Flags as c } from "@oclif/core";
7
- import { spawn as l } from "node:child_process";
6
+ import { spawn as c } from "node:child_process";
7
+ import { Flags as l } from "@oclif/core";
8
8
  //#region src/flows.ts
9
9
  var u = {
10
10
  review: {
@@ -55,7 +55,7 @@ function p() {
55
55
  }
56
56
  async function m(e) {
57
57
  await new Promise((t, n) => {
58
- let r = l("ix-flow", e, { stdio: "inherit" });
58
+ let r = c("ix-flow", e, { stdio: "inherit" });
59
59
  r.on("error", n), r.on("close", (e) => {
60
60
  if (e === 0) {
61
61
  t();
@@ -69,12 +69,12 @@ async function m(e) {
69
69
  //#region src/flow-command.ts
70
70
  var h = class extends t {
71
71
  static flowFlags = {
72
- target: c.string({
72
+ target: l.string({
73
73
  description: "Spec target ref to feed the workflow (repeatable).",
74
74
  multiple: !0
75
75
  }),
76
- json: c.boolean({ description: "Forward --json to ix-flow." }),
77
- id: c.string({ description: "Explicit workflow run id." })
76
+ json: l.boolean({ description: "Forward --json to ix-flow." }),
77
+ id: l.string({ description: "Explicit workflow run id." })
78
78
  };
79
79
  async launch(e) {
80
80
  await d(this.flowName, {