@agent-ix/quoin 0.17.0 → 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 (109) 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-a9axb4Jl.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-W2jFinr6.js +188 -0
  18. package/dist/{base-D_-Jy4cE.js → base-BE20w0jY.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-BeqcskAI.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/store.d.ts +48 -2
  85. package/dist/evidence/store.d.ts.map +1 -1
  86. package/dist/evidence/types.d.ts +84 -0
  87. package/dist/evidence/types.d.ts.map +1 -1
  88. package/dist/evidence-FRF9RN77.js +595 -0
  89. package/dist/{flow-command-B-ZBn9Sd.js → flow-command-BrzzKBo9.js} +1 -1
  90. package/dist/index.js +6 -6
  91. package/dist/{modules-DSkUXhHn.js → modules-_FQTZ3gx.js} +2 -2
  92. package/dist/{plugins-DiS0OXoo.js → plugins-Q1MtCIE5.js} +1 -1
  93. package/dist/quire/contract.d.ts +1 -1
  94. package/dist/quire/contract.d.ts.map +1 -1
  95. package/dist/{quire-D7ra5rUF.js → quire-Dis3ky5t.js} +1 -1
  96. package/dist/{version-DmZHxX4n.js → version-D0l3nDPZ.js} +1 -1
  97. package/dist/{write-CPdSNIkF.js → write-CMA6BDUq.js} +1 -1
  98. package/package.json +2 -1
  99. package/skills/spec-fuzz/SKILL.md +94 -0
  100. package/skills/spec-fuzz/assets/templates/atheris.py.md +74 -0
  101. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +83 -0
  102. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +76 -0
  103. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +51 -0
  104. package/skills/spec-fuzz/references/step-1-select-obligations.md +47 -0
  105. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +55 -0
  106. package/skills/spec-fuzz/references/step-3-emit-targets.md +65 -0
  107. package/skills/spec-fuzz/references/step-4-report.md +56 -0
  108. package/dist/audit-CudnEJmh.js +0 -127
  109. package/dist/evidence-QUw0KyMH.js +0 -209
@@ -1,127 +0,0 @@
1
- //#region src/auditor/audit.ts
2
- function e(e) {
3
- let a = [], o = [], s = /* @__PURE__ */ new Map();
4
- for (let t of e.bindings) {
5
- let e = s.get(t.obligation) ?? [];
6
- e.push(t), s.set(t.obligation, e);
7
- }
8
- let c = new Map(e.runs.map((e) => [e.suite, e]));
9
- for (let l of [...e.obligations].sort(n)) {
10
- let n = (s.get(l.id) ?? []).slice().sort((e, n) => t(e.suite, n.suite));
11
- if (n.length === 0) {
12
- a.push({
13
- kind: "undischarged",
14
- obligation: l.id,
15
- severity: "medium",
16
- summary: `no evidence is bound to ${l.id}`
17
- });
18
- continue;
19
- }
20
- let u = n.filter((e) => e.statementHashAtBinding !== l.statement_hash);
21
- if (u.length > 0) {
22
- a.push({
23
- kind: "suspect-link",
24
- obligation: l.id,
25
- severity: "high",
26
- summary: `${l.id} was reworded after its evidence was bound in ${u.map((e) => e.suite).join(", ")} (bound against ${u[0].statementHashAtBinding.slice(0, 12)}…, now ${l.statement_hash.slice(0, 12)}…). Re-affirm or re-verify.`
27
- });
28
- continue;
29
- }
30
- let d = n.filter((e) => !c.has(e.suite));
31
- if (d.length > 0) {
32
- a.push({
33
- kind: "stale-evidence",
34
- obligation: l.id,
35
- severity: "high",
36
- summary: `${l.id} is bound to ${d.map((e) => e.suite).join(", ")}, which ${d.length === 1 ? "has" : "have"} no recorded run. The binding claims evidence that is not in the store.`
37
- });
38
- continue;
39
- }
40
- let f = n.map((e) => c.get(e.suite));
41
- if (e.headCommit) {
42
- let t = n.filter((t, n) => f[n].commit !== e.headCommit);
43
- t.length > 0 && a.push({
44
- kind: "stale-evidence",
45
- obligation: l.id,
46
- severity: "medium",
47
- summary: `${l.id} rests on ` + t.map((e) => `a ${e.suite} run at ${c.get(e.suite).commit.slice(0, 12)}`).join(" and ") + `, not at HEAD (${e.headCommit.slice(0, 12)}).`
48
- });
49
- }
50
- let p = n.flatMap((e, t) => e.symbols.filter((e) => {
51
- let n = f[t].entries.find((t) => t.symbol === e);
52
- return !n || n.outcome === "skip";
53
- }).map((t) => `${e.suite}:${t}`)), m = n.reduce((e, t) => e + t.symbols.length, 0);
54
- if (p.length > 0 && p.length === m) {
55
- a.push({
56
- kind: "vacuous-evidence",
57
- obligation: l.id,
58
- severity: "high",
59
- summary: `every symbol bound to ${l.id} was skipped or absent from its run: ${p.sort(t).join(", ")}. The row reads as covered and nothing was verified.`
60
- });
61
- continue;
62
- }
63
- let h = r(l, n, f, e.catalog);
64
- if (h) {
65
- a.push(h);
66
- continue;
67
- }
68
- let g = i(l, n, e);
69
- if (g) {
70
- a.push(g);
71
- continue;
72
- }
73
- o.push(l.id);
74
- }
75
- return a.sort((e, n) => t(e.obligation, n.obligation) || t(e.kind, n.kind)), {
76
- findings: a,
77
- healthy: o.sort(t)
78
- };
79
- }
80
- function t(e, t) {
81
- return e === t ? 0 : e < t ? -1 : 1;
82
- }
83
- function n(e, n) {
84
- return t(e.id, n.id);
85
- }
86
- function r(e, n, r, i) {
87
- if (!i || !e.method) return null;
88
- let a = e.method.trim().toLowerCase(), o = i.methods.filter((e) => e.id.toLowerCase() === a || e.class.toLowerCase() === a);
89
- if (o.length === 0) return {
90
- kind: "unknown-method",
91
- obligation: e.id,
92
- severity: "medium",
93
- summary: `${e.id} declares \`${e.method}\`, which is neither a catalog method id nor a catalog class. Nothing can say what discharging it means, so no conformance check can run against it.`
94
- };
95
- let s = new Set(o.map((e) => e.evidenceKind).filter((e) => typeof e == "string" && e.length > 0));
96
- if (s.size === 0) return null;
97
- let c = n.filter((e, t) => {
98
- let n = r[t].evidenceKind;
99
- return typeof n == "string" && n.length > 0 && !s.has(n);
100
- });
101
- return c.length === 0 ? null : {
102
- kind: "method-conformance",
103
- obligation: e.id,
104
- severity: "medium",
105
- summary: `${e.id} declares \`${e.method}\`, whose evidence kind is ${[...s].sort(t).join("/")}, but is discharged by ` + c.map((e) => `a ${r[n.indexOf(e)].evidenceKind} run in ${e.suite}`).join(" and ") + ". A method is not discharged by evidence of another kind."
106
- };
107
- }
108
- function i(e, t, n) {
109
- let r = n.multiplicityRequires ?? [];
110
- if (r.length === 0 || !e.criticality || !r.includes(e.criticality)) return null;
111
- let i = new Set(t.map((e) => e.suite));
112
- return i.size >= 2 ? null : {
113
- kind: "insufficient-multiplicity",
114
- obligation: e.id,
115
- severity: "medium",
116
- summary: `${e.id} is criticality ${e.criticality}, which requires two independent methods, but all its evidence comes from ${[...i].join(", ")}.`
117
- };
118
- }
119
- function a(e) {
120
- return `${e.kind}:${e.obligation}`;
121
- }
122
- function o(e, t) {
123
- let n = new Set(t.accepted);
124
- return e.findings.filter((e) => !n.has(a(e)));
125
- }
126
- //#endregion
127
- export { a as n, o as r, e as t };
@@ -1,209 +0,0 @@
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";
5
- //#endregion
6
- //#region src/evidence/store.ts
7
- function l(e) {
8
- return s(e, "spec", "evidence");
9
- }
10
- function u(e) {
11
- return s(l(e), "bindings.json");
12
- }
13
- function d(e) {
14
- return s(l(e), "baseline.json");
15
- }
16
- function f(e, t, n) {
17
- return s(l(e), c, t, `${p(n)}.json`);
18
- }
19
- function p(e) {
20
- return e.slice(0, 12);
21
- }
22
- function m(e) {
23
- return `${JSON.stringify(h(e), null, 2)}\n`;
24
- }
25
- function h(e) {
26
- if (Array.isArray(e)) return e.map(h);
27
- if (typeof e != "object" || !e) return e;
28
- let t = {};
29
- for (let n of Object.keys(e).sort()) t[n] = h(e[n]);
30
- return t;
31
- }
32
- function g(e, n) {
33
- t(o(e), { recursive: !0 }), a(e, m(n), "utf8");
34
- }
35
- var _ = class extends Error {
36
- path;
37
- cause;
38
- constructor(e, t) {
39
- let n = t instanceof Error ? t.message : String(t);
40
- 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";
41
- }
42
- };
43
- function v(t) {
44
- if (!e(t)) return null;
45
- try {
46
- return JSON.parse(n(t, "utf8"));
47
- } catch (e) {
48
- throw new _(t, e);
49
- }
50
- }
51
- function y(e, t) {
52
- try {
53
- return v(e);
54
- } catch (n) {
55
- if (n instanceof _) return t.push(e), null;
56
- throw n;
57
- }
58
- }
59
- function b(e, t) {
60
- let n = f(e, t.suite, t.commit);
61
- return g(n, {
62
- ...t,
63
- schemaVersion: 1
64
- }), n;
65
- }
66
- function x(t, n) {
67
- let i = s(l(t), c, n);
68
- return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
69
- }
70
- function S(e, t, n = []) {
71
- return x(e, t).map((r) => y(f(e, t, r.replace(/\.json$/, "")), n)).filter((e) => e !== null).sort((e, t) => w(e.timestamp, t.timestamp) || w(e.commit, t.commit));
72
- }
73
- function C(e, t, n = []) {
74
- return S(e, t, n).at(-1) ?? null;
75
- }
76
- function w(e, t) {
77
- return e === t ? 0 : e < t ? -1 : 1;
78
- }
79
- function T(t) {
80
- let n = s(l(t), c);
81
- return e(n) ? r(n, { withFileTypes: !0 }).filter((e) => e.isDirectory()).map((e) => e.name).sort() : [];
82
- }
83
- function E(e) {
84
- return v(u(e)) ?? {
85
- schemaVersion: 1,
86
- bindings: []
87
- };
88
- }
89
- function D(e, t) {
90
- let n = [...t.bindings].sort(j);
91
- g(u(e), {
92
- schemaVersion: 1,
93
- bindings: n
94
- });
95
- }
96
- function O(e) {
97
- return v(d(e));
98
- }
99
- function k(e, t) {
100
- g(d(e), {
101
- schemaVersion: 1,
102
- commit: t.commit,
103
- accepted: [...t.accepted].sort(w)
104
- });
105
- }
106
- function A(e, t = !1) {
107
- let n = new Set(E(e).bindings.map((e) => `${e.suite}/${p(e.commit)}.json`)), r = [];
108
- for (let a of T(e)) {
109
- let o = x(e, a), u = /* @__PURE__ */ new Set(), d = C(e, a);
110
- d && u.add(`${p(d.commit)}.json`);
111
- for (let d of o) {
112
- if (u.has(d) || n.has(`${a}/${d}`)) continue;
113
- let o = s(l(e), c, a, d);
114
- r.push(o), t || i(o);
115
- }
116
- }
117
- return r.sort();
118
- }
119
- function j(e, t) {
120
- return e.obligation === t.obligation ? e.suite === t.suite ? 0 : e.suite < t.suite ? -1 : 1 : e.obligation < t.obligation ? -1 : 1;
121
- }
122
- function M(e, t) {
123
- let n = e.findIndex((e) => e.obligation === t.obligation && e.suite === t.suite);
124
- if (n === -1) return {
125
- bindings: [...e, { ...t }],
126
- created: !0,
127
- suspect: !1
128
- };
129
- let r = e[n], i = r.statementHashAtBinding !== t.statementHashAtBinding, a = {
130
- ...r,
131
- commit: t.commit,
132
- symbols: t.symbols
133
- }, o = [...e];
134
- return o[n] = a, {
135
- bindings: o,
136
- created: !1,
137
- suspect: i
138
- };
139
- }
140
- function N(e, t, n, r, i, a, o) {
141
- let s = e.map((e, t) => [e, t]).filter(([e]) => e.obligation === t && (!o || e.suite === o));
142
- if (s.length === 0) return {
143
- bindings: e,
144
- found: !1
145
- };
146
- let c = [...e];
147
- for (let [e, t] of s) c[t] = {
148
- ...e,
149
- statementHashAtBinding: n,
150
- affirmations: [...e.affirmations ?? [], {
151
- who: r,
152
- commit: i,
153
- note: a
154
- }]
155
- };
156
- return {
157
- bindings: c,
158
- found: !0
159
- };
160
- }
161
- //#endregion
162
- //#region src/evidence/record.ts
163
- function P(e) {
164
- let t = b(e.repo, {
165
- schemaVersion: 1,
166
- suite: e.suite,
167
- commit: e.commit,
168
- tool: e.tool,
169
- evidenceKind: e.evidenceKind,
170
- timestamp: e.timestamp,
171
- entries: e.entries
172
- }), n = new Map(e.obligations.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
173
- for (let t of e.entries) for (let e of t.traceIds ?? []) {
174
- if (!n.has(e)) {
175
- i.add(e);
176
- continue;
177
- }
178
- if (t.outcome !== "pass") continue;
179
- let a = r.get(e) ?? [];
180
- a.push(t.symbol), r.set(e, a);
181
- }
182
- let a = E(e.repo).bindings, o = [], s = [];
183
- for (let [t, i] of [...r].sort(([e], [t]) => e === t ? 0 : e < t ? -1 : 1)) {
184
- let r = n.get(t);
185
- if (!r) continue;
186
- let c = M(a, {
187
- obligation: t,
188
- statementHashAtBinding: r.statement_hash,
189
- suite: e.suite,
190
- commit: e.commit,
191
- symbols: [...i].sort()
192
- });
193
- a = c.bindings, c.created && o.push(t), c.suspect && s.push(t);
194
- }
195
- return D(e.repo, {
196
- schemaVersion: 1,
197
- bindings: a
198
- }), {
199
- runPath: t,
200
- bound: o.sort(),
201
- suspect: s.sort(),
202
- unmatched: [...i].sort()
203
- };
204
- }
205
- function F(e) {
206
- return e.obligations ?? [];
207
- }
208
- //#endregion
209
- export { A as a, O as c, D as d, d as i, E as l, P as n, C as o, N as r, T as s, F as t, k as u };