@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
@@ -3,17 +3,18 @@
3
3
  **Goal**: Emit the findings from Steps 1–5 as a single **quire-validated `SpecReview`**
4
4
  document with a Verdict, at `reviews/YY-MM-DD-<slug>.md`.
5
5
 
6
- ## Fetch the template, then author (guardrail)
6
+ ## Render the template, then author (guardrail)
7
7
 
8
- The `SpecReview` archetype lives in `spec-artifacts-process`. Fetch its skeleton first, then
9
- author, then validate (the ecosystem direct-render-then-validate model):
8
+ The `SpecReview` archetype lives in `spec-artifacts-process`. Render its skeleton first,
9
+ then author, then validate (the ecosystem direct-render-then-validate model):
10
10
 
11
11
  ```
12
12
  quoin write --types SpecReview
13
13
  ```
14
14
 
15
- If `quoin write` is unavailable in the working tree, read the skeleton directly from
16
- `~/.ix/filament/modules/spec-artifacts-process/skeletons/SpecReview.md`.
15
+ If `quoin write` is unavailable, use the complete frontmatter, body, findings-table, and
16
+ validation contract below. Do not consult a private repository, user-home path, or
17
+ separately installed template.
17
18
 
18
19
  ## Frontmatter
19
20
 
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: spec-architecture-evaluation
3
+ description: Evaluate a repository's implemented architecture against its stated boundaries, quality goals, and operating scenarios, producing an evidence-backed SpecReview. Use for architecture reviews; do not use for general test-gap or code-style review.
4
+ ---
5
+
6
+ # Architecture Evaluation
7
+
8
+ Evaluate the architecture that exists, including its specifications and code. Do not infer health from diagrams, test counts, or a single aggregate score.
9
+
10
+ ## Evaluation
11
+
12
+ 1. Establish the scope and named quality goals from the repository's architecture decisions, requirements, and current implementation.
13
+ 2. Walk representative success, failure, recovery, and change scenarios across component boundaries. Follow data, control, and ownership; record the concrete files or artifacts that establish each claim.
14
+ 3. Check whether responsibilities have one clear owner, dependencies point in the intended direction, failure and recovery cross boundaries coherently, and measurement or policy code is separated from presentation and orchestration.
15
+ 4. For each problem, state what is wrong, where it occurs, why it matters in a named scenario, and the smallest credible repair. Distinguish a demonstrated defect from a risk that still needs measurement.
16
+ 5. Prefer a small number of supported findings. Do not invent a numeric architecture score or treat an unavailable metric as zero.
17
+
18
+ ## Output contract
19
+
20
+ Write one Quire-validated `SpecReview` under `reviews/YY-MM-DD-<slug>.md` with:
21
+
22
+ - `type: SpecReview`
23
+ - `analysis: architecture-evaluation`
24
+ - an exact `scope` and `review_set`
25
+ - a substantive `## Summary`
26
+ - a `## Findings` table with the module's required columns
27
+
28
+ Each finding must name evidence in `Refs` and contain enough location and causal detail to be actionable. If no defect is demonstrated, record a low-severity “No issues found” row and summarize the scenarios actually examined.
29
+
30
+ Validate the result with the repository's real `quire validate` command. This review is advisory evidence unless the repository separately declares it as a gate.
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  name: spec-fuzz
3
- description: Turn Fuzz-kind obligations into runnable fuzz targets. Consumes `quoin advise
4
- --json`, selects the obligations whose verification method carries `evidence_kind: Fuzz`,
5
- grounds each one's entry-point symbol in the repository's source, and emits targets in the
6
- repo's own harness (cargo-fuzz / atheris / fast-check) keyed on the obligation id. Writes
7
- nothing where the tooling is absent or the entry point cannot be grounded — a finding
8
- instead. Emits a validated SpecReview recording every obligation it could not serve.
3
+ description: >-
4
+ Turn Fuzz-kind obligations into runnable fuzz targets. Consumes `quoin advise --json`,
5
+ selects the obligations whose verification method carries `evidence_kind: Fuzz`, grounds
6
+ each one's entry-point symbol in the repository's source, and emits targets in the repo's
7
+ own harness (cargo-fuzz / atheris / fast-check) keyed on the obligation id. Writes nothing
8
+ where the tooling is absent or the entry point cannot be grounded — a finding instead.
9
+ Emits a validated SpecReview recording every obligation it could not serve.
9
10
  ---
10
11
 
11
12
  # Spec Fuzz
@@ -1,603 +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", l = "scans", u = "mutation-score";
5
- //#endregion
6
- //#region src/evidence/store.ts
7
- function d(e) {
8
- return s(e, "spec", "evidence");
9
- }
10
- function f(e) {
11
- return s(d(e), "bindings.json");
12
- }
13
- function p(e) {
14
- return s(d(e), "baseline.json");
15
- }
16
- function m(e, t, n) {
17
- return s(d(e), c, t, `${g(n)}.json`);
18
- }
19
- function h(e, t, n) {
20
- return s(d(e), l, t, `${g(n)}.json`);
21
- }
22
- function g(e) {
23
- return e.slice(0, 12);
24
- }
25
- function _(e) {
26
- return `${JSON.stringify(v(e), null, 2)}\n`;
27
- }
28
- function v(e) {
29
- if (Array.isArray(e)) return e.map(v);
30
- if (typeof e != "object" || !e) return e;
31
- let t = {};
32
- for (let n of Object.keys(e).sort()) t[n] = v(e[n]);
33
- return t;
34
- }
35
- function y(e, n) {
36
- t(o(e), { recursive: !0 }), a(e, _(n), "utf8");
37
- }
38
- var b = 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 x(t) {
47
- if (!e(t)) return null;
48
- try {
49
- return JSON.parse(n(t, "utf8"));
50
- } catch (e) {
51
- throw new b(t, e);
52
- }
53
- }
54
- function S(e, t) {
55
- try {
56
- return x(e);
57
- } catch (n) {
58
- if (n instanceof b) return t.push(e), null;
59
- throw n;
60
- }
61
- }
62
- function ee(e, t) {
63
- let n = m(e, t.suite, t.commit);
64
- return y(n, {
65
- ...t,
66
- schemaVersion: 1
67
- }), n;
68
- }
69
- function te(e, t) {
70
- let n = h(e, t.suite, t.commit);
71
- return y(n, {
72
- ...t,
73
- schemaVersion: 1
74
- }), n;
75
- }
76
- function C(t, n) {
77
- let i = s(d(t), l, n);
78
- return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
79
- }
80
- function ne(e, t, n = []) {
81
- return C(e, t).map((r) => S(h(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 w(e, t, n = []) {
84
- return ne(e, t, n).at(-1) ?? null;
85
- }
86
- function re(e) {
87
- return e.rulesEvaluated === void 0 ? null : e.rulesEvaluated === 0;
88
- }
89
- function T(t, n) {
90
- let i = s(d(t), c, n);
91
- return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
92
- }
93
- function E(e, t, n = []) {
94
- return T(e, t).map((r) => S(m(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 D(e, t, n = []) {
97
- return E(e, t, n).at(-1) ?? null;
98
- }
99
- function O(e) {
100
- return A(e).map((t) => D(e, t)).filter((e) => e !== null);
101
- }
102
- function ie(e) {
103
- return A(e).map((t) => w(e, t)).filter((e) => e !== null);
104
- }
105
- function k(e, t) {
106
- return e === t ? 0 : e < t ? -1 : 1;
107
- }
108
- function A(t) {
109
- let n = /* @__PURE__ */ new Set();
110
- for (let i of [c, l]) {
111
- let a = s(d(t), i);
112
- if (e(a)) for (let e of r(a, { withFileTypes: !0 })) e.isDirectory() && n.add(e.name);
113
- }
114
- return [...n].sort();
115
- }
116
- function j(e) {
117
- return x(f(e)) ?? {
118
- schemaVersion: 1,
119
- bindings: []
120
- };
121
- }
122
- function M(e, t) {
123
- let n = [...t.bindings].sort(F);
124
- y(f(e), {
125
- schemaVersion: 1,
126
- bindings: n
127
- });
128
- }
129
- function ae(e) {
130
- return x(p(e));
131
- }
132
- function N(e, t) {
133
- y(p(e), {
134
- schemaVersion: 1,
135
- commit: t.commit,
136
- accepted: [...t.accepted].sort(k)
137
- });
138
- }
139
- function P(e, t = !1) {
140
- let n = new Set(j(e).bindings.map((e) => `${e.suite}/${g(e.commit)}.json`)), r = [];
141
- for (let a of A(e)) {
142
- let o = T(e, a), u = /* @__PURE__ */ new Set(), f = D(e, a);
143
- f && u.add(`${g(f.commit)}.json`);
144
- for (let l of o) {
145
- if (u.has(l) || n.has(`${a}/${l}`)) continue;
146
- let o = s(d(e), c, a, l);
147
- r.push(o), t || i(o);
148
- }
149
- let p = C(e, a), m = /* @__PURE__ */ new Set(), h = w(e, a);
150
- h && m.add(`${g(h.commit)}.json`);
151
- for (let o of p) {
152
- if (m.has(o) || n.has(`${a}/${o}`)) continue;
153
- let c = s(d(e), l, a, o);
154
- r.push(c), t || i(c);
155
- }
156
- }
157
- return r.sort();
158
- }
159
- function F(e, t) {
160
- return e.obligation === t.obligation ? e.suite === t.suite ? 0 : e.suite < t.suite ? -1 : 1 : e.obligation < t.obligation ? -1 : 1;
161
- }
162
- function I(e, t) {
163
- let n = e.findIndex((e) => e.obligation === t.obligation && e.suite === t.suite);
164
- if (n === -1) return {
165
- bindings: [...e, { ...t }],
166
- created: !0,
167
- suspect: !1
168
- };
169
- let r = e[n], i = r.statementHashAtBinding !== t.statementHashAtBinding, a = {
170
- ...r,
171
- commit: t.commit,
172
- symbols: t.symbols
173
- }, o = [...e];
174
- return o[n] = a, {
175
- bindings: o,
176
- created: !1,
177
- suspect: i
178
- };
179
- }
180
- function L(e, t, n, r, i, a, o) {
181
- let s = e.map((e, t) => [e, t]).filter(([e]) => e.obligation === t && (!o || e.suite === o));
182
- if (s.length === 0) return {
183
- bindings: e,
184
- found: !1
185
- };
186
- let c = [...e];
187
- for (let [e, t] of s) c[t] = {
188
- ...e,
189
- statementHashAtBinding: n,
190
- affirmations: [...e.affirmations ?? [], {
191
- who: r,
192
- commit: i,
193
- note: a
194
- }]
195
- };
196
- return {
197
- bindings: c,
198
- found: !0
199
- };
200
- }
201
- //#endregion
202
- //#region src/evidence/record.ts
203
- function R(e) {
204
- let t = ee(e.repo, {
205
- schemaVersion: 1,
206
- suite: e.suite,
207
- commit: e.commit,
208
- tool: e.tool,
209
- evidenceKind: e.evidenceKind,
210
- timestamp: e.timestamp,
211
- entries: e.entries
212
- }), n = new Map(e.obligations.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
213
- for (let t of e.obligations) for (let e of t.target_ids ?? []) n.has(e) || r.set(e, [...r.get(e) ?? [], t]);
214
- let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
215
- for (let t of e.entries) for (let e of t.traceIds ?? []) {
216
- let o = n.has(e) ? [n.get(e)] : r.get(e) ?? [];
217
- if (o.length === 0) {
218
- a.add(e);
219
- continue;
220
- }
221
- if (t.outcome === "pass") for (let e of o) {
222
- let n = i.get(e.id) ?? [];
223
- n.push(t.symbol), i.set(e.id, n);
224
- }
225
- }
226
- let o = j(e.repo).bindings, s = [], c = [];
227
- for (let [t, r] of [...i].sort(([e], [t]) => e === t ? 0 : e < t ? -1 : 1)) {
228
- let i = n.get(t);
229
- if (!i) continue;
230
- let a = I(o, {
231
- obligation: t,
232
- statementHashAtBinding: i.statement_hash,
233
- suite: e.suite,
234
- commit: e.commit,
235
- symbols: [...r].sort()
236
- });
237
- o = a.bindings, a.created && s.push(t), a.suspect && c.push(t);
238
- }
239
- return M(e.repo, { bindings: o }), {
240
- runPath: t,
241
- bound: s.sort(),
242
- suspect: c.sort(),
243
- unmatched: [...a].sort()
244
- };
245
- }
246
- function z(e) {
247
- return e.obligations ?? [];
248
- }
249
- //#endregion
250
- //#region src/evidence/adapters/types.ts
251
- var B = class extends Error {
252
- adapter;
253
- constructor(e, t) {
254
- super(`${e}: ${t}`), this.adapter = e, this.name = "AdapterError";
255
- }
256
- };
257
- //#endregion
258
- //#region src/evidence/adapters/cargo-mutants.ts
259
- function V(e) {
260
- let t = e.file?.trim(), n = e.function?.function_name?.trim();
261
- if (t !== void 0 && t !== "" && n !== void 0 && n !== "") return `${t}::${n}`;
262
- }
263
- var H = {
264
- name: "cargo-mutants",
265
- summary: "cargo-mutants outcomes.json — mutation score per mutated function.",
266
- tools: ["cargo-mutants", "cargo mutants"],
267
- parse(e) {
268
- let t;
269
- try {
270
- t = JSON.parse(e);
271
- } catch (e) {
272
- throw new B("cargo-mutants", `input is not JSON: ${e.message}`);
273
- }
274
- if (!Array.isArray(t.outcomes)) throw new B("cargo-mutants", "no `outcomes` array — expected the contents of mutants.out/outcomes.json");
275
- let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
276
- for (let e of t.outcomes) {
277
- if (e.scenario === "Baseline" || typeof e.scenario != "object") continue;
278
- let t = e.scenario.Mutant;
279
- if (t === void 0) continue;
280
- let i = V(t);
281
- 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));
282
- }
283
- let i = [.../* @__PURE__ */ new Set([...n.keys(), ...r.keys()])].sort();
284
- if (i.length === 0) throw new B("cargo-mutants", "no viable mutants in the report — nothing was measured");
285
- return { entries: i.map((e) => {
286
- let t = n.get(e) ?? 0, i = r.get(e) ?? 0, a = t + i;
287
- return {
288
- symbol: e,
289
- outcome: i === 0 ? "pass" : "fail",
290
- score: t / a,
291
- metric: u
292
- };
293
- }) };
294
- }
295
- }, U = /<testcase\b([^>]*?)(\/>|>([\s\S]*?)<\/testcase\s*>)/g, W = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
296
- function G(e) {
297
- let t = /* @__PURE__ */ new Map();
298
- for (let n of e.matchAll(W)) t.set(n[1], K(n[2]));
299
- return t;
300
- }
301
- function K(e) {
302
- return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&apos;", "'").replaceAll("&amp;", "&");
303
- }
304
- function q(e, t) {
305
- let n = e.trim(), r = t.trim();
306
- return n === "" ? r : r === "" ? n : n === r ? r : n.endsWith(`::${r}`) || n.endsWith(`.${r}`) ? n.replaceAll(".", "::") : `${n.replaceAll(".", "::")}::${r}`;
307
- }
308
- var J = /<property\b([^>]*)\/?>/g;
309
- function oe(e) {
310
- let t = [];
311
- for (let n of e.matchAll(J)) {
312
- let e = G(n[1]), r = e.get("name"), i = e.get("value");
313
- 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);
314
- }
315
- return t.length > 0 ? t : void 0;
316
- }
317
- function se(e) {
318
- return /<error\b/.test(e) ? "error" : /<failure\b/.test(e) ? "fail" : /<skipped\b/.test(e) ? "skip" : "pass";
319
- }
320
- var ce = {
321
- name: "junit",
322
- summary: "JUnit XML (<testsuite>/<testcase>), as emitted by most runners.",
323
- tools: [
324
- "junit",
325
- "pytest",
326
- "jest",
327
- "vitest",
328
- "gotestsum",
329
- "surefire"
330
- ],
331
- parse(e) {
332
- let t = [];
333
- for (let n of e.matchAll(U)) {
334
- let e = G(n[1]), r = n[3] ?? "", i = q(e.get("classname") ?? "", e.get("name") ?? "");
335
- if (i === "") continue;
336
- let a = oe(r);
337
- t.push({
338
- symbol: i,
339
- outcome: se(r),
340
- ...a === void 0 ? {} : { traceIds: a }
341
- });
342
- }
343
- if (t.length === 0) throw new B("junit", "no <testcase> elements found — is this JUnit XML?");
344
- return { entries: t };
345
- }
346
- }, le = /^([A-Za-z0-9._-]+):\s*(OK|FAIL)\b\s*(?:[—-]\s*)?(.*)$/, ue = /\(([^)]*)\)[.\s]*$/, de = /\b((?:FR|NFR|StR|US)-\d+-AC-\d+|TC-\d+)\b/g;
347
- function fe(e) {
348
- let t = ue.exec(e);
349
- if (!t) return;
350
- let n = [...t[1].matchAll(de)].map((e) => e[1]);
351
- return n.length > 0 ? n : void 0;
352
- }
353
- function pe(e) {
354
- let t = [], n = 0;
355
- for (let r of e.split("\n")) {
356
- let e = le.exec(r.trim());
357
- if (!e) continue;
358
- let [, i, a, o] = e;
359
- if (n += 1, a === "OK") continue;
360
- let s = o.trim(), c = fe(s);
361
- t.push({
362
- ruleId: i,
363
- severity: "violation",
364
- ...s === "" ? {} : { message: s },
365
- ...c === void 0 ? {} : { traceIds: c }
366
- });
367
- }
368
- if (n === 0) throw new B("audit-script", "no `<name>: OK` or `<name>: FAIL` line found — is this audit-script output?");
369
- return {
370
- findings: t,
371
- tool: "audit-script",
372
- rulesEvaluated: n
373
- };
374
- }
375
- //#endregion
376
- //#region src/evidence/adapters/agent-eval.ts
377
- function me(e) {
378
- let t;
379
- try {
380
- t = JSON.parse(e);
381
- } catch (e) {
382
- throw new B("agent-eval", `not JSON: ${e instanceof Error ? e.message : String(e)}`);
383
- }
384
- let n = t;
385
- if (!n || typeof n != "object" || !Array.isArray(n.results)) throw new B("agent-eval", "expected a cli-agent-evals report with a \"results\" array");
386
- let r = [];
387
- for (let e of n.results) {
388
- let t = typeof e.id == "string" ? e.id : null;
389
- t && r.push({
390
- symbol: t,
391
- outcome: e.ok === !0 ? "pass" : "fail",
392
- traceIds: [t],
393
- ...he(e)
394
- });
395
- }
396
- if (r.length === 0) throw new B("agent-eval", "no scenario results in the report — did the suite run?");
397
- return { entries: r };
398
- }
399
- function he(e) {
400
- let t = e.passRate;
401
- if (typeof t != "string") return {};
402
- let [n, r] = t.split("/").map(Number);
403
- return !Number.isFinite(n) || !Number.isFinite(r) || r === 0 ? {} : { score: n / r };
404
- }
405
- var ge = {
406
- name: "agent-eval",
407
- summary: "cli-agent-evals report JSON — one entry per scenario, keyed on the scenario id.",
408
- tools: [
409
- "cli-agent-evals",
410
- "agent-evals",
411
- "agent-pty"
412
- ],
413
- parse: me
414
- };
415
- //#endregion
416
- //#region src/evidence/adapters/sbom.ts
417
- function _e(e) {
418
- let t;
419
- try {
420
- t = JSON.parse(e);
421
- } catch (e) {
422
- throw new B("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.`);
423
- }
424
- if (!t || typeof t != "object") throw new B("sbom", "expected a JSON object");
425
- let n = t;
426
- return { entries: Y(n) ?? ve(n) ?? ye(n) };
427
- }
428
- function Y(e) {
429
- return String(e.bomFormat ?? "") === "CycloneDX" ? (Array.isArray(e.components) ? e.components : []).map((e) => {
430
- let t = e, n = typeof t.purl == "string" ? t.purl : null, r = typeof t.name == "string" ? t.name : null;
431
- if (!n && !r) return null;
432
- let i = typeof t.version == "string" ? t.version : null;
433
- return {
434
- symbol: n ?? (i ? `${r}@${i}` : r),
435
- outcome: "pass"
436
- };
437
- }).filter((e) => e !== null) : null;
438
- }
439
- function ve(e) {
440
- return typeof e.spdxVersion == "string" ? (Array.isArray(e.packages) ? e.packages : []).map((e) => {
441
- 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;
442
- if (!r && !i) return null;
443
- let a = typeof t.versionInfo == "string" ? t.versionInfo : null;
444
- return {
445
- symbol: r ?? (a ? `${i}@${a}` : i),
446
- outcome: "pass"
447
- };
448
- }).filter((e) => e !== null) : null;
449
- }
450
- function ye(e) {
451
- throw new B("sbom", `neither a CycloneDX (\`bomFormat\`) nor an SPDX (\`spdxVersion\`) document — top-level keys: ${Object.keys(e).slice(0, 6).join(", ") || "(none)"}`);
452
- }
453
- var be = {
454
- name: "sbom",
455
- summary: "CycloneDX or SPDX JSON — one entry per component, so an empty inventory reads as vacuous.",
456
- tools: [
457
- "cyclonedx",
458
- "spdx",
459
- "syft",
460
- "cdxgen",
461
- "cargo-cyclonedx"
462
- ],
463
- parse: _e
464
- };
465
- //#endregion
466
- //#region src/evidence/adapters/sarif.ts
467
- function xe(e) {
468
- let t;
469
- try {
470
- t = JSON.parse(e);
471
- } catch (e) {
472
- throw new B("sarif", `input is not JSON: ${e.message}`);
473
- }
474
- if (!Array.isArray(t.runs)) throw new B("sarif", "no `runs` array — expected a SARIF 2.1.0 log");
475
- if (t.runs.length === 0) throw new B("sarif", "`runs` is empty — a log with no run proves no scan executed");
476
- let n = [], r = [], i;
477
- for (let e of t.runs) {
478
- let t = e.tool?.driver;
479
- 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);
480
- for (let t of e.results ?? []) {
481
- let e = t.ruleId ?? t.rule?.id;
482
- if (e === void 0 || e === "") continue;
483
- let r = t.locations?.[0]?.physicalLocation;
484
- n.push({
485
- ruleId: e,
486
- ...t.level === void 0 ? {} : { severity: t.level },
487
- ...t.message?.text === void 0 ? {} : { message: t.message.text },
488
- ...r?.artifactLocation?.uri === void 0 ? {} : { path: r.artifactLocation.uri },
489
- ...r?.region?.startLine === void 0 ? {} : { line: r.region.startLine }
490
- });
491
- }
492
- }
493
- return {
494
- findings: n,
495
- ...r.length === 0 ? {} : { tool: r.join(", ") },
496
- ...i === void 0 ? {} : { rulesEvaluated: i }
497
- };
498
- }
499
- function Se(e) {
500
- let t;
501
- try {
502
- t = JSON.parse(e);
503
- } catch (e) {
504
- throw new B("cargo-audit", `input is not JSON: ${e.message}`);
505
- }
506
- if (t.vulnerabilities === void 0) throw new B("cargo-audit", "no `vulnerabilities` object — expected `cargo audit --json` output");
507
- let n = [], r = (e, t) => {
508
- let r = e.advisory?.id;
509
- if (r === void 0 || r === "") return;
510
- let i = e.package;
511
- n.push({
512
- ruleId: r,
513
- severity: t,
514
- ...e.advisory?.title === void 0 ? {} : { message: e.advisory.title },
515
- ...i?.name === void 0 ? {} : { path: i.version === void 0 ? i.name : `${i.name}@${i.version}` }
516
- });
517
- };
518
- for (let e of t.vulnerabilities.list ?? []) r(e, "vulnerability");
519
- for (let [e, n] of Object.entries(t.warnings ?? {})) for (let t of n) r(t, e);
520
- let i = t.database?.["advisory-count"];
521
- return {
522
- findings: n,
523
- tool: "cargo-audit",
524
- ...i === void 0 ? {} : { rulesEvaluated: i }
525
- };
526
- }
527
- //#endregion
528
- //#region src/evidence/adapters/registry.ts
529
- var X = {
530
- name: "entries",
531
- summary: "Normalized {\"entries\": [{symbol, outcome, traceIds?}]} — the default.",
532
- tools: [],
533
- parse(e) {
534
- let t;
535
- try {
536
- t = JSON.parse(e);
537
- } catch (e) {
538
- throw new B("entries", `input is not JSON: ${e.message}`);
539
- }
540
- if (!Array.isArray(t.entries)) throw new B("entries", "expected JSON of the form {\"entries\": [{symbol, outcome, traceIds?}]}");
541
- return { entries: t.entries };
542
- }
543
- }, Z = [
544
- X,
545
- ce,
546
- H,
547
- be,
548
- ge
549
- ], Q = [
550
- {
551
- name: "sarif",
552
- summary: "SARIF 2.1.0 — semgrep --sarif, CodeQL, ESLint, ZAP via converter.",
553
- tools: [
554
- "sarif",
555
- "semgrep",
556
- "codeql"
557
- ],
558
- parse: xe
559
- },
560
- {
561
- name: "audit-script",
562
- summary: "Architecture-conformance audit scripts: '<name>: OK' / '<name>: FAIL — … (AC-ID)'.",
563
- tools: [
564
- "audit-script",
565
- "make ci",
566
- "audit-static",
567
- "import-linter",
568
- "dependency-cruiser"
569
- ],
570
- parse: pe
571
- },
572
- {
573
- name: "cargo-audit",
574
- summary: "cargo audit --json — RUSTSEC advisories and warning kinds.",
575
- tools: [
576
- "cargo-audit",
577
- "cargo audit",
578
- "cargo-deny",
579
- "cargo deny"
580
- ],
581
- parse: Se
582
- }
583
- ], $ = [...Z.map((e) => e.name), ...Q.map((e) => e.name)];
584
- function Ce(e) {
585
- if (e.adapter !== void 0 && e.adapter !== "") return Q.find((t) => t.name === e.adapter);
586
- let t = (e.tool ?? "").toLowerCase();
587
- if (t !== "") return Q.find((e) => e.tools.some((e) => t.includes(e)));
588
- }
589
- function we(e) {
590
- if (e.adapter !== void 0 && e.adapter !== "") {
591
- let t = Z.find((t) => t.name === e.adapter);
592
- if (t === void 0) throw new B("adapter", `unknown adapter '${e.adapter}'. Available: ${$.join(", ")}`);
593
- return t;
594
- }
595
- let t = (e.tool ?? "").toLowerCase();
596
- if (t !== "") {
597
- let e = Z.find((e) => e.tools.some((e) => t.includes(e)));
598
- if (e !== void 0) return e;
599
- }
600
- return X;
601
- }
602
- //#endregion
603
- export { re as _, R as a, te as b, I as c, O as d, w as f, j as g, ae as h, z as i, P as l, A as m, we as n, L as o, ie as p, Ce as r, p as s, $ as t, D as u, N as v, u as x, M as y };