@agent-ix/quoin 0.23.1 → 0.26.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 (516) hide show
  1. package/README.md +8 -258
  2. package/bin/launcher.js +138 -0
  3. package/package.json +22 -123
  4. package/.agents/plugins/marketplace.json +0 -14
  5. package/.claude-plugin/marketplace.json +0 -16
  6. package/.claude-plugin/plugin.json +0 -8
  7. package/.codex-plugin/plugin.json +0 -27
  8. package/.github/plugin/marketplace.json +0 -16
  9. package/bin/quoin.js +0 -21
  10. package/default-modules.yaml +0 -107
  11. package/dist/advisor/advise.d.ts +0 -199
  12. package/dist/advisor/advise.d.ts.map +0 -1
  13. package/dist/advisor/index.d.ts +0 -10
  14. package/dist/advisor/index.d.ts.map +0 -1
  15. package/dist/advisor/methods.d.ts +0 -60
  16. package/dist/advisor/methods.d.ts.map +0 -1
  17. package/dist/advisor-B0rESCx1.js +0 -63
  18. package/dist/assurance/graph.d.ts +0 -87
  19. package/dist/assurance/graph.d.ts.map +0 -1
  20. package/dist/assurance/index.d.ts +0 -9
  21. package/dist/assurance/index.d.ts.map +0 -1
  22. package/dist/assurance/render.d.ts +0 -3
  23. package/dist/assurance/render.d.ts.map +0 -1
  24. package/dist/auditor/audit.d.ts +0 -146
  25. package/dist/auditor/audit.d.ts.map +0 -1
  26. package/dist/auditor/combinatorial.d.ts +0 -53
  27. package/dist/auditor/combinatorial.d.ts.map +0 -1
  28. package/dist/auditor/index.d.ts +0 -9
  29. package/dist/auditor/index.d.ts.map +0 -1
  30. package/dist/auditor-Dd3i9Aqx.js +0 -340
  31. package/dist/base-gAClyCNd.js +0 -137
  32. package/dist/base.d.ts +0 -23
  33. package/dist/base.d.ts.map +0 -1
  34. package/dist/catalog.d.ts +0 -33
  35. package/dist/catalog.d.ts.map +0 -1
  36. package/dist/change-assurance/attestations.d.ts +0 -7
  37. package/dist/change-assurance/attestations.d.ts.map +0 -1
  38. package/dist/change-assurance/index.d.ts +0 -14
  39. package/dist/change-assurance/index.d.ts.map +0 -1
  40. package/dist/change-assurance/integrity.d.ts +0 -11
  41. package/dist/change-assurance/integrity.d.ts.map +0 -1
  42. package/dist/change-assurance/records.d.ts +0 -22
  43. package/dist/change-assurance/records.d.ts.map +0 -1
  44. package/dist/change-assurance/schema-assets.d.ts +0 -8
  45. package/dist/change-assurance/schema-assets.d.ts.map +0 -1
  46. package/dist/change-assurance/store.d.ts +0 -18
  47. package/dist/change-assurance/store.d.ts.map +0 -1
  48. package/dist/change-assurance/types.d.ts +0 -180
  49. package/dist/change-assurance/types.d.ts.map +0 -1
  50. package/dist/change-assurance/verify.d.ts +0 -4
  51. package/dist/change-assurance/verify.d.ts.map +0 -1
  52. package/dist/change-assurance-CyKLPeKa.js +0 -1236
  53. package/dist/cli.d.ts +0 -61
  54. package/dist/cli.d.ts.map +0 -1
  55. package/dist/cli.js +0 -34
  56. package/dist/commands/advise.d.ts +0 -16
  57. package/dist/commands/advise.d.ts.map +0 -1
  58. package/dist/commands/advise.js +0 -234
  59. package/dist/commands/assurance.d.ts +0 -14
  60. package/dist/commands/assurance.d.ts.map +0 -1
  61. package/dist/commands/assurance.js +0 -204
  62. package/dist/commands/catalog/index.d.ts +0 -2
  63. package/dist/commands/catalog/index.d.ts.map +0 -1
  64. package/dist/commands/catalog/index.js +0 -2
  65. package/dist/commands/catalog/list.d.ts +0 -11
  66. package/dist/commands/catalog/list.d.ts.map +0 -1
  67. package/dist/commands/catalog/list.js +0 -22
  68. package/dist/commands/catalog/methods.d.ts +0 -12
  69. package/dist/commands/catalog/methods.d.ts.map +0 -1
  70. package/dist/commands/catalog/methods.js +0 -43
  71. package/dist/commands/catalog/show.d.ts +0 -13
  72. package/dist/commands/catalog/show.d.ts.map +0 -1
  73. package/dist/commands/catalog/show.js +0 -25
  74. package/dist/commands/catalog/validate.d.ts +0 -10
  75. package/dist/commands/catalog/validate.d.ts.map +0 -1
  76. package/dist/commands/catalog/validate.js +0 -27
  77. package/dist/commands/change-assurance/common.d.ts +0 -37
  78. package/dist/commands/change-assurance/common.d.ts.map +0 -1
  79. package/dist/commands/change-assurance/index.d.ts +0 -8
  80. package/dist/commands/change-assurance/index.d.ts.map +0 -1
  81. package/dist/commands/change-assurance/index.js +0 -12
  82. package/dist/commands/change-assurance/intake.d.ts +0 -15
  83. package/dist/commands/change-assurance/intake.d.ts.map +0 -1
  84. package/dist/commands/change-assurance/intake.js +0 -53
  85. package/dist/commands/change-assurance/receipt.d.ts +0 -21
  86. package/dist/commands/change-assurance/receipt.d.ts.map +0 -1
  87. package/dist/commands/change-assurance/receipt.js +0 -99
  88. package/dist/commands/change-assurance/recover.d.ts +0 -13
  89. package/dist/commands/change-assurance/recover.d.ts.map +0 -1
  90. package/dist/commands/change-assurance/recover.js +0 -29
  91. package/dist/commands/change-assurance/schema.d.ts +0 -13
  92. package/dist/commands/change-assurance/schema.d.ts.map +0 -1
  93. package/dist/commands/change-assurance/schema.js +0 -40
  94. package/dist/commands/change-assurance/seal-attestation.d.ts +0 -15
  95. package/dist/commands/change-assurance/seal-attestation.d.ts.map +0 -1
  96. package/dist/commands/change-assurance/seal-attestation.js +0 -58
  97. package/dist/commands/change-assurance/seal-record.d.ts +0 -14
  98. package/dist/commands/change-assurance/seal-record.d.ts.map +0 -1
  99. package/dist/commands/change-assurance/seal-record.js +0 -53
  100. package/dist/commands/change-assurance/verify-receipt.d.ts +0 -13
  101. package/dist/commands/change-assurance/verify-receipt.d.ts.map +0 -1
  102. package/dist/commands/change-assurance/verify-receipt.js +0 -41
  103. package/dist/commands/completeness.d.ts +0 -16
  104. package/dist/commands/completeness.d.ts.map +0 -1
  105. package/dist/commands/completeness.js +0 -49
  106. package/dist/commands/config/doctor.d.ts +0 -7
  107. package/dist/commands/config/doctor.d.ts.map +0 -1
  108. package/dist/commands/config/doctor.js +0 -15
  109. package/dist/commands/config/edit.d.ts +0 -7
  110. package/dist/commands/config/edit.d.ts.map +0 -1
  111. package/dist/commands/config/edit.js +0 -13
  112. package/dist/commands/config/get.d.ts +0 -11
  113. package/dist/commands/config/get.d.ts.map +0 -1
  114. package/dist/commands/config/get.js +0 -20
  115. package/dist/commands/config/index.d.ts +0 -2
  116. package/dist/commands/config/index.d.ts.map +0 -1
  117. package/dist/commands/config/index.js +0 -2
  118. package/dist/commands/config/set.d.ts +0 -12
  119. package/dist/commands/config/set.d.ts.map +0 -1
  120. package/dist/commands/config/set.js +0 -26
  121. package/dist/commands/evidence/affirm.d.ts +0 -17
  122. package/dist/commands/evidence/affirm.d.ts.map +0 -1
  123. package/dist/commands/evidence/affirm.js +0 -65
  124. package/dist/commands/evidence/audit.d.ts +0 -34
  125. package/dist/commands/evidence/audit.d.ts.map +0 -1
  126. package/dist/commands/evidence/audit.js +0 -107
  127. package/dist/commands/evidence/baseline.d.ts +0 -14
  128. package/dist/commands/evidence/baseline.d.ts.map +0 -1
  129. package/dist/commands/evidence/baseline.js +0 -89
  130. package/dist/commands/evidence/gc.d.ts +0 -13
  131. package/dist/commands/evidence/gc.d.ts.map +0 -1
  132. package/dist/commands/evidence/gc.js +0 -35
  133. package/dist/commands/evidence/index.d.ts +0 -8
  134. package/dist/commands/evidence/index.d.ts.map +0 -1
  135. package/dist/commands/evidence/index.js +0 -18
  136. package/dist/commands/evidence/inspect-mocks.d.ts +0 -16
  137. package/dist/commands/evidence/inspect-mocks.d.ts.map +0 -1
  138. package/dist/commands/evidence/inspect-mocks.js +0 -49
  139. package/dist/commands/evidence/record.d.ts +0 -22
  140. package/dist/commands/evidence/record.d.ts.map +0 -1
  141. package/dist/commands/evidence/record.js +0 -144
  142. package/dist/commands/graph/change-impact.d.ts +0 -16
  143. package/dist/commands/graph/change-impact.d.ts.map +0 -1
  144. package/dist/commands/graph/change-impact.js +0 -29
  145. package/dist/commands/graph/churn.d.ts +0 -14
  146. package/dist/commands/graph/churn.d.ts.map +0 -1
  147. package/dist/commands/graph/churn.js +0 -15
  148. package/dist/commands/graph/common.d.ts +0 -16
  149. package/dist/commands/graph/common.d.ts.map +0 -1
  150. package/dist/commands/graph/fan-out.d.ts +0 -14
  151. package/dist/commands/graph/fan-out.d.ts.map +0 -1
  152. package/dist/commands/graph/fan-out.js +0 -15
  153. package/dist/commands/graph/index.d.ts +0 -8
  154. package/dist/commands/graph/index.d.ts.map +0 -1
  155. package/dist/commands/graph/index.js +0 -12
  156. package/dist/commands/matrix.d.ts +0 -14
  157. package/dist/commands/matrix.d.ts.map +0 -1
  158. package/dist/commands/matrix.js +0 -15
  159. package/dist/commands/measurement/index.d.ts +0 -7
  160. package/dist/commands/measurement/index.d.ts.map +0 -1
  161. package/dist/commands/measurement/index.js +0 -11
  162. package/dist/commands/measurement/intervention.d.ts +0 -11
  163. package/dist/commands/measurement/intervention.d.ts.map +0 -1
  164. package/dist/commands/measurement/intervention.js +0 -31
  165. package/dist/commands/measurement/operational-release.d.ts +0 -11
  166. package/dist/commands/measurement/operational-release.d.ts.map +0 -1
  167. package/dist/commands/measurement/operational-release.js +0 -31
  168. package/dist/commands/measurement/record.d.ts +0 -10
  169. package/dist/commands/measurement/record.d.ts.map +0 -1
  170. package/dist/commands/measurement/record.js +0 -36
  171. package/dist/commands/module/ensure-defaults.d.ts +0 -8
  172. package/dist/commands/module/ensure-defaults.d.ts.map +0 -1
  173. package/dist/commands/module/ensure-defaults.js +0 -17
  174. package/dist/commands/module/index.d.ts +0 -2
  175. package/dist/commands/module/index.d.ts.map +0 -1
  176. package/dist/commands/module/index.js +0 -2
  177. package/dist/commands/module/install.d.ts +0 -11
  178. package/dist/commands/module/install.d.ts.map +0 -1
  179. package/dist/commands/module/install.js +0 -22
  180. package/dist/commands/module/list.d.ts +0 -8
  181. package/dist/commands/module/list.d.ts.map +0 -1
  182. package/dist/commands/module/list.js +0 -13
  183. package/dist/commands/module/remove.d.ts +0 -10
  184. package/dist/commands/module/remove.d.ts.map +0 -1
  185. package/dist/commands/module/remove.js +0 -16
  186. package/dist/commands/plugin/deprecation.d.ts +0 -10
  187. package/dist/commands/plugin/deprecation.d.ts.map +0 -1
  188. package/dist/commands/plugin/ensure-defaults.d.ts +0 -8
  189. package/dist/commands/plugin/ensure-defaults.d.ts.map +0 -1
  190. package/dist/commands/plugin/ensure-defaults.js +0 -12
  191. package/dist/commands/plugin/index.d.ts +0 -2
  192. package/dist/commands/plugin/index.d.ts.map +0 -1
  193. package/dist/commands/plugin/index.js +0 -2
  194. package/dist/commands/plugin/install.d.ts +0 -8
  195. package/dist/commands/plugin/install.d.ts.map +0 -1
  196. package/dist/commands/plugin/install.js +0 -12
  197. package/dist/commands/plugin/list.d.ts +0 -8
  198. package/dist/commands/plugin/list.d.ts.map +0 -1
  199. package/dist/commands/plugin/list.js +0 -12
  200. package/dist/commands/plugin/remove.d.ts +0 -8
  201. package/dist/commands/plugin/remove.d.ts.map +0 -1
  202. package/dist/commands/plugin/remove.js +0 -12
  203. package/dist/commands/report.d.ts +0 -19
  204. package/dist/commands/report.d.ts.map +0 -1
  205. package/dist/commands/report.js +0 -96
  206. package/dist/commands/review.d.ts +0 -14
  207. package/dist/commands/review.d.ts.map +0 -1
  208. package/dist/commands/review.js +0 -15
  209. package/dist/commands/to-plan.d.ts +0 -14
  210. package/dist/commands/to-plan.d.ts.map +0 -1
  211. package/dist/commands/to-plan.js +0 -15
  212. package/dist/commands/update.d.ts +0 -13
  213. package/dist/commands/update.d.ts.map +0 -1
  214. package/dist/commands/update.js +0 -34
  215. package/dist/commands/validate.d.ts +0 -13
  216. package/dist/commands/validate.d.ts.map +0 -1
  217. package/dist/commands/validate.js +0 -123
  218. package/dist/commands/write.d.ts +0 -16
  219. package/dist/commands/write.d.ts.map +0 -1
  220. package/dist/commands/write.js +0 -33
  221. package/dist/common-B1ZJ8CSO.js +0 -36
  222. package/dist/common-DTrmnvL-.js +0 -35
  223. package/dist/completeness/assess.d.ts +0 -82
  224. package/dist/completeness/assess.d.ts.map +0 -1
  225. package/dist/completeness/bundle.d.ts +0 -52
  226. package/dist/completeness/bundle.d.ts.map +0 -1
  227. package/dist/completeness/declarations.d.ts +0 -46
  228. package/dist/completeness/declarations.d.ts.map +0 -1
  229. package/dist/completeness/index.d.ts +0 -11
  230. package/dist/completeness/index.d.ts.map +0 -1
  231. package/dist/completeness/run.d.ts +0 -35
  232. package/dist/completeness/run.d.ts.map +0 -1
  233. package/dist/completeness-BzBuNq6w.js +0 -228
  234. package/dist/config-schema-Dp-vlxuR.js +0 -13
  235. package/dist/config-schema.d.ts +0 -52
  236. package/dist/config-schema.d.ts.map +0 -1
  237. package/dist/deprecation-fRxUHoxv.js +0 -4
  238. package/dist/evidence/adapters/agent-eval.d.ts +0 -26
  239. package/dist/evidence/adapters/agent-eval.d.ts.map +0 -1
  240. package/dist/evidence/adapters/audit-script.d.ts +0 -25
  241. package/dist/evidence/adapters/audit-script.d.ts.map +0 -1
  242. package/dist/evidence/adapters/cargo-mutants.d.ts +0 -3
  243. package/dist/evidence/adapters/cargo-mutants.d.ts.map +0 -1
  244. package/dist/evidence/adapters/contract-conformance.d.ts +0 -16
  245. package/dist/evidence/adapters/contract-conformance.d.ts.map +0 -1
  246. package/dist/evidence/adapters/differential-report.d.ts +0 -18
  247. package/dist/evidence/adapters/differential-report.d.ts.map +0 -1
  248. package/dist/evidence/adapters/junit.d.ts +0 -17
  249. package/dist/evidence/adapters/junit.d.ts.map +0 -1
  250. package/dist/evidence/adapters/registry.d.ts +0 -63
  251. package/dist/evidence/adapters/registry.d.ts.map +0 -1
  252. package/dist/evidence/adapters/sarif.d.ts +0 -35
  253. package/dist/evidence/adapters/sarif.d.ts.map +0 -1
  254. package/dist/evidence/adapters/sbom.d.ts +0 -35
  255. package/dist/evidence/adapters/sbom.d.ts.map +0 -1
  256. package/dist/evidence/adapters/types.d.ts +0 -86
  257. package/dist/evidence/adapters/types.d.ts.map +0 -1
  258. package/dist/evidence/index.d.ts +0 -27
  259. package/dist/evidence/index.d.ts.map +0 -1
  260. package/dist/evidence/mock-inspection.d.ts +0 -16
  261. package/dist/evidence/mock-inspection.d.ts.map +0 -1
  262. package/dist/evidence/record.d.ts +0 -58
  263. package/dist/evidence/record.d.ts.map +0 -1
  264. package/dist/evidence/store.d.ts +0 -215
  265. package/dist/evidence/store.d.ts.map +0 -1
  266. package/dist/evidence/types.d.ts +0 -281
  267. package/dist/evidence/types.d.ts.map +0 -1
  268. package/dist/evidence-OyqpqHLS.js +0 -614
  269. package/dist/flow-command-CCRTE5Oe.js +0 -88
  270. package/dist/flow-command.d.ts +0 -25
  271. package/dist/flow-command.d.ts.map +0 -1
  272. package/dist/flows.d.ts +0 -7
  273. package/dist/flows.d.ts.map +0 -1
  274. package/dist/graph-analysis/analysis.d.ts +0 -106
  275. package/dist/graph-analysis/analysis.d.ts.map +0 -1
  276. package/dist/graph-analysis/index.d.ts +0 -6
  277. package/dist/graph-analysis/index.d.ts.map +0 -1
  278. package/dist/graph-analysis/input.d.ts +0 -33
  279. package/dist/graph-analysis/input.d.ts.map +0 -1
  280. package/dist/graph-analysis/load.d.ts +0 -21
  281. package/dist/graph-analysis/load.d.ts.map +0 -1
  282. package/dist/graph-analysis/render.d.ts +0 -4
  283. package/dist/graph-analysis/render.d.ts.map +0 -1
  284. package/dist/graph-analysis-IWaoJJSN.js +0 -657
  285. package/dist/hooks/command-not-found.d.ts +0 -23
  286. package/dist/hooks/command-not-found.d.ts.map +0 -1
  287. package/dist/hooks/command-not-found.js +0 -8
  288. package/dist/index.d.ts +0 -13
  289. package/dist/index.d.ts.map +0 -1
  290. package/dist/index.js +0 -12
  291. package/dist/measurement/agent-eval-intervention.d.ts +0 -6
  292. package/dist/measurement/agent-eval-intervention.d.ts.map +0 -1
  293. package/dist/measurement/atomic-file.d.ts +0 -5
  294. package/dist/measurement/atomic-file.d.ts.map +0 -1
  295. package/dist/measurement/compare.d.ts +0 -4
  296. package/dist/measurement/compare.d.ts.map +0 -1
  297. package/dist/measurement/date-time.d.ts +0 -3
  298. package/dist/measurement/date-time.d.ts.map +0 -1
  299. package/dist/measurement/github-release-operational.d.ts +0 -7
  300. package/dist/measurement/github-release-operational.d.ts.map +0 -1
  301. package/dist/measurement/graph-adapters.d.ts +0 -304
  302. package/dist/measurement/graph-adapters.d.ts.map +0 -1
  303. package/dist/measurement/graph-portfolio-load.d.ts +0 -3
  304. package/dist/measurement/graph-portfolio-load.d.ts.map +0 -1
  305. package/dist/measurement/graph-portfolio.d.ts +0 -158
  306. package/dist/measurement/graph-portfolio.d.ts.map +0 -1
  307. package/dist/measurement/index.d.ts +0 -22
  308. package/dist/measurement/index.d.ts.map +0 -1
  309. package/dist/measurement/intervention-report.d.ts +0 -24
  310. package/dist/measurement/intervention-report.d.ts.map +0 -1
  311. package/dist/measurement/intervention-schema.d.ts +0 -144
  312. package/dist/measurement/intervention-schema.d.ts.map +0 -1
  313. package/dist/measurement/intervention-types.d.ts +0 -105
  314. package/dist/measurement/intervention-types.d.ts.map +0 -1
  315. package/dist/measurement/intervention.d.ts +0 -16
  316. package/dist/measurement/intervention.d.ts.map +0 -1
  317. package/dist/measurement/operational-report.d.ts +0 -17
  318. package/dist/measurement/operational-report.d.ts.map +0 -1
  319. package/dist/measurement/operational-schema.d.ts +0 -461
  320. package/dist/measurement/operational-schema.d.ts.map +0 -1
  321. package/dist/measurement/operational-types.d.ts +0 -121
  322. package/dist/measurement/operational-types.d.ts.map +0 -1
  323. package/dist/measurement/operational.d.ts +0 -13
  324. package/dist/measurement/operational.d.ts.map +0 -1
  325. package/dist/measurement/plans.d.ts +0 -6
  326. package/dist/measurement/plans.d.ts.map +0 -1
  327. package/dist/measurement/portfolio.d.ts +0 -54
  328. package/dist/measurement/portfolio.d.ts.map +0 -1
  329. package/dist/measurement/profiles.d.ts +0 -9
  330. package/dist/measurement/profiles.d.ts.map +0 -1
  331. package/dist/measurement/report.d.ts +0 -48
  332. package/dist/measurement/report.d.ts.map +0 -1
  333. package/dist/measurement/schemas/operational-evidence-v1.schema.json.d.ts +0 -384
  334. package/dist/measurement/store.d.ts +0 -14
  335. package/dist/measurement/store.d.ts.map +0 -1
  336. package/dist/measurement/types.d.ts +0 -85
  337. package/dist/measurement/types.d.ts.map +0 -1
  338. package/dist/measurement/validate.d.ts +0 -9
  339. package/dist/measurement/validate.d.ts.map +0 -1
  340. package/dist/measurement-j8sDSqx5.js +0 -2980
  341. package/dist/modules-DDQkKC4l.js +0 -23
  342. package/dist/modules.d.ts +0 -10
  343. package/dist/modules.d.ts.map +0 -1
  344. package/dist/org.d.ts +0 -61
  345. package/dist/org.d.ts.map +0 -1
  346. package/dist/plugins-CHpYhpEI.js +0 -77
  347. package/dist/plugins.d.ts +0 -13
  348. package/dist/plugins.d.ts.map +0 -1
  349. package/dist/quire/assurance.d.ts +0 -109
  350. package/dist/quire/assurance.d.ts.map +0 -1
  351. package/dist/quire/contract.d.ts +0 -88
  352. package/dist/quire/contract.d.ts.map +0 -1
  353. package/dist/quire/exec.d.ts +0 -66
  354. package/dist/quire/exec.d.ts.map +0 -1
  355. package/dist/quire/index.d.ts +0 -13
  356. package/dist/quire/index.d.ts.map +0 -1
  357. package/dist/quire/types.d.ts +0 -415
  358. package/dist/quire/types.d.ts.map +0 -1
  359. package/dist/quire/validate.d.ts +0 -39
  360. package/dist/quire/validate.d.ts.map +0 -1
  361. package/dist/quire-BsVj1xIR.js +0 -4968
  362. package/dist/schema-assets-HZWo_iFN.js +0 -233
  363. package/dist/schemas/assurance-v1.schema.json +0 -225
  364. package/dist/schemas/change-assurance-record-v1.schema.json +0 -234
  365. package/dist/schemas/coverage-v1.schema.json +0 -1111
  366. package/dist/schemas/operational-evidence-v1.schema.json +0 -381
  367. package/dist/schemas/proof-attestation-v1.schema.json +0 -96
  368. package/dist/schemas/properties-v1.schema.json +0 -159
  369. package/dist/schemas/verification-receipt-v1.schema.json +0 -208
  370. package/dist/validators/gates.d.ts +0 -18
  371. package/dist/validators/gates.d.ts.map +0 -1
  372. package/dist/validators/index.d.ts +0 -2
  373. package/dist/validators/index.d.ts.map +0 -1
  374. package/dist/version-CMxMIh5g.js +0 -17
  375. package/dist/version.d.ts +0 -3
  376. package/dist/version.d.ts.map +0 -1
  377. package/dist/write-CGTI0dRO.js +0 -157
  378. package/dist/write.d.ts +0 -28
  379. package/dist/write.d.ts.map +0 -1
  380. package/skills/assurance-status-report/SKILL.md +0 -135
  381. package/skills/assurance-status-report/references/report-contract.md +0 -110
  382. package/skills/gap-analysis/SKILL.md +0 -111
  383. package/skills/gap-analysis/references/step-1-target-selection.md +0 -53
  384. package/skills/gap-analysis/references/step-2-plan-completion.md +0 -49
  385. package/skills/gap-analysis/references/step-3-matrix-verification.md +0 -147
  386. package/skills/gap-analysis/references/step-4-underspecified-code.md +0 -92
  387. package/skills/gap-analysis/references/step-5-semantic-review.md +0 -51
  388. package/skills/gap-analysis/references/step-6-specreview-artifact.md +0 -108
  389. package/skills/spec-app-review/SKILL.md +0 -51
  390. package/skills/spec-app-review/references/checklist.md +0 -197
  391. package/skills/spec-architecture-evaluation/SKILL.md +0 -30
  392. package/skills/spec-correctness/SKILL.md +0 -96
  393. package/skills/spec-correctness/assets/strategy-table.md +0 -101
  394. package/skills/spec-correctness/assets/templates/fast-check.ts.md +0 -169
  395. package/skills/spec-correctness/assets/templates/hypothesis.py.md +0 -156
  396. package/skills/spec-correctness/assets/templates/proptest.rs.md +0 -147
  397. package/skills/spec-correctness/references/step-0-scope-and-harness.md +0 -94
  398. package/skills/spec-correctness/references/step-1-census.md +0 -53
  399. package/skills/spec-correctness/references/step-2-clause-grounding.md +0 -159
  400. package/skills/spec-correctness/references/step-3-strategy-selection.md +0 -85
  401. package/skills/spec-correctness/references/step-4-generate-tests.md +0 -117
  402. package/skills/spec-correctness/references/step-5-second-pass.md +0 -81
  403. package/skills/spec-correctness/references/step-6-review-artifact.md +0 -134
  404. package/skills/spec-correctness/references/step-7-report-and-handoff.md +0 -102
  405. package/skills/spec-dependency-analysis/SKILL.md +0 -90
  406. package/skills/spec-ears-analysis/SKILL.md +0 -102
  407. package/skills/spec-evidence-analysis/SKILL.md +0 -156
  408. package/skills/spec-failure-domain-analysis/SKILL.md +0 -59
  409. package/skills/spec-fuzz/SKILL.md +0 -133
  410. package/skills/spec-fuzz/assets/templates/atheris.py.md +0 -74
  411. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +0 -83
  412. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +0 -76
  413. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +0 -51
  414. package/skills/spec-fuzz/references/step-1-select-obligations.md +0 -47
  415. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +0 -55
  416. package/skills/spec-fuzz/references/step-3-emit-targets.md +0 -65
  417. package/skills/spec-fuzz/references/step-4-report.md +0 -56
  418. package/skills/spec-ideation/SKILL.md +0 -46
  419. package/skills/spec-integrity-analysis/SKILL.md +0 -62
  420. package/skills/spec-matrix/SKILL.md +0 -186
  421. package/skills/spec-matrix/assets/test-cases/TC-001.md +0 -35
  422. package/skills/spec-matrix/assets/test-cases/TC-002.md +0 -37
  423. package/skills/spec-matrix/assets/test-cases/TC-006.md +0 -50
  424. package/skills/spec-matrix/assets/test-matrix-example.md +0 -104
  425. package/skills/spec-matrix/assets/test-matrix-template.md +0 -123
  426. package/skills/spec-matrix/workflow-assets/dist/index.d.ts +0 -146
  427. package/skills/spec-matrix/workflow-assets/dist/index.d.ts.map +0 -1
  428. package/skills/spec-matrix/workflow-assets/dist/index.js +0 -7525
  429. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts +0 -6
  430. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts.map +0 -1
  431. package/skills/spec-matrix/workflow-assets/skills/matrix/SKILL.md +0 -35
  432. package/skills/spec-matrix/workflow-assets/skills/matrix/scripts/invariants.js +0 -1
  433. package/skills/spec-matrix/workflow-assets/skills/matrix/templates/report/default.md +0 -30
  434. package/skills/spec-matrix/workflow-assets/skills/matrix/workflows/matrix/def.yaml +0 -82
  435. package/skills/spec-object-review/SKILL.md +0 -125
  436. package/skills/spec-object-review/references/object-type-guide.md +0 -118
  437. package/skills/spec-review/SKILL.md +0 -92
  438. package/skills/spec-review/references/checklist.md +0 -50
  439. package/skills/spec-review/workflow-assets/dist/index.d.ts +0 -146
  440. package/skills/spec-review/workflow-assets/dist/index.d.ts.map +0 -1
  441. package/skills/spec-review/workflow-assets/dist/index.js +0 -7525
  442. package/skills/spec-review/workflow-assets/dist/invariants.d.ts +0 -6
  443. package/skills/spec-review/workflow-assets/dist/invariants.d.ts.map +0 -1
  444. package/skills/spec-review/workflow-assets/skills/review/SKILL.md +0 -96
  445. package/skills/spec-review/workflow-assets/skills/review/scripts/invariants.js +0 -61
  446. package/skills/spec-review/workflow-assets/skills/review/workflows/review/def.yaml +0 -68
  447. package/skills/spec-risk-complexity-analysis/SKILL.md +0 -92
  448. package/skills/spec-scope-boundary-analysis/SKILL.md +0 -101
  449. package/skills/spec-security-analysis/SKILL.md +0 -84
  450. package/skills/spec-security-analysis/assets/security-analysis-example.md +0 -89
  451. package/skills/spec-security-analysis/assets/security-analysis-template.md +0 -73
  452. package/skills/spec-security-analysis/references/component-type-mapping.md +0 -161
  453. package/skills/spec-security-analysis/references/gdpr/ChII-Principles.md +0 -58
  454. package/skills/spec-security-analysis/references/gdpr/ChIII-DataSubjectRights.md +0 -84
  455. package/skills/spec-security-analysis/references/gdpr/ChIV-ControllerProcessor.md +0 -83
  456. package/skills/spec-security-analysis/references/gdpr/ChV-DataTransfers.md +0 -62
  457. package/skills/spec-security-analysis/references/gdpr/index.md +0 -54
  458. package/skills/spec-security-analysis/references/iso27001/A5-OrganizationalControls.md +0 -64
  459. package/skills/spec-security-analysis/references/iso27001/A6-PeopleControls.md +0 -30
  460. package/skills/spec-security-analysis/references/iso27001/A7-PhysicalControls.md +0 -35
  461. package/skills/spec-security-analysis/references/iso27001/A8-TechnologicalControls.md +0 -66
  462. package/skills/spec-security-analysis/references/iso27001/index.md +0 -43
  463. package/skills/spec-security-analysis/references/nist-800-53/AC-AccessControl.md +0 -57
  464. package/skills/spec-security-analysis/references/nist-800-53/AU-AuditAccountability.md +0 -49
  465. package/skills/spec-security-analysis/references/nist-800-53/CM-ConfigurationManagement.md +0 -36
  466. package/skills/spec-security-analysis/references/nist-800-53/IA-IdentificationAuthentication.md +0 -44
  467. package/skills/spec-security-analysis/references/nist-800-53/SA-SystemServicesAcquisition.md +0 -50
  468. package/skills/spec-security-analysis/references/nist-800-53/SC-SystemCommunications.md +0 -53
  469. package/skills/spec-security-analysis/references/nist-800-53/SI-SystemInformationIntegrity.md +0 -52
  470. package/skills/spec-security-analysis/references/nist-800-53/index.md +0 -58
  471. package/skills/spec-security-analysis/references/owasp-asvs/V1-Architecture.md +0 -33
  472. package/skills/spec-security-analysis/references/owasp-asvs/V10-MaliciousCode.md +0 -33
  473. package/skills/spec-security-analysis/references/owasp-asvs/V11-BusinessLogic.md +0 -32
  474. package/skills/spec-security-analysis/references/owasp-asvs/V12-Files.md +0 -34
  475. package/skills/spec-security-analysis/references/owasp-asvs/V13-API.md +0 -34
  476. package/skills/spec-security-analysis/references/owasp-asvs/V14-Configuration.md +0 -35
  477. package/skills/spec-security-analysis/references/owasp-asvs/V2-Authentication.md +0 -36
  478. package/skills/spec-security-analysis/references/owasp-asvs/V3-SessionManagement.md +0 -35
  479. package/skills/spec-security-analysis/references/owasp-asvs/V4-AccessControl.md +0 -39
  480. package/skills/spec-security-analysis/references/owasp-asvs/V5-Validation.md +0 -37
  481. package/skills/spec-security-analysis/references/owasp-asvs/V6-Cryptography.md +0 -34
  482. package/skills/spec-security-analysis/references/owasp-asvs/V7-ErrorLogging.md +0 -37
  483. package/skills/spec-security-analysis/references/owasp-asvs/V8-DataProtection.md +0 -34
  484. package/skills/spec-security-analysis/references/owasp-asvs/V9-Communication.md +0 -32
  485. package/skills/spec-security-analysis/references/owasp-asvs/index.md +0 -59
  486. package/skills/spec-security-analysis/references/soc2/CC1-ControlEnvironment.md +0 -31
  487. package/skills/spec-security-analysis/references/soc2/CC2-CommunicationInformation.md +0 -27
  488. package/skills/spec-security-analysis/references/soc2/CC3-RiskAssessment.md +0 -29
  489. package/skills/spec-security-analysis/references/soc2/CC4-MonitoringActivities.md +0 -27
  490. package/skills/spec-security-analysis/references/soc2/CC5-ControlActivities.md +0 -28
  491. package/skills/spec-security-analysis/references/soc2/CC6-LogicalPhysicalAccess.md +0 -45
  492. package/skills/spec-security-analysis/references/soc2/CC7-SystemOperations.md +0 -42
  493. package/skills/spec-security-analysis/references/soc2/CC8-ChangeManagement.md +0 -32
  494. package/skills/spec-security-analysis/references/soc2/CC9-RiskMitigation.md +0 -34
  495. package/skills/spec-security-analysis/references/soc2/index.md +0 -46
  496. package/skills/spec-security-analysis/references/standards-index.md +0 -46
  497. package/skills/spec-to-plan/SKILL.md +0 -88
  498. package/skills/spec-to-plan/references/step-0-plan-selection.md +0 -121
  499. package/skills/spec-to-plan/references/step-1-analysis.md +0 -88
  500. package/skills/spec-to-plan/references/step-2-test-plan.md +0 -43
  501. package/skills/spec-to-plan/references/step-3-execution-plan.md +0 -218
  502. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts +0 -146
  503. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts.map +0 -1
  504. package/skills/spec-to-plan/workflow-assets/dist/index.js +0 -7525
  505. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts +0 -6
  506. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts.map +0 -1
  507. package/skills/spec-to-plan/workflow-assets/skills/to-plan/SKILL.md +0 -35
  508. package/skills/spec-to-plan/workflow-assets/skills/to-plan/scripts/invariants.js +0 -1
  509. package/skills/spec-to-plan/workflow-assets/skills/to-plan/templates/implementation-plan/default.md +0 -44
  510. package/skills/spec-to-plan/workflow-assets/skills/to-plan/workflows/to-plan/def.yaml +0 -85
  511. package/skills/specify/SKILL.md +0 -154
  512. package/skills/specify/assets/app-spec-template.md +0 -143
  513. package/skills/specify/assets/spec-template.md +0 -299
  514. package/skills/specify/references/integration-tests.md +0 -72
  515. package/skills/specify/references/us-to-fr.md +0 -40
  516. package/skills/specify/references/writing-good-requirements.md +0 -61
@@ -1,1236 +0,0 @@
1
- import { y as e } from "./schema-assets-HZWo_iFN.js";
2
- import { closeSync as t, existsSync as n, fsyncSync as r, mkdirSync as i, mkdtempSync as a, openSync as o, readFileSync as s, readdirSync as c, renameSync as l, rmSync as u, writeSync as d } from "node:fs";
3
- import { dirname as f, join as p } from "node:path";
4
- import { createHash as m } from "node:crypto";
5
- //#region node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/utils.js
6
- function h(e) {
7
- return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in e && e.BYTES_PER_ELEMENT === 1;
8
- }
9
- function g(e, t = "") {
10
- if (typeof e != "number") {
11
- let n = t && `"${t}" `;
12
- throw TypeError(`${n}expected number, got ${typeof e}`);
13
- }
14
- if (!Number.isSafeInteger(e) || e < 0) {
15
- let n = t && `"${t}" `;
16
- throw RangeError(`${n}expected integer >= 0, got ${e}`);
17
- }
18
- }
19
- function _(e, t, n = "") {
20
- let r = h(e), i = e?.length, a = t !== void 0;
21
- if (!r || a && i !== t) {
22
- let o = n && `"${n}" `, s = a ? ` of length ${t}` : "", c = r ? `length=${i}` : `type=${typeof e}`, l = o + "expected Uint8Array" + s + ", got " + c;
23
- throw r ? RangeError(l) : TypeError(l);
24
- }
25
- return e;
26
- }
27
- function v(e) {
28
- return Uint8Array.from(_(e));
29
- }
30
- function y(e, t = !0) {
31
- if (e.destroyed) throw Error("Hash instance has been destroyed");
32
- if (t && e.finished) throw Error("Hash#digest() has already been called");
33
- }
34
- function b(e, t) {
35
- _(e, void 0, "digestInto() output");
36
- let n = t.outputLen;
37
- if (e.length < n) throw RangeError("\"digestInto() output\" expected to be of length >=" + n);
38
- }
39
- function x(e) {
40
- return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
41
- }
42
- function S(e) {
43
- return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
44
- }
45
- function C(...e) {
46
- for (let t = 0; t < e.length; t++) e[t].fill(0);
47
- }
48
- function w(e, t) {
49
- return e << 32 - t | e >>> t;
50
- }
51
- var ee = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
52
- function te(e) {
53
- return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
54
- }
55
- var ne = ee ? (e) => e : (e) => te(e) >>> 0;
56
- function re(e) {
57
- for (let t = 0; t < e.length; t++) e[t] = te(e[t]);
58
- return e;
59
- }
60
- var T = ee ? (e) => e : re, ie = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", ae = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
61
- function oe(e) {
62
- if (_(e), ie) return e.toHex();
63
- let t = "";
64
- for (let n = 0; n < e.length; n++) t += ae[e[n]];
65
- return t;
66
- }
67
- function se(e, t = {}) {
68
- let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
69
- return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
70
- }
71
- //#endregion
72
- //#region node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_md.js
73
- var ce = /* @__PURE__ */ Uint32Array.from([
74
- 1779033703,
75
- 3144134277,
76
- 1013904242,
77
- 2773480762,
78
- 1359893119,
79
- 2600822924,
80
- 528734635,
81
- 1541459225
82
- ]), E = /* @__PURE__ */ BigInt(2 ** 32 - 1), le = /* @__PURE__ */ BigInt(32);
83
- function ue(e, t = !1) {
84
- return t ? {
85
- h: Number(e & E),
86
- l: Number(e >> le & E)
87
- } : {
88
- h: Number(e >> le & E) | 0,
89
- l: Number(e & E) | 0
90
- };
91
- }
92
- //#endregion
93
- //#region node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_blake.js
94
- function D(e, t, n, r, i) {
95
- return e = e + t + i | 0, r = w(r ^ e, 16), n = n + r | 0, t = w(t ^ n, 12), {
96
- a: e,
97
- b: t,
98
- c: n,
99
- d: r
100
- };
101
- }
102
- function O(e, t, n, r, i) {
103
- return e = e + t + i | 0, r = w(r ^ e, 8), n = n + r | 0, t = w(t ^ n, 7), {
104
- a: e,
105
- b: t,
106
- c: n,
107
- d: r
108
- };
109
- }
110
- //#endregion
111
- //#region node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/blake2.js
112
- var de = class {
113
- buffer;
114
- buffer32;
115
- finished = !1;
116
- destroyed = !1;
117
- length = 0;
118
- pos = 0;
119
- blockLen;
120
- outputLen;
121
- canXOF = !1;
122
- constructor(e, t) {
123
- g(e), g(t), this.blockLen = e, this.outputLen = t, this.buffer = new Uint8Array(e), this.buffer32 = S(this.buffer);
124
- }
125
- update(e) {
126
- y(this), _(e);
127
- let { blockLen: t, buffer: n, buffer32: r } = this, i = e.length, a = e.byteOffset, o = e.buffer;
128
- for (let s = 0; s < i;) {
129
- this.pos === t && (T(r), this.compress(r, 0, !1), T(r), this.pos = 0);
130
- let c = Math.min(t - this.pos, i - s), l = a + s;
131
- if (c === t && !(l % 4) && s + c < i) {
132
- let e = new Uint32Array(o, l, Math.floor((i - s) / 4));
133
- T(e);
134
- for (let n = 0; s + t < i; n += r.length, s += t) this.length += t, this.compress(e, n, !1);
135
- T(e);
136
- continue;
137
- }
138
- n.set(e.subarray(s, s + c), this.pos), this.pos += c, this.length += c, s += c;
139
- }
140
- return this;
141
- }
142
- digestInto(e) {
143
- y(this), b(e, this);
144
- let { pos: t, buffer32: n } = this;
145
- if (this.finished = !0, C(this.buffer.subarray(t)), T(n), this.compress(n, 0, !0), T(n), e.byteOffset & 3) throw RangeError("\"digestInto() output\" expected 4-byte aligned byteOffset, got " + e.byteOffset);
146
- let r = this.get(), i = S(e), a = Math.floor(this.outputLen / 4);
147
- for (let e = 0; e < a; e++) i[e] = ne(r[e]);
148
- let o = this.outputLen % 4;
149
- if (!o) return;
150
- let s = a * 4, c = r[a];
151
- for (let t = 0; t < o; t++) e[s + t] = c >>> 8 * t;
152
- }
153
- digest() {
154
- let { buffer: e, outputLen: t } = this;
155
- this.digestInto(e);
156
- let n = e.slice(0, t);
157
- return this.destroy(), n;
158
- }
159
- _cloneInto(e) {
160
- let { buffer: t, length: n, finished: r, destroyed: i, outputLen: a, pos: o } = this;
161
- return e ||= new this.constructor({ dkLen: a }), e.set(...this.get()), e.buffer.set(t), e.destroyed = i, e.finished = r, e.length = n, e.pos = o, e.outputLen = a, e;
162
- }
163
- clone() {
164
- return this._cloneInto();
165
- }
166
- };
167
- function fe(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y) {
168
- let b = 0;
169
- for (let x = 0; x < r; x++) ({a: i, b: c, c: f, d: g} = D(i, c, f, g, n[t + e[b++]])), {a: i, b: c, c: f, d: g} = O(i, c, f, g, n[t + e[b++]]), {a: a, b: l, c: p, d: _} = D(a, l, p, _, n[t + e[b++]]), {a: a, b: l, c: p, d: _} = O(a, l, p, _, n[t + e[b++]]), {a: o, b: u, c: m, d: v} = D(o, u, m, v, n[t + e[b++]]), {a: o, b: u, c: m, d: v} = O(o, u, m, v, n[t + e[b++]]), {a: s, b: d, c: h, d: y} = D(s, d, h, y, n[t + e[b++]]), {a: s, b: d, c: h, d: y} = O(s, d, h, y, n[t + e[b++]]), {a: i, b: l, c: m, d: y} = D(i, l, m, y, n[t + e[b++]]), {a: i, b: l, c: m, d: y} = O(i, l, m, y, n[t + e[b++]]), {a: a, b: u, c: h, d: g} = D(a, u, h, g, n[t + e[b++]]), {a: a, b: u, c: h, d: g} = O(a, u, h, g, n[t + e[b++]]), {a: o, b: d, c: f, d: _} = D(o, d, f, _, n[t + e[b++]]), {a: o, b: d, c: f, d: _} = O(o, d, f, _, n[t + e[b++]]), {a: s, b: c, c: p, d: v} = D(s, c, p, v, n[t + e[b++]]), {a: s, b: c, c: p, d: v} = O(s, c, p, v, n[t + e[b++]]);
170
- return {
171
- v0: i,
172
- v1: a,
173
- v2: o,
174
- v3: s,
175
- v4: c,
176
- v5: l,
177
- v6: u,
178
- v7: d,
179
- v8: f,
180
- v9: p,
181
- v10: m,
182
- v11: h,
183
- v12: g,
184
- v13: _,
185
- v14: v,
186
- v15: y
187
- };
188
- }
189
- //#endregion
190
- //#region node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/blake3.js
191
- var k = {
192
- CHUNK_START: 1,
193
- CHUNK_END: 2,
194
- PARENT: 4,
195
- ROOT: 8,
196
- KEYED_HASH: 16,
197
- DERIVE_KEY_CONTEXT: 32,
198
- DERIVE_KEY_MATERIAL: 64
199
- }, A = /* @__PURE__ */ ce.slice(), pe = /* @__PURE__ */ (() => {
200
- let e = Array.from({ length: 16 }, (e, t) => t), t = (e) => [
201
- 2,
202
- 6,
203
- 3,
204
- 10,
205
- 7,
206
- 0,
207
- 4,
208
- 13,
209
- 1,
210
- 11,
211
- 12,
212
- 5,
213
- 9,
214
- 14,
215
- 15,
216
- 8
217
- ].map((t) => e[t]), n = [];
218
- for (let r = 0, i = e; r < 7; r++, i = t(i)) n.push(...i);
219
- return Uint8Array.from(n);
220
- })(), me = class e extends de {
221
- canXOF = !0;
222
- chunkPos = 0;
223
- chunksDone = 0;
224
- flags = 0;
225
- IV;
226
- state;
227
- stack = [];
228
- posOut = 0;
229
- bufferOut32 = /* @__PURE__ */ new Uint32Array(16);
230
- bufferOut;
231
- chunkOut = 0;
232
- enableXOF = !0;
233
- constructor(t = {}, n = 0) {
234
- super(64, t.dkLen === void 0 ? 32 : t.dkLen);
235
- let { key: r, context: i } = t, a = i !== void 0;
236
- if (r !== void 0) {
237
- if (a) throw Error("Only \"key\" or \"context\" can be specified at same time");
238
- _(r, 32, "key");
239
- let e = v(r);
240
- this.IV = S(e), T(this.IV), this.flags = n | k.KEYED_HASH;
241
- } else if (a) {
242
- _(i, void 0, "context");
243
- let t = i, r = new e({ dkLen: 32 }, k.DERIVE_KEY_CONTEXT).update(t).digest();
244
- this.IV = S(r), T(this.IV), this.flags = n | k.DERIVE_KEY_MATERIAL;
245
- } else this.IV = A.slice(), this.flags = n;
246
- this.state = this.IV.slice(), this.bufferOut = x(this.bufferOut32);
247
- }
248
- get() {
249
- return [];
250
- }
251
- set() {}
252
- b2Compress(e, t, n, r = 0) {
253
- let { state: i, pos: a } = this, { h: o, l: s } = ue(BigInt(e), !0), { v0: c, v1: l, v2: u, v3: d, v4: f, v5: p, v6: m, v7: h, v8: g, v9: _, v10: v, v11: y, v12: b, v13: x, v14: S, v15: C } = fe(pe, r, n, 7, i[0], i[1], i[2], i[3], i[4], i[5], i[6], i[7], A[0], A[1], A[2], A[3], o, s, a, t);
254
- i[0] = c ^ g, i[1] = l ^ _, i[2] = u ^ v, i[3] = d ^ y, i[4] = f ^ b, i[5] = p ^ x, i[6] = m ^ S, i[7] = h ^ C;
255
- }
256
- compress(e, t = 0, n = !1) {
257
- let r = this.flags;
258
- if (this.chunkPos || (r |= k.CHUNK_START), (this.chunkPos === 15 || n) && (r |= k.CHUNK_END), n || (this.pos = this.blockLen), this.b2Compress(this.chunksDone, r, e, t), this.chunkPos += 1, this.chunkPos === 16 || n) {
259
- let e = this.state;
260
- this.state = this.IV.slice();
261
- for (let t, r = this.chunksDone + 1; (n || !(r & 1)) && (t = this.stack.pop()); r >>= 1) this.buffer32.set(t, 0), this.buffer32.set(e, 8), this.pos = this.blockLen, this.b2Compress(0, this.flags | k.PARENT, this.buffer32, 0), e = this.state, this.state = this.IV.slice();
262
- this.chunksDone++, this.chunkPos = 0, this.stack.push(e);
263
- }
264
- this.pos = 0;
265
- }
266
- _cloneInto(e) {
267
- e = super._cloneInto(e);
268
- let { IV: t, flags: n, state: r, chunkPos: i, posOut: a, chunkOut: o, stack: s, chunksDone: c } = this;
269
- return e.state.set(r.slice()), e.stack = s.map((e) => Uint32Array.from(e)), e.IV.set(t), e.flags = n, e.chunkPos = i, e.chunksDone = c, e.posOut = a, e.chunkOut = o, e.enableXOF = this.enableXOF, e.bufferOut32.set(this.bufferOut32), e;
270
- }
271
- destroy() {
272
- this.destroyed = !0, C(this.state, this.buffer32, this.IV, this.bufferOut32), C(...this.stack);
273
- }
274
- b2CompressOut() {
275
- let { state: e, pos: t, flags: n, buffer32: r, bufferOut32: i } = this, { h: a, l: o } = ue(BigInt(this.chunkOut++));
276
- T(r);
277
- let { v0: s, v1: c, v2: l, v3: u, v4: d, v5: f, v6: p, v7: m, v8: h, v9: g, v10: _, v11: v, v12: y, v13: b, v14: x, v15: S } = fe(pe, 0, r, 7, e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], A[0], A[1], A[2], A[3], o, a, t, n);
278
- i[0] = s ^ h, i[1] = c ^ g, i[2] = l ^ _, i[3] = u ^ v, i[4] = d ^ y, i[5] = f ^ b, i[6] = p ^ x, i[7] = m ^ S, i[8] = e[0] ^ h, i[9] = e[1] ^ g, i[10] = e[2] ^ _, i[11] = e[3] ^ v, i[12] = e[4] ^ y, i[13] = e[5] ^ b, i[14] = e[6] ^ x, i[15] = e[7] ^ S, T(r), T(i), this.posOut = 0;
279
- }
280
- finish() {
281
- if (this.finished) return;
282
- this.finished = !0, C(this.buffer.subarray(this.pos));
283
- let e = this.flags | k.ROOT;
284
- this.stack.length ? (e |= k.PARENT, T(this.buffer32), this.compress(this.buffer32, 0, !0), T(this.buffer32), this.chunksDone = 0, this.pos = this.blockLen) : e |= (this.chunkPos ? 0 : k.CHUNK_START) | k.CHUNK_END, this.flags = e, this.b2CompressOut();
285
- }
286
- writeInto(e) {
287
- y(this, !1), _(e), this.finish();
288
- let { blockLen: t, bufferOut: n } = this;
289
- for (let r = 0, i = e.length; r < i;) {
290
- this.posOut >= t && this.b2CompressOut();
291
- let a = Math.min(t - this.posOut, i - r);
292
- e.set(n.subarray(this.posOut, this.posOut + a), r), this.posOut += a, r += a;
293
- }
294
- return e;
295
- }
296
- xofInto(e) {
297
- if (!this.enableXOF) throw Error("XOF is not possible after digest call");
298
- return this.writeInto(e);
299
- }
300
- xof(e) {
301
- return g(e), this.xofInto(new Uint8Array(e));
302
- }
303
- digestInto(e) {
304
- if (b(e, this), this.finished) throw Error("digest() was already called");
305
- this.enableXOF = !1, this.writeInto(e.subarray(0, this.outputLen)), this.destroy();
306
- }
307
- digest() {
308
- let e = new Uint8Array(this.outputLen);
309
- return this.digestInto(e), e;
310
- }
311
- }, he = /* @__PURE__ */ se((e = {}) => new me(e)), ge = new TextEncoder(), j = class extends Error {
312
- constructor(e) {
313
- super(e), this.name = "IntegrityError";
314
- }
315
- };
316
- function M(e) {
317
- return oe(he(e));
318
- }
319
- function N(e) {
320
- let t;
321
- if (typeof e == "string") t = e;
322
- else try {
323
- t = new TextDecoder("utf-8", { fatal: !0 }).decode(e);
324
- } catch {
325
- throw new j("input is not valid UTF-8");
326
- }
327
- if (t.charCodeAt(0) === 65279) throw new j("a byte-order mark is not permitted");
328
- return new _e(t).parse();
329
- }
330
- var _e = class {
331
- text;
332
- offset = 0;
333
- constructor(e) {
334
- this.text = e;
335
- }
336
- parse() {
337
- let e = this.value();
338
- return this.space(), this.offset !== this.text.length && this.fail("trailing JSON content"), e;
339
- }
340
- value() {
341
- this.space();
342
- let e = this.text[this.offset];
343
- return e === "{" ? this.object() : e === "[" ? this.array() : e === "\"" ? this.string() : e === "t" ? this.literal("true", !0) : e === "f" ? this.literal("false", !1) : e === "n" ? this.literal("null", null) : this.number();
344
- }
345
- object() {
346
- this.offset++, this.space();
347
- let e = Object.create(null), t = /* @__PURE__ */ new Set();
348
- if (this.take("}")) return e;
349
- for (;;) {
350
- this.space(), this.text[this.offset] !== "\"" && this.fail("object key must be a string");
351
- let n = this.string();
352
- if (t.has(n) && this.fail(`duplicate object name ${JSON.stringify(n)}`), t.add(n), this.space(), this.take(":") || this.fail("expected ':' after object key"), e[n] = this.value(), this.space(), this.take("}")) return e;
353
- this.take(",") || this.fail("expected ',' or '}' in object");
354
- }
355
- }
356
- array() {
357
- this.offset++, this.space();
358
- let e = [];
359
- if (this.take("]")) return e;
360
- for (;;) {
361
- if (e.push(this.value()), this.space(), this.take("]")) return e;
362
- this.take(",") || this.fail("expected ',' or ']' in array");
363
- }
364
- }
365
- string() {
366
- let e = this.offset;
367
- this.offset++;
368
- let t = !1;
369
- for (; this.offset < this.text.length;) {
370
- let n = this.text.charCodeAt(this.offset);
371
- if (!t && n === 34) {
372
- this.offset++;
373
- let t;
374
- try {
375
- t = JSON.parse(this.text.slice(e, this.offset));
376
- } catch {
377
- this.fail("invalid JSON string");
378
- }
379
- return ye(t), t;
380
- }
381
- !t && n < 32 && this.fail("unescaped control character"), t = !t && n === 92, this.offset++;
382
- }
383
- this.fail("unterminated JSON string");
384
- }
385
- number() {
386
- let e = this.text.slice(this.offset), t = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(e);
387
- t || this.fail("expected a JSON value"), this.offset += t[0].length;
388
- let n = Number(t[0]);
389
- return Number.isFinite(n) || this.fail("number is not finite I-JSON"), n;
390
- }
391
- literal(e, t) {
392
- return this.text.slice(this.offset, this.offset + e.length) !== e && this.fail(`expected ${e}`), this.offset += e.length, t;
393
- }
394
- take(e) {
395
- return this.text[this.offset] === e && (this.offset++, !0);
396
- }
397
- space() {
398
- for (; [
399
- " ",
400
- " ",
401
- "\r",
402
- "\n"
403
- ].includes(this.text[this.offset] ?? "");) this.offset++;
404
- }
405
- fail(e) {
406
- throw new j(`${e} at byte ${this.offset}`);
407
- }
408
- };
409
- function P(e) {
410
- if (e === null) return "null";
411
- if (typeof e == "boolean") return e ? "true" : "false";
412
- if (typeof e == "number") {
413
- if (!Number.isFinite(e)) throw new j("non-finite I-JSON number");
414
- return JSON.stringify(e);
415
- }
416
- if (typeof e == "string") return ye(e), JSON.stringify(e);
417
- if (Array.isArray(e)) return `[${e.map(P).join(",")}]`;
418
- if (typeof e != "object" || e === void 0) throw new j(`unsupported JSON value: ${typeof e}`);
419
- let t = e;
420
- return `{${Object.keys(t).sort().map((e) => {
421
- if (t[e] === void 0) throw new j(`undefined member ${e}`);
422
- return ye(e), `${JSON.stringify(e)}:${P(t[e])}`;
423
- }).join(",")}}`;
424
- }
425
- function F(e) {
426
- return ge.encode(P(e));
427
- }
428
- function I(e) {
429
- let t = { ...e };
430
- return delete t.digest, M(F(t));
431
- }
432
- function ve(e) {
433
- let t = e.digest;
434
- if (typeof t != "string" || !/^[a-f0-9]{64}$/.test(t)) throw new j("digest must be exactly 64 lowercase hexadecimal characters");
435
- if (I(e) !== t) throw new j("digest mismatch");
436
- }
437
- function ye(e) {
438
- for (let t = 0; t < e.length; t++) {
439
- let n = e.charCodeAt(t);
440
- if (n >= 55296 && n <= 56319) {
441
- let n = e.charCodeAt(t + 1);
442
- if (!(n >= 56320 && n <= 57343)) throw new j("invalid Unicode lone high surrogate");
443
- t++;
444
- } else if (n >= 56320 && n <= 57343) throw new j("invalid Unicode lone low surrogate");
445
- }
446
- }
447
- //#endregion
448
- //#region src/change-assurance/records.ts
449
- var be = /^[a-f0-9]{64}$/, xe = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;
450
- function Se(e) {
451
- let t = { ...e };
452
- delete t.digest;
453
- let n = Ee(t);
454
- De(n, !1);
455
- let r = I(n);
456
- return L({
457
- ...n,
458
- digest: r
459
- });
460
- }
461
- function L(e) {
462
- return De(e, !0), ve(e), e;
463
- }
464
- function Ce(e) {
465
- return F(L(e));
466
- }
467
- function we(e, t) {
468
- L(e);
469
- let n = t.slice().sort((e, t) => e.revision - t.revision);
470
- if (e.revision === 1) {
471
- if (e.parent_digest !== null || n.length !== 0) throw Error("revision 1 must have a null parent and no parent chain");
472
- return [];
473
- }
474
- if (n.length !== e.revision - 1) throw Error("revision gap in parent chain");
475
- let r = null;
476
- for (let t = 0; t < n.length; t++) {
477
- let i = L(n[t]);
478
- if (i.record_id !== e.record_id) throw Error("cross-record parent");
479
- if (i.revision !== t + 1) throw Error("revision gap in parent chain");
480
- if (i.parent_digest !== r) throw Error("parent digest mismatch");
481
- r = i.digest;
482
- }
483
- if (e.parent_digest !== r) throw Error("immediate parent mismatch");
484
- return n.map((e) => e.digest);
485
- }
486
- function Te(e, t) {
487
- if (!t) return {
488
- outcome: "incomplete",
489
- reasons: ["event_chain_missing"],
490
- event: null
491
- };
492
- try {
493
- let e = R(t, "decision history");
494
- z(e, ["run_id", "events"]), H(e.run_id, "decision history run_id"), B(e.events, "decision history events", !1);
495
- } catch {
496
- return {
497
- outcome: "invalid",
498
- reasons: ["event_chain_invalid"],
499
- event: null
500
- };
501
- }
502
- if (!Me(t.events)) return {
503
- outcome: "invalid",
504
- reasons: ["event_chain_invalid"],
505
- event: null
506
- };
507
- if (t.run_id !== e.review_workflow.run_id) return {
508
- outcome: "invalid",
509
- reasons: ["decision_mismatch"],
510
- event: null
511
- };
512
- if (t.events.length === 0) return {
513
- outcome: "incomplete",
514
- reasons: ["decision_missing"],
515
- event: null
516
- };
517
- let n = t.events.filter((t) => t.kind === e.review_workflow.decision_event_kind);
518
- if (n.length === 0) return {
519
- outcome: "incomplete",
520
- reasons: ["decision_missing"],
521
- event: null
522
- };
523
- let r = n.filter((t) => {
524
- try {
525
- z(R(t, "decision event"), [
526
- "id",
527
- "ts",
528
- "actor",
529
- "kind",
530
- "payload",
531
- "prevHash",
532
- "hash"
533
- ]), H(t.id, "decision event id"), V(t.ts, "decision event timestamp"), U(t.prevHash, "decision previous hash"), U(t.hash, "decision event hash"), z(R(t.actor, "decision actor"), [
534
- "kind",
535
- "id",
536
- ...t.actor.ackToken === void 0 ? [] : ["ackToken"]
537
- ]), q(t.actor.kind, [
538
- "agent",
539
- "human",
540
- "service"
541
- ], "decision actor kind"), V(t.actor.id, "decision actor id"), t.actor.ackToken !== void 0 && V(t.actor.ackToken, "decision actor ackToken");
542
- let n = R(t.payload, "decision payload");
543
- z(n, [
544
- "schema_version",
545
- "record_id",
546
- "revision",
547
- "record_digest",
548
- "decision",
549
- ...n.note === void 0 ? [] : ["note"]
550
- ]);
551
- let r = n;
552
- return r.note !== void 0 && V(r.note, "decision note"), t.actor.kind === "human" && r.schema_version === 1 && r.record_id === e.record_id && r.revision === e.revision && r.record_digest === e.digest && [
553
- "approved",
554
- "rejected",
555
- "revise"
556
- ].includes(r.decision);
557
- } catch {
558
- return !1;
559
- }
560
- });
561
- if (r.length !== 1 || r.length !== n.length) return {
562
- outcome: "invalid",
563
- reasons: ["decision_mismatch"],
564
- event: null
565
- };
566
- let i = r[0], a = i.payload, o = {
567
- run_id: t.run_id,
568
- event_id: i.id,
569
- event_hash: i.hash,
570
- chain_tail_hash: t.events.at(-1)?.hash ?? i.hash,
571
- recorded_actor: i.actor.id,
572
- decision: a.decision
573
- };
574
- return a.decision === "rejected" ? {
575
- outcome: "invalid",
576
- reasons: ["review_rejected"],
577
- event: o
578
- } : a.decision === "revise" ? {
579
- outcome: "invalid",
580
- reasons: ["review_revision_requested"],
581
- event: o
582
- } : {
583
- outcome: "valid",
584
- reasons: [],
585
- event: o
586
- };
587
- }
588
- function Ee(e) {
589
- let t = structuredClone(e);
590
- t.subject.scope.sort(), t.source_connections.sort((e, t) => Y(e.source_id, t.source_id)), t.impact_snapshot.gaps.sort(), t.definition.requirements.sort((e, t) => Y(e.id, t.id)), t.definition.preservation_constraints.sort((e, t) => Y(e.id, t.id)), t.definition.proof_obligations.sort((e, t) => Y(e.proof_id, t.proof_id)), t.definition.unknowns.sort((e, t) => Y(e.id, t.id));
591
- for (let e of t.definition.requirements) e.source_ids.sort();
592
- for (let e of t.definition.preservation_constraints) e.source_ids.sort();
593
- for (let e of t.definition.proof_obligations) e.obligation_ids.sort();
594
- return t;
595
- }
596
- function De(e, t) {
597
- let n = R(e, "record");
598
- z(n, [
599
- "schema_version",
600
- "record_type",
601
- "record_id",
602
- "revision",
603
- "parent_digest",
604
- ...t ? ["digest"] : [],
605
- "subject",
606
- "source_connections",
607
- "impact_snapshot",
608
- "definition",
609
- "review_workflow"
610
- ]), Pe(n.schema_version, 1, "schema_version"), Pe(n.record_type, "change_assurance", "record_type"), H(n.record_id, "record_id"), (!Number.isInteger(n.revision) || n.revision < 1) && J("revision"), n.parent_digest !== null && U(n.parent_digest, "parent_digest"), n.revision === 1 && n.parent_digest !== null && J("revision 1 parent_digest"), n.revision > 1 && n.parent_digest === null && J("successor parent_digest"), t && U(n.digest, "digest");
611
- let r = R(n.subject, "subject");
612
- z(r, [
613
- "repository",
614
- "base_revision",
615
- "scope"
616
- ]), V(r.repository, "subject.repository"), V(r.base_revision, "subject.base_revision"), W(r.scope, "subject.scope", !0, !0), K(r.scope, (e) => e, "subject.scope");
617
- let i = B(n.source_connections, "source_connections", !0);
618
- G(i.map((e, t) => {
619
- let n = R(e, `source_connections[${t}]`);
620
- return z(n, [
621
- "source_id",
622
- "kind",
623
- "revision",
624
- "digest"
625
- ]), H(n.source_id, "source_id"), q(n.kind, [
626
- "requirement",
627
- "test",
628
- "api",
629
- "architecture",
630
- "impact_evidence",
631
- "recovery_evidence",
632
- "other"
633
- ], "source kind"), V(n.revision, "source revision"), U(n.digest, "source digest"), n.source_id;
634
- }), "duplicate source identity"), K(i, (e) => e.source_id, "source_connections");
635
- let a = R(n.impact_snapshot, "impact_snapshot");
636
- z(a, [
637
- "identity",
638
- "revision",
639
- "digest",
640
- "completeness",
641
- "truncated",
642
- "gaps"
643
- ]), H(a.identity, "impact identity"), V(a.revision, "impact revision"), U(a.digest, "impact digest"), q(a.completeness, ["complete", "incomplete"], "impact completeness"), typeof a.truncated != "boolean" && J("impact truncated"), W(a.gaps, "impact gaps", !1, !1), K(a.gaps, (e) => e, "impact gaps");
644
- let o = R(n.definition, "definition");
645
- z(o, [
646
- "requirements",
647
- "preservation_constraints",
648
- "proof_obligations",
649
- "unknowns"
650
- ]), G(Oe(o.requirements, "requirements", !0), "duplicate requirement identity"), K(B(o.requirements, "requirements", !0), (e) => e.id, "requirements"), G(Oe(o.preservation_constraints, "preservation_constraints", !1), "duplicate constraint identity"), K(B(o.preservation_constraints, "preservation_constraints", !1), (e) => e.id, "preservation_constraints");
651
- let s = B(o.proof_obligations, "proof_obligations", !0);
652
- G(s.map((e, t) => {
653
- let n = R(e, `proof_obligations[${t}]`);
654
- return z(n, [
655
- "proof_id",
656
- "statement",
657
- "obligation_ids",
658
- "evidence_kind",
659
- "command",
660
- "tool_identity",
661
- "configuration_digest"
662
- ]), H(n.proof_id, "proof_id"), V(n.statement, "proof statement"), W(n.obligation_ids, "obligation_ids", !0, !0), K(n.obligation_ids, (e) => e, "obligation_ids"), V(n.evidence_kind, "evidence_kind"), ke(n.command), V(n.tool_identity, "tool_identity"), U(n.configuration_digest, "configuration_digest"), n.proof_id;
663
- }), "duplicate proof identity"), K(s, (e) => e.proof_id, "proof_obligations");
664
- let c = B(o.unknowns, "unknowns", !1);
665
- G(c.map((e, t) => {
666
- let n = R(e, `unknowns[${t}]`);
667
- return z(n, [
668
- "id",
669
- "statement",
670
- "disposition",
671
- "owner",
672
- ...n.resolution === void 0 ? [] : ["resolution"]
673
- ]), H(n.id, "unknown id"), V(n.statement, "unknown statement"), V(n.owner, "unknown owner"), q(n.disposition, [
674
- "open",
675
- "accepted",
676
- "deferred",
677
- "resolved"
678
- ], "unknown disposition"), n.disposition === "resolved" ? V(n.resolution, "unknown resolution") : n.resolution !== void 0 && J("non-resolved unknown resolution"), n.id;
679
- }), "duplicate unknown identity"), K(c, (e) => e.id, "unknowns");
680
- let l = R(n.review_workflow, "review_workflow");
681
- z(l, ["run_id", "decision_event_kind"]), H(l.run_id, "run_id"), Pe(l.decision_event_kind, "change_assurance.review_decided", "decision_event_kind");
682
- }
683
- function Oe(e, t, n) {
684
- return B(e, t, n).map((e, n) => {
685
- let r = R(e, `${t}[${n}]`);
686
- return z(r, [
687
- "id",
688
- "statement",
689
- "source_ids"
690
- ]), H(r.id, `${t} id`), V(r.statement, `${t} statement`), W(r.source_ids, `${t} source_ids`, !0, !0), K(r.source_ids, (e) => e, `${t} source_ids`), r.id;
691
- });
692
- }
693
- function ke(e) {
694
- let t = R(e, "command");
695
- z(t, ["argv", "working_directory"]);
696
- let n = B(t.argv, "argv", !0);
697
- for (let e of n) typeof e != "string" && J("argv");
698
- let r = V(t.working_directory, "working_directory"), i = r.split("/");
699
- r !== "." && (r.startsWith("/") || r.includes("\\") || r.endsWith("/") || i.some((e) => e === "" || e === ".." || e === ".")) && J("working_directory must be normalized repository-relative POSIX path");
700
- }
701
- var Ae = "0".repeat(64);
702
- function je(e) {
703
- return m("sha256").update(Ne({
704
- id: e.id,
705
- ts: e.ts,
706
- actor: e.actor,
707
- kind: e.kind,
708
- payload: e.payload,
709
- prevHash: e.prevHash
710
- })).digest("hex");
711
- }
712
- function Me(e) {
713
- let t = Ae;
714
- for (let n of e) {
715
- try {
716
- if (z(R(n, "ix-flow event"), [
717
- "id",
718
- "ts",
719
- "actor",
720
- "kind",
721
- "payload",
722
- "prevHash",
723
- "hash"
724
- ]), n.prevHash !== t || n.hash !== je(n)) return !1;
725
- } catch {
726
- return !1;
727
- }
728
- t = n.hash;
729
- }
730
- return !0;
731
- }
732
- function Ne(e) {
733
- if (Array.isArray(e)) return `[${e.map(Ne).join(",")}]`;
734
- if (typeof e == "object" && e) {
735
- let t = e;
736
- return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${Ne(t[e])}`).join(",")}}`;
737
- }
738
- return JSON.stringify(e);
739
- }
740
- function R(e, t) {
741
- (typeof e != "object" || !e || Array.isArray(e)) && J(`${t} object`);
742
- let n = Object.getPrototypeOf(e);
743
- return n !== Object.prototype && n !== null && J(`${t} plain object`), e;
744
- }
745
- function z(e, t) {
746
- let n = new Set(t);
747
- for (let t of Object.keys(e)) n.has(t) || J(`extra field ${t}`);
748
- for (let t of n) Object.hasOwn(e, t) || J(`missing field ${t}`);
749
- }
750
- function B(e, t, n) {
751
- return (!Array.isArray(e) || n && e.length === 0) && J(t), e;
752
- }
753
- function V(e, t) {
754
- return (typeof e != "string" || e.length === 0) && J(t), e;
755
- }
756
- function H(e, t) {
757
- (typeof e != "string" || !xe.test(e)) && J(t);
758
- }
759
- function U(e, t) {
760
- (typeof e != "string" || !be.test(e)) && J(t);
761
- }
762
- function W(e, t, n, r) {
763
- let i = B(e, t, n);
764
- for (let e of i) (typeof e != "string" || e.length === 0) && J(t);
765
- r && G(i, `duplicate ${t}`);
766
- }
767
- function G(e, t) {
768
- new Set(e).size !== e.length && J(t);
769
- }
770
- function K(e, t, n) {
771
- for (let r = 1; r < e.length; r++) Y(t(e[r - 1]), t(e[r])) > 0 && J(`${n} order`);
772
- }
773
- function q(e, t, n) {
774
- t.includes(e) || J(n);
775
- }
776
- function Pe(e, t, n) {
777
- e !== t && J(n);
778
- }
779
- function J(e) {
780
- throw Error(`invalid change assurance record: ${e}`);
781
- }
782
- function Y(e, t) {
783
- return e < t ? -1 : +(e > t);
784
- }
785
- //#endregion
786
- //#region src/change-assurance/attestations.ts
787
- function Fe(e) {
788
- let t = { ...e };
789
- delete t.digest;
790
- let n = Le(t);
791
- Re(n, !1);
792
- let r = I(n);
793
- return X({
794
- ...n,
795
- digest: r
796
- });
797
- }
798
- function X(e) {
799
- return Re(e, !0), ve(e), e;
800
- }
801
- function Ie(e) {
802
- return F(X(e));
803
- }
804
- function Le(e) {
805
- let t = structuredClone(e), n = Object.fromEntries(Object.entries(t.environment).sort(([e], [t]) => Y(e, t)));
806
- return {
807
- ...t,
808
- environment: n
809
- };
810
- }
811
- function Re(e, t) {
812
- let n = R(e, "attestation");
813
- z(n, [
814
- "schema_version",
815
- "record_type",
816
- "attestation_id",
817
- ...t ? ["digest"] : [],
818
- "record_digest",
819
- "candidate_revision",
820
- "proof_id",
821
- "command",
822
- "tool",
823
- "environment",
824
- "observed_at",
825
- "result",
826
- "retained_output"
827
- ]), n.schema_version !== 1 && Z("schema_version"), n.record_type !== "proof_attestation" && Z("record_type"), H(n.attestation_id, "attestation_id"), t && U(n.digest, "digest"), U(n.record_digest, "record_digest"), V(n.candidate_revision, "candidate_revision"), H(n.proof_id, "proof_id"), ke(n.command);
828
- let r = R(n.tool, "tool");
829
- z(r, [
830
- "identity",
831
- "version",
832
- "configuration_digest"
833
- ]), V(r.identity, "tool.identity");
834
- let i = V(r.version, "tool.version");
835
- /^(?:v?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?|[a-f0-9]{40}|[a-f0-9]{64})$/.test(i) || Z("tool.version is not immutable"), U(r.configuration_digest, "tool.configuration_digest");
836
- let a = R(n.environment, "environment");
837
- Object.keys(a).length === 0 && Z("environment");
838
- for (let [e, t] of Object.entries(a)) t !== null && ![
839
- "string",
840
- "number",
841
- "boolean"
842
- ].includes(typeof t) && Z(`environment.${e}`), typeof t == "number" && !Number.isFinite(t) && Z(`environment.${e}`);
843
- let o = V(n.observed_at, "observed_at");
844
- (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(o) || Number.isNaN(Date.parse(o))) && Z("observed_at"), [
845
- "passed",
846
- "failed",
847
- "unavailable",
848
- "not_computed"
849
- ].includes(n.result) || Z("result");
850
- let s = R(n.retained_output, "retained_output");
851
- z(s, [
852
- "media_type",
853
- "digest",
854
- "size_bytes"
855
- ]), V(s.media_type, "retained_output.media_type"), U(s.digest, "retained_output.digest"), (!Number.isInteger(s.size_bytes) || s.size_bytes < 0) && Z("retained_output.size_bytes"), Array.isArray(n.environment) && B(n.environment, "environment", !0);
856
- }
857
- function Z(e) {
858
- throw Error(`invalid proof attestation: ${e}`);
859
- }
860
- //#endregion
861
- //#region src/change-assurance/store.ts
862
- var ze = "change-assurance";
863
- function Q(t) {
864
- return p(e(t), ze);
865
- }
866
- function Be(e, t) {
867
- return Xe(t), p(Q(e), "records", `${t}.json`);
868
- }
869
- function Ve(e, t) {
870
- return Xe(t), p(Q(e), "attestations", t);
871
- }
872
- function He(e, t) {
873
- let r = Ce(t), a = Be(e, t.digest);
874
- if (i(f(a), { recursive: !0 }), n(a)) {
875
- if (!Ye(s(a), r)) throw Error("record digest collision");
876
- return a;
877
- }
878
- let o = `${a}.tmp-${process.pid}-${Date.now()}`;
879
- return qe(o, r), l(o, a), Je(f(a)), a;
880
- }
881
- function Ue(e, t) {
882
- let r = Be(e, t);
883
- if (!n(r)) return null;
884
- let i = L(N(s(r)));
885
- if (i.digest !== t) throw Error("record path digest mismatch");
886
- return i;
887
- }
888
- function We(e, t, r, o = {}) {
889
- let c = X(N(t)), u = Ie(c);
890
- if (c.retained_output.size_bytes !== r.byteLength || c.retained_output.digest !== M(r)) throw Error("retained output digest or size mismatch");
891
- let d = Ve(e, c.digest), m = f(d);
892
- if (i(m, { recursive: !0 }), n(d)) {
893
- let e = s(p(d, "attestation.json")), t = s(p(d, "output.bin"));
894
- if (!Ye(e, u) || !Ye(t, r)) throw Error("attestation digest collision");
895
- return d;
896
- }
897
- let h = a(p(m, ".tmp-attestation-"));
898
- try {
899
- qe(p(h, "attestation.json"), u), qe(p(h, "output.bin"), r), Je(h), o.beforeRename?.(), l(h, d), Je(m);
900
- } catch (e) {
901
- throw e;
902
- }
903
- return d;
904
- }
905
- function Ge(e, t) {
906
- let r = Ve(e, t);
907
- if (!n(r)) return null;
908
- let i = X(N(s(p(r, "attestation.json")))), a = s(p(r, "output.bin"));
909
- if (i.digest !== t) throw Error("attestation path digest mismatch");
910
- if (i.retained_output.size_bytes !== a.byteLength || i.retained_output.digest !== M(a)) throw Error("stored output integrity mismatch");
911
- return {
912
- attestation: i,
913
- output: a
914
- };
915
- }
916
- function Ke(e) {
917
- let t = p(Q(e), "attestations");
918
- if (!n(t)) return 0;
919
- let r = c(t).filter((e) => e.startsWith(".tmp-attestation-"));
920
- for (let e of r) u(p(t, e), {
921
- recursive: !0,
922
- force: !0
923
- });
924
- return r.length;
925
- }
926
- function qe(e, n) {
927
- let i = o(e, "wx");
928
- try {
929
- let e = 0;
930
- for (; e < n.byteLength;) {
931
- let t = d(i, n, e, n.byteLength - e);
932
- if (t === 0) throw Error("short write while retaining change assurance evidence");
933
- e += t;
934
- }
935
- r(i);
936
- } finally {
937
- t(i);
938
- }
939
- }
940
- function Je(e) {
941
- let n = o(e, "r");
942
- try {
943
- r(n);
944
- } finally {
945
- t(n);
946
- }
947
- }
948
- function Ye(e, t) {
949
- return e.byteLength === t.byteLength && e.every((e, n) => e === t[n]);
950
- }
951
- function Xe(e) {
952
- if (!/^[a-f0-9]{64}$/.test(e)) throw Error("change-assurance path requires a lowercase hexadecimal digest");
953
- }
954
- var Ze = P({ claim: "content integrity and recorded attribution only" });
955
- //#endregion
956
- //#region src/change-assurance/verify.ts
957
- function Qe(e) {
958
- let t = [];
959
- try {
960
- L(e.record);
961
- } catch (n) {
962
- let r = n instanceof Error ? n.message : String(n);
963
- if (/digest mismatch/i.test(r)) t.push("record_digest_mismatch");
964
- else return et(e);
965
- }
966
- let n = ot(t, "invalid"), r = [], i = [];
967
- try {
968
- i = we(e.record, e.parents);
969
- } catch (e) {
970
- let t = e instanceof Error ? e.message : String(e);
971
- /missing|no parent/i.test(t) ? r.push("parent_missing") : /revision gap/i.test(t) ? r.push("revision_gap") : /mismatch|cross-record/i.test(t) ? r.push("parent_mismatch") : r.push("parent_invalid");
972
- }
973
- let a = ot(r, "invalid"), o = Te(e.record, e.decision_history), s = {
974
- outcome: o.outcome,
975
- reasons: o.reasons
976
- }, c = [];
977
- e.record.impact_snapshot.completeness === "incomplete" && c.push("impact_incomplete"), e.record.impact_snapshot.truncated && c.push("impact_truncated"), e.record.definition.unknowns.some((e) => e.disposition !== "resolved") && c.push("unresolved_unknown");
978
- let l = ot(c, "incomplete"), u = at(e.selections, (e) => e.proof_id), d = at(e.attestations, (e) => e.attestation?.digest ?? ""), f = at(e.audits, (e) => e.proof_id), p = new Set(e.record.definition.proof_obligations.map((e) => e.proof_id)), m = [];
979
- e.selections.some((e) => !p.has(e.proof_id)) && m.push("proof_id_mismatch");
980
- let h = e.record.definition.proof_obligations.slice().sort((e, t) => Y(e.proof_id, t.proof_id)).map((t) => {
981
- let n = u.get(t.proof_id) ?? [], r = [];
982
- n.length === 0 && r.push("attestation_missing"), n.length > 1 && r.push("attestation_schema_invalid");
983
- let i = n.length === 1 ? d.get(n[0].attestation_digest) ?? [] : [];
984
- i.length > 1 && r.push("attestation_schema_invalid");
985
- let a = i.length === 1 ? i[0] : void 0;
986
- if (n.length === 1 && i.length === 0 && r.push("attestation_missing"), a) {
987
- let n = !0;
988
- try {
989
- X(a.attestation);
990
- } catch (e) {
991
- n = !1, /digest/i.test(e instanceof Error ? e.message : String(e)) ? r.push("attestation_digest_mismatch") : r.push("attestation_schema_invalid");
992
- }
993
- n && (a.attestation.record_digest !== e.record.digest && r.push("record_binding_mismatch"), a.attestation.candidate_revision !== e.candidate_revision && r.push("candidate_revision_mismatch"), a.attestation.proof_id !== t.proof_id && r.push("proof_id_mismatch"), (JSON.stringify(a.attestation.command.argv) !== JSON.stringify(t.command.argv) || a.attestation.command.working_directory !== t.command.working_directory) && r.push("command_mismatch"), a.attestation.tool.identity !== t.tool_identity && r.push("tool_identity_mismatch"), a.attestation.tool.configuration_digest !== t.configuration_digest && r.push("configuration_mismatch"), a.output === null ? r.push("output_missing") : (a.attestation.retained_output.size_bytes !== a.output.byteLength || a.attestation.retained_output.digest !== M(a.output)) && r.push("output_digest_mismatch"), a.attestation.result === "failed" && r.push("result_failed"), a.attestation.result === "unavailable" && r.push("result_unavailable"), a.attestation.result === "not_computed" && r.push("result_not_computed"));
994
- }
995
- let o = f.get(t.proof_id) ?? [], s = null;
996
- if (o.length === 1) try {
997
- s = $e(o[0], t.obligation_ids);
998
- } catch {
999
- r.push("audit_finding");
1000
- }
1001
- if (o.length > 1 && r.push("audit_finding"), !s || s.state === "not_evaluated") r.push("audit_not_evaluated");
1002
- else {
1003
- for (let e of t.obligation_ids) s.healthy_obligation_ids.includes(e) || r.push("audit_finding");
1004
- for (let e of s.findings) r.push(it(e.kind));
1005
- }
1006
- let c = ut(r);
1007
- return {
1008
- proof_id: t.proof_id,
1009
- obligation_ids: t.obligation_ids.slice().sort(),
1010
- attestation_digest: a?.attestation.digest ?? n[0]?.attestation_digest ?? null,
1011
- retained_output_digest: a?.attestation?.retained_output?.digest ?? null,
1012
- audit_report_digest: s?.report_digest ?? null,
1013
- audit_findings: (s?.findings ?? []).slice().sort((e, t) => Y(e.obligation_id, t.obligation_id) || Y(e.kind, t.kind)),
1014
- outcome: lt(c),
1015
- reasons: c
1016
- };
1017
- }), g = ut([
1018
- ...m,
1019
- ...n.reasons,
1020
- ...a.reasons,
1021
- ...s.reasons,
1022
- ...l.reasons,
1023
- ...h.flatMap((e) => e.reasons)
1024
- ]), _ = {
1025
- schema_version: 1,
1026
- record_type: "verification_receipt",
1027
- record_digest: e.record.digest,
1028
- candidate_revision: e.candidate_revision,
1029
- decision_event: o.event,
1030
- parent_digests: i,
1031
- checks: {
1032
- record: n,
1033
- lineage: a,
1034
- review: s,
1035
- impact: l
1036
- },
1037
- proofs: h,
1038
- unknowns: e.record.definition.unknowns.map(({ id: e, disposition: t }) => ({
1039
- id: e,
1040
- disposition: t
1041
- })).sort((e, t) => Y(e.id, t.id)),
1042
- outcome: lt(g),
1043
- reasons: g
1044
- };
1045
- return tt({
1046
- ..._,
1047
- digest: I(_)
1048
- });
1049
- }
1050
- function $e(e, t) {
1051
- if (U(e.report_digest, "FR-032 report digest"), !e.report || !Array.isArray(e.report.findings) || !Array.isArray(e.report.healthy) || !Array.isArray(e.report.unevaluated)) throw Error("invalid retained FR-032 report");
1052
- for (let t of e.report.findings) V(t.obligation, "FR-032 finding obligation"), V(t.kind, "FR-032 finding kind");
1053
- for (let t of e.report.healthy) V(t, "FR-032 healthy obligation");
1054
- let n = new Set(t);
1055
- return {
1056
- report_digest: e.report_digest,
1057
- state: e.report.unevaluated.some((e) => n.has(e.obligation)) ? "not_evaluated" : "evaluated",
1058
- findings: e.report.findings.filter((e) => n.has(e.obligation)).map((e) => ({
1059
- obligation_id: e.obligation,
1060
- kind: e.kind
1061
- })),
1062
- healthy_obligation_ids: e.report.healthy.filter((e) => n.has(e))
1063
- };
1064
- }
1065
- function et(e) {
1066
- let t = e?.record, n = typeof t == "object" && t && !Array.isArray(t) ? t : { retained_record: t }, r = n.digest, i = {
1067
- schema_version: 1,
1068
- record_type: "verification_receipt",
1069
- record_digest: typeof r == "string" && /^[a-f0-9]{64}$/.test(r) ? r : I({ retained_record: n }),
1070
- candidate_revision: typeof e?.candidate_revision == "string" && e.candidate_revision.length > 0 ? e.candidate_revision : "invalid",
1071
- decision_event: null,
1072
- parent_digests: [],
1073
- checks: {
1074
- record: {
1075
- outcome: "invalid",
1076
- reasons: ["schema_invalid"]
1077
- },
1078
- lineage: {
1079
- outcome: "valid",
1080
- reasons: []
1081
- },
1082
- review: {
1083
- outcome: "valid",
1084
- reasons: []
1085
- },
1086
- impact: {
1087
- outcome: "valid",
1088
- reasons: []
1089
- }
1090
- },
1091
- proofs: [],
1092
- unknowns: [],
1093
- outcome: "invalid",
1094
- reasons: ["schema_invalid"]
1095
- };
1096
- return tt({
1097
- ...i,
1098
- digest: I(i)
1099
- });
1100
- }
1101
- function tt(e) {
1102
- let t = R(e, "verification receipt");
1103
- if (z(t, [
1104
- "schema_version",
1105
- "record_type",
1106
- "digest",
1107
- "record_digest",
1108
- "candidate_revision",
1109
- "decision_event",
1110
- "parent_digests",
1111
- "checks",
1112
- "proofs",
1113
- "unknowns",
1114
- "outcome",
1115
- "reasons"
1116
- ]), t.schema_version !== 1 || t.record_type !== "verification_receipt") throw Error("invalid verification receipt schema identity");
1117
- if (U(t.digest, "receipt digest"), U(t.record_digest, "record digest"), V(t.candidate_revision, "candidate revision"), t.decision_event !== null) {
1118
- let e = R(t.decision_event, "decision event");
1119
- z(e, [
1120
- "run_id",
1121
- "event_id",
1122
- "event_hash",
1123
- "chain_tail_hash",
1124
- "recorded_actor",
1125
- "decision"
1126
- ]), H(e.run_id, "decision run_id"), H(e.event_id, "decision event_id"), U(e.event_hash, "decision event_hash"), U(e.chain_tail_hash, "decision chain_tail_hash"), V(e.recorded_actor, "decision recorded_actor"), $(e.decision, [
1127
- "approved",
1128
- "rejected",
1129
- "revise"
1130
- ], "decision");
1131
- }
1132
- for (let e of B(t.parent_digests, "parent digests", !1)) U(e, "parent digest");
1133
- let n = R(t.checks, "checks");
1134
- z(n, [
1135
- "record",
1136
- "lineage",
1137
- "review",
1138
- "impact"
1139
- ]);
1140
- for (let e of [
1141
- "record",
1142
- "lineage",
1143
- "review",
1144
- "impact"
1145
- ]) nt(n[e], `checks.${e}`);
1146
- for (let [e, n] of B(t.proofs, "proofs", !1).entries()) {
1147
- let t = R(n, `proofs[${e}]`);
1148
- z(t, [
1149
- "proof_id",
1150
- "obligation_ids",
1151
- "attestation_digest",
1152
- "retained_output_digest",
1153
- "audit_report_digest",
1154
- "audit_findings",
1155
- "outcome",
1156
- "reasons"
1157
- ]), H(t.proof_id, "proof_id");
1158
- for (let e of B(t.obligation_ids, "obligation_ids", !0)) H(e, "obligation_id");
1159
- for (let e of [
1160
- "attestation_digest",
1161
- "retained_output_digest",
1162
- "audit_report_digest"
1163
- ]) t[e] !== null && U(t[e], e);
1164
- for (let e of B(t.audit_findings, "audit_findings", !1)) {
1165
- let t = R(e, "audit finding");
1166
- z(t, ["obligation_id", "kind"]), H(t.obligation_id, "audit obligation_id"), V(t.kind, "audit finding kind");
1167
- }
1168
- rt(t);
1169
- }
1170
- for (let e of B(t.unknowns, "unknowns", !1)) {
1171
- let t = R(e, "receipt unknown");
1172
- z(t, ["id", "disposition"]), H(t.id, "unknown id"), $(t.disposition, [
1173
- "open",
1174
- "accepted",
1175
- "deferred",
1176
- "resolved"
1177
- ], "unknown disposition");
1178
- }
1179
- if (rt(t), t.digest !== I(t)) throw Error("verification receipt digest mismatch");
1180
- return e;
1181
- }
1182
- function nt(e, t) {
1183
- let n = R(e, t);
1184
- z(n, ["outcome", "reasons"]), rt(n);
1185
- }
1186
- function rt(e) {
1187
- $(e.outcome, [
1188
- "valid",
1189
- "invalid",
1190
- "incomplete"
1191
- ], "outcome");
1192
- let t = B(e.reasons, "reasons", !1);
1193
- for (let e of t) $(e, st, "reason");
1194
- let n = ut(t);
1195
- if (n.length !== t.length || n.some((e, n) => e !== t[n])) throw Error("verification receipt reasons must be unique and lexicographically ordered");
1196
- if (e.outcome !== lt(n)) throw Error("verification receipt outcome disagrees with reason precedence");
1197
- }
1198
- function $(e, t, n) {
1199
- if (!t.includes(e)) throw Error(`invalid verification receipt ${n}`);
1200
- }
1201
- function it(e) {
1202
- return e === "stale-evidence" ? "evidence_stale" : e === "suspect-link" ? "evidence_suspect" : e === "vacuous-evidence" ? "evidence_vacuous" : e === "undischarged" ? "evidence_unrelated" : "audit_finding";
1203
- }
1204
- function at(e, t) {
1205
- let n = /* @__PURE__ */ new Map();
1206
- for (let r of e) n.set(t(r), [...n.get(t(r)) ?? [], r]);
1207
- return n;
1208
- }
1209
- function ot(e, t = "valid") {
1210
- let n = ut(e);
1211
- return {
1212
- outcome: n.length === 0 ? "valid" : t,
1213
- reasons: n
1214
- };
1215
- }
1216
- var st = /* @__PURE__ */ "schema_invalid.record_digest_mismatch.parent_missing.parent_invalid.parent_mismatch.revision_gap.impact_incomplete.impact_truncated.unresolved_unknown.decision_missing.event_chain_missing.event_chain_invalid.decision_mismatch.review_rejected.review_revision_requested.attestation_missing.attestation_schema_invalid.attestation_digest_mismatch.output_missing.output_digest_mismatch.record_binding_mismatch.candidate_revision_mismatch.proof_id_mismatch.command_mismatch.tool_identity_mismatch.configuration_mismatch.result_failed.result_unavailable.result_not_computed.evidence_stale.evidence_suspect.evidence_vacuous.evidence_unrelated.audit_finding.audit_not_evaluated".split("."), ct = /* @__PURE__ */ new Set([
1217
- "parent_missing",
1218
- "impact_incomplete",
1219
- "impact_truncated",
1220
- "unresolved_unknown",
1221
- "decision_missing",
1222
- "event_chain_missing",
1223
- "attestation_missing",
1224
- "output_missing",
1225
- "result_unavailable",
1226
- "result_not_computed",
1227
- "audit_not_evaluated"
1228
- ]);
1229
- function lt(e) {
1230
- return e.length === 0 ? "valid" : e.every((e) => ct.has(e)) ? "incomplete" : "invalid";
1231
- }
1232
- function ut(e) {
1233
- return [...new Set(e)].sort();
1234
- }
1235
- //#endregion
1236
- export { ve as C, I as D, P as E, N as O, j as S, F as T, Se as _, Q as a, Me as b, Ue as c, He as d, Ie as f, Ce as g, je as h, Ve as i, Be as l, X as m, tt as n, We as o, Fe as p, Ze as r, Ge as s, Qe as t, Ke as u, Te as v, M as w, we as x, L as y };