@agent-ix/quoin 0.17.0 → 0.20.0

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 (113) 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-Dhy9S7PS.js → advisor-B7X0YTVo.js} +1 -1
  7. package/dist/assurance/graph.d.ts +79 -0
  8. package/dist/assurance/graph.d.ts.map +1 -0
  9. package/dist/assurance/index.d.ts +9 -0
  10. package/dist/assurance/index.d.ts.map +1 -0
  11. package/dist/assurance/render.d.ts +3 -0
  12. package/dist/assurance/render.d.ts.map +1 -0
  13. package/dist/auditor/audit.d.ts +23 -2
  14. package/dist/auditor/audit.d.ts.map +1 -1
  15. package/dist/auditor/combinatorial.d.ts +53 -0
  16. package/dist/auditor/combinatorial.d.ts.map +1 -0
  17. package/dist/auditor-C9dLCmDh.js +188 -0
  18. package/dist/{base-D_-Jy4cE.js → base-q8brKRlC.js} +1 -1
  19. package/dist/cli.js +1 -1
  20. package/dist/combinatorial-Cq01XfhV.js +80 -0
  21. package/dist/commands/advise.js +35 -32
  22. package/dist/commands/assurance.d.ts +14 -0
  23. package/dist/commands/assurance.d.ts.map +1 -0
  24. package/dist/commands/assurance.js +179 -0
  25. package/dist/commands/catalog/list.js +2 -2
  26. package/dist/commands/catalog/methods.js +3 -3
  27. package/dist/commands/catalog/show.js +2 -2
  28. package/dist/commands/catalog/validate.js +2 -2
  29. package/dist/commands/completeness.d.ts +16 -0
  30. package/dist/commands/completeness.d.ts.map +1 -0
  31. package/dist/commands/completeness.js +49 -0
  32. package/dist/commands/config/doctor.js +1 -1
  33. package/dist/commands/config/edit.js +1 -1
  34. package/dist/commands/config/get.js +1 -1
  35. package/dist/commands/config/set.js +1 -1
  36. package/dist/commands/evidence/affirm.js +3 -3
  37. package/dist/commands/evidence/audit.d.ts +10 -0
  38. package/dist/commands/evidence/audit.d.ts.map +1 -1
  39. package/dist/commands/evidence/audit.js +54 -36
  40. package/dist/commands/evidence/baseline.js +12 -12
  41. package/dist/commands/evidence/gc.js +2 -2
  42. package/dist/commands/evidence/index.js +1 -1
  43. package/dist/commands/evidence/record.d.ts +2 -0
  44. package/dist/commands/evidence/record.d.ts.map +1 -1
  45. package/dist/commands/evidence/record.js +89 -32
  46. package/dist/commands/matrix.js +1 -1
  47. package/dist/commands/module/ensure-defaults.js +3 -3
  48. package/dist/commands/module/install.js +2 -2
  49. package/dist/commands/module/list.js +2 -2
  50. package/dist/commands/module/remove.js +2 -2
  51. package/dist/commands/review.js +1 -1
  52. package/dist/commands/to-plan.js +1 -1
  53. package/dist/commands/update.js +2 -2
  54. package/dist/commands/write.js +3 -3
  55. package/dist/completeness/assess.d.ts +82 -0
  56. package/dist/completeness/assess.d.ts.map +1 -0
  57. package/dist/completeness/bundle.d.ts +52 -0
  58. package/dist/completeness/bundle.d.ts.map +1 -0
  59. package/dist/completeness/declarations.d.ts +46 -0
  60. package/dist/completeness/declarations.d.ts.map +1 -0
  61. package/dist/completeness/index.d.ts +11 -0
  62. package/dist/completeness/index.d.ts.map +1 -0
  63. package/dist/completeness/run.d.ts +35 -0
  64. package/dist/completeness/run.d.ts.map +1 -0
  65. package/dist/completeness-Bic6298v.js +228 -0
  66. package/dist/evidence/adapters/agent-eval.d.ts +26 -0
  67. package/dist/evidence/adapters/agent-eval.d.ts.map +1 -0
  68. package/dist/evidence/adapters/audit-script.d.ts +25 -0
  69. package/dist/evidence/adapters/audit-script.d.ts.map +1 -0
  70. package/dist/evidence/adapters/cargo-mutants.d.ts +3 -0
  71. package/dist/evidence/adapters/cargo-mutants.d.ts.map +1 -0
  72. package/dist/evidence/adapters/junit.d.ts +17 -0
  73. package/dist/evidence/adapters/junit.d.ts.map +1 -0
  74. package/dist/evidence/adapters/registry.d.ts +63 -0
  75. package/dist/evidence/adapters/registry.d.ts.map +1 -0
  76. package/dist/evidence/adapters/sarif.d.ts +35 -0
  77. package/dist/evidence/adapters/sarif.d.ts.map +1 -0
  78. package/dist/evidence/adapters/sbom.d.ts +35 -0
  79. package/dist/evidence/adapters/sbom.d.ts.map +1 -0
  80. package/dist/evidence/adapters/types.d.ts +55 -0
  81. package/dist/evidence/adapters/types.d.ts.map +1 -0
  82. package/dist/evidence/index.d.ts +10 -0
  83. package/dist/evidence/index.d.ts.map +1 -1
  84. package/dist/evidence/record.d.ts.map +1 -1
  85. package/dist/evidence/store.d.ts +48 -2
  86. package/dist/evidence/store.d.ts.map +1 -1
  87. package/dist/evidence/types.d.ts +84 -0
  88. package/dist/evidence/types.d.ts.map +1 -1
  89. package/dist/evidence-OIkRqQrU.js +599 -0
  90. package/dist/{flow-command-B-ZBn9Sd.js → flow-command-k7eYqzBE.js} +1 -1
  91. package/dist/index.js +6 -6
  92. package/dist/{modules-DSkUXhHn.js → modules-E0AaYTTp.js} +2 -2
  93. package/dist/{plugins-DiS0OXoo.js → plugins-xe5e7dMl.js} +1 -1
  94. package/dist/quire/contract.d.ts +2 -2
  95. package/dist/quire/contract.d.ts.map +1 -1
  96. package/dist/quire/types.d.ts +11 -0
  97. package/dist/quire/types.d.ts.map +1 -1
  98. package/dist/{quire-D7ra5rUF.js → quire-BS-EW-0Y.js} +2 -2
  99. package/dist/schemas/coverage-v1.schema.json +6 -1
  100. package/dist/{version-DmZHxX4n.js → version-0hg-SgVf.js} +1 -1
  101. package/dist/{write-CPdSNIkF.js → write-Dig0zXLM.js} +1 -1
  102. package/package.json +2 -1
  103. package/skills/spec-fuzz/SKILL.md +94 -0
  104. package/skills/spec-fuzz/assets/templates/atheris.py.md +74 -0
  105. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +83 -0
  106. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +76 -0
  107. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +51 -0
  108. package/skills/spec-fuzz/references/step-1-select-obligations.md +47 -0
  109. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +55 -0
  110. package/skills/spec-fuzz/references/step-3-emit-targets.md +65 -0
  111. package/skills/spec-fuzz/references/step-4-report.md +56 -0
  112. package/dist/audit-CudnEJmh.js +0 -127
  113. package/dist/evidence-QUw0KyMH.js +0 -209
@@ -0,0 +1,599 @@
1
+ import { existsSync as e, mkdirSync as t, readFileSync as n, readdirSync as r, rmSync as i, writeFileSync as a } from "node:fs";
2
+ import { dirname as o, join as s } from "node:path";
3
+ //#region src/evidence/types.ts
4
+ var c = "runs", l = "scans";
5
+ //#endregion
6
+ //#region src/evidence/store.ts
7
+ function u(e) {
8
+ return s(e, "spec", "evidence");
9
+ }
10
+ function d(e) {
11
+ return s(u(e), "bindings.json");
12
+ }
13
+ function f(e) {
14
+ return s(u(e), "baseline.json");
15
+ }
16
+ function p(e, t, n) {
17
+ return s(u(e), c, t, `${h(n)}.json`);
18
+ }
19
+ function m(e, t, n) {
20
+ return s(u(e), l, t, `${h(n)}.json`);
21
+ }
22
+ function h(e) {
23
+ return e.slice(0, 12);
24
+ }
25
+ function g(e) {
26
+ return `${JSON.stringify(_(e), null, 2)}\n`;
27
+ }
28
+ function _(e) {
29
+ if (Array.isArray(e)) return e.map(_);
30
+ if (typeof e != "object" || !e) return e;
31
+ let t = {};
32
+ for (let n of Object.keys(e).sort()) t[n] = _(e[n]);
33
+ return t;
34
+ }
35
+ function v(e, n) {
36
+ t(o(e), { recursive: !0 }), a(e, g(n), "utf8");
37
+ }
38
+ var y = class extends Error {
39
+ path;
40
+ cause;
41
+ constructor(e, t) {
42
+ let n = t instanceof Error ? t.message : String(t);
43
+ super(`${e} exists but is not readable JSON: ${n}. A merge conflict in a checked-in store file is the usual cause — resolve it, or delete the file to start from an empty store.`), this.path = e, this.cause = t, this.name = "StoreReadError";
44
+ }
45
+ };
46
+ function b(t) {
47
+ if (!e(t)) return null;
48
+ try {
49
+ return JSON.parse(n(t, "utf8"));
50
+ } catch (e) {
51
+ throw new y(t, e);
52
+ }
53
+ }
54
+ function x(e, t) {
55
+ try {
56
+ return b(e);
57
+ } catch (n) {
58
+ if (n instanceof y) return t.push(e), null;
59
+ throw n;
60
+ }
61
+ }
62
+ function ee(e, t) {
63
+ let n = p(e, t.suite, t.commit);
64
+ return v(n, {
65
+ ...t,
66
+ schemaVersion: 1
67
+ }), n;
68
+ }
69
+ function S(e, t) {
70
+ let n = m(e, t.suite, t.commit);
71
+ return v(n, {
72
+ ...t,
73
+ schemaVersion: 1
74
+ }), n;
75
+ }
76
+ function C(t, n) {
77
+ let i = s(u(t), l, n);
78
+ return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
79
+ }
80
+ function w(e, t, n = []) {
81
+ return C(e, t).map((r) => x(m(e, t, r.replace(/\.json$/, "")), n)).filter((e) => e !== null).sort((e, t) => k(e.timestamp, t.timestamp) || k(e.commit, t.commit));
82
+ }
83
+ function T(e, t, n = []) {
84
+ return w(e, t, n).at(-1) ?? null;
85
+ }
86
+ function E(e) {
87
+ return e.rulesEvaluated === void 0 ? null : e.rulesEvaluated === 0;
88
+ }
89
+ function D(t, n) {
90
+ let i = s(u(t), c, n);
91
+ return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
92
+ }
93
+ function te(e, t, n = []) {
94
+ return D(e, t).map((r) => x(p(e, t, r.replace(/\.json$/, "")), n)).filter((e) => e !== null).sort((e, t) => k(e.timestamp, t.timestamp) || k(e.commit, t.commit));
95
+ }
96
+ function O(e, t, n = []) {
97
+ return te(e, t, n).at(-1) ?? null;
98
+ }
99
+ function k(e, t) {
100
+ return e === t ? 0 : e < t ? -1 : 1;
101
+ }
102
+ function A(t) {
103
+ let n = /* @__PURE__ */ new Set();
104
+ for (let i of [c, l]) {
105
+ let a = s(u(t), i);
106
+ if (e(a)) for (let e of r(a, { withFileTypes: !0 })) e.isDirectory() && n.add(e.name);
107
+ }
108
+ return [...n].sort();
109
+ }
110
+ function j(e) {
111
+ return b(d(e)) ?? {
112
+ schemaVersion: 1,
113
+ bindings: []
114
+ };
115
+ }
116
+ function M(e, t) {
117
+ let n = [...t.bindings].sort(N);
118
+ v(d(e), {
119
+ schemaVersion: 1,
120
+ bindings: n
121
+ });
122
+ }
123
+ function ne(e) {
124
+ return b(f(e));
125
+ }
126
+ function re(e, t) {
127
+ v(f(e), {
128
+ schemaVersion: 1,
129
+ commit: t.commit,
130
+ accepted: [...t.accepted].sort(k)
131
+ });
132
+ }
133
+ function ie(e, t = !1) {
134
+ let n = new Set(j(e).bindings.map((e) => `${e.suite}/${h(e.commit)}.json`)), r = [];
135
+ for (let a of A(e)) {
136
+ let o = D(e, a), d = /* @__PURE__ */ new Set(), f = O(e, a);
137
+ f && d.add(`${h(f.commit)}.json`);
138
+ for (let l of o) {
139
+ if (d.has(l) || n.has(`${a}/${l}`)) continue;
140
+ let o = s(u(e), c, a, l);
141
+ r.push(o), t || i(o);
142
+ }
143
+ let p = C(e, a), m = /* @__PURE__ */ new Set(), g = T(e, a);
144
+ g && m.add(`${h(g.commit)}.json`);
145
+ for (let o of p) {
146
+ if (m.has(o) || n.has(`${a}/${o}`)) continue;
147
+ let c = s(u(e), l, a, o);
148
+ r.push(c), t || i(c);
149
+ }
150
+ }
151
+ return r.sort();
152
+ }
153
+ function N(e, t) {
154
+ return e.obligation === t.obligation ? e.suite === t.suite ? 0 : e.suite < t.suite ? -1 : 1 : e.obligation < t.obligation ? -1 : 1;
155
+ }
156
+ function P(e, t) {
157
+ let n = e.findIndex((e) => e.obligation === t.obligation && e.suite === t.suite);
158
+ if (n === -1) return {
159
+ bindings: [...e, { ...t }],
160
+ created: !0,
161
+ suspect: !1
162
+ };
163
+ let r = e[n], i = r.statementHashAtBinding !== t.statementHashAtBinding, a = {
164
+ ...r,
165
+ commit: t.commit,
166
+ symbols: t.symbols
167
+ }, o = [...e];
168
+ return o[n] = a, {
169
+ bindings: o,
170
+ created: !1,
171
+ suspect: i
172
+ };
173
+ }
174
+ function F(e, t, n, r, i, a, o) {
175
+ let s = e.map((e, t) => [e, t]).filter(([e]) => e.obligation === t && (!o || e.suite === o));
176
+ if (s.length === 0) return {
177
+ bindings: e,
178
+ found: !1
179
+ };
180
+ let c = [...e];
181
+ for (let [e, t] of s) c[t] = {
182
+ ...e,
183
+ statementHashAtBinding: n,
184
+ affirmations: [...e.affirmations ?? [], {
185
+ who: r,
186
+ commit: i,
187
+ note: a
188
+ }]
189
+ };
190
+ return {
191
+ bindings: c,
192
+ found: !0
193
+ };
194
+ }
195
+ //#endregion
196
+ //#region src/evidence/record.ts
197
+ function I(e) {
198
+ let t = ee(e.repo, {
199
+ schemaVersion: 1,
200
+ suite: e.suite,
201
+ commit: e.commit,
202
+ tool: e.tool,
203
+ evidenceKind: e.evidenceKind,
204
+ timestamp: e.timestamp,
205
+ entries: e.entries
206
+ }), n = new Map(e.obligations.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
207
+ for (let t of e.obligations) for (let e of t.target_ids ?? []) n.has(e) || r.set(e, [...r.get(e) ?? [], t]);
208
+ let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
209
+ for (let t of e.entries) for (let e of t.traceIds ?? []) {
210
+ let o = n.has(e) ? [n.get(e)] : r.get(e) ?? [];
211
+ if (o.length === 0) {
212
+ a.add(e);
213
+ continue;
214
+ }
215
+ if (t.outcome === "pass") for (let e of o) {
216
+ let n = i.get(e.id) ?? [];
217
+ n.push(t.symbol), i.set(e.id, n);
218
+ }
219
+ }
220
+ let o = j(e.repo).bindings, s = [], c = [];
221
+ for (let [t, r] of [...i].sort(([e], [t]) => e === t ? 0 : e < t ? -1 : 1)) {
222
+ let i = n.get(t);
223
+ if (!i) continue;
224
+ let a = P(o, {
225
+ obligation: t,
226
+ statementHashAtBinding: i.statement_hash,
227
+ suite: e.suite,
228
+ commit: e.commit,
229
+ symbols: [...r].sort()
230
+ });
231
+ o = a.bindings, a.created && s.push(t), a.suspect && c.push(t);
232
+ }
233
+ return M(e.repo, {
234
+ schemaVersion: 1,
235
+ bindings: o
236
+ }), {
237
+ runPath: t,
238
+ bound: s.sort(),
239
+ suspect: c.sort(),
240
+ unmatched: [...a].sort()
241
+ };
242
+ }
243
+ function L(e) {
244
+ return e.obligations ?? [];
245
+ }
246
+ //#endregion
247
+ //#region src/evidence/adapters/types.ts
248
+ var R = class extends Error {
249
+ adapter;
250
+ constructor(e, t) {
251
+ super(`${e}: ${t}`), this.adapter = e, this.name = "AdapterError";
252
+ }
253
+ };
254
+ //#endregion
255
+ //#region src/evidence/adapters/cargo-mutants.ts
256
+ function z(e) {
257
+ let t = e.file?.trim(), n = e.function?.function_name?.trim();
258
+ if (t !== void 0 && t !== "" && n !== void 0 && n !== "") return `${t}::${n}`;
259
+ }
260
+ var B = {
261
+ name: "cargo-mutants",
262
+ summary: "cargo-mutants outcomes.json — mutation score per mutated function.",
263
+ tools: ["cargo-mutants", "cargo mutants"],
264
+ parse(e) {
265
+ let t;
266
+ try {
267
+ t = JSON.parse(e);
268
+ } catch (e) {
269
+ throw new R("cargo-mutants", `input is not JSON: ${e.message}`);
270
+ }
271
+ if (!Array.isArray(t.outcomes)) throw new R("cargo-mutants", "no `outcomes` array — expected the contents of mutants.out/outcomes.json");
272
+ let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
273
+ for (let e of t.outcomes) {
274
+ if (e.scenario === "Baseline" || typeof e.scenario != "object") continue;
275
+ let t = e.scenario.Mutant;
276
+ if (t === void 0) continue;
277
+ let i = z(t);
278
+ i !== void 0 && (e.summary === "CaughtMutant" ? n.set(i, (n.get(i) ?? 0) + 1) : (e.summary === "MissedMutant" || e.summary === "Timeout") && r.set(i, (r.get(i) ?? 0) + 1));
279
+ }
280
+ let i = [.../* @__PURE__ */ new Set([...n.keys(), ...r.keys()])].sort();
281
+ if (i.length === 0) throw new R("cargo-mutants", "no viable mutants in the report — nothing was measured");
282
+ return { entries: i.map((e) => {
283
+ let t = n.get(e) ?? 0, i = r.get(e) ?? 0, a = t + i;
284
+ return {
285
+ symbol: e,
286
+ outcome: i === 0 ? "pass" : "fail",
287
+ score: t / a
288
+ };
289
+ }) };
290
+ }
291
+ }, V = /<testcase\b([^>]*?)(\/>|>([\s\S]*?)<\/testcase\s*>)/g, H = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
292
+ function U(e) {
293
+ let t = /* @__PURE__ */ new Map();
294
+ for (let n of e.matchAll(H)) t.set(n[1], W(n[2]));
295
+ return t;
296
+ }
297
+ function W(e) {
298
+ return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&apos;", "'").replaceAll("&amp;", "&");
299
+ }
300
+ function G(e, t) {
301
+ let n = e.trim(), r = t.trim();
302
+ return n === "" ? r : r === "" ? n : n === r ? r : n.endsWith(`::${r}`) || n.endsWith(`.${r}`) ? n.replaceAll(".", "::") : `${n.replaceAll(".", "::")}::${r}`;
303
+ }
304
+ var K = /<property\b([^>]*)\/?>/g;
305
+ function q(e) {
306
+ let t = [];
307
+ for (let n of e.matchAll(K)) {
308
+ let e = U(n[1]), r = e.get("name"), i = e.get("value");
309
+ 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);
310
+ }
311
+ return t.length > 0 ? t : void 0;
312
+ }
313
+ function J(e) {
314
+ return /<error\b/.test(e) ? "error" : /<failure\b/.test(e) ? "fail" : /<skipped\b/.test(e) ? "skip" : "pass";
315
+ }
316
+ var ae = {
317
+ name: "junit",
318
+ summary: "JUnit XML (<testsuite>/<testcase>), as emitted by most runners.",
319
+ tools: [
320
+ "junit",
321
+ "pytest",
322
+ "jest",
323
+ "vitest",
324
+ "gotestsum",
325
+ "surefire"
326
+ ],
327
+ parse(e) {
328
+ let t = [];
329
+ for (let n of e.matchAll(V)) {
330
+ let e = U(n[1]), r = n[3] ?? "", i = G(e.get("classname") ?? "", e.get("name") ?? "");
331
+ if (i === "") continue;
332
+ let a = q(r);
333
+ t.push({
334
+ symbol: i,
335
+ outcome: J(r),
336
+ ...a === void 0 ? {} : { traceIds: a }
337
+ });
338
+ }
339
+ if (t.length === 0) throw new R("junit", "no <testcase> elements found — is this JUnit XML?");
340
+ return { entries: t };
341
+ }
342
+ }, oe = /^([A-Za-z0-9._-]+):\s*(OK|FAIL)\b\s*(?:[—-]\s*)?(.*)$/, se = /\(([^)]*)\)[.\s]*$/, ce = /\b((?:FR|NFR|StR|US)-\d+-AC-\d+|TC-\d+)\b/g;
343
+ function le(e) {
344
+ let t = se.exec(e);
345
+ if (!t) return;
346
+ let n = [...t[1].matchAll(ce)].map((e) => e[1]);
347
+ return n.length > 0 ? n : void 0;
348
+ }
349
+ function ue(e) {
350
+ let t = [], n = 0;
351
+ for (let r of e.split("\n")) {
352
+ let e = oe.exec(r.trim());
353
+ if (!e) continue;
354
+ let [, i, a, o] = e;
355
+ if (n += 1, a === "OK") continue;
356
+ let s = o.trim(), c = le(s);
357
+ t.push({
358
+ ruleId: i,
359
+ severity: "violation",
360
+ ...s === "" ? {} : { message: s },
361
+ ...c === void 0 ? {} : { traceIds: c }
362
+ });
363
+ }
364
+ if (n === 0) throw new R("audit-script", "no `<name>: OK` or `<name>: FAIL` line found — is this audit-script output?");
365
+ return {
366
+ findings: t,
367
+ tool: "audit-script",
368
+ rulesEvaluated: n
369
+ };
370
+ }
371
+ //#endregion
372
+ //#region src/evidence/adapters/agent-eval.ts
373
+ function de(e) {
374
+ let t;
375
+ try {
376
+ t = JSON.parse(e);
377
+ } catch (e) {
378
+ throw new R("agent-eval", `not JSON: ${e instanceof Error ? e.message : String(e)}`);
379
+ }
380
+ let n = t;
381
+ if (!n || typeof n != "object" || !Array.isArray(n.results)) throw new R("agent-eval", "expected a cli-agent-evals report with a \"results\" array");
382
+ let r = [];
383
+ for (let e of n.results) {
384
+ let t = typeof e.id == "string" ? e.id : null;
385
+ t && r.push({
386
+ symbol: t,
387
+ outcome: e.ok === !0 ? "pass" : "fail",
388
+ traceIds: [t],
389
+ ...fe(e)
390
+ });
391
+ }
392
+ if (r.length === 0) throw new R("agent-eval", "no scenario results in the report — did the suite run?");
393
+ return { entries: r };
394
+ }
395
+ function fe(e) {
396
+ let t = e.passRate;
397
+ if (typeof t != "string") return {};
398
+ let [n, r] = t.split("/").map(Number);
399
+ return !Number.isFinite(n) || !Number.isFinite(r) || r === 0 ? {} : { score: n / r };
400
+ }
401
+ var pe = {
402
+ name: "agent-eval",
403
+ summary: "cli-agent-evals report JSON — one entry per scenario, keyed on the scenario id.",
404
+ tools: [
405
+ "cli-agent-evals",
406
+ "agent-evals",
407
+ "agent-pty"
408
+ ],
409
+ parse: de
410
+ };
411
+ //#endregion
412
+ //#region src/evidence/adapters/sbom.ts
413
+ function me(e) {
414
+ let t;
415
+ try {
416
+ t = JSON.parse(e);
417
+ } catch (e) {
418
+ throw new R("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.`);
419
+ }
420
+ if (!t || typeof t != "object") throw new R("sbom", "expected a JSON object");
421
+ let n = t;
422
+ return { entries: he(n) ?? ge(n) ?? _e(n) };
423
+ }
424
+ function he(e) {
425
+ return String(e.bomFormat ?? "") === "CycloneDX" ? (Array.isArray(e.components) ? e.components : []).map((e) => {
426
+ let t = e, n = typeof t.purl == "string" ? t.purl : null, r = typeof t.name == "string" ? t.name : null;
427
+ if (!n && !r) return null;
428
+ let i = typeof t.version == "string" ? t.version : null;
429
+ return {
430
+ symbol: n ?? (i ? `${r}@${i}` : r),
431
+ outcome: "pass"
432
+ };
433
+ }).filter((e) => e !== null) : null;
434
+ }
435
+ function ge(e) {
436
+ return typeof e.spdxVersion == "string" ? (Array.isArray(e.packages) ? e.packages : []).map((e) => {
437
+ 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;
438
+ if (!r && !i) return null;
439
+ let a = typeof t.versionInfo == "string" ? t.versionInfo : null;
440
+ return {
441
+ symbol: r ?? (a ? `${i}@${a}` : i),
442
+ outcome: "pass"
443
+ };
444
+ }).filter((e) => e !== null) : null;
445
+ }
446
+ function _e(e) {
447
+ throw new R("sbom", `neither a CycloneDX (\`bomFormat\`) nor an SPDX (\`spdxVersion\`) document — top-level keys: ${Object.keys(e).slice(0, 6).join(", ") || "(none)"}`);
448
+ }
449
+ var Y = {
450
+ name: "sbom",
451
+ summary: "CycloneDX or SPDX JSON — one entry per component, so an empty inventory reads as vacuous.",
452
+ tools: [
453
+ "cyclonedx",
454
+ "spdx",
455
+ "syft",
456
+ "cdxgen",
457
+ "cargo-cyclonedx"
458
+ ],
459
+ parse: me
460
+ };
461
+ //#endregion
462
+ //#region src/evidence/adapters/sarif.ts
463
+ function ve(e) {
464
+ let t;
465
+ try {
466
+ t = JSON.parse(e);
467
+ } catch (e) {
468
+ throw new R("sarif", `input is not JSON: ${e.message}`);
469
+ }
470
+ if (!Array.isArray(t.runs)) throw new R("sarif", "no `runs` array — expected a SARIF 2.1.0 log");
471
+ if (t.runs.length === 0) throw new R("sarif", "`runs` is empty — a log with no run proves no scan executed");
472
+ let n = [], r = [], i;
473
+ for (let e of t.runs) {
474
+ let t = e.tool?.driver;
475
+ 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);
476
+ for (let t of e.results ?? []) {
477
+ let e = t.ruleId ?? t.rule?.id;
478
+ if (e === void 0 || e === "") continue;
479
+ let r = t.locations?.[0]?.physicalLocation;
480
+ n.push({
481
+ ruleId: e,
482
+ ...t.level === void 0 ? {} : { severity: t.level },
483
+ ...t.message?.text === void 0 ? {} : { message: t.message.text },
484
+ ...r?.artifactLocation?.uri === void 0 ? {} : { path: r.artifactLocation.uri },
485
+ ...r?.region?.startLine === void 0 ? {} : { line: r.region.startLine }
486
+ });
487
+ }
488
+ }
489
+ return {
490
+ findings: n,
491
+ ...r.length === 0 ? {} : { tool: r.join(", ") },
492
+ ...i === void 0 ? {} : { rulesEvaluated: i }
493
+ };
494
+ }
495
+ function ye(e) {
496
+ let t;
497
+ try {
498
+ t = JSON.parse(e);
499
+ } catch (e) {
500
+ throw new R("cargo-audit", `input is not JSON: ${e.message}`);
501
+ }
502
+ if (t.vulnerabilities === void 0) throw new R("cargo-audit", "no `vulnerabilities` object — expected `cargo audit --json` output");
503
+ let n = [], r = (e, t) => {
504
+ let r = e.advisory?.id;
505
+ if (r === void 0 || r === "") return;
506
+ let i = e.package;
507
+ n.push({
508
+ ruleId: r,
509
+ severity: t,
510
+ ...e.advisory?.title === void 0 ? {} : { message: e.advisory.title },
511
+ ...i?.name === void 0 ? {} : { path: i.version === void 0 ? i.name : `${i.name}@${i.version}` }
512
+ });
513
+ };
514
+ for (let e of t.vulnerabilities.list ?? []) r(e, "vulnerability");
515
+ for (let [e, n] of Object.entries(t.warnings ?? {})) for (let t of n) r(t, e);
516
+ let i = t.database?.["advisory-count"];
517
+ return {
518
+ findings: n,
519
+ tool: "cargo-audit",
520
+ ...i === void 0 ? {} : { rulesEvaluated: i }
521
+ };
522
+ }
523
+ //#endregion
524
+ //#region src/evidence/adapters/registry.ts
525
+ var X = {
526
+ name: "entries",
527
+ summary: "Normalized {\"entries\": [{symbol, outcome, traceIds?}]} — the default.",
528
+ tools: [],
529
+ parse(e) {
530
+ let t;
531
+ try {
532
+ t = JSON.parse(e);
533
+ } catch (e) {
534
+ throw new R("entries", `input is not JSON: ${e.message}`);
535
+ }
536
+ if (!Array.isArray(t.entries)) throw new R("entries", "expected JSON of the form {\"entries\": [{symbol, outcome, traceIds?}]}");
537
+ return { entries: t.entries };
538
+ }
539
+ }, Z = [
540
+ X,
541
+ ae,
542
+ B,
543
+ Y,
544
+ pe
545
+ ], Q = [
546
+ {
547
+ name: "sarif",
548
+ summary: "SARIF 2.1.0 — semgrep --sarif, CodeQL, ESLint, ZAP via converter.",
549
+ tools: [
550
+ "sarif",
551
+ "semgrep",
552
+ "codeql"
553
+ ],
554
+ parse: ve
555
+ },
556
+ {
557
+ name: "audit-script",
558
+ summary: "Architecture-conformance audit scripts: '<name>: OK' / '<name>: FAIL — … (AC-ID)'.",
559
+ tools: [
560
+ "audit-script",
561
+ "make ci",
562
+ "audit-static",
563
+ "import-linter",
564
+ "dependency-cruiser"
565
+ ],
566
+ parse: ue
567
+ },
568
+ {
569
+ name: "cargo-audit",
570
+ summary: "cargo audit --json — RUSTSEC advisories and warning kinds.",
571
+ tools: [
572
+ "cargo-audit",
573
+ "cargo audit",
574
+ "cargo-deny",
575
+ "cargo deny"
576
+ ],
577
+ parse: ye
578
+ }
579
+ ], $ = [...Z.map((e) => e.name), ...Q.map((e) => e.name)];
580
+ function be(e) {
581
+ if (e.adapter !== void 0 && e.adapter !== "") return Q.find((t) => t.name === e.adapter);
582
+ let t = (e.tool ?? "").toLowerCase();
583
+ if (t !== "") return Q.find((e) => e.tools.some((e) => t.includes(e)));
584
+ }
585
+ function xe(e) {
586
+ if (e.adapter !== void 0 && e.adapter !== "") {
587
+ let t = Z.find((t) => t.name === e.adapter);
588
+ if (t === void 0) throw new R("adapter", `unknown adapter '${e.adapter}'. Available: ${$.join(", ")}`);
589
+ return t;
590
+ }
591
+ let t = (e.tool ?? "").toLowerCase();
592
+ if (t !== "") {
593
+ let e = Z.find((e) => e.tools.some((e) => t.includes(e)));
594
+ if (e !== void 0) return e;
595
+ }
596
+ return X;
597
+ }
598
+ //#endregion
599
+ export { M as _, I as a, P as c, T as d, A as f, re as g, E as h, L as i, ie as l, j as m, xe as n, F as o, ne as p, be as r, f as s, $ as t, O as u, S as v };
@@ -1,4 +1,4 @@
1
- import { a as e, t } from "./base-D_-Jy4cE.js";
1
+ import { a as e, t } from "./base-q8brKRlC.js";
2
2
  import { existsSync as n } from "node:fs";
3
3
  import { dirname as r, join as i, resolve as a } from "node:path";
4
4
  import { fileURLToPath as o } from "node:url";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { n as e, t } from "./version-DmZHxX4n.js";
1
+ import { n as e, t } from "./version-0hg-SgVf.js";
2
2
  import { isVersionRequest as n, main as r } from "./cli.js";
3
- import { i, n as a, o, r as s, t as c } from "./base-D_-Jy4cE.js";
4
- import { a as l, i as u, n as d, r as f } from "./plugins-DiS0OXoo.js";
5
- import { n as p, t as m } from "./modules-DSkUXhHn.js";
3
+ import { i, n as a, o, r as s, t as c } from "./base-q8brKRlC.js";
4
+ import { a as l, i as u, n as d, r as f } from "./plugins-xe5e7dMl.js";
5
+ import { n as p, t as m } from "./modules-E0AaYTTp.js";
6
6
  import { i as h, n as g, r as _, t as v } from "./config-schema-Dp-vlxuR.js";
7
- import { a as y, i as b, n as x, o as S, r as C, t as w } from "./write-CPdSNIkF.js";
8
- import { t as T } from "./flow-command-B-ZBn9Sd.js";
7
+ import { a as y, i as b, n as x, o as S, r as C, t as w } from "./write-Dig0zXLM.js";
8
+ import { t as T } from "./flow-command-k7eYqzBE.js";
9
9
  export { T as FlowCommand, v as QUOIN_ENV_BINDINGS, g as QUOIN_PLUGIN_ID, c as QuoinCommand, _ as QuoinConfigSchema, b as UNRESOLVED_ORG_MESSAGE, w as createAuthoringPack, a as defaultModuleRoots, m as defaultModulesManifest, p as ensureDefaultModules, s as filamentModulesDir, i as findCatalogEntry, x as formatAuthoringPack, d as installPlugin, n as isVersionRequest, h as ixSchema, f as listPlugins, o as loadCatalog, r as main, y as originOrg, t as packageVersion, u as parseSourceArg, C as parseTypeList, l as removePlugin, S as resolveOrg, e as resolveVersion };
@@ -1,5 +1,5 @@
1
- import { a as e } from "./base-D_-Jy4cE.js";
2
- import { t } from "./plugins-DiS0OXoo.js";
1
+ import { a as e } from "./base-q8brKRlC.js";
2
+ import { t } from "./plugins-xe5e7dMl.js";
3
3
  import { readFileSync as n } from "node:fs";
4
4
  import { dirname as r, join as i } from "node:path";
5
5
  import { fileURLToPath as a } from "node:url";
@@ -1,4 +1,4 @@
1
- import { a as e, r as t } from "./base-D_-Jy4cE.js";
1
+ import { a as e, r as t } from "./base-q8brKRlC.js";
2
2
  import { existsSync as n, readFileSync as r, rmSync as i } from "node:fs";
3
3
  import { basename as a, join as o } from "node:path";
4
4
  import { parse as s } from "yaml";
@@ -24,7 +24,7 @@
24
24
  /** Where the vendored schemas came from, and exactly which bytes. */
25
25
  export declare const QUIRE_CONTRACT: {
26
26
  /** The quire-rs release the vendored schemas were copied from. */
27
- readonly sourceTag: "v0.29.0";
27
+ readonly sourceTag: "v0.36.0";
28
28
  /** The contract version, as carried in each schema's `$id` and filename. */
29
29
  readonly contractVersion: "v1";
30
30
  /**
@@ -41,7 +41,7 @@ export declare const QUIRE_CONTRACT: {
41
41
  * without a matching refresh fails loudly.
42
42
  */
43
43
  readonly hashes: {
44
- readonly "coverage-v1.schema.json": "bcc79e194a2f6c1a60d5345cf4f7947913fe0fe7dcde3f31989b9d9b8cecdbc3";
44
+ readonly "coverage-v1.schema.json": "5669991ed60f2dbf3db82f7b43e12893ecc328b63e3c290b84b41d08c92881e6";
45
45
  readonly "properties-v1.schema.json": "d81f1ec85abdecd1f1664ded15e081f9aecb6c0f054d6b332b71e904cf826292";
46
46
  };
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/quire/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,qEAAqE;AACrE,eAAO,MAAM,cAAc;IACzB,kEAAkE;;IAElE,4EAA4E;;IAE5E;;;;;;;OAOG;;IAEH;;;OAGG;;;;;CAOK,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,cAAc,CAAC,MAAM,CAAC;AAI5D,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEpD;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAInD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,qBAAqB,GAAG,IAAI,CA2B9B"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/quire/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,qEAAqE;AACrE,eAAO,MAAM,cAAc;IACzB,kEAAkE;;IAElE,4EAA4E;;IAE5E;;;;;;;OAOG;;IAkBH;;;OAGG;;;;;CAOK,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,cAAc,CAAC,MAAM,CAAC;AAI5D,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEpD;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAInD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,qBAAqB,GAAG,IAAI,CA2B9B"}
@@ -81,6 +81,17 @@ export interface Obligation {
81
81
  method?: string | null;
82
82
  parameters?: Record<string, string>;
83
83
  criticality?: string | null;
84
+ /**
85
+ * Test-case ids the criterion's method cell names — `Test (TC-707)` yields
86
+ * `["TC-707"]` (quire-rs FR-053-AC-11, v0.35.0).
87
+ *
88
+ * Optional because an engine before v0.35.0 emits none, and because a cell
89
+ * naming no test case carries none. Treat absent and empty alike: both mean
90
+ * "this obligation names no test case", never "the engine is old" — a
91
+ * consumer that branched on the difference would report a version as a
92
+ * finding.
93
+ */
94
+ target_ids?: string[];
84
95
  }
85
96
  /** Bundle-wide totals. The criteria pair is all-or-nothing. */
86
97
  export interface CoverageTotals {