@emilia-protocol/gate 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +252 -0
  3. package/action-control-manifest.js +3 -268
  4. package/action-escrow-custodian.js +3 -394
  5. package/action-escrow-evidence.js +3 -858
  6. package/action-escrow-package.js +3 -1668
  7. package/action-escrow-postgres.js +3 -337
  8. package/action-escrow-state.js +3 -396
  9. package/action-escrow-verifiers.js +3 -331
  10. package/action-escrow.js +3 -2447
  11. package/action-packs.js +3 -140
  12. package/adapters/_kit.js +3 -104
  13. package/adapters/aws.js +3 -108
  14. package/adapters/cloudflare.js +3 -54
  15. package/adapters/gcp.js +3 -70
  16. package/adapters/github.js +3 -109
  17. package/adapters/jira.js +3 -55
  18. package/adapters/k8s.js +3 -70
  19. package/adapters/linear.js +3 -55
  20. package/adapters/salesforce.js +3 -55
  21. package/adapters/stripe.js +3 -81
  22. package/adapters/supabase.js +3 -121
  23. package/adapters/terraform.js +3 -59
  24. package/adapters/vercel.js +3 -84
  25. package/aec-execution.js +3 -312
  26. package/breakglass.js +3 -582
  27. package/capability-receipt.js +4 -0
  28. package/cf1-conformance.js +3 -106
  29. package/challenge-store.js +3 -69
  30. package/control-plane.js +3 -340
  31. package/coverage.js +3 -721
  32. package/demo.mjs +1 -1
  33. package/deployment-attestation.js +3 -247
  34. package/dist/action-control-manifest.d.ts +82 -0
  35. package/dist/action-control-manifest.d.ts.map +1 -0
  36. package/dist/action-control-manifest.js +422 -0
  37. package/dist/action-control-manifest.js.map +1 -0
  38. package/dist/action-escrow-custodian.d.ts +74 -0
  39. package/dist/action-escrow-custodian.d.ts.map +1 -0
  40. package/dist/action-escrow-custodian.js +363 -0
  41. package/dist/action-escrow-custodian.js.map +1 -0
  42. package/dist/action-escrow-evidence.d.ts +130 -0
  43. package/dist/action-escrow-evidence.d.ts.map +1 -0
  44. package/dist/action-escrow-evidence.js +1012 -0
  45. package/dist/action-escrow-evidence.js.map +1 -0
  46. package/dist/action-escrow-package.d.ts +10 -0
  47. package/dist/action-escrow-package.d.ts.map +1 -0
  48. package/dist/action-escrow-package.js +1583 -0
  49. package/dist/action-escrow-package.js.map +1 -0
  50. package/dist/action-escrow-postgres.d.ts +62 -0
  51. package/dist/action-escrow-postgres.d.ts.map +1 -0
  52. package/dist/action-escrow-postgres.js +339 -0
  53. package/dist/action-escrow-postgres.js.map +1 -0
  54. package/dist/action-escrow-state.d.ts +141 -0
  55. package/dist/action-escrow-state.d.ts.map +1 -0
  56. package/dist/action-escrow-state.js +413 -0
  57. package/dist/action-escrow-state.js.map +1 -0
  58. package/dist/action-escrow-verifiers.d.ts +65 -0
  59. package/dist/action-escrow-verifiers.d.ts.map +1 -0
  60. package/dist/action-escrow-verifiers.js +421 -0
  61. package/dist/action-escrow-verifiers.js.map +1 -0
  62. package/dist/action-escrow.d.ts +112 -0
  63. package/dist/action-escrow.d.ts.map +1 -0
  64. package/dist/action-escrow.js +2661 -0
  65. package/dist/action-escrow.js.map +1 -0
  66. package/dist/action-packs.d.ts +54 -0
  67. package/dist/action-packs.d.ts.map +1 -0
  68. package/dist/action-packs.js +143 -0
  69. package/dist/action-packs.js.map +1 -0
  70. package/dist/adapters/_kit.d.ts +50 -0
  71. package/dist/adapters/_kit.d.ts.map +1 -0
  72. package/dist/adapters/_kit.js +98 -0
  73. package/dist/adapters/_kit.js.map +1 -0
  74. package/dist/adapters/aws.d.ts +158 -0
  75. package/dist/adapters/aws.d.ts.map +1 -0
  76. package/dist/adapters/aws.js +136 -0
  77. package/dist/adapters/aws.js.map +1 -0
  78. package/dist/adapters/cloudflare.d.ts +116 -0
  79. package/dist/adapters/cloudflare.d.ts.map +1 -0
  80. package/dist/adapters/cloudflare.js +75 -0
  81. package/dist/adapters/cloudflare.js.map +1 -0
  82. package/dist/adapters/gcp.d.ts +139 -0
  83. package/dist/adapters/gcp.d.ts.map +1 -0
  84. package/dist/adapters/gcp.js +69 -0
  85. package/dist/adapters/gcp.js.map +1 -0
  86. package/dist/adapters/github.d.ts +123 -0
  87. package/dist/adapters/github.d.ts.map +1 -0
  88. package/dist/adapters/github.js +105 -0
  89. package/dist/adapters/github.js.map +1 -0
  90. package/dist/adapters/jira.d.ts +109 -0
  91. package/dist/adapters/jira.d.ts.map +1 -0
  92. package/dist/adapters/jira.js +54 -0
  93. package/dist/adapters/jira.js.map +1 -0
  94. package/dist/adapters/k8s.d.ts +139 -0
  95. package/dist/adapters/k8s.d.ts.map +1 -0
  96. package/dist/adapters/k8s.js +69 -0
  97. package/dist/adapters/k8s.js.map +1 -0
  98. package/dist/adapters/linear.d.ts +109 -0
  99. package/dist/adapters/linear.d.ts.map +1 -0
  100. package/dist/adapters/linear.js +54 -0
  101. package/dist/adapters/linear.js.map +1 -0
  102. package/dist/adapters/salesforce.d.ts +109 -0
  103. package/dist/adapters/salesforce.d.ts.map +1 -0
  104. package/dist/adapters/salesforce.js +54 -0
  105. package/dist/adapters/salesforce.js.map +1 -0
  106. package/dist/adapters/stripe.d.ts +116 -0
  107. package/dist/adapters/stripe.d.ts.map +1 -0
  108. package/dist/adapters/stripe.js +77 -0
  109. package/dist/adapters/stripe.js.map +1 -0
  110. package/dist/adapters/supabase.d.ts +127 -0
  111. package/dist/adapters/supabase.d.ts.map +1 -0
  112. package/dist/adapters/supabase.js +112 -0
  113. package/dist/adapters/supabase.js.map +1 -0
  114. package/dist/adapters/terraform.d.ts +109 -0
  115. package/dist/adapters/terraform.d.ts.map +1 -0
  116. package/dist/adapters/terraform.js +58 -0
  117. package/dist/adapters/terraform.js.map +1 -0
  118. package/dist/adapters/vercel.d.ts +114 -0
  119. package/dist/adapters/vercel.d.ts.map +1 -0
  120. package/dist/adapters/vercel.js +81 -0
  121. package/dist/adapters/vercel.js.map +1 -0
  122. package/dist/aec-execution.d.ts +107 -0
  123. package/dist/aec-execution.d.ts.map +1 -0
  124. package/dist/aec-execution.js +334 -0
  125. package/dist/aec-execution.js.map +1 -0
  126. package/dist/breakglass.d.ts +205 -0
  127. package/dist/breakglass.d.ts.map +1 -0
  128. package/dist/breakglass.js +627 -0
  129. package/dist/breakglass.js.map +1 -0
  130. package/dist/capability-receipt.d.ts +601 -0
  131. package/dist/capability-receipt.d.ts.map +1 -0
  132. package/dist/capability-receipt.js +1177 -0
  133. package/dist/capability-receipt.js.map +1 -0
  134. package/dist/cf1-conformance.d.ts +83 -0
  135. package/dist/cf1-conformance.d.ts.map +1 -0
  136. package/dist/cf1-conformance.js +94 -0
  137. package/dist/cf1-conformance.js.map +1 -0
  138. package/dist/challenge-store.d.ts +20 -0
  139. package/dist/challenge-store.d.ts.map +1 -0
  140. package/dist/challenge-store.js +62 -0
  141. package/dist/challenge-store.js.map +1 -0
  142. package/dist/control-plane.d.ts +136 -0
  143. package/dist/control-plane.d.ts.map +1 -0
  144. package/dist/control-plane.js +349 -0
  145. package/dist/control-plane.js.map +1 -0
  146. package/dist/coverage.d.ts +156 -0
  147. package/dist/coverage.d.ts.map +1 -0
  148. package/dist/coverage.js +768 -0
  149. package/dist/coverage.js.map +1 -0
  150. package/dist/deployment-attestation.d.ts +93 -0
  151. package/dist/deployment-attestation.d.ts.map +1 -0
  152. package/dist/deployment-attestation.js +262 -0
  153. package/dist/deployment-attestation.js.map +1 -0
  154. package/dist/eg1-conformance.d.ts +286 -0
  155. package/dist/eg1-conformance.d.ts.map +1 -0
  156. package/dist/eg1-conformance.js +379 -0
  157. package/dist/eg1-conformance.js.map +1 -0
  158. package/dist/enterprise.d.ts +88 -0
  159. package/dist/enterprise.d.ts.map +1 -0
  160. package/dist/enterprise.js +194 -0
  161. package/dist/enterprise.js.map +1 -0
  162. package/dist/evidence-postgres.d.ts +123 -0
  163. package/dist/evidence-postgres.d.ts.map +1 -0
  164. package/dist/evidence-postgres.js +343 -0
  165. package/dist/evidence-postgres.js.map +1 -0
  166. package/dist/evidence.d.ts +113 -0
  167. package/dist/evidence.d.ts.map +1 -0
  168. package/dist/evidence.js +369 -0
  169. package/dist/evidence.js.map +1 -0
  170. package/dist/execution-binding.d.ts +49 -0
  171. package/dist/execution-binding.d.ts.map +1 -0
  172. package/dist/execution-binding.js +243 -0
  173. package/dist/execution-binding.js.map +1 -0
  174. package/dist/formal-runtime-map.d.ts +42 -0
  175. package/dist/formal-runtime-map.d.ts.map +1 -0
  176. package/dist/formal-runtime-map.js +23 -0
  177. package/dist/formal-runtime-map.js.map +1 -0
  178. package/dist/index.d.ts +1002 -0
  179. package/dist/index.d.ts.map +1 -0
  180. package/dist/index.js +1736 -0
  181. package/dist/index.js.map +1 -0
  182. package/dist/key-registry.d.ts +60 -0
  183. package/dist/key-registry.d.ts.map +1 -0
  184. package/dist/key-registry.js +144 -0
  185. package/dist/key-registry.js.map +1 -0
  186. package/dist/mcp.d.ts +53 -0
  187. package/dist/mcp.d.ts.map +1 -0
  188. package/dist/mcp.js +112 -0
  189. package/dist/mcp.js.map +1 -0
  190. package/dist/metering.d.ts +80 -0
  191. package/dist/metering.d.ts.map +1 -0
  192. package/dist/metering.js +227 -0
  193. package/dist/metering.js.map +1 -0
  194. package/dist/metrics.d.ts +68 -0
  195. package/dist/metrics.d.ts.map +1 -0
  196. package/dist/metrics.js +242 -0
  197. package/dist/metrics.js.map +1 -0
  198. package/dist/network-witness.d.ts +167 -0
  199. package/dist/network-witness.d.ts.map +1 -0
  200. package/dist/network-witness.js +520 -0
  201. package/dist/network-witness.js.map +1 -0
  202. package/dist/protocol-state.d.ts +141 -0
  203. package/dist/protocol-state.d.ts.map +1 -0
  204. package/dist/protocol-state.js +106 -0
  205. package/dist/protocol-state.js.map +1 -0
  206. package/dist/receipt-program.d.ts +59 -0
  207. package/dist/receipt-program.d.ts.map +1 -0
  208. package/dist/receipt-program.js +1053 -0
  209. package/dist/receipt-program.js.map +1 -0
  210. package/dist/reliance-kernel.d.ts +66 -0
  211. package/dist/reliance-kernel.d.ts.map +1 -0
  212. package/dist/reliance-kernel.js +103 -0
  213. package/dist/reliance-kernel.js.map +1 -0
  214. package/dist/reliance-packet.d.ts +67 -0
  215. package/dist/reliance-packet.d.ts.map +1 -0
  216. package/dist/reliance-packet.js +176 -0
  217. package/dist/reliance-packet.js.map +1 -0
  218. package/dist/remedy-program-postgres.d.ts +37 -0
  219. package/dist/remedy-program-postgres.d.ts.map +1 -0
  220. package/dist/remedy-program-postgres.js +291 -0
  221. package/dist/remedy-program-postgres.js.map +1 -0
  222. package/dist/remedy-program-receipt.d.ts +97 -0
  223. package/dist/remedy-program-receipt.d.ts.map +1 -0
  224. package/dist/remedy-program-receipt.js +817 -0
  225. package/dist/remedy-program-receipt.js.map +1 -0
  226. package/dist/remedy-program.d.ts +76 -0
  227. package/dist/remedy-program.d.ts.map +1 -0
  228. package/dist/remedy-program.js +1346 -0
  229. package/dist/remedy-program.js.map +1 -0
  230. package/dist/reports/art14.d.ts +101 -0
  231. package/dist/reports/art14.d.ts.map +1 -0
  232. package/dist/reports/art14.js +340 -0
  233. package/dist/reports/art14.js.map +1 -0
  234. package/dist/reports/assurance-package.d.ts +197 -0
  235. package/dist/reports/assurance-package.d.ts.map +1 -0
  236. package/dist/reports/assurance-package.js +313 -0
  237. package/dist/reports/assurance-package.js.map +1 -0
  238. package/dist/reports/auditor-workpaper.d.ts +194 -0
  239. package/dist/reports/auditor-workpaper.d.ts.map +1 -0
  240. package/dist/reports/auditor-workpaper.js +545 -0
  241. package/dist/reports/auditor-workpaper.js.map +1 -0
  242. package/dist/reports/external-verification.d.ts +76 -0
  243. package/dist/reports/external-verification.d.ts.map +1 -0
  244. package/dist/reports/external-verification.js +209 -0
  245. package/dist/reports/external-verification.js.map +1 -0
  246. package/dist/reports/reperform.d.ts +122 -0
  247. package/dist/reports/reperform.d.ts.map +1 -0
  248. package/dist/reports/reperform.js +432 -0
  249. package/dist/reports/reperform.js.map +1 -0
  250. package/dist/reports/underwriter.d.ts +127 -0
  251. package/dist/reports/underwriter.d.ts.map +1 -0
  252. package/dist/reports/underwriter.js +348 -0
  253. package/dist/reports/underwriter.js.map +1 -0
  254. package/dist/retention.d.ts +88 -0
  255. package/dist/retention.d.ts.map +1 -0
  256. package/dist/retention.js +90 -0
  257. package/dist/retention.js.map +1 -0
  258. package/dist/roster.d.ts +113 -0
  259. package/dist/roster.d.ts.map +1 -0
  260. package/dist/roster.js +261 -0
  261. package/dist/roster.js.map +1 -0
  262. package/dist/runtime-monitor.d.ts +132 -0
  263. package/dist/runtime-monitor.d.ts.map +1 -0
  264. package/dist/runtime-monitor.js +197 -0
  265. package/dist/runtime-monitor.js.map +1 -0
  266. package/dist/settlement.d.ts +68 -0
  267. package/dist/settlement.d.ts.map +1 -0
  268. package/dist/settlement.js +306 -0
  269. package/dist/settlement.js.map +1 -0
  270. package/dist/siem.d.ts +261 -0
  271. package/dist/siem.d.ts.map +1 -0
  272. package/dist/siem.js +247 -0
  273. package/dist/siem.js.map +1 -0
  274. package/dist/store-postgres.d.ts +107 -0
  275. package/dist/store-postgres.d.ts.map +1 -0
  276. package/dist/store-postgres.js +152 -0
  277. package/dist/store-postgres.js.map +1 -0
  278. package/dist/store.d.ts +95 -0
  279. package/dist/store.d.ts.map +1 -0
  280. package/dist/store.js +202 -0
  281. package/dist/store.js.map +1 -0
  282. package/dist/strict-json.d.ts +14 -0
  283. package/dist/strict-json.d.ts.map +1 -0
  284. package/dist/strict-json.js +132 -0
  285. package/dist/strict-json.js.map +1 -0
  286. package/dist/trust-program-adapters.d.ts +122 -0
  287. package/dist/trust-program-adapters.d.ts.map +1 -0
  288. package/dist/trust-program-adapters.js +802 -0
  289. package/dist/trust-program-adapters.js.map +1 -0
  290. package/dist/trust-program-postgres.d.ts +41 -0
  291. package/dist/trust-program-postgres.d.ts.map +1 -0
  292. package/dist/trust-program-postgres.js +346 -0
  293. package/dist/trust-program-postgres.js.map +1 -0
  294. package/dist/trust-program-revocation.d.ts +206 -0
  295. package/dist/trust-program-revocation.d.ts.map +1 -0
  296. package/dist/trust-program-revocation.js +600 -0
  297. package/dist/trust-program-revocation.js.map +1 -0
  298. package/dist/trust-program.d.ts +197 -0
  299. package/dist/trust-program.d.ts.map +1 -0
  300. package/dist/trust-program.js +1351 -0
  301. package/dist/trust-program.js.map +1 -0
  302. package/dist/witness-postgres.d.ts +43 -0
  303. package/dist/witness-postgres.d.ts.map +1 -0
  304. package/dist/witness-postgres.js +92 -0
  305. package/dist/witness-postgres.js.map +1 -0
  306. package/dist/zk-range-proof.d.ts +78 -0
  307. package/dist/zk-range-proof.d.ts.map +1 -0
  308. package/dist/zk-range-proof.js +228 -0
  309. package/dist/zk-range-proof.js.map +1 -0
  310. package/eg1-conformance.js +3 -404
  311. package/enterprise.js +3 -180
  312. package/ep-assure.mjs +1 -0
  313. package/evidence-postgres.js +3 -356
  314. package/evidence.js +4 -360
  315. package/execution-binding.js +3 -212
  316. package/formal-runtime-map.js +4 -0
  317. package/index.js +4 -1249
  318. package/key-registry.js +3 -134
  319. package/mcp.js +3 -109
  320. package/metering.js +3 -226
  321. package/metrics.js +3 -231
  322. package/network-witness.js +3 -499
  323. package/package.json +31 -2
  324. package/receipt-program.js +4 -0
  325. package/reliance-kernel.js +3 -112
  326. package/reliance-packet.js +3 -175
  327. package/remedy-program-postgres.js +4 -0
  328. package/remedy-program-receipt.js +4 -0
  329. package/remedy-program.js +4 -0
  330. package/reports/art14.js +0 -0
  331. package/reports/assurance-package.js +2 -312
  332. package/reports/auditor-workpaper.js +3 -537
  333. package/reports/external-verification.js +3 -222
  334. package/reports/reperform.js +3 -424
  335. package/reports/underwriter.js +3 -339
  336. package/retention.js +3 -84
  337. package/roster.js +3 -264
  338. package/runtime-monitor.js +4 -0
  339. package/settlement.js +3 -299
  340. package/siem.js +3 -235
  341. package/src/action-control-manifest.ts +424 -0
  342. package/src/action-escrow-custodian.ts +427 -0
  343. package/src/action-escrow-evidence.ts +1178 -0
  344. package/src/action-escrow-package.ts +1821 -0
  345. package/src/action-escrow-postgres.ts +366 -0
  346. package/src/action-escrow-state.ts +498 -0
  347. package/src/action-escrow-verifiers.ts +484 -0
  348. package/src/action-escrow.ts +3039 -0
  349. package/src/action-packs.ts +170 -0
  350. package/src/adapters/_kit.ts +117 -0
  351. package/src/adapters/aws.ts +142 -0
  352. package/src/adapters/cloudflare.ts +78 -0
  353. package/src/adapters/gcp.ts +71 -0
  354. package/src/adapters/github.ts +110 -0
  355. package/src/adapters/jira.ts +56 -0
  356. package/src/adapters/k8s.ts +71 -0
  357. package/src/adapters/linear.ts +56 -0
  358. package/src/adapters/salesforce.ts +56 -0
  359. package/src/adapters/stripe.ts +82 -0
  360. package/src/adapters/supabase.ts +122 -0
  361. package/src/adapters/terraform.ts +60 -0
  362. package/src/adapters/vercel.ts +85 -0
  363. package/src/aec-execution.ts +354 -0
  364. package/src/breakglass.ts +647 -0
  365. package/src/capability-receipt.ts +1258 -0
  366. package/src/cf1-conformance.ts +120 -0
  367. package/src/challenge-store.ts +70 -0
  368. package/src/control-plane.ts +374 -0
  369. package/src/coverage.ts +832 -0
  370. package/src/deployment-attestation.ts +259 -0
  371. package/src/eg1-conformance.ts +471 -0
  372. package/src/enterprise.ts +195 -0
  373. package/src/evidence-postgres.ts +374 -0
  374. package/src/evidence.ts +367 -0
  375. package/src/execution-binding.ts +236 -0
  376. package/src/formal-runtime-map.ts +24 -0
  377. package/src/index.ts +2122 -0
  378. package/src/key-registry.ts +150 -0
  379. package/src/mcp.ts +120 -0
  380. package/src/metering.ts +237 -0
  381. package/src/metrics.ts +232 -0
  382. package/src/network-witness.ts +585 -0
  383. package/src/protocol-state.ts +143 -0
  384. package/src/protocol-state.typecheck.ts +94 -0
  385. package/src/receipt-program.ts +1105 -0
  386. package/src/reliance-kernel.ts +119 -0
  387. package/src/reliance-packet.ts +206 -0
  388. package/src/remedy-program-postgres.ts +367 -0
  389. package/src/remedy-program-receipt.ts +891 -0
  390. package/src/remedy-program.ts +1388 -0
  391. package/src/reports/art14.ts +361 -0
  392. package/src/reports/assurance-package.ts +330 -0
  393. package/src/reports/auditor-workpaper.ts +558 -0
  394. package/src/reports/external-verification.ts +232 -0
  395. package/src/reports/reperform.ts +441 -0
  396. package/src/reports/underwriter.ts +356 -0
  397. package/src/retention.ts +100 -0
  398. package/src/roster.ts +273 -0
  399. package/src/runtime-monitor.ts +217 -0
  400. package/src/settlement.ts +313 -0
  401. package/src/siem.ts +247 -0
  402. package/src/store-postgres.ts +167 -0
  403. package/src/store.ts +214 -0
  404. package/src/strict-json.ts +115 -0
  405. package/src/trust-program-adapters.ts +847 -0
  406. package/src/trust-program-postgres.ts +429 -0
  407. package/src/trust-program-revocation.ts +751 -0
  408. package/src/trust-program.ts +1460 -0
  409. package/src/witness-postgres.ts +106 -0
  410. package/src/zk-range-proof.ts +250 -0
  411. package/store-postgres.js +3 -161
  412. package/store.js +4 -198
  413. package/strict-json.js +3 -102
  414. package/trust-program-adapters.js +4 -0
  415. package/trust-program-postgres.js +4 -0
  416. package/trust-program-revocation.js +4 -0
  417. package/trust-program.js +4 -0
  418. package/witness-postgres.js +3 -96
  419. package/zk-range-proof.js +4 -0
@@ -0,0 +1,197 @@
1
+ import { RELIANCE_VERDICTS } from '@emilia-protocol/verify/reliance';
2
+ export declare const ASSURANCE_PACKAGE_VERSION = "EP-ASSURANCE-PACKAGE-v1";
3
+ export declare const ASSURANCE_REPERFORMANCE_VERSION = "EP-ASSURANCE-REPERFORMANCE-v1";
4
+ export { RELIANCE_VERDICTS };
5
+ /**
6
+ * The reliance control catalog: every reliance verdict maps to the control
7
+ * objective it exercises. A `rely` shows the control PASSING; every do_not_rely_*
8
+ * shows the control OPERATING (it refused a non-admissible action). Denials are
9
+ * the control working, not the control failing.
10
+ */
11
+ export declare const RELIANCE_CONTROL_CATALOG: Readonly<{
12
+ 'RC-1': {
13
+ objective: string;
14
+ verdicts: string[];
15
+ };
16
+ 'RC-2': {
17
+ objective: string;
18
+ verdicts: string[];
19
+ };
20
+ 'RC-3': {
21
+ objective: string;
22
+ verdicts: string[];
23
+ };
24
+ 'RC-4': {
25
+ objective: string;
26
+ verdicts: string[];
27
+ };
28
+ 'RC-5': {
29
+ objective: string;
30
+ verdicts: string[];
31
+ };
32
+ 'RC-6': {
33
+ objective: string;
34
+ verdicts: string[];
35
+ };
36
+ }>;
37
+ /**
38
+ * Bundle N automated reliance decisions + the evidence each relied on into one
39
+ * portable, content-addressed assurance package. Does NOT re-perform (that is the
40
+ * assurer's independent step); it packages faithfully, including the verdict the
41
+ * org's runtime CLAIMED, so drift is checkable later.
42
+ *
43
+ * @param {Array<object>} decisions each: { decision_id, action, receipt, quorum?,
44
+ * authority_proof?, revocation_state?, consumption?, stated_verdict? }
45
+ * @param {object} [opts]
46
+ * @param {object} [opts.profile] the pinned EP-RELIANCE-PROFILE-v1 the org operated under
47
+ * @param {object} [opts.organization] { id, name } (no PHI)
48
+ * @param {number|Function} [opts.now]
49
+ * @returns {object} EP-ASSURANCE-PACKAGE-v1
50
+ */
51
+ export declare function buildAssurancePackage(decisions?: any[], { profile, organization, now, }?: {
52
+ profile?: Record<string, any> | null;
53
+ organization?: Record<string, any> | null;
54
+ now?: number | (() => number);
55
+ }): {
56
+ package_digest: string;
57
+ '@version': string;
58
+ organization: any;
59
+ reliance_profile: any;
60
+ profile_hash: string | null;
61
+ control_catalog: Readonly<{
62
+ 'RC-1': {
63
+ objective: string;
64
+ verdicts: string[];
65
+ };
66
+ 'RC-2': {
67
+ objective: string;
68
+ verdicts: string[];
69
+ };
70
+ 'RC-3': {
71
+ objective: string;
72
+ verdicts: string[];
73
+ };
74
+ 'RC-4': {
75
+ objective: string;
76
+ verdicts: string[];
77
+ };
78
+ 'RC-5': {
79
+ objective: string;
80
+ verdicts: string[];
81
+ };
82
+ 'RC-6': {
83
+ objective: string;
84
+ verdicts: string[];
85
+ };
86
+ }>;
87
+ decisions: {
88
+ decision_id: any;
89
+ action: any;
90
+ policy_hash: any;
91
+ stated_verdict: any;
92
+ evidence: {
93
+ receipt: any;
94
+ quorum: any;
95
+ authority_proof: any;
96
+ revocation_state: any;
97
+ consumption: any;
98
+ };
99
+ }[];
100
+ exception_history: {
101
+ decision_id: any;
102
+ stated_verdict: any;
103
+ control_id: any;
104
+ }[];
105
+ counts: {
106
+ decisions: number;
107
+ stated_admissible: number;
108
+ stated_refused: number;
109
+ stated_unknown: number;
110
+ };
111
+ assembled_at: string;
112
+ };
113
+ /**
114
+ * INDEPENDENT re-performance. Recompute every reliance verdict offline from the
115
+ * packaged evidence under the package's pinned profile and AUDITOR-supplied keys,
116
+ * trusting nothing the package asserts. Detect drift (recomputed ≠ stated), map
117
+ * to control objectives, and emit an auditor-style workpaper. Conclusion fields
118
+ * are ALWAYS null: the assurer concludes, not this tool.
119
+ *
120
+ * @param {object} pkg an EP-ASSURANCE-PACKAGE-v1
121
+ * @param {object} opts
122
+ * @param {object} [opts.approverKeys] auditor-pinned approver keys (out of band)
123
+ * @param {string|null} [opts.logPublicKey] auditor-pinned transparency-log key
124
+ * @param {string|null} [opts.rpId]
125
+ * @param {string[]} [opts.allowedOrigins]
126
+ * @param {object} [opts.revokerKeys]
127
+ * @param {(key:object)=>boolean} [opts.isConsumed] auditor-owned consumption lookup
128
+ * @param {number|string|Date|Function} [opts.now] reliance-evaluation clock (pin for determinism)
129
+ * @returns {object} EP-ASSURANCE-REPERFORMANCE-v1
130
+ */
131
+ export declare function reperformAssurancePackage(pkg: any, { approverKeys, logPublicKey, rpId, allowedOrigins, revokerKeys, isConsumed, now, }?: {
132
+ approverKeys?: Record<string, any>;
133
+ logPublicKey?: string | null;
134
+ rpId?: string | null;
135
+ allowedOrigins?: string[];
136
+ revokerKeys?: Record<string, any>;
137
+ isConsumed?: (key: any) => boolean;
138
+ now?: number | (() => number);
139
+ }): {
140
+ '@version': string;
141
+ product: string;
142
+ package_digest: string;
143
+ stated_package_digest: any;
144
+ package_digest_verified: boolean;
145
+ profile_hash: any;
146
+ generated_at: string;
147
+ honesty: {
148
+ reperforms: string;
149
+ does_not_establish: string[];
150
+ status: string;
151
+ };
152
+ population: {
153
+ decisions: any;
154
+ admissible: number;
155
+ refused: number;
156
+ drift: number;
157
+ relied_on_inadmissible_evidence: any;
158
+ by_recomputed_verdict: any;
159
+ by_control: any;
160
+ };
161
+ control_catalog: Readonly<{
162
+ 'RC-1': {
163
+ objective: string;
164
+ verdicts: string[];
165
+ };
166
+ 'RC-2': {
167
+ objective: string;
168
+ verdicts: string[];
169
+ };
170
+ 'RC-3': {
171
+ objective: string;
172
+ verdicts: string[];
173
+ };
174
+ 'RC-4': {
175
+ objective: string;
176
+ verdicts: string[];
177
+ };
178
+ 'RC-5': {
179
+ objective: string;
180
+ verdicts: string[];
181
+ };
182
+ 'RC-6': {
183
+ objective: string;
184
+ verdicts: string[];
185
+ };
186
+ }>;
187
+ results: any;
188
+ reperformance_digest: string | null;
189
+ conclusion: {
190
+ supportable: null;
191
+ opinion: null;
192
+ signed_off_by: null;
193
+ };
194
+ };
195
+ /** Render a plain-text auditor workpaper. Refuses to print a filled conclusion. */
196
+ export declare function renderAssuranceWorkpaper(doc: any): string;
197
+ //# sourceMappingURL=assurance-package.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assurance-package.d.ts","sourceRoot":"","sources":["../../src/reports/assurance-package.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AACnE,eAAO,MAAM,+BAA+B,kCAAkC,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC;AA+CH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,GAAE,GAAG,EAAO,EAAE,EAC3D,OAAO,EAAE,YAAmB,EAAE,GAAO,GACtC,GAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC1C,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CL;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,KAAA,EAAE,EAC7C,YAAiB,EAAE,YAAmB,EAAE,IAAW,EAAE,cAAmB,EAAE,WAAgB,EAAE,UAAU,EAAE,GAAO,GAChH,GAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkG4B,MAAM,GAAG,IAAI;;;;;;EAU9C;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CAAC,GAAG,KAAA,UA6B3C"}
@@ -0,0 +1,313 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * EP-ASSURANCE-PACKAGE-v1 — the reliance assurance layer.
4
+ *
5
+ * The layer above the reliance kernel. The kernel answers "may this party rely on
6
+ * this action?" The assurance package answers the question an INDEPENDENT assurer
7
+ * (an audit firm, a regulator, an insurer) asks: "can I reproduce, test, and
8
+ * attest that an organization's automated actions were governed by admissible
9
+ * evidence under the organization's OWN pinned rule?"
10
+ *
11
+ * Two halves, mirroring the re-performance discipline of reperform.js:
12
+ * buildAssurancePackage(decisions, ...) the organization bundles its
13
+ * automated decisions + the evidence each relied on into ONE portable,
14
+ * content-addressed package (action, receipt, profile, authority proof,
15
+ * revocation check, consumption, denial/exception history, policy hash).
16
+ * reperformAssurancePackage(pkg, ...) the assurer RE-PERFORMS every
17
+ * reliance verdict offline from that evidence, TRUSTING NOTHING the package
18
+ * asserts: it recomputes each verdict with evaluateReliance, compares to the
19
+ * verdict the org's runtime CLAIMED (drift = a control failure the assurer
20
+ * caught), maps every verdict to a control objective, and emits an
21
+ * auditor-style workpaper. It does not conclude; the assurer concludes.
22
+ *
23
+ * PCAOB AS 1105 alignment (why this is audit evidence): the source is
24
+ * cryptographic, the decision trail is immutable and content-addressed, the rule
25
+ * is a pinned profile, and the verdict is re-performable directly. This module
26
+ * SUPPORTS a re-performance procedure; it never issues an opinion.
27
+ */
28
+ import { hashCanonical } from '../execution-binding.js';
29
+ import { evaluateReliance, RELIANCE_VERDICTS } from '@emilia-protocol/verify/reliance';
30
+ export const ASSURANCE_PACKAGE_VERSION = 'EP-ASSURANCE-PACKAGE-v1';
31
+ export const ASSURANCE_REPERFORMANCE_VERSION = 'EP-ASSURANCE-REPERFORMANCE-v1';
32
+ export { RELIANCE_VERDICTS };
33
+ /**
34
+ * The reliance control catalog: every reliance verdict maps to the control
35
+ * objective it exercises. A `rely` shows the control PASSING; every do_not_rely_*
36
+ * shows the control OPERATING (it refused a non-admissible action). Denials are
37
+ * the control working, not the control failing.
38
+ */
39
+ export const RELIANCE_CONTROL_CATALOG = Object.freeze({
40
+ 'RC-1': { objective: 'Only a human with valid organization-bound, scoped authority for THIS exact action may authorize it', verdicts: ['do_not_rely_authority_missing', 'do_not_rely_authority_subject_mismatch', 'do_not_rely_authority_organization_mismatch', 'do_not_rely_authority_revoked', 'do_not_rely_authority_expired', 'do_not_rely_scope_mismatch', 'do_not_rely_amount_exceeded', 'do_not_rely_registry_unavailable'] },
41
+ 'RC-2': { objective: 'Authorization uses a device-bound named-human ceremony (Class-A or quorum)', verdicts: ['do_not_rely_no_class_a', 'do_not_rely_quorum_unsatisfied'] },
42
+ 'RC-3': { objective: 'The action conforms to a pinned, accepted policy', verdicts: ['do_not_rely_policy_mismatch'] },
43
+ 'RC-4': { objective: 'Authorization is consumed exactly once (no replay)', verdicts: ['do_not_rely_already_consumed'] },
44
+ 'RC-5': { objective: 'Reliance is evaluated against fresh revocation state', verdicts: ['do_not_rely_stale_revocation'] },
45
+ 'RC-6': { objective: 'Evidence is signed by a trusted issuer and evaluated under a pinned rule', verdicts: ['do_not_rely_unsigned', 'do_not_rely_untrusted_issuer', 'do_not_rely_no_profile'] },
46
+ });
47
+ const VERDICT_TO_CONTROL = Object.freeze(Object.entries(RELIANCE_CONTROL_CATALOG).reduce((m, [cid, c]) => {
48
+ for (const v of c.verdicts)
49
+ m[v] = cid;
50
+ return m;
51
+ }, {}));
52
+ /** Which control objective a verdict exercises (rely passes ALL, so returns null). */
53
+ function controlForVerdict(verdict) {
54
+ if (verdict === 'rely')
55
+ return null;
56
+ return VERDICT_TO_CONTROL[verdict] || null;
57
+ }
58
+ function toIso(now) {
59
+ const ms = typeof now === 'function' ? now() : now;
60
+ return new Date(ms == null ? 0 : ms).toISOString();
61
+ }
62
+ function portableJsonCopy(value, active = new Set()) {
63
+ if (value === null || typeof value === 'string' || typeof value === 'boolean')
64
+ return value;
65
+ if (typeof value === 'number') {
66
+ if (!Number.isFinite(value) || Object.is(value, -0)) {
67
+ throw new TypeError('assurance-package: value is not canonical JSON');
68
+ }
69
+ return value;
70
+ }
71
+ if (typeof value !== 'object') {
72
+ throw new TypeError('assurance-package: value is not JSON');
73
+ }
74
+ if (active.has(value))
75
+ throw new TypeError('assurance-package: cyclic value');
76
+ active.add(value);
77
+ try {
78
+ if (Array.isArray(value))
79
+ return value.map((entry) => portableJsonCopy(entry, active));
80
+ const prototype = Object.getPrototypeOf(value);
81
+ if (prototype !== Object.prototype && prototype !== null) {
82
+ throw new TypeError('assurance-package: value must use plain JSON objects');
83
+ }
84
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, portableJsonCopy(entry, active)]));
85
+ }
86
+ finally {
87
+ active.delete(value);
88
+ }
89
+ }
90
+ /**
91
+ * Bundle N automated reliance decisions + the evidence each relied on into one
92
+ * portable, content-addressed assurance package. Does NOT re-perform (that is the
93
+ * assurer's independent step); it packages faithfully, including the verdict the
94
+ * org's runtime CLAIMED, so drift is checkable later.
95
+ *
96
+ * @param {Array<object>} decisions each: { decision_id, action, receipt, quorum?,
97
+ * authority_proof?, revocation_state?, consumption?, stated_verdict? }
98
+ * @param {object} [opts]
99
+ * @param {object} [opts.profile] the pinned EP-RELIANCE-PROFILE-v1 the org operated under
100
+ * @param {object} [opts.organization] { id, name } (no PHI)
101
+ * @param {number|Function} [opts.now]
102
+ * @returns {object} EP-ASSURANCE-PACKAGE-v1
103
+ */
104
+ export function buildAssurancePackage(decisions = [], { profile, organization = null, now = 0, } = {}) {
105
+ if (!Array.isArray(decisions))
106
+ throw new Error('assurance-package: decisions must be an array');
107
+ const items = decisions.map((d, i) => {
108
+ const source = portableJsonCopy(d ?? {});
109
+ const decision_id = source.decision_id ?? `decision-${i}`;
110
+ return {
111
+ decision_id,
112
+ action: source.action ?? null,
113
+ policy_hash: source.action?.policy_hash ?? null,
114
+ stated_verdict: typeof source.stated_verdict === 'string' ? source.stated_verdict : null,
115
+ evidence: {
116
+ receipt: source.receipt ?? null,
117
+ quorum: source.quorum ?? null,
118
+ authority_proof: source.authority_proof ?? null,
119
+ revocation_state: source.revocation_state ?? null,
120
+ consumption: source.consumption ?? null,
121
+ },
122
+ };
123
+ });
124
+ // Denial/exception history = the decisions the org itself recorded as refused.
125
+ const exceptions = items.filter((it) => it.stated_verdict && it.stated_verdict !== 'rely')
126
+ .map((it) => ({ decision_id: it.decision_id, stated_verdict: it.stated_verdict, control_id: controlForVerdict(it.stated_verdict) }));
127
+ const profileCopy = profile == null ? null : portableJsonCopy(profile);
128
+ const body = {
129
+ '@version': ASSURANCE_PACKAGE_VERSION,
130
+ organization: organization == null ? null : portableJsonCopy(organization),
131
+ reliance_profile: profileCopy,
132
+ profile_hash: profileCopy ? hashCanonical(profileCopy) : null,
133
+ control_catalog: RELIANCE_CONTROL_CATALOG,
134
+ decisions: items,
135
+ exception_history: exceptions,
136
+ counts: {
137
+ decisions: items.length,
138
+ stated_admissible: items.filter((it) => it.stated_verdict === 'rely').length,
139
+ stated_refused: items.filter((it) => it.stated_verdict && it.stated_verdict !== 'rely').length,
140
+ stated_unknown: items.filter((it) => !it.stated_verdict).length,
141
+ },
142
+ assembled_at: toIso(now),
143
+ };
144
+ // Content address over everything EXCEPT the timestamp (so the same evidence
145
+ // yields the same digest regardless of when it was packaged).
146
+ const { assembled_at: _t, ...digestScope } = body;
147
+ return { ...body, package_digest: hashCanonical(digestScope) };
148
+ }
149
+ /**
150
+ * INDEPENDENT re-performance. Recompute every reliance verdict offline from the
151
+ * packaged evidence under the package's pinned profile and AUDITOR-supplied keys,
152
+ * trusting nothing the package asserts. Detect drift (recomputed ≠ stated), map
153
+ * to control objectives, and emit an auditor-style workpaper. Conclusion fields
154
+ * are ALWAYS null: the assurer concludes, not this tool.
155
+ *
156
+ * @param {object} pkg an EP-ASSURANCE-PACKAGE-v1
157
+ * @param {object} opts
158
+ * @param {object} [opts.approverKeys] auditor-pinned approver keys (out of band)
159
+ * @param {string|null} [opts.logPublicKey] auditor-pinned transparency-log key
160
+ * @param {string|null} [opts.rpId]
161
+ * @param {string[]} [opts.allowedOrigins]
162
+ * @param {object} [opts.revokerKeys]
163
+ * @param {(key:object)=>boolean} [opts.isConsumed] auditor-owned consumption lookup
164
+ * @param {number|string|Date|Function} [opts.now] reliance-evaluation clock (pin for determinism)
165
+ * @returns {object} EP-ASSURANCE-REPERFORMANCE-v1
166
+ */
167
+ export function reperformAssurancePackage(pkg, { approverKeys = {}, logPublicKey = null, rpId = null, allowedOrigins = [], revokerKeys = {}, isConsumed, now = 0, } = {}) {
168
+ if (!pkg || pkg['@version'] !== ASSURANCE_PACKAGE_VERSION)
169
+ throw new Error('assurance-reperform: not an EP-ASSURANCE-PACKAGE-v1');
170
+ const profile = pkg.reliance_profile;
171
+ const evalOpts = { approverKeys, logPublicKey, rpId, allowedOrigins, revokerKeys, ...(typeof isConsumed === 'function' ? { isConsumed } : {}) };
172
+ const relianceNow = typeof now === 'function' ? now() : now;
173
+ const results = (Array.isArray(pkg.decisions) ? pkg.decisions : []).map((it) => {
174
+ const ev = it.evidence || {};
175
+ const input = {
176
+ action: it.action || {},
177
+ receipt: ev.receipt,
178
+ quorum: ev.quorum || undefined,
179
+ authority_proof: ev.authority_proof || undefined,
180
+ revocation_state: ev.revocation_state || undefined,
181
+ consumption: ev.consumption || undefined,
182
+ relying_party_profile: profile,
183
+ now: relianceNow,
184
+ };
185
+ let recomputed;
186
+ try {
187
+ recomputed = evaluateReliance(input, evalOpts);
188
+ }
189
+ catch (err) {
190
+ const message = err?.message;
191
+ recomputed = { verdict: 'do_not_rely_unsigned', rely: false, reasons: [`reperform_error:${message || 'threw'}`] };
192
+ }
193
+ const recomputed_verdict = recomputed.verdict;
194
+ const stated_verdict = it.stated_verdict ?? null;
195
+ // Drift: the org's runtime claimed one outcome, independent re-performance
196
+ // computed another. A claimed `rely` that recomputes to a refusal is the
197
+ // material finding — the org relied on evidence that does not support reliance.
198
+ const drift = stated_verdict !== null && stated_verdict !== recomputed_verdict;
199
+ return {
200
+ decision_id: it.decision_id,
201
+ action_type: it.action?.action_type ?? null,
202
+ stated_verdict,
203
+ recomputed_verdict,
204
+ admissible: recomputed_verdict === 'rely',
205
+ drift,
206
+ drift_severity: drift ? (stated_verdict === 'rely' ? 'relied_on_inadmissible_evidence' : 'refused_admissible_or_reclassified') : null,
207
+ control_id: controlForVerdict(recomputed_verdict),
208
+ reasons: recomputed.reasons || [],
209
+ };
210
+ });
211
+ const byVerdict = Object.create(null);
212
+ const byControl = Object.create(null);
213
+ let admissible = 0;
214
+ let refused = 0;
215
+ let drift = 0;
216
+ for (const r of results) {
217
+ byVerdict[r.recomputed_verdict] = (byVerdict[r.recomputed_verdict] || 0) + 1;
218
+ if (r.admissible)
219
+ admissible += 1;
220
+ else
221
+ refused += 1;
222
+ if (r.drift)
223
+ drift += 1;
224
+ if (r.control_id)
225
+ byControl[r.control_id] = (byControl[r.control_id] || 0) + 1;
226
+ }
227
+ // Recompute the package digest from the package's OWN contents rather than
228
+ // trusting pkg.package_digest. "No value the package asserts is trusted" has to
229
+ // include the digest: copying the stated one verbatim would let a tampered
230
+ // package carry a lying content-address through re-performance unchecked. Mirror
231
+ // buildAssurancePackage's digestScope exactly (body minus assembled_at and the
232
+ // digest field itself), then compare.
233
+ const { assembled_at: _statedAt, package_digest: _statedDigest, ...digestScope } = pkg;
234
+ const recomputedPackageDigest = hashCanonical(digestScope);
235
+ const packageDigestVerified = pkg.package_digest != null && recomputedPackageDigest === pkg.package_digest;
236
+ const doc = {
237
+ '@version': ASSURANCE_REPERFORMANCE_VERSION,
238
+ product: 'EMILIA Reliance Assurance',
239
+ package_digest: recomputedPackageDigest,
240
+ stated_package_digest: pkg.package_digest ?? null,
241
+ package_digest_verified: packageDigestVerified,
242
+ profile_hash: pkg.profile_hash ?? null,
243
+ generated_at: toIso(now),
244
+ honesty: {
245
+ reperforms: 'Independent recomputation of every reliance verdict from the packaged evidence, under the package\'s pinned '
246
+ + 'EP-RELIANCE-PROFILE-v1 and auditor-supplied keys, using the offline reliance kernel. No value the package '
247
+ + 'asserts (including the stated verdict) is trusted; the stated verdict is compared, never relied on.',
248
+ does_not_establish: [
249
+ 'Completeness of the decision population: decisions withheld before packaging are not detectable from the package alone. Bind the population to an externally anchored count to close this.',
250
+ 'Runtime freshness or one-time consumption AT THE MOMENT OF DECISION: those were live properties; re-performance checks the evidence as packaged, not the runtime state that existed then.',
251
+ 'Issuer, approver, and registrar key custody, enrollment, or identity proofing, which remain external trust roots the auditor supplies out of band.',
252
+ 'The business correctness or wisdom of any authorized action.',
253
+ ],
254
+ status: 'Support for an audit re-performance procedure. This document does not conclude, opine, or certify; any conclusion is the auditor\'s.',
255
+ },
256
+ population: {
257
+ decisions: results.length,
258
+ admissible,
259
+ refused,
260
+ drift,
261
+ relied_on_inadmissible_evidence: results.filter((r) => r.drift_severity === 'relied_on_inadmissible_evidence').length,
262
+ by_recomputed_verdict: byVerdict,
263
+ by_control: byControl,
264
+ },
265
+ control_catalog: RELIANCE_CONTROL_CATALOG,
266
+ results,
267
+ reperformance_digest: null, // filled below
268
+ // Conclusion fields are ALWAYS null: a machine may support re-performance, it
269
+ // may never fill in the auditor's sign-off. A renderer must refuse to print a
270
+ // non-null conclusion here.
271
+ conclusion: { supportable: null, opinion: null, signed_off_by: null },
272
+ };
273
+ // Deterministic re-performance digest over the recomputed results + population
274
+ // (excludes timestamps), so a second assurer reproduces it byte-for-byte.
275
+ doc.reperformance_digest = hashCanonical({ package_digest: doc.package_digest, population: doc.population, results });
276
+ return doc;
277
+ }
278
+ /** Render a plain-text auditor workpaper. Refuses to print a filled conclusion. */
279
+ export function renderAssuranceWorkpaper(doc) {
280
+ if (!doc || doc['@version'] !== ASSURANCE_REPERFORMANCE_VERSION)
281
+ throw new Error('render: not an EP-ASSURANCE-REPERFORMANCE-v1');
282
+ if (doc.conclusion && (doc.conclusion.supportable !== null || doc.conclusion.opinion !== null || doc.conclusion.signed_off_by !== null)) {
283
+ throw new Error('render refused: conclusion fields must be null (the auditor concludes, not the tool)');
284
+ }
285
+ const p = doc.population;
286
+ const lines = [];
287
+ lines.push(`EMILIA Reliance Assurance — re-performance workpaper (${doc['@version']})`);
288
+ lines.push(`package_digest: ${doc.package_digest} (recomputed)`);
289
+ lines.push(`package_digest match: ${doc.package_digest_verified ? 'YES — recomputed digest equals the package\'s stated digest' : 'NO — stated digest does NOT match recomputed contents (tamper or drift)'}`);
290
+ lines.push(`reperformance_digest: ${doc.reperformance_digest}`);
291
+ lines.push('');
292
+ lines.push(`Population: ${p.decisions} decisions | admissible(rely): ${p.admissible} | refused: ${p.refused} | drift: ${p.drift}`);
293
+ lines.push(`Relied on INADMISSIBLE evidence (claimed rely, recomputed refusal): ${p.relied_on_inadmissible_evidence}`);
294
+ lines.push('');
295
+ lines.push('By recomputed verdict:');
296
+ for (const [v, n] of Object.entries(p.by_recomputed_verdict))
297
+ lines.push(` ${v}: ${n}`);
298
+ lines.push('');
299
+ lines.push('Control objectives exercised (denials are the control operating):');
300
+ for (const [cid, n] of Object.entries(p.by_control))
301
+ lines.push(` ${cid} (${RELIANCE_CONTROL_CATALOG[cid].objective}): ${n}`);
302
+ lines.push('');
303
+ const drifts = doc.results.filter((r) => r.drift);
304
+ if (drifts.length) {
305
+ lines.push('DRIFT (independent re-performance disagrees with the runtime\'s stated verdict):');
306
+ for (const r of drifts)
307
+ lines.push(` ${r.decision_id}: stated=${r.stated_verdict} recomputed=${r.recomputed_verdict} [${r.drift_severity}]`);
308
+ lines.push('');
309
+ }
310
+ lines.push('Conclusion: NULL by construction. The auditor concludes; this workpaper only supports the procedure.');
311
+ return lines.join('\n');
312
+ }
313
+ //# sourceMappingURL=assurance-package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assurance-package.js","sourceRoot":"","sources":["../../src/reports/assurance-package.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AACnE,MAAM,CAAC,MAAM,+BAA+B,GAAG,+BAA+B,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,M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