settld 0.1.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 (863) hide show
  1. package/Dockerfile +45 -0
  2. package/README.md +150 -0
  3. package/SETTLD_VERSION +1 -0
  4. package/bin/settld.js +212 -0
  5. package/conformance/README.md +14 -0
  6. package/conformance/kernel-v0/README.md +60 -0
  7. package/conformance/kernel-v0/cases.json +19 -0
  8. package/conformance/kernel-v0/run.mjs +830 -0
  9. package/conformance/v1/README.md +77 -0
  10. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/attestation/bundle_head_attestation.json +1 -0
  11. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/evidence/evidence_index.json +1 -0
  12. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/governance/policy.json +1 -0
  13. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/governance/revocations.json +1 -0
  14. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/manifest.json +1 -0
  15. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
  16. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/governance/policy.json +1 -0
  17. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/governance/revocations.json +1 -0
  18. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
  19. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/manifest.json +1 -0
  20. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/metering/metering_report.json +1 -0
  21. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  22. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
  23. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  24. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  25. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  26. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  27. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
  28. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
  29. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  30. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  31. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  32. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
  33. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
  34. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
  35. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
  36. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
  37. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
  38. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
  39. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/settld.json +1 -0
  40. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/verify/verification_report.json +1 -0
  41. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/settld.json +1 -0
  42. package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/verify/verification_report.json +1 -0
  43. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/acceptance/acceptance_criteria.json +1 -0
  44. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/acceptance/acceptance_evaluation.json +1 -0
  45. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/attestation/bundle_head_attestation.json +1 -0
  46. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/evidence/evidence_index.json +1 -0
  47. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/governance/policy.json +1 -0
  48. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/governance/revocations.json +1 -0
  49. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/manifest.json +1 -0
  50. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
  51. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/governance/policy.json +1 -0
  52. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/governance/revocations.json +1 -0
  53. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
  54. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/manifest.json +1 -0
  55. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/metering/metering_report.json +1 -0
  56. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  57. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
  58. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  59. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  60. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  61. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  62. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
  63. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
  64. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  65. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  66. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  67. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
  68. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
  69. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
  70. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
  71. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
  72. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
  73. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
  74. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/settld.json +1 -0
  75. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/verify/verification_report.json +1 -0
  76. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/settld.json +1 -0
  77. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/sla/sla_definition.json +1 -0
  78. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/sla/sla_evaluation.json +1 -0
  79. package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/verify/verification_report.json +1 -0
  80. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/acceptance/acceptance_criteria.json +1 -0
  81. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/acceptance/acceptance_evaluation.json +1 -0
  82. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/attestation/bundle_head_attestation.json +1 -0
  83. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/evidence/evidence_index.json +1 -0
  84. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/governance/policy.json +1 -0
  85. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/governance/revocations.json +1 -0
  86. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/manifest.json +1 -0
  87. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
  88. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/governance/policy.json +1 -0
  89. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/governance/revocations.json +1 -0
  90. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
  91. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/manifest.json +1 -0
  92. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/metering/metering_report.json +1 -0
  93. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  94. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
  95. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  96. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  97. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  98. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  99. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
  100. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
  101. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  102. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  103. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  104. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
  105. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
  106. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
  107. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
  108. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
  109. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
  110. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
  111. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/settld.json +1 -0
  112. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/verify/verification_report.json +1 -0
  113. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/settld.json +1 -0
  114. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/sla/sla_definition.json +1 -0
  115. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/sla/sla_evaluation.json +1 -0
  116. package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/verify/verification_report.json +1 -0
  117. package/conformance/v1/bundles/closepack/strict-pass/acceptance/acceptance_criteria.json +1 -0
  118. package/conformance/v1/bundles/closepack/strict-pass/acceptance/acceptance_evaluation.json +1 -0
  119. package/conformance/v1/bundles/closepack/strict-pass/attestation/bundle_head_attestation.json +1 -0
  120. package/conformance/v1/bundles/closepack/strict-pass/evidence/evidence_index.json +1 -0
  121. package/conformance/v1/bundles/closepack/strict-pass/governance/policy.json +1 -0
  122. package/conformance/v1/bundles/closepack/strict-pass/governance/revocations.json +1 -0
  123. package/conformance/v1/bundles/closepack/strict-pass/manifest.json +1 -0
  124. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
  125. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/governance/policy.json +1 -0
  126. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/governance/revocations.json +1 -0
  127. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
  128. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/manifest.json +1 -0
  129. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/metering/metering_report.json +1 -0
  130. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  131. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
  132. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  133. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  134. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  135. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  136. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
  137. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
  138. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  139. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  140. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  141. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
  142. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
  143. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
  144. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
  145. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
  146. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
  147. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
  148. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/settld.json +1 -0
  149. package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/verify/verification_report.json +1 -0
  150. package/conformance/v1/bundles/closepack/strict-pass/settld.json +1 -0
  151. package/conformance/v1/bundles/closepack/strict-pass/sla/sla_definition.json +1 -0
  152. package/conformance/v1/bundles/closepack/strict-pass/sla/sla_evaluation.json +1 -0
  153. package/conformance/v1/bundles/closepack/strict-pass/verify/verification_report.json +1 -0
  154. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/attestation/bundle_head_attestation.json +1 -0
  155. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/GLBatch.v1.json +1 -0
  156. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/JournalCsv.v1.csv +2 -0
  157. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/JournalCsv.v1.json +1 -0
  158. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/reconcile.json +1 -0
  159. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/governance/policy.json +1 -0
  160. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/governance/revocations.json +1 -0
  161. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/manifest.json +1 -0
  162. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/attestation/bundle_head_attestation.json +1 -0
  163. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/events/events.jsonl +1 -0
  164. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/events/payload_material.jsonl +1 -0
  165. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/events/events.jsonl +1 -0
  166. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/events/payload_material.jsonl +1 -0
  167. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/snapshot.json +1 -0
  168. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/policy.json +1 -0
  169. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/revocations.json +1 -0
  170. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/events/events.jsonl +0 -0
  171. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/events/payload_material.jsonl +0 -0
  172. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/snapshot.json +1 -0
  173. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/keys/public_keys.json +1 -0
  174. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/manifest.json +1 -0
  175. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/verify/report.json +1 -0
  176. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/verify/verification_report.json +1 -0
  177. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/settld.json +1 -0
  178. package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/verify/verification_report.json +1 -0
  179. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
  180. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/GLBatch.v1.json +1 -0
  181. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/JournalCsv.v1.csv +2 -0
  182. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/JournalCsv.v1.json +1 -0
  183. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/reconcile.json +2 -0
  184. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/governance/policy.json +1 -0
  185. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/governance/revocations.json +1 -0
  186. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/manifest.json +1 -0
  187. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/attestation/bundle_head_attestation.json +1 -0
  188. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/events/events.jsonl +1 -0
  189. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/events/payload_material.jsonl +1 -0
  190. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/events/events.jsonl +1 -0
  191. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/events/payload_material.jsonl +1 -0
  192. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/snapshot.json +1 -0
  193. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/policy.json +1 -0
  194. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/revocations.json +1 -0
  195. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/events/events.jsonl +0 -0
  196. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/events/payload_material.jsonl +0 -0
  197. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/snapshot.json +1 -0
  198. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/keys/public_keys.json +1 -0
  199. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/manifest.json +1 -0
  200. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/verify/report.json +1 -0
  201. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/verify/verification_report.json +1 -0
  202. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/settld.json +1 -0
  203. package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
  204. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
  205. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/GLBatch.v1.json +1 -0
  206. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/JournalCsv.v1.csv +2 -0
  207. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/JournalCsv.v1.json +1 -0
  208. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/reconcile.json +1 -0
  209. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/governance/policy.json +1 -0
  210. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/governance/revocations.json +1 -0
  211. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/manifest.json +1 -0
  212. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/attestation/bundle_head_attestation.json +1 -0
  213. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/events/events.jsonl +1 -0
  214. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/events/payload_material.jsonl +1 -0
  215. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/events/events.jsonl +1 -0
  216. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/events/payload_material.jsonl +1 -0
  217. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/snapshot.json +1 -0
  218. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/policy.json +1 -0
  219. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/revocations.json +1 -0
  220. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/events/events.jsonl +0 -0
  221. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/events/payload_material.jsonl +0 -0
  222. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/snapshot.json +1 -0
  223. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/keys/public_keys.json +1 -0
  224. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/manifest.json +1 -0
  225. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/verify/report.json +1 -0
  226. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/verify/verification_report.json +1 -0
  227. package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/settld.json +1 -0
  228. package/conformance/v1/bundles/financepack/strict-pass/attestation/bundle_head_attestation.json +1 -0
  229. package/conformance/v1/bundles/financepack/strict-pass/finance/GLBatch.v1.json +1 -0
  230. package/conformance/v1/bundles/financepack/strict-pass/finance/JournalCsv.v1.csv +2 -0
  231. package/conformance/v1/bundles/financepack/strict-pass/finance/JournalCsv.v1.json +1 -0
  232. package/conformance/v1/bundles/financepack/strict-pass/finance/reconcile.json +1 -0
  233. package/conformance/v1/bundles/financepack/strict-pass/governance/policy.json +1 -0
  234. package/conformance/v1/bundles/financepack/strict-pass/governance/revocations.json +1 -0
  235. package/conformance/v1/bundles/financepack/strict-pass/manifest.json +1 -0
  236. package/conformance/v1/bundles/financepack/strict-pass/month/attestation/bundle_head_attestation.json +1 -0
  237. package/conformance/v1/bundles/financepack/strict-pass/month/events/events.jsonl +1 -0
  238. package/conformance/v1/bundles/financepack/strict-pass/month/events/payload_material.jsonl +1 -0
  239. package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/events/events.jsonl +1 -0
  240. package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/events/payload_material.jsonl +1 -0
  241. package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/snapshot.json +1 -0
  242. package/conformance/v1/bundles/financepack/strict-pass/month/governance/policy.json +1 -0
  243. package/conformance/v1/bundles/financepack/strict-pass/month/governance/revocations.json +1 -0
  244. package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/events/events.jsonl +0 -0
  245. package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/events/payload_material.jsonl +0 -0
  246. package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/snapshot.json +1 -0
  247. package/conformance/v1/bundles/financepack/strict-pass/month/keys/public_keys.json +1 -0
  248. package/conformance/v1/bundles/financepack/strict-pass/month/manifest.json +1 -0
  249. package/conformance/v1/bundles/financepack/strict-pass/month/verify/report.json +1 -0
  250. package/conformance/v1/bundles/financepack/strict-pass/month/verify/verification_report.json +1 -0
  251. package/conformance/v1/bundles/financepack/strict-pass/settld.json +1 -0
  252. package/conformance/v1/bundles/financepack/strict-pass/verify/verification_report.json +1 -0
  253. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
  254. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
  255. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
  256. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/invoice/invoice_claim.json +1 -0
  257. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/manifest.json +1 -0
  258. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/metering/metering_report.json +1 -0
  259. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  260. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/events/events.jsonl +1 -0
  261. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  262. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  263. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  264. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  265. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/policy.json +1 -0
  266. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/revocations.json +1 -0
  267. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  268. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  269. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  270. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/job/snapshot.json +1 -0
  271. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/keys/public_keys.json +1 -0
  272. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/manifest.json +1 -0
  273. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/verify/report.json +1 -0
  274. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/verify/verification_report.json +1 -0
  275. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/pricing/pricing_matrix.json +1 -0
  276. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/pricing/pricing_matrix_signatures.json +1 -0
  277. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/settld.json +1 -0
  278. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/attestation/bundle_head_attestation.json +1 -0
  279. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/governance/policy.json +1 -0
  280. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/governance/revocations.json +1 -0
  281. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/invoice/invoice_claim.json +1 -0
  282. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/manifest.json +1 -0
  283. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/metering/metering_report.json +1 -0
  284. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  285. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/events/events.jsonl +1 -0
  286. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  287. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  288. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  289. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  290. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/policy.json +1 -0
  291. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/revocations.json +1 -0
  292. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  293. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  294. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  295. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/job/snapshot.json +1 -0
  296. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/keys/public_keys.json +1 -0
  297. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/manifest.json +1 -0
  298. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/verify/report.json +1 -0
  299. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/verify/verification_report.json +1 -0
  300. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/pricing/pricing_matrix.json +1 -0
  301. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/settld.json +1 -0
  302. package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/verify/verification_report.json +1 -0
  303. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/attestation/bundle_head_attestation.json +1 -0
  304. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/governance/policy.json +1 -0
  305. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/governance/revocations.json +1 -0
  306. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/invoice/invoice_claim.json +1 -0
  307. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/manifest.json +1 -0
  308. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/metering/metering_report.json +1 -0
  309. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  310. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/events/events.jsonl +1 -0
  311. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  312. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  313. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  314. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  315. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/policy.json +1 -0
  316. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/revocations.json +1 -0
  317. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  318. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  319. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  320. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/job/snapshot.json +1 -0
  321. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/keys/public_keys.json +1 -0
  322. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/manifest.json +1 -0
  323. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/verify/report.json +1 -0
  324. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/verify/verification_report.json +1 -0
  325. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/pricing/pricing_matrix.json +1 -0
  326. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/pricing/pricing_matrix_signatures.json +1 -0
  327. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/settld.json +1 -0
  328. package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/verify/verification_report.json +1 -0
  329. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/attestation/bundle_head_attestation.json +1 -0
  330. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/governance/policy.json +1 -0
  331. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/governance/revocations.json +1 -0
  332. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/invoice/invoice_claim.json +1 -0
  333. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/manifest.json +1 -0
  334. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/metering/metering_report.json +1 -0
  335. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  336. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/events/events.jsonl +1 -0
  337. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  338. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  339. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  340. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  341. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/policy.json +1 -0
  342. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/revocations.json +1 -0
  343. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  344. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  345. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  346. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/job/snapshot.json +1 -0
  347. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/keys/public_keys.json +1 -0
  348. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/manifest.json +1 -0
  349. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/verify/report.json +1 -0
  350. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/verify/verification_report.json +1 -0
  351. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/pricing/pricing_matrix.json +1 -0
  352. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/pricing/pricing_matrix_signatures.json +1 -0
  353. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/settld.json +1 -0
  354. package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/verify/verification_report.json +1 -0
  355. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/attestation/bundle_head_attestation.json +1 -0
  356. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/governance/policy.json +1 -0
  357. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/governance/revocations.json +1 -0
  358. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/invoice/invoice_claim.json +1 -0
  359. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/manifest.json +1 -0
  360. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/metering/metering_report.json +1 -0
  361. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  362. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/events/events.jsonl +1 -0
  363. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  364. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  365. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  366. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  367. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/policy.json +1 -0
  368. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/revocations.json +1 -0
  369. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  370. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  371. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  372. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/job/snapshot.json +1 -0
  373. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/keys/public_keys.json +1 -0
  374. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/manifest.json +1 -0
  375. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/verify/report.json +1 -0
  376. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/verify/verification_report.json +1 -0
  377. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/pricing/pricing_matrix.json +1 -0
  378. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/pricing/pricing_matrix_signatures.json +1 -0
  379. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/settld.json +1 -0
  380. package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/verify/verification_report.json +1 -0
  381. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/attestation/bundle_head_attestation.json +1 -0
  382. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/governance/policy.json +1 -0
  383. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/governance/revocations.json +1 -0
  384. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/invoice/invoice_claim.json +1 -0
  385. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/manifest.json +1 -0
  386. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/metering/metering_report.json +1 -0
  387. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  388. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/events/events.jsonl +1 -0
  389. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  390. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  391. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  392. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  393. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/policy.json +1 -0
  394. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/revocations.json +1 -0
  395. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  396. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  397. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  398. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/job/snapshot.json +1 -0
  399. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/keys/public_keys.json +1 -0
  400. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/manifest.json +1 -0
  401. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/verify/report.json +1 -0
  402. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/verify/verification_report.json +1 -0
  403. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/pricing/pricing_matrix.json +1 -0
  404. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/settld.json +1 -0
  405. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/verify/verification_report.json +1 -0
  406. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
  407. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/governance/policy.json +1 -0
  408. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/governance/revocations.json +1 -0
  409. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/invoice/invoice_claim.json +1 -0
  410. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/manifest.json +1 -0
  411. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/metering/metering_report.json +1 -0
  412. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  413. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/events/events.jsonl +1 -0
  414. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  415. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  416. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  417. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  418. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/policy.json +1 -0
  419. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/revocations.json +1 -0
  420. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  421. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  422. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  423. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/job/snapshot.json +1 -0
  424. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/keys/public_keys.json +1 -0
  425. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/manifest.json +1 -0
  426. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/verify/report.json +1 -0
  427. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/verify/verification_report.json +1 -0
  428. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/pricing/pricing_matrix.json +1 -0
  429. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/pricing/pricing_matrix_signatures.json +1 -0
  430. package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/settld.json +1 -0
  431. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/attestation/bundle_head_attestation.json +1 -0
  432. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/governance/policy.json +1 -0
  433. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/governance/revocations.json +1 -0
  434. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/invoice/invoice_claim.json +1 -0
  435. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/manifest.json +1 -0
  436. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/metering/metering_report.json +1 -0
  437. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  438. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/events/events.jsonl +1 -0
  439. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  440. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  441. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  442. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  443. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/policy.json +1 -0
  444. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/revocations.json +1 -0
  445. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  446. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  447. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  448. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/job/snapshot.json +1 -0
  449. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/keys/public_keys.json +1 -0
  450. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/manifest.json +1 -0
  451. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/verify/report.json +1 -0
  452. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/verify/verification_report.json +1 -0
  453. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/pricing/pricing_matrix.json +1 -0
  454. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/pricing/pricing_matrix_signatures.json +1 -0
  455. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/settld.json +1 -0
  456. package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/verify/verification_report.json +1 -0
  457. package/conformance/v1/bundles/invoicebundle/strict-pass/attestation/bundle_head_attestation.json +1 -0
  458. package/conformance/v1/bundles/invoicebundle/strict-pass/governance/policy.json +1 -0
  459. package/conformance/v1/bundles/invoicebundle/strict-pass/governance/revocations.json +1 -0
  460. package/conformance/v1/bundles/invoicebundle/strict-pass/invoice/invoice_claim.json +1 -0
  461. package/conformance/v1/bundles/invoicebundle/strict-pass/manifest.json +1 -0
  462. package/conformance/v1/bundles/invoicebundle/strict-pass/metering/metering_report.json +1 -0
  463. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
  464. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/events/events.jsonl +1 -0
  465. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
  466. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
  467. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
  468. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
  469. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/policy.json +1 -0
  470. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/revocations.json +1 -0
  471. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
  472. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
  473. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
  474. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/job/snapshot.json +1 -0
  475. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/keys/public_keys.json +1 -0
  476. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/manifest.json +1 -0
  477. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/verify/report.json +1 -0
  478. package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/verify/verification_report.json +1 -0
  479. package/conformance/v1/bundles/invoicebundle/strict-pass/pricing/pricing_matrix.json +1 -0
  480. package/conformance/v1/bundles/invoicebundle/strict-pass/pricing/pricing_matrix_signatures.json +1 -0
  481. package/conformance/v1/bundles/invoicebundle/strict-pass/settld.json +1 -0
  482. package/conformance/v1/bundles/invoicebundle/strict-pass/verify/verification_report.json +1 -0
  483. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
  484. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/events/events.jsonl +1 -0
  485. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/events/payload_material.jsonl +1 -0
  486. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/events/events.jsonl +1 -0
  487. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/events/payload_material.jsonl +1 -0
  488. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/snapshot.json +1 -0
  489. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
  490. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
  491. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/events/events.jsonl +0 -0
  492. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/events/payload_material.jsonl +0 -0
  493. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/snapshot.json +1 -0
  494. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/job/snapshot.json +1 -0
  495. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/keys/public_keys.json +1 -0
  496. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/manifest.json +1 -0
  497. package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/verify/report.json +1 -0
  498. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
  499. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/events/events.jsonl +1 -0
  500. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/events/payload_material.jsonl +1 -0
  501. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/events/events.jsonl +1 -0
  502. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/events/payload_material.jsonl +1 -0
  503. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/snapshot.json +1 -0
  504. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/policy.json +1 -0
  505. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/revocations.json +1 -0
  506. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/events/events.jsonl +0 -0
  507. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/events/payload_material.jsonl +0 -0
  508. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/snapshot.json +1 -0
  509. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/job/snapshot.json +1 -0
  510. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/keys/public_keys.json +1 -0
  511. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/manifest.json +1 -0
  512. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/verify/report.json +1 -0
  513. package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
  514. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/attestation/bundle_head_attestation.json +1 -0
  515. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/events/events.jsonl +1 -0
  516. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/events/payload_material.jsonl +1 -0
  517. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/events/events.jsonl +1 -0
  518. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/events/payload_material.jsonl +1 -0
  519. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/snapshot.json +1 -0
  520. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/policy.json +1 -0
  521. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/revocations.json +1 -0
  522. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/events/events.jsonl +0 -0
  523. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/events/payload_material.jsonl +0 -0
  524. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/snapshot.json +1 -0
  525. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/job/snapshot.json +1 -0
  526. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/keys/public_keys.json +1 -0
  527. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/manifest.json +1 -0
  528. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/verify/report.json +1 -0
  529. package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/verify/verification_report.json +1 -0
  530. package/conformance/v1/bundles/jobproof/strict-pass/attestation/bundle_head_attestation.json +1 -0
  531. package/conformance/v1/bundles/jobproof/strict-pass/events/events.jsonl +1 -0
  532. package/conformance/v1/bundles/jobproof/strict-pass/events/payload_material.jsonl +1 -0
  533. package/conformance/v1/bundles/jobproof/strict-pass/governance/global/events/events.jsonl +1 -0
  534. package/conformance/v1/bundles/jobproof/strict-pass/governance/global/events/payload_material.jsonl +1 -0
  535. package/conformance/v1/bundles/jobproof/strict-pass/governance/global/snapshot.json +1 -0
  536. package/conformance/v1/bundles/jobproof/strict-pass/governance/policy.json +1 -0
  537. package/conformance/v1/bundles/jobproof/strict-pass/governance/revocations.json +1 -0
  538. package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/events/events.jsonl +0 -0
  539. package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/events/payload_material.jsonl +0 -0
  540. package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/snapshot.json +1 -0
  541. package/conformance/v1/bundles/jobproof/strict-pass/job/snapshot.json +1 -0
  542. package/conformance/v1/bundles/jobproof/strict-pass/keys/public_keys.json +1 -0
  543. package/conformance/v1/bundles/jobproof/strict-pass/manifest.json +1 -0
  544. package/conformance/v1/bundles/jobproof/strict-pass/verify/report.json +1 -0
  545. package/conformance/v1/bundles/jobproof/strict-pass/verify/verification_report.json +1 -0
  546. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
  547. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/events/events.jsonl +1 -0
  548. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/events/payload_material.jsonl +1 -0
  549. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/events/events.jsonl +1 -0
  550. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/events/payload_material.jsonl +1 -0
  551. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/snapshot.json +1 -0
  552. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
  553. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
  554. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/events/events.jsonl +0 -0
  555. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/events/payload_material.jsonl +0 -0
  556. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/snapshot.json +1 -0
  557. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/keys/public_keys.json +1 -0
  558. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/manifest.json +1 -0
  559. package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/verify/report.json +1 -0
  560. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
  561. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/events/events.jsonl +2 -0
  562. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/events/payload_material.jsonl +1 -0
  563. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/events/events.jsonl +1 -0
  564. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/events/payload_material.jsonl +1 -0
  565. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/snapshot.json +1 -0
  566. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/policy.json +1 -0
  567. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/revocations.json +1 -0
  568. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/events/events.jsonl +0 -0
  569. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/events/payload_material.jsonl +0 -0
  570. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/snapshot.json +1 -0
  571. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/keys/public_keys.json +1 -0
  572. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/manifest.json +1 -0
  573. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/verify/report.json +1 -0
  574. package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
  575. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/attestation/bundle_head_attestation.json +1 -0
  576. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/events/events.jsonl +1 -0
  577. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/events/payload_material.jsonl +1 -0
  578. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/events/events.jsonl +1 -0
  579. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/events/payload_material.jsonl +1 -0
  580. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/snapshot.json +1 -0
  581. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/policy.json +1 -0
  582. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/revocations.json +1 -0
  583. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/events/events.jsonl +0 -0
  584. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/events/payload_material.jsonl +0 -0
  585. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/snapshot.json +1 -0
  586. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/keys/public_keys.json +1 -0
  587. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/manifest.json +1 -0
  588. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/verify/report.json +1 -0
  589. package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/verify/verification_report.json +1 -0
  590. package/conformance/v1/bundles/monthproof/strict-pass/attestation/bundle_head_attestation.json +1 -0
  591. package/conformance/v1/bundles/monthproof/strict-pass/events/events.jsonl +1 -0
  592. package/conformance/v1/bundles/monthproof/strict-pass/events/payload_material.jsonl +1 -0
  593. package/conformance/v1/bundles/monthproof/strict-pass/governance/global/events/events.jsonl +1 -0
  594. package/conformance/v1/bundles/monthproof/strict-pass/governance/global/events/payload_material.jsonl +1 -0
  595. package/conformance/v1/bundles/monthproof/strict-pass/governance/global/snapshot.json +1 -0
  596. package/conformance/v1/bundles/monthproof/strict-pass/governance/policy.json +1 -0
  597. package/conformance/v1/bundles/monthproof/strict-pass/governance/revocations.json +1 -0
  598. package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/events/events.jsonl +0 -0
  599. package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/events/payload_material.jsonl +0 -0
  600. package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/snapshot.json +1 -0
  601. package/conformance/v1/bundles/monthproof/strict-pass/keys/public_keys.json +1 -0
  602. package/conformance/v1/bundles/monthproof/strict-pass/manifest.json +1 -0
  603. package/conformance/v1/bundles/monthproof/strict-pass/verify/report.json +1 -0
  604. package/conformance/v1/bundles/monthproof/strict-pass/verify/verification_report.json +1 -0
  605. package/conformance/v1/cases.json +381 -0
  606. package/conformance/v1/expected/closepack_nonstrict_pass_missing_sla_acceptance.json +9 -0
  607. package/conformance/v1/expected/closepack_strict_fail_embedded_invoice_fails.json +9 -0
  608. package/conformance/v1/expected/closepack_strict_fail_evidence_index_mismatch.json +9 -0
  609. package/conformance/v1/expected/closepack_strict_pass.json +9 -0
  610. package/conformance/v1/expected/financepack_strict_fail_missing_verification_report.json +9 -0
  611. package/conformance/v1/expected/financepack_strict_fail_on_warnings_tool_version_unknown.json +9 -0
  612. package/conformance/v1/expected/financepack_strict_fail_trust_roots_missing.json +9 -0
  613. package/conformance/v1/expected/financepack_strict_fail_trust_roots_wrong.json +9 -0
  614. package/conformance/v1/expected/financepack_strict_pass.json +9 -0
  615. package/conformance/v1/expected/invoicebundle_nonstrict_pass_missing_verification_report.json +9 -0
  616. package/conformance/v1/expected/invoicebundle_nonstrict_pass_unsigned_pricing_matrix_warning.json +9 -0
  617. package/conformance/v1/expected/invoicebundle_strict_fail_evidence_sha_mismatch.json +9 -0
  618. package/conformance/v1/expected/invoicebundle_strict_fail_invalid_pricing_matrix_signature.json +9 -0
  619. package/conformance/v1/expected/invoicebundle_strict_fail_invoice_total_mismatch.json +9 -0
  620. package/conformance/v1/expected/invoicebundle_strict_fail_missing_pricing_matrix_signature.json +9 -0
  621. package/conformance/v1/expected/invoicebundle_strict_fail_missing_verification_report.json +9 -0
  622. package/conformance/v1/expected/invoicebundle_strict_fail_pricing_code_unknown.json +9 -0
  623. package/conformance/v1/expected/invoicebundle_strict_pass.json +9 -0
  624. package/conformance/v1/expected/jobproof_nonstrict_pass_missing_verification_report.json +9 -0
  625. package/conformance/v1/expected/jobproof_strict_fail_manifest_tamper.json +9 -0
  626. package/conformance/v1/expected/jobproof_strict_fail_unauthorized_signer.json +9 -0
  627. package/conformance/v1/expected/jobproof_strict_pass.json +9 -0
  628. package/conformance/v1/expected/monthproof_nonstrict_pass_missing_verification_report.json +9 -0
  629. package/conformance/v1/expected/monthproof_strict_fail_manifest_tamper.json +9 -0
  630. package/conformance/v1/expected/monthproof_strict_fail_unauthorized_signer.json +9 -0
  631. package/conformance/v1/expected/monthproof_strict_pass.json +9 -0
  632. package/conformance/v1/expected/security_bundle_symlink_outside.json +9 -0
  633. package/conformance/v1/expected/security_manifest_case_collision.json +8 -0
  634. package/conformance/v1/expected/security_manifest_duplicate_paths.json +9 -0
  635. package/conformance/v1/expected/security_manifest_path_traversal.json +9 -0
  636. package/conformance/v1/lib/harness.mjs +78 -0
  637. package/conformance/v1/lib/mutations.mjs +61 -0
  638. package/conformance/v1/produce-cases.json +75 -0
  639. package/conformance/v1/producer/bad-plugin-invalid-provider.mjs +4 -0
  640. package/conformance/v1/producer/bad-plugin-no-export.mjs +3 -0
  641. package/conformance/v1/producer/fixture_keypairs.json +18 -0
  642. package/conformance/v1/producer/inmemory-signer-plugin.mjs +47 -0
  643. package/conformance/v1/producer/signer-stdio-bad-json.mjs +54 -0
  644. package/conformance/v1/producer/signer-stdio-partial-stdout-exit1.mjs +51 -0
  645. package/conformance/v1/producer/signer-stdio-stderr-only-exit1.mjs +46 -0
  646. package/conformance/v1/producer/signer-stdio-stub.mjs +134 -0
  647. package/conformance/v1/protocol-vectors/v1.json +81 -0
  648. package/conformance/v1/release-cases.json +111 -0
  649. package/conformance/v1/release-trust-quorum.json +15 -0
  650. package/conformance/v1/release-trust-revoked.json +16 -0
  651. package/conformance/v1/release-trust.json +15 -0
  652. package/conformance/v1/releases/release_fail_asset_hash_mismatch/a.tgz +1 -0
  653. package/conformance/v1/releases/release_fail_asset_hash_mismatch/b.tar.gz +1 -0
  654. package/conformance/v1/releases/release_fail_asset_hash_mismatch/release_index_v1.json +1 -0
  655. package/conformance/v1/releases/release_fail_asset_hash_mismatch/release_index_v1.sig +1 -0
  656. package/conformance/v1/releases/release_fail_missing_asset/a.tgz +1 -0
  657. package/conformance/v1/releases/release_fail_missing_asset/release_index_v1.json +1 -0
  658. package/conformance/v1/releases/release_fail_missing_asset/release_index_v1.sig +1 -0
  659. package/conformance/v1/releases/release_fail_signature_invalid/a.tgz +1 -0
  660. package/conformance/v1/releases/release_fail_signature_invalid/b.tar.gz +1 -0
  661. package/conformance/v1/releases/release_fail_signature_invalid/release_index_v1.json +1 -0
  662. package/conformance/v1/releases/release_fail_signature_invalid/release_index_v1.sig +1 -0
  663. package/conformance/v1/releases/release_pass/a.tgz +1 -0
  664. package/conformance/v1/releases/release_pass/b.tar.gz +1 -0
  665. package/conformance/v1/releases/release_pass/release_index_v1.json +1 -0
  666. package/conformance/v1/releases/release_pass/release_index_v1.sig +1 -0
  667. package/conformance/v1/run-produce.mjs +507 -0
  668. package/conformance/v1/run-release.mjs +129 -0
  669. package/conformance/v1/run.mjs +229 -0
  670. package/conformance/v1/trust.json +11 -0
  671. package/docker-compose.yml +154 -0
  672. package/package.json +98 -0
  673. package/packages/artifact-verify/src/bundle-path.js +60 -0
  674. package/packages/artifact-verify/src/canonical-json.js +48 -0
  675. package/packages/artifact-verify/src/close-pack-bundle.js +914 -0
  676. package/packages/artifact-verify/src/crypto.js +18 -0
  677. package/packages/artifact-verify/src/finance-pack-bundle.js +750 -0
  678. package/packages/artifact-verify/src/governance-policy.js +312 -0
  679. package/packages/artifact-verify/src/hash-file.js +38 -0
  680. package/packages/artifact-verify/src/index.js +100 -0
  681. package/packages/artifact-verify/src/invoice-bundle.js +865 -0
  682. package/packages/artifact-verify/src/job-proof-bundle.js +1996 -0
  683. package/packages/artifact-verify/src/map-with-concurrency.js +32 -0
  684. package/packages/artifact-verify/src/reconcile.js +135 -0
  685. package/packages/artifact-verify/src/release/release-index-lib.js +190 -0
  686. package/packages/artifact-verify/src/release/verify-release.js +187 -0
  687. package/packages/artifact-verify/src/revocation-list.js +119 -0
  688. package/packages/artifact-verify/src/safe-unzip.js +335 -0
  689. package/packages/artifact-verify/src/settlement-decision-report.js +61 -0
  690. package/packages/artifact-verify/src/timestamp-proof.js +49 -0
  691. package/packages/artifact-verify/src/tool-provenance.js +49 -0
  692. package/packages/artifact-verify/src/trust.js +54 -0
  693. package/packages/artifact-verify/src/verification-warnings.js +34 -0
  694. package/scripts/closepack/export.mjs +101 -0
  695. package/scripts/closepack/lib.mjs +1068 -0
  696. package/scripts/closepack/verify.mjs +65 -0
  697. package/scripts/init/capability.mjs +556 -0
  698. package/scripts/init/postinstall-sanity.mjs +18 -0
  699. package/services/finance-sink/README.md +37 -0
  700. package/services/finance-sink/package.json +6 -0
  701. package/services/finance-sink/src/ack-worker.js +152 -0
  702. package/services/finance-sink/src/config.js +176 -0
  703. package/services/finance-sink/src/dedupe-store.js +232 -0
  704. package/services/finance-sink/src/s3-store.js +139 -0
  705. package/services/finance-sink/src/server.js +391 -0
  706. package/services/receiver/README.md +49 -0
  707. package/services/receiver/package.json +6 -0
  708. package/services/receiver/src/ack-worker.js +166 -0
  709. package/services/receiver/src/config.js +178 -0
  710. package/services/receiver/src/dedupe-store.js +232 -0
  711. package/services/receiver/src/s3-store.js +111 -0
  712. package/services/receiver/src/server.js +304 -0
  713. package/src/agent/agent-sim.js +167 -0
  714. package/src/api/app.js +31794 -0
  715. package/src/api/http.js +124 -0
  716. package/src/api/maintenance.js +174 -0
  717. package/src/api/middleware/auth.js +105 -0
  718. package/src/api/middleware/authz.js +19 -0
  719. package/src/api/openapi.js +5684 -0
  720. package/src/api/outbox.js +93 -0
  721. package/src/api/persistence.js +628 -0
  722. package/src/api/server.js +100 -0
  723. package/src/api/store.js +2088 -0
  724. package/src/api/workers/artifacts.js +574 -0
  725. package/src/api/workers/deliveries.js +628 -0
  726. package/src/api/workers/proof.js +374 -0
  727. package/src/core/acceptance-criteria.js +78 -0
  728. package/src/core/access.js +130 -0
  729. package/src/core/agent-reputation.js +311 -0
  730. package/src/core/agent-runs.js +253 -0
  731. package/src/core/agent-wallets.js +883 -0
  732. package/src/core/allocations.js +160 -0
  733. package/src/core/artifact-verification-status.js +216 -0
  734. package/src/core/artifacts.js +938 -0
  735. package/src/core/assist.js +106 -0
  736. package/src/core/audit-export.js +68 -0
  737. package/src/core/auth.js +189 -0
  738. package/src/core/billing-plans.js +187 -0
  739. package/src/core/booking.js +268 -0
  740. package/src/core/cancellation.js +34 -0
  741. package/src/core/canonical-json.js +104 -0
  742. package/src/core/claims.js +152 -0
  743. package/src/core/close-pack-bundle.js +527 -0
  744. package/src/core/config.js +272 -0
  745. package/src/core/contract-compiler.js +68 -0
  746. package/src/core/contract-document.js +226 -0
  747. package/src/core/contract-selection.js +152 -0
  748. package/src/core/contracts.js +439 -0
  749. package/src/core/crypto.js +30 -0
  750. package/src/core/deterministic-zip.js +169 -0
  751. package/src/core/dispatch-events.js +113 -0
  752. package/src/core/dispatch.js +26 -0
  753. package/src/core/dispute-open-envelope.js +163 -0
  754. package/src/core/escrow-ledger.js +329 -0
  755. package/src/core/event-chain.js +114 -0
  756. package/src/core/event-policy.js +120 -0
  757. package/src/core/evidence-linker.js +93 -0
  758. package/src/core/evidence-store.js +286 -0
  759. package/src/core/evidence.js +119 -0
  760. package/src/core/failpoints.js +30 -0
  761. package/src/core/finance-account-map.js +59 -0
  762. package/src/core/finance-pack-bundle.js +554 -0
  763. package/src/core/funding-hold.js +185 -0
  764. package/src/core/gl-batch.js +107 -0
  765. package/src/core/governance-policy.js +174 -0
  766. package/src/core/governance.js +92 -0
  767. package/src/core/hold-exposure.js +74 -0
  768. package/src/core/idempotency.js +51 -0
  769. package/src/core/ids.js +21 -0
  770. package/src/core/incidents.js +75 -0
  771. package/src/core/insurer-reimbursements.js +58 -0
  772. package/src/core/interaction-directions.js +170 -0
  773. package/src/core/invoice-bundle.js +564 -0
  774. package/src/core/job-reducer.js +702 -0
  775. package/src/core/job-state-machine.js +266 -0
  776. package/src/core/journal-csv.js +94 -0
  777. package/src/core/ledger-postings-finance.js +31 -0
  778. package/src/core/ledger-postings.js +476 -0
  779. package/src/core/ledger.js +59 -0
  780. package/src/core/liveness.js +154 -0
  781. package/src/core/log.js +156 -0
  782. package/src/core/maintenance-locks.js +3 -0
  783. package/src/core/marketplace-kernel.js +243 -0
  784. package/src/core/metrics.js +133 -0
  785. package/src/core/money-rail-adapters.js +735 -0
  786. package/src/core/month-close-hold-policy.js +19 -0
  787. package/src/core/month-close.js +159 -0
  788. package/src/core/operator-cost.js +79 -0
  789. package/src/core/operator-coverage.js +46 -0
  790. package/src/core/operator-reducer.js +73 -0
  791. package/src/core/operators.js +52 -0
  792. package/src/core/ops-audit.js +45 -0
  793. package/src/core/party-statements.js +145 -0
  794. package/src/core/pilot-templates.js +26 -0
  795. package/src/core/policy.js +76 -0
  796. package/src/core/pricing.js +71 -0
  797. package/src/core/proof-bundle.js +1153 -0
  798. package/src/core/proof-events.js +88 -0
  799. package/src/core/proof-verifier.js +261 -0
  800. package/src/core/proof.js +46 -0
  801. package/src/core/protocol.js +105 -0
  802. package/src/core/quotas.js +32 -0
  803. package/src/core/reputation-event.js +203 -0
  804. package/src/core/rescheduling.js +51 -0
  805. package/src/core/retention.js +32 -0
  806. package/src/core/revocation-list.js +70 -0
  807. package/src/core/risk.js +383 -0
  808. package/src/core/robot-health.js +111 -0
  809. package/src/core/robot-reducer.js +198 -0
  810. package/src/core/robots.js +152 -0
  811. package/src/core/s3-presign.js +111 -0
  812. package/src/core/secrets.js +128 -0
  813. package/src/core/settlement-adjustment.js +151 -0
  814. package/src/core/settlement-kernel.js +405 -0
  815. package/src/core/settlement-policy.js +206 -0
  816. package/src/core/settlement-splits.js +46 -0
  817. package/src/core/signer-keys.js +33 -0
  818. package/src/core/skills.js +86 -0
  819. package/src/core/sla-events.js +229 -0
  820. package/src/core/sla-metering.js +169 -0
  821. package/src/core/sla-policy-templates.js +340 -0
  822. package/src/core/sla.js +29 -0
  823. package/src/core/statements.js +426 -0
  824. package/src/core/tenancy.js +55 -0
  825. package/src/core/timestamp-proof.js +36 -0
  826. package/src/core/tool-manifest.js +116 -0
  827. package/src/core/tool-provenance.js +36 -0
  828. package/src/core/url-safety.js +263 -0
  829. package/src/core/verification-warnings.js +53 -0
  830. package/src/core/zone-coverage.js +59 -0
  831. package/src/core/zones.js +8 -0
  832. package/src/core/zoneset.js +67 -0
  833. package/src/db/migrate.js +61 -0
  834. package/src/db/migrations/001_init.sql +92 -0
  835. package/src/db/migrations/002_robot_reservations.sql +23 -0
  836. package/src/db/migrations/003_idempotency_v2.sql +32 -0
  837. package/src/db/migrations/004_notifications.sql +12 -0
  838. package/src/db/migrations/005_multi_tenant.sql +106 -0
  839. package/src/db/migrations/006_contracts.sql +27 -0
  840. package/src/db/migrations/007_artifacts_deliveries_correlations.sql +53 -0
  841. package/src/db/migrations/008_delivery_ingest_hardening.sql +52 -0
  842. package/src/db/migrations/009_auth_keys.sql +21 -0
  843. package/src/db/migrations/010_signer_keys.sql +25 -0
  844. package/src/db/migrations/011_ops_audit.sql +33 -0
  845. package/src/db/migrations/012_retention.sql +16 -0
  846. package/src/db/migrations/013_perf_indexes.sql +18 -0
  847. package/src/db/migrations/014_contracts_v2.sql +68 -0
  848. package/src/db/migrations/015_parties.sql +16 -0
  849. package/src/db/migrations/016_ledger_allocations.sql +18 -0
  850. package/src/db/migrations/017_party_statements.sql +31 -0
  851. package/src/db/migrations/018_finance_account_map.sql +12 -0
  852. package/src/db/migrations/019_ledger_allocations_account_id.sql +7 -0
  853. package/src/db/migrations/020_artifacts_source_event_unique.sql +10 -0
  854. package/src/db/migrations/021_artifacts_by_job_created_at_id.sql +6 -0
  855. package/src/db/migrations/022_governance_uniqueness.sql +28 -0
  856. package/src/db/migrations/023_marketplace_tasks.sql +45 -0
  857. package/src/db/migrations/024_agent_runtime_state.sql +70 -0
  858. package/src/db/migrations/025_tenant_settlement_policies.sql +19 -0
  859. package/src/db/migrations/026_money_rails_billable_events.sql +82 -0
  860. package/src/db/migrations/027_tenant_billing_config.sql +10 -0
  861. package/src/db/migrations/028_marketplace_rfq_storage.sql +121 -0
  862. package/src/db/pg.js +123 -0
  863. package/src/db/store-pg.js +6465 -0
@@ -0,0 +1,914 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+
4
+ import { canonicalJsonStringify } from "./canonical-json.js";
5
+ import { sha256HexUtf8, verifyHashHexEd25519 } from "./crypto.js";
6
+ import { hashFile } from "./hash-file.js";
7
+ import { mapWithConcurrency } from "./map-with-concurrency.js";
8
+ import { prevalidateManifestFileEntries, resolveBundlePath } from "./bundle-path.js";
9
+ import {
10
+ GOVERNANCE_POLICY_SCHEMA_V2,
11
+ authorizeServerSignerForPolicy,
12
+ parseGovernancePolicyV1,
13
+ parseGovernancePolicyV2,
14
+ verifyGovernancePolicyV2Signature
15
+ } from "./governance-policy.js";
16
+ import { deriveKeyTimelineFromRevocationList, parseRevocationListV1, verifyRevocationListV1Signature } from "./revocation-list.js";
17
+ import { verifyTimestampProofV1 } from "./timestamp-proof.js";
18
+ import { trustedGovernanceRootKeysFromEnv, trustedTimeAuthorityKeysFromEnv } from "./trust.js";
19
+ import { verifyInvoiceBundleDir } from "./invoice-bundle.js";
20
+ import { VERIFICATION_WARNING_CODE, validateVerificationWarnings } from "./verification-warnings.js";
21
+
22
+ export const CLOSE_PACK_TYPE_V1 = "ClosePack.v1";
23
+ export const CLOSE_PACK_MANIFEST_SCHEMA_V1 = "ClosePackManifest.v1";
24
+ export const BUNDLE_HEAD_ATTESTATION_SCHEMA_V1 = "BundleHeadAttestation.v1";
25
+
26
+ const DEFAULT_HASH_CONCURRENCY = 16;
27
+
28
+ async function readJson(filepath) {
29
+ const raw = await fs.readFile(filepath, "utf8");
30
+ return JSON.parse(raw);
31
+ }
32
+
33
+ function normalizeHashConcurrency(value) {
34
+ if (value === null || value === undefined) return DEFAULT_HASH_CONCURRENCY;
35
+ if (!Number.isInteger(value) || value < 1) throw new TypeError("hashConcurrency must be a positive integer");
36
+ return value;
37
+ }
38
+
39
+ function stripManifestHash(manifestWithHash) {
40
+ const { manifestHash: _ignored, ...rest } = manifestWithHash ?? {};
41
+ return rest;
42
+ }
43
+
44
+ function stripVerificationReportSig(report) {
45
+ const { reportHash: _h, signature: _sig, ...rest } = report ?? {};
46
+ return rest;
47
+ }
48
+
49
+ function stripAttestationSig(attestation) {
50
+ const { signature: _sig, attestationHash: _hash, ...rest } = attestation ?? {};
51
+ return rest;
52
+ }
53
+
54
+ function safeIsoToMs(value) {
55
+ const t = Date.parse(String(value ?? ""));
56
+ return Number.isFinite(t) ? t : NaN;
57
+ }
58
+
59
+ function keyEffectiveWindowMs(meta) {
60
+ const validFromMs = safeIsoToMs(meta?.validFrom);
61
+ const validToMs = safeIsoToMs(meta?.validTo);
62
+ const rotatedAtMs = safeIsoToMs(meta?.rotatedAt);
63
+ const revokedAtMs = safeIsoToMs(meta?.revokedAt);
64
+ return { validFromMs, validToMs, rotatedAtMs, revokedAtMs };
65
+ }
66
+
67
+ function isServerKeyUsableAtForAttestation({ meta, atIso }) {
68
+ if (!meta || typeof meta !== "object") return { ok: true };
69
+ const atMs = safeIsoToMs(atIso);
70
+ if (!Number.isFinite(atMs)) return { ok: true };
71
+ const { validFromMs, validToMs } = keyEffectiveWindowMs(meta);
72
+ if (Number.isFinite(validFromMs) && atMs < validFromMs) return { ok: false, reason: "NOT_YET_VALID", boundary: meta.validFrom ?? null };
73
+ if (Number.isFinite(validToMs) && atMs > validToMs) return { ok: false, reason: "EXPIRED", boundary: meta.validTo ?? null };
74
+ return { ok: true };
75
+ }
76
+
77
+ function enforceProspectiveKeyTimeline({ signerKeyId, effectiveSignedAt, trustworthyTime, timelineRow }) {
78
+ const atMs = safeIsoToMs(effectiveSignedAt);
79
+ if (!Number.isFinite(atMs)) return { ok: true };
80
+ if (!timelineRow || typeof timelineRow !== "object") return { ok: true };
81
+
82
+ const revokedAt = typeof timelineRow.revokedAt === "string" ? timelineRow.revokedAt : null;
83
+ const rotatedAt = typeof timelineRow.rotatedAt === "string" ? timelineRow.rotatedAt : null;
84
+
85
+ const revokedMs = safeIsoToMs(revokedAt);
86
+ if (Number.isFinite(revokedMs)) {
87
+ if (atMs >= revokedMs) return { ok: false, error: "SIGNER_REVOKED", signerKeyId, boundary: revokedAt };
88
+ if (!trustworthyTime) return { ok: false, error: "SIGNING_TIME_UNPROVABLE", signerKeyId, boundary: revokedAt };
89
+ }
90
+
91
+ const rotatedMs = safeIsoToMs(rotatedAt);
92
+ if (Number.isFinite(rotatedMs)) {
93
+ if (atMs >= rotatedMs) return { ok: false, error: "SIGNER_ROTATED", signerKeyId, boundary: rotatedAt };
94
+ if (!trustworthyTime) return { ok: false, error: "SIGNING_TIME_UNPROVABLE", signerKeyId, boundary: rotatedAt };
95
+ }
96
+
97
+ return { ok: true };
98
+ }
99
+
100
+ function effectiveSigningTimeFromTimestampProof({ documentCoreWithProof, fallbackSignedAt, trustedTimeAuthorities }) {
101
+ const proof = documentCoreWithProof?.timestampProof ?? null;
102
+ if (!proof) return { effectiveSignedAt: fallbackSignedAt ?? null, trustworthy: false, proof: null };
103
+ const res = verifyTimestampProofV1({ proof, trustedTimeAuthorityPublicKeyByKeyId: trustedTimeAuthorities });
104
+ if (!res.ok) return { effectiveSignedAt: fallbackSignedAt ?? null, trustworthy: false, proof };
105
+ const timestamp = typeof proof.timestamp === "string" ? proof.timestamp : null;
106
+ return { effectiveSignedAt: timestamp ?? fallbackSignedAt ?? null, trustworthy: true, proof };
107
+ }
108
+
109
+ function parsePublicKeysV1(keysJson) {
110
+ const publicKeyByKeyId = new Map();
111
+ const keyMetaByKeyId = new Map();
112
+ const schemaVersion = typeof keysJson?.schemaVersion === "string" ? keysJson.schemaVersion : null;
113
+ if (schemaVersion !== "PublicKeys.v1") return { ok: false, error: "unsupported keys schemaVersion", schemaVersion };
114
+ const keys = Array.isArray(keysJson?.keys) ? keysJson.keys : [];
115
+ for (const k of keys) {
116
+ if (!k || typeof k !== "object") continue;
117
+ const keyId = typeof k.keyId === "string" && k.keyId.trim() ? k.keyId : null;
118
+ const publicKeyPem = typeof k.publicKeyPem === "string" && k.publicKeyPem.trim() ? k.publicKeyPem : null;
119
+ if (!keyId || !publicKeyPem) continue;
120
+ publicKeyByKeyId.set(keyId, publicKeyPem);
121
+ keyMetaByKeyId.set(keyId, k);
122
+ }
123
+ return { ok: true, publicKeyByKeyId, keyMetaByKeyId };
124
+ }
125
+
126
+ function parseJsonl(text) {
127
+ const out = [];
128
+ const lines = String(text ?? "").split("\n");
129
+ for (const line of lines) {
130
+ const trimmed = line.trim();
131
+ if (!trimmed) continue;
132
+ out.push(JSON.parse(trimmed));
133
+ }
134
+ return out;
135
+ }
136
+
137
+ function deriveServerKeyTimelineFromGovernanceEvents(events) {
138
+ const out = new Map();
139
+ const list = Array.isArray(events) ? events : [];
140
+ for (const e of list) {
141
+ if (!e || typeof e !== "object") continue;
142
+ const type = String(e.type ?? "");
143
+ const at = typeof e.at === "string" ? e.at : null;
144
+ const p = e.payload ?? null;
145
+ if (!at || !p || typeof p !== "object") continue;
146
+ if (type === "SERVER_SIGNER_KEY_REGISTERED") {
147
+ const keyId = typeof p.keyId === "string" ? p.keyId : null;
148
+ if (!keyId) continue;
149
+ const row = out.get(keyId) ?? {};
150
+ if (!row.validFrom || safeIsoToMs(at) < safeIsoToMs(row.validFrom)) row.validFrom = at;
151
+ row.serverGoverned = true;
152
+ out.set(keyId, row);
153
+ } else if (type === "SERVER_SIGNER_KEY_ROTATED") {
154
+ const oldKeyId = typeof p.oldKeyId === "string" ? p.oldKeyId : null;
155
+ const newKeyId = typeof p.newKeyId === "string" ? p.newKeyId : null;
156
+ if (oldKeyId) {
157
+ const row = out.get(oldKeyId) ?? {};
158
+ if (!row.rotatedAt || safeIsoToMs(at) < safeIsoToMs(row.rotatedAt)) row.rotatedAt = at;
159
+ row.serverGoverned = true;
160
+ out.set(oldKeyId, row);
161
+ }
162
+ if (newKeyId) {
163
+ const row = out.get(newKeyId) ?? {};
164
+ if (!row.validFrom || safeIsoToMs(at) < safeIsoToMs(row.validFrom)) row.validFrom = at;
165
+ row.serverGoverned = true;
166
+ out.set(newKeyId, row);
167
+ }
168
+ } else if (type === "SERVER_SIGNER_KEY_REVOKED") {
169
+ const keyId = typeof p.keyId === "string" ? p.keyId : null;
170
+ if (!keyId) continue;
171
+ const row = out.get(keyId) ?? {};
172
+ if (!row.revokedAt || safeIsoToMs(at) < safeIsoToMs(row.revokedAt)) row.revokedAt = at;
173
+ row.serverGoverned = true;
174
+ out.set(keyId, row);
175
+ }
176
+ }
177
+ return out;
178
+ }
179
+
180
+ function applyDerivedServerTimeline({ keyMetaByKeyId, derived }) {
181
+ const out = new Map(keyMetaByKeyId instanceof Map ? keyMetaByKeyId : []);
182
+ if (!(derived instanceof Map)) return out;
183
+ for (const [keyId, d] of derived.entries()) {
184
+ const meta = out.get(keyId) ?? {};
185
+ out.set(keyId, { ...meta, ...d });
186
+ }
187
+ return out;
188
+ }
189
+
190
+ async function verifyManifestFileHashes({ dir, manifestFiles, warnings, hashConcurrency }) {
191
+ const entries = [];
192
+ const seen = new Set();
193
+ for (const f of manifestFiles ?? []) {
194
+ if (!f || typeof f !== "object") continue;
195
+ const name = typeof f.name === "string" ? f.name : null;
196
+ const expectedSha = typeof f.sha256 === "string" ? f.sha256 : null;
197
+ if (!name || !expectedSha) continue;
198
+ if (seen.has(name)) return { ok: false, error: "MANIFEST_DUPLICATE_PATH", name, warnings };
199
+ seen.add(name);
200
+ const rp = resolveBundlePath({ bundleDir: dir, name });
201
+ if (!rp.ok) return { ok: false, error: rp.error, name: rp.name ?? name, reason: rp.reason ?? null, warnings };
202
+ entries.push({ name, expectedSha, fp: rp.path });
203
+ }
204
+
205
+ const actualByIndex = await mapWithConcurrency(entries, hashConcurrency, async (e) => {
206
+ try {
207
+ const st = await fs.lstat(e.fp);
208
+ if (st.isSymbolicLink()) return { ok: false, error: { code: "SYMLINK" } };
209
+ if (!st.isFile()) return { ok: false, error: { code: "NOT_FILE" } };
210
+ const actualSha = await hashFile(e.fp, { algo: "sha256" });
211
+ return { ok: true, actualSha };
212
+ } catch (err) {
213
+ return { ok: false, error: { code: "READ_FAILED", message: err?.message ?? String(err ?? "") } };
214
+ }
215
+ });
216
+
217
+ for (let i = 0; i < entries.length; i += 1) {
218
+ const e = entries[i];
219
+ const res = actualByIndex[i];
220
+ if (!res || res.ok !== true) {
221
+ if (res?.error?.code === "SYMLINK") return { ok: false, error: "MANIFEST_SYMLINK_FORBIDDEN", name: e.name, warnings };
222
+ return {
223
+ ok: false,
224
+ error: "failed to hash file",
225
+ name: e.name,
226
+ detail: { code: res?.error?.code ?? "UNKNOWN", message: res?.error?.message ?? null },
227
+ warnings
228
+ };
229
+ }
230
+ if (res.actualSha !== e.expectedSha) return { ok: false, error: "sha256 mismatch", name: e.name, expected: e.expectedSha, actual: res.actualSha, warnings };
231
+ }
232
+
233
+ return { ok: true };
234
+ }
235
+
236
+ function evidenceRefHashUtf8(value) {
237
+ const s = typeof value === "string" ? value : null;
238
+ if (!s || !s.trim()) return null;
239
+ return sha256HexUtf8(s);
240
+ }
241
+
242
+ function computeEvidenceIndexV1({ generatedAt, jobProofEmbeddedPath, jobProofManifestHash, jobProofHeadAttestationHash, jobEvents, meteringReport }) {
243
+ const items = [];
244
+ for (const ref of Array.isArray(meteringReport?.evidenceRefs) ? meteringReport.evidenceRefs : []) {
245
+ if (!ref || typeof ref !== "object") continue;
246
+ const p = typeof ref.path === "string" ? ref.path.replaceAll("\\", "/") : null;
247
+ const sha256 = typeof ref.sha256 === "string" ? ref.sha256 : null;
248
+ if (!p || !sha256) continue;
249
+ items.push({
250
+ key: `metering:${p}`,
251
+ source: "metering_evidence_ref",
252
+ path: p,
253
+ sha256,
254
+ eventId: null,
255
+ at: null,
256
+ evidenceId: null,
257
+ kind: null,
258
+ contentType: null,
259
+ sizeBytes: null,
260
+ evidenceRefHash: null
261
+ });
262
+ }
263
+ for (const e of Array.isArray(jobEvents) ? jobEvents : []) {
264
+ if (!e || typeof e !== "object") continue;
265
+ if (e.type !== "EVIDENCE_CAPTURED") continue;
266
+ const p = e.payload ?? null;
267
+ if (!p || typeof p !== "object") continue;
268
+ const evidenceId = typeof p.evidenceId === "string" && p.evidenceId.trim() ? p.evidenceId.trim() : null;
269
+ if (!evidenceId) continue;
270
+ items.push({
271
+ key: `evidence:${evidenceId}`,
272
+ source: "job_evidence_event",
273
+ path: null,
274
+ sha256: null,
275
+ eventId: typeof e.id === "string" ? e.id : null,
276
+ at: typeof e.at === "string" ? e.at : null,
277
+ evidenceId,
278
+ kind: typeof p.kind === "string" ? p.kind : null,
279
+ contentType: typeof p.contentType === "string" ? p.contentType : null,
280
+ sizeBytes: Number.isSafeInteger(p.sizeBytes) ? p.sizeBytes : null,
281
+ evidenceRefHash: evidenceRefHashUtf8(p.evidenceRef ?? null)
282
+ });
283
+ }
284
+ items.sort((a, b) => String(a.key).localeCompare(String(b.key)));
285
+ return {
286
+ schemaVersion: "EvidenceIndex.v1",
287
+ generatedAt,
288
+ jobProof: {
289
+ embeddedPath: jobProofEmbeddedPath,
290
+ manifestHash: jobProofManifestHash,
291
+ headAttestationHash: jobProofHeadAttestationHash
292
+ },
293
+ items
294
+ };
295
+ }
296
+
297
+ function extractBookingFromJobEvents(jobEvents) {
298
+ let latest = null;
299
+ for (const e of Array.isArray(jobEvents) ? jobEvents : []) {
300
+ if (!e || typeof e !== "object") continue;
301
+ if (e.type !== "BOOKED") continue;
302
+ latest = e;
303
+ }
304
+ const p = latest?.payload ?? null;
305
+ return p && typeof p === "object" ? p : null;
306
+ }
307
+
308
+ function extractLatestProofFromJobEvents(jobEvents) {
309
+ let latest = null;
310
+ for (const e of Array.isArray(jobEvents) ? jobEvents : []) {
311
+ if (!e || typeof e !== "object") continue;
312
+ if (e.type !== "PROOF_EVALUATED") continue;
313
+ latest = e;
314
+ }
315
+ const p = latest?.payload ?? null;
316
+ return p && typeof p === "object" ? p : null;
317
+ }
318
+
319
+ function executionWindowFromEvents(events) {
320
+ const list = Array.isArray(events) ? events : [];
321
+ let startedAt = null;
322
+ let completedAt = null;
323
+ for (const e of list) {
324
+ if (!e || typeof e !== "object") continue;
325
+ if (startedAt === null && (e.type === "EXECUTION_STARTED" || e.type === "JOB_EXECUTION_STARTED")) startedAt = e.at ?? null;
326
+ if (completedAt === null && (e.type === "EXECUTION_COMPLETED" || e.type === "JOB_EXECUTION_COMPLETED")) completedAt = e.at ?? null;
327
+ }
328
+ return { startedAt, completedAt };
329
+ }
330
+
331
+ function stallMsFromEvents(events) {
332
+ const list = Array.isArray(events) ? events : [];
333
+ let stallStartMs = null;
334
+ let total = 0;
335
+ for (const e of list) {
336
+ if (!e || typeof e !== "object") continue;
337
+ if (e.type === "JOB_EXECUTION_STALLED") {
338
+ const t = safeIsoToMs(e.at);
339
+ if (Number.isFinite(t)) stallStartMs = t;
340
+ continue;
341
+ }
342
+ if (e.type === "JOB_EXECUTION_RESUMED") {
343
+ const t = safeIsoToMs(e.at);
344
+ if (Number.isFinite(t) && stallStartMs !== null) total += Math.max(0, t - stallStartMs);
345
+ stallStartMs = null;
346
+ }
347
+ }
348
+ return total;
349
+ }
350
+
351
+ function computeSlaEvaluationV1({ generatedAt, slaDefinition, jobEvents }) {
352
+ const booking = extractBookingFromJobEvents(jobEvents);
353
+ const proof = extractLatestProofFromJobEvents(jobEvents);
354
+ const { startedAt, completedAt } = executionWindowFromEvents(jobEvents);
355
+ const stallMs = stallMsFromEvents(jobEvents);
356
+
357
+ const startedAtMs = safeIsoToMs(startedAt);
358
+ const completedAtMs = safeIsoToMs(completedAt);
359
+ const execMs = Number.isFinite(startedAtMs) && Number.isFinite(completedAtMs) ? Math.max(0, completedAtMs - startedAtMs) : null;
360
+
361
+ const results = [];
362
+ for (const r of Array.isArray(slaDefinition?.rules) ? slaDefinition.rules : []) {
363
+ if (!r || typeof r !== "object") continue;
364
+ const ruleId = typeof r.ruleId === "string" ? r.ruleId : null;
365
+ const kind = typeof r.kind === "string" ? r.kind : null;
366
+ if (!ruleId || !kind) continue;
367
+
368
+ if (kind === "MUST_START_WITHIN_WINDOW") {
369
+ const winStartMs = safeIsoToMs(booking?.startAt);
370
+ const winEndMs = safeIsoToMs(booking?.endAt);
371
+ if (!Number.isFinite(winStartMs) || !Number.isFinite(winEndMs) || !Number.isFinite(startedAtMs)) {
372
+ results.push({ ruleId, kind, status: "unknown", detail: { startedAt: startedAt ?? null, window: booking ? { startAt: booking.startAt ?? null, endAt: booking.endAt ?? null } : null } });
373
+ } else {
374
+ const ok = startedAtMs >= winStartMs && startedAtMs <= winEndMs;
375
+ results.push({ ruleId, kind, status: ok ? "ok" : "breach", detail: { startedAt, window: { startAt: booking?.startAt ?? null, endAt: booking?.endAt ?? null } } });
376
+ }
377
+ continue;
378
+ }
379
+ if (kind === "MAX_EXECUTION_MS") {
380
+ const maxExecutionMs = Number.isSafeInteger(r.maxExecutionMs) ? r.maxExecutionMs : null;
381
+ if (maxExecutionMs === null || execMs === null) {
382
+ results.push({ ruleId, kind, status: "unknown", detail: { startedAt: startedAt ?? null, completedAt: completedAt ?? null, executionMs: execMs, maxExecutionMs } });
383
+ } else {
384
+ const ok = execMs <= maxExecutionMs;
385
+ results.push({ ruleId, kind, status: ok ? "ok" : "breach", detail: { startedAt, completedAt, executionMs: execMs, maxExecutionMs } });
386
+ }
387
+ continue;
388
+ }
389
+ if (kind === "MAX_STALL_MS") {
390
+ const maxStallMs = Number.isSafeInteger(r.maxStallMs) ? r.maxStallMs : null;
391
+ if (maxStallMs === null) {
392
+ results.push({ ruleId, kind, status: "unknown", detail: { stallMs, maxStallMs } });
393
+ } else {
394
+ const ok = stallMs <= maxStallMs;
395
+ results.push({ ruleId, kind, status: ok ? "ok" : "breach", detail: { stallMs, maxStallMs } });
396
+ }
397
+ continue;
398
+ }
399
+ if (kind === "PROOF_ZONE_COVERAGE_MIN_PCT") {
400
+ const thresholdPct = Number.isSafeInteger(r.thresholdPct) ? r.thresholdPct : null;
401
+ const minCoveragePct = Number.isSafeInteger(proof?.metrics?.minCoveragePct) ? proof.metrics.minCoveragePct : null;
402
+ if (thresholdPct === null || minCoveragePct === null) {
403
+ results.push({ ruleId, kind, status: "unknown", detail: { minCoveragePct, thresholdPct } });
404
+ } else {
405
+ const ok = minCoveragePct >= thresholdPct;
406
+ results.push({ ruleId, kind, status: ok ? "ok" : "breach", detail: { minCoveragePct, thresholdPct } });
407
+ }
408
+ continue;
409
+ }
410
+ results.push({ ruleId, kind, status: "unknown", detail: { reason: "unsupported rule kind" } });
411
+ }
412
+ results.sort((a, b) => String(a.ruleId ?? "").localeCompare(String(b.ruleId ?? "")));
413
+ let overallStatus = "ok";
414
+ if (results.some((x) => x.status === "breach")) overallStatus = "breach";
415
+ else if (results.some((x) => x.status === "unknown")) overallStatus = "unknown";
416
+ return { schemaVersion: "SlaEvaluation.v1", generatedAt, overallStatus, results };
417
+ }
418
+
419
+ function computeAcceptanceEvaluationV1({ generatedAt, acceptanceCriteria, jobEvents, slaEvaluation }) {
420
+ const proof = extractLatestProofFromJobEvents(jobEvents);
421
+ const results = [];
422
+ for (const c of Array.isArray(acceptanceCriteria?.criteria) ? acceptanceCriteria.criteria : []) {
423
+ if (!c || typeof c !== "object") continue;
424
+ const criterionId = typeof c.criterionId === "string" ? c.criterionId : null;
425
+ const kind = typeof c.kind === "string" ? c.kind : null;
426
+ if (!criterionId || !kind) continue;
427
+
428
+ if (kind === "PROOF_STATUS_EQUALS") {
429
+ const expectedStatus = typeof c.expectedStatus === "string" ? c.expectedStatus : null;
430
+ const actualStatus = typeof proof?.status === "string" ? proof.status : null;
431
+ if (!expectedStatus || !actualStatus) results.push({ criterionId, kind, status: "unknown", detail: { expectedStatus, actualStatus } });
432
+ else results.push({ criterionId, kind, status: actualStatus === expectedStatus ? "ok" : "fail", detail: { expectedStatus, actualStatus } });
433
+ continue;
434
+ }
435
+ if (kind === "SLA_OVERALL_OK") {
436
+ const overallStatus = typeof slaEvaluation?.overallStatus === "string" ? slaEvaluation.overallStatus : null;
437
+ if (!overallStatus) results.push({ criterionId, kind, status: "unknown", detail: { overallStatus: null } });
438
+ else results.push({ criterionId, kind, status: overallStatus === "ok" ? "ok" : "fail", detail: { overallStatus } });
439
+ continue;
440
+ }
441
+ results.push({ criterionId, kind, status: "unknown", detail: { reason: "unsupported criterion kind" } });
442
+ }
443
+ results.sort((a, b) => String(a.criterionId ?? "").localeCompare(String(b.criterionId ?? "")));
444
+ let overallStatus = "ok";
445
+ if (results.some((x) => x.status === "fail")) overallStatus = "fail";
446
+ else if (results.some((x) => x.status === "unknown")) overallStatus = "unknown";
447
+ return { schemaVersion: "AcceptanceEvaluation.v1", generatedAt, overallStatus, results };
448
+ }
449
+
450
+ function verifyBundleHeadAttestationV1({
451
+ attestation,
452
+ expectedManifestHash,
453
+ expectedTenantId,
454
+ expectedInvoiceId,
455
+ invoiceManifestHash,
456
+ invoiceAttestationHash,
457
+ governancePolicy,
458
+ revocationTimelineByKeyId,
459
+ trustedTimeAuthorities,
460
+ publicKeyByKeyId,
461
+ keyMetaByKeyId,
462
+ strict
463
+ }) {
464
+ if (!attestation || typeof attestation !== "object" || Array.isArray(attestation)) return { ok: false, error: "invalid bundle head attestation JSON" };
465
+ if (String(attestation.schemaVersion ?? "") !== BUNDLE_HEAD_ATTESTATION_SCHEMA_V1) return { ok: false, error: "unsupported attestation schemaVersion", schemaVersion: attestation.schemaVersion ?? null };
466
+ if (String(attestation.kind ?? "") !== CLOSE_PACK_TYPE_V1) return { ok: false, error: "attestation kind mismatch", expected: CLOSE_PACK_TYPE_V1, actual: attestation.kind ?? null };
467
+ if (expectedTenantId !== null && expectedTenantId !== undefined) {
468
+ if (String(attestation.tenantId ?? "") !== String(expectedTenantId ?? "")) return { ok: false, error: "attestation tenantId mismatch", expected: expectedTenantId ?? null, actual: attestation.tenantId ?? null };
469
+ }
470
+
471
+ const scope = attestation.scope ?? null;
472
+ if (!scope || typeof scope !== "object" || Array.isArray(scope)) return { ok: false, error: "attestation scope mismatch" };
473
+ if (expectedInvoiceId !== null && expectedInvoiceId !== undefined) {
474
+ if (String(scope.invoiceId ?? "") !== String(expectedInvoiceId ?? "")) return { ok: false, error: "attestation scope.invoiceId mismatch", expected: expectedInvoiceId ?? null, actual: scope.invoiceId ?? null };
475
+ }
476
+
477
+ if (String(attestation.manifestHash ?? "") !== String(expectedManifestHash ?? "")) return { ok: false, error: "attestation manifestHash mismatch", expected: expectedManifestHash ?? null, actual: attestation.manifestHash ?? null };
478
+
479
+ const signerKeyId = typeof attestation.signerKeyId === "string" && attestation.signerKeyId.trim() ? attestation.signerKeyId : null;
480
+ const signature = typeof attestation.signature === "string" && attestation.signature.trim() ? attestation.signature : null;
481
+ const signedAt = typeof attestation.signedAt === "string" && attestation.signedAt.trim() ? attestation.signedAt : null;
482
+ if (strict && (!signerKeyId || !signature || !signedAt)) return { ok: false, error: "attestation missing signature fields", signerKeyId, signature: Boolean(signature), signedAt };
483
+
484
+ const attestationCore = stripAttestationSig(attestation);
485
+ const expectedHash = sha256HexUtf8(canonicalJsonStringify(attestationCore));
486
+ const declaredHash = typeof attestation.attestationHash === "string" && attestation.attestationHash.trim() ? attestation.attestationHash : null;
487
+ if (declaredHash && declaredHash !== expectedHash) return { ok: false, error: "attestationHash mismatch", expected: expectedHash, actual: declaredHash };
488
+
489
+ if (signature && signerKeyId) {
490
+ const publicKeyPem = publicKeyByKeyId.get(signerKeyId) ?? null;
491
+ if (!publicKeyPem) return { ok: false, error: "unknown attestation signerKeyId", signerKeyId };
492
+ const okSig = verifyHashHexEd25519({ hashHex: expectedHash, signatureBase64: signature, publicKeyPem });
493
+ if (!okSig) return { ok: false, error: "attestation signature invalid", signerKeyId };
494
+
495
+ if (strict) {
496
+ const meta = keyMetaByKeyId.get(signerKeyId) ?? null;
497
+ const auth = authorizeServerSignerForPolicy({
498
+ policy: governancePolicy,
499
+ documentKind: "bundle_head_attestation",
500
+ subjectType: CLOSE_PACK_TYPE_V1,
501
+ signerKeyId,
502
+ signerScope: "global",
503
+ keyMeta: meta
504
+ });
505
+ if (!auth.ok) return { ok: false, error: "attestation signer not authorized", detail: auth, signerKeyId };
506
+ if (!(typeof meta?.validFrom === "string" && meta.validFrom.trim())) return { ok: false, error: "attestation signer key missing validFrom", signerKeyId };
507
+ if (revocationTimelineByKeyId instanceof Map) {
508
+ const time = effectiveSigningTimeFromTimestampProof({ documentCoreWithProof: attestationCore, fallbackSignedAt: signedAt, trustedTimeAuthorities });
509
+ const effectiveSignedAt = time.effectiveSignedAt;
510
+ const usable = isServerKeyUsableAtForAttestation({ meta, atIso: effectiveSignedAt });
511
+ if (!usable.ok) return { ok: false, error: "attestation signer key not valid", signerKeyId, reason: usable.reason, boundary: usable.boundary ?? null };
512
+ const row = revocationTimelineByKeyId.get(signerKeyId) ?? null;
513
+ const timelineCheck = enforceProspectiveKeyTimeline({ signerKeyId, effectiveSignedAt, trustworthyTime: time.trustworthy, timelineRow: row });
514
+ if (!timelineCheck.ok) return { ok: false, error: timelineCheck.error, detail: { ...timelineCheck, timeProof: time.proof ?? null }, signerKeyId };
515
+ } else {
516
+ const usable = isServerKeyUsableAtForAttestation({ meta, atIso: signedAt });
517
+ if (!usable.ok) return { ok: false, error: "attestation signer key not valid", signerKeyId, reason: usable.reason, boundary: usable.boundary ?? null };
518
+ }
519
+ }
520
+ }
521
+
522
+ const heads = attestation.heads ?? null;
523
+ if (!heads || typeof heads !== "object" || Array.isArray(heads)) return { ok: false, error: "attestation missing heads" };
524
+ const ib = heads.invoiceBundle ?? null;
525
+ if (!ib || typeof ib !== "object" || Array.isArray(ib)) return { ok: false, error: "attestation missing heads.invoiceBundle" };
526
+ if (String(ib.manifestHash ?? "") !== String(invoiceManifestHash ?? "")) return { ok: false, error: "attestation invoiceBundle.manifestHash mismatch", expected: invoiceManifestHash ?? null, actual: ib.manifestHash ?? null };
527
+ if (invoiceAttestationHash && String(ib.attestationHash ?? "") !== String(invoiceAttestationHash ?? "")) {
528
+ return { ok: false, error: "attestation invoiceBundle.attestationHash mismatch", expected: invoiceAttestationHash ?? null, actual: ib.attestationHash ?? null };
529
+ }
530
+
531
+ return { ok: true, attestationHash: expectedHash, signerKeyId, signedAt };
532
+ }
533
+
534
+ function verifyVerificationReportV1({ report, expectedManifestHash, publicKeys, governancePolicy, revocationTimelineByKeyId, trustedTimeAuthorities, strict }) {
535
+ if (!report || typeof report !== "object" || Array.isArray(report)) return { ok: false, error: "invalid verification report JSON" };
536
+ if (String(report.schemaVersion ?? "") !== "VerificationReport.v1") return { ok: false, error: "unsupported verification report schemaVersion" };
537
+ if (String(report.profile ?? "") !== "strict") return { ok: false, error: "unsupported verification report profile", profile: report.profile ?? null };
538
+ const warningsCheck = validateVerificationWarnings(report.warnings ?? null);
539
+ if (!warningsCheck.ok) return { ok: false, error: `verification report warnings invalid: ${warningsCheck.error}`, detail: warningsCheck };
540
+
541
+ const subject = report.subject ?? null;
542
+ if (!subject || typeof subject !== "object" || Array.isArray(subject)) return { ok: false, error: "invalid verification report subject" };
543
+ if (String(subject.type ?? "") !== CLOSE_PACK_TYPE_V1) return { ok: false, error: "verification report subject.type mismatch", expected: CLOSE_PACK_TYPE_V1, actual: subject.type ?? null };
544
+ if (String(subject.manifestHash ?? "") !== String(expectedManifestHash ?? "")) {
545
+ return { ok: false, error: "verification report subject.manifestHash mismatch", expected: expectedManifestHash ?? null, actual: subject.manifestHash ?? null };
546
+ }
547
+
548
+ if (strict) {
549
+ const b = report.bundleHeadAttestation ?? null;
550
+ if (!b || typeof b !== "object" || Array.isArray(b)) return { ok: false, error: "verification report missing bundleHeadAttestation" };
551
+ const declared = typeof b.attestationHash === "string" && b.attestationHash.trim() ? b.attestationHash : null;
552
+ if (!declared) return { ok: false, error: "verification report bundleHeadAttestation.attestationHash missing" };
553
+ }
554
+
555
+ const reportCore = stripVerificationReportSig(report);
556
+ const expectedReportHash = sha256HexUtf8(canonicalJsonStringify(reportCore));
557
+ const actualReportHash = typeof report.reportHash === "string" ? report.reportHash : null;
558
+ if (!actualReportHash) return { ok: false, error: "verification report missing reportHash" };
559
+ if (expectedReportHash !== actualReportHash) {
560
+ return { ok: false, error: "verification report reportHash mismatch", expected: expectedReportHash, actual: actualReportHash };
561
+ }
562
+
563
+ const signature = typeof report.signature === "string" && report.signature.trim() ? report.signature : null;
564
+ const signerKeyId = typeof report.signerKeyId === "string" && report.signerKeyId.trim() ? report.signerKeyId : null;
565
+ const signedAt = typeof report.signedAt === "string" && report.signedAt.trim() ? report.signedAt : null;
566
+ if (strict && (!signature || !signerKeyId || !signedAt)) {
567
+ return { ok: false, error: "verification report missing signature", signature: Boolean(signature), signerKeyId, signedAt };
568
+ }
569
+
570
+ const signer = report.signer ?? null;
571
+ if (signer !== null && signer !== undefined) {
572
+ if (!signer || typeof signer !== "object" || Array.isArray(signer)) return { ok: false, error: "verification report signer must be an object" };
573
+ if (typeof signer.keyId !== "string" || !signer.keyId.trim()) return { ok: false, error: "verification report signer.keyId missing" };
574
+ if (signerKeyId && signer.keyId !== signerKeyId) return { ok: false, error: "verification report signer.keyId mismatch", expected: signerKeyId, actual: signer.keyId };
575
+ if (signer.scope !== undefined && signer.scope !== null) {
576
+ const scope = String(signer.scope);
577
+ if (scope !== "global" && scope !== "tenant") return { ok: false, error: "verification report signer.scope invalid", scope };
578
+ }
579
+ }
580
+
581
+ if (signature && signerKeyId) {
582
+ const publicKeyPem = publicKeys?.publicKeyByKeyId?.get?.(signerKeyId) ?? null;
583
+ if (!publicKeyPem) return { ok: false, error: "unknown verification report signerKeyId", signerKeyId };
584
+ const ok = verifyHashHexEd25519({ hashHex: actualReportHash, signatureBase64: signature, publicKeyPem });
585
+ if (!ok) return { ok: false, error: "verification report signature invalid", signerKeyId };
586
+
587
+ if (strict) {
588
+ const meta = publicKeys?.keyMetaByKeyId?.get?.(signerKeyId) ?? null;
589
+ const auth = authorizeServerSignerForPolicy({
590
+ policy: governancePolicy,
591
+ documentKind: "verification_report",
592
+ subjectType: CLOSE_PACK_TYPE_V1,
593
+ signerKeyId,
594
+ signerScope: signer?.scope ?? "global",
595
+ keyMeta: meta
596
+ });
597
+ if (!auth.ok) return { ok: false, error: "verification report signer not authorized", detail: auth, signerKeyId };
598
+ if (!(typeof meta?.validFrom === "string" && meta.validFrom.trim())) return { ok: false, error: "verification report signer key missing validFrom", signerKeyId };
599
+ if (revocationTimelineByKeyId instanceof Map) {
600
+ const time = effectiveSigningTimeFromTimestampProof({ documentCoreWithProof: reportCore, fallbackSignedAt: signedAt, trustedTimeAuthorities });
601
+ const effectiveSignedAt = time.effectiveSignedAt;
602
+ const usable = isServerKeyUsableAtForAttestation({ meta, atIso: effectiveSignedAt });
603
+ if (!usable.ok) return { ok: false, error: "verification report signer key not valid", signerKeyId, reason: usable.reason, boundary: usable.boundary ?? null };
604
+ const row = revocationTimelineByKeyId.get(signerKeyId) ?? null;
605
+ const timelineCheck = enforceProspectiveKeyTimeline({ signerKeyId, effectiveSignedAt, trustworthyTime: time.trustworthy, timelineRow: row });
606
+ if (!timelineCheck.ok) return { ok: false, error: timelineCheck.error, detail: { ...timelineCheck, timeProof: time.proof ?? null }, signerKeyId };
607
+ } else {
608
+ const usable = isServerKeyUsableAtForAttestation({ meta, atIso: signedAt });
609
+ if (!usable.ok) return { ok: false, error: "verification report signer key not valid", signerKeyId, reason: usable.reason, boundary: usable.boundary ?? null };
610
+ }
611
+ }
612
+ }
613
+
614
+ return { ok: true, reportHash: actualReportHash, signerKeyId: signerKeyId ?? null };
615
+ }
616
+
617
+ export async function verifyClosePackBundleDir({ dir, strict = false, hashConcurrency = null } = {}) {
618
+ if (!dir) throw new Error("dir is required");
619
+ if (strict !== true && strict !== false) throw new TypeError("strict must be a boolean");
620
+ hashConcurrency = normalizeHashConcurrency(hashConcurrency);
621
+
622
+ const warnings = [];
623
+ if (!strict) {
624
+ const rawTrusted = String(process.env.SETTLD_TRUSTED_GOVERNANCE_ROOT_KEYS_JSON ?? "").trim();
625
+ if (!rawTrusted) warnings.push({ code: VERIFICATION_WARNING_CODE.TRUSTED_GOVERNANCE_ROOT_KEYS_MISSING_LENIENT, detail: { env: "SETTLD_TRUSTED_GOVERNANCE_ROOT_KEYS_JSON" } });
626
+ }
627
+
628
+ const header = await readJson(path.join(dir, "settld.json"));
629
+ if (header?.type !== CLOSE_PACK_TYPE_V1) return { ok: false, error: "unsupported bundle type", type: header?.type ?? null, warnings };
630
+
631
+ const manifestWithHash = await readJson(path.join(dir, "manifest.json"));
632
+ if (manifestWithHash?.schemaVersion !== CLOSE_PACK_MANIFEST_SCHEMA_V1) {
633
+ return { ok: false, error: "unsupported manifest schemaVersion", schemaVersion: manifestWithHash?.schemaVersion ?? null, warnings };
634
+ }
635
+
636
+ {
637
+ const pre = prevalidateManifestFileEntries({ bundleDir: dir, manifestFiles: manifestWithHash?.files });
638
+ if (!pre.ok) return { ...pre, warnings };
639
+ }
640
+
641
+ const expectedManifestHash = String(manifestWithHash?.manifestHash ?? "");
642
+ if (!expectedManifestHash) return { ok: false, error: "manifest missing manifestHash", warnings };
643
+ const manifestCore = stripManifestHash(manifestWithHash);
644
+ const actualManifestHash = sha256HexUtf8(canonicalJsonStringify(manifestCore));
645
+ if (actualManifestHash !== expectedManifestHash) return { ok: false, error: "manifestHash mismatch", expected: expectedManifestHash, actual: actualManifestHash, warnings };
646
+
647
+ {
648
+ const present = new Set();
649
+ for (const f of manifestWithHash.files ?? []) {
650
+ const name = typeof f?.name === "string" ? f.name : null;
651
+ if (!name) continue;
652
+ present.add(name);
653
+ }
654
+ const required = ["settld.json", "governance/policy.json", "governance/revocations.json", "evidence/evidence_index.json", "payload/invoice_bundle/settld.json", "payload/invoice_bundle/manifest.json"];
655
+ const missing = required.filter((n) => !present.has(n));
656
+ if (strict && missing.length) return { ok: false, error: "manifest missing required files", missing, warnings };
657
+ }
658
+
659
+ {
660
+ const check = await verifyManifestFileHashes({ dir, manifestFiles: manifestWithHash.files, warnings, hashConcurrency });
661
+ if (!check.ok) return check;
662
+ }
663
+
664
+ // Verify embedded Invoice bundle (primary economic truth).
665
+ const invoiceDir = path.join(dir, "payload", "invoice_bundle");
666
+ const invoiceRes = await verifyInvoiceBundleDir({ dir: invoiceDir, strict, hashConcurrency });
667
+ if (!invoiceRes.ok) return { ok: false, error: "embedded invoice bundle verification failed", detail: invoiceRes, warnings: [...warnings, ...(Array.isArray(invoiceRes.warnings) ? invoiceRes.warnings : [])] };
668
+
669
+ const embeddedInvoiceManifestHash = String(invoiceRes.manifestHash ?? "");
670
+ const embeddedInvoiceAttestationHash = typeof invoiceRes?.headAttestation?.attestationHash === "string" ? invoiceRes.headAttestation.attestationHash : null;
671
+
672
+ const declaredInvoiceBundle = header?.invoiceBundle ?? null;
673
+ const declaredEmbeddedPath = typeof declaredInvoiceBundle?.embeddedPath === "string" ? declaredInvoiceBundle.embeddedPath : null;
674
+ const declaredInvoiceManifestHash = typeof declaredInvoiceBundle?.manifestHash === "string" ? declaredInvoiceBundle.manifestHash : null;
675
+ const declaredInvoiceAttestationHash = typeof declaredInvoiceBundle?.headAttestationHash === "string" ? declaredInvoiceBundle.headAttestationHash : null;
676
+ if (declaredEmbeddedPath && declaredEmbeddedPath !== "payload/invoice_bundle") {
677
+ return { ok: false, error: "closepack invoiceBundle.embeddedPath invalid", expected: "payload/invoice_bundle", actual: declaredEmbeddedPath, warnings };
678
+ }
679
+ if (declaredInvoiceManifestHash && declaredInvoiceManifestHash !== embeddedInvoiceManifestHash) {
680
+ return { ok: false, error: "closepack invoiceBundle.manifestHash mismatch", expected: declaredInvoiceManifestHash, actual: embeddedInvoiceManifestHash, warnings };
681
+ }
682
+ if (strict && declaredInvoiceAttestationHash && embeddedInvoiceAttestationHash && declaredInvoiceAttestationHash !== embeddedInvoiceAttestationHash) {
683
+ return { ok: false, error: "closepack invoiceBundle.headAttestationHash mismatch", expected: declaredInvoiceAttestationHash, actual: embeddedInvoiceAttestationHash, warnings };
684
+ }
685
+
686
+ // Load JobProof public keys (used to verify ClosePack head/report signatures).
687
+ const jobDir = path.join(invoiceDir, "payload", "job_proof_bundle");
688
+ let jobPublicKeys = null;
689
+ try {
690
+ const keysJson = await readJson(path.join(jobDir, "keys", "public_keys.json"));
691
+ jobPublicKeys = parsePublicKeysV1(keysJson);
692
+ } catch {
693
+ jobPublicKeys = null;
694
+ }
695
+ if (strict && !(jobPublicKeys?.ok)) return { ok: false, error: "missing keys/public_keys.json", warnings };
696
+
697
+ if (jobPublicKeys?.ok && strict) {
698
+ const raw = await fs.readFile(path.join(jobDir, "governance", "global", "events", "events.jsonl"), "utf8");
699
+ const govEvents = parseJsonl(raw);
700
+ const derived = deriveServerKeyTimelineFromGovernanceEvents(govEvents);
701
+ jobPublicKeys.keyMetaByKeyId = applyDerivedServerTimeline({ keyMetaByKeyId: jobPublicKeys.keyMetaByKeyId, derived });
702
+ }
703
+
704
+ // Verify governance policy + revocations for ClosePack itself (authorization contract).
705
+ let governancePolicy = null;
706
+ let revocationTimelineByKeyId = new Map();
707
+ let trustedGovernanceRoots = new Map();
708
+ let trustedTimeAuthorities = new Map();
709
+
710
+ try {
711
+ const policyJson = await readJson(path.join(dir, "governance", "policy.json"));
712
+ const schemaVersion = String(policyJson?.schemaVersion ?? "");
713
+ if (schemaVersion === GOVERNANCE_POLICY_SCHEMA_V2) {
714
+ const parsed = parseGovernancePolicyV2(policyJson);
715
+ if (!parsed.ok) {
716
+ if (strict) return { ok: false, error: "invalid governance/policy.json", detail: parsed, warnings };
717
+ } else {
718
+ governancePolicy = parsed.policy;
719
+ }
720
+ } else {
721
+ const parsed = parseGovernancePolicyV1(policyJson);
722
+ if (!parsed.ok) {
723
+ if (strict) return { ok: false, error: "invalid governance/policy.json", detail: parsed, warnings };
724
+ } else {
725
+ governancePolicy = parsed.policy;
726
+ }
727
+ }
728
+ } catch {
729
+ if (strict) return { ok: false, error: "missing governance/policy.json", warnings };
730
+ warnings.push({ code: VERIFICATION_WARNING_CODE.GOVERNANCE_POLICY_MISSING_LENIENT });
731
+ }
732
+ if (!strict && governancePolicy && String(governancePolicy.schemaVersion ?? "") !== GOVERNANCE_POLICY_SCHEMA_V2) {
733
+ warnings.push({ code: VERIFICATION_WARNING_CODE.GOVERNANCE_POLICY_V1_ACCEPTED_LENIENT, detail: { schemaVersion: governancePolicy.schemaVersion ?? null } });
734
+ }
735
+
736
+ if (strict) {
737
+ if (!governancePolicy) return { ok: false, error: "missing governance policy", warnings };
738
+ if (String(governancePolicy.schemaVersion ?? "") !== GOVERNANCE_POLICY_SCHEMA_V2) {
739
+ return { ok: false, error: "strict requires GovernancePolicy.v2", schemaVersion: governancePolicy.schemaVersion ?? null, warnings };
740
+ }
741
+ trustedGovernanceRoots = trustedGovernanceRootKeysFromEnv();
742
+ if (trustedGovernanceRoots.size === 0) return { ok: false, error: "strict requires trusted governance root keys", env: "SETTLD_TRUSTED_GOVERNANCE_ROOT_KEYS_JSON", warnings };
743
+ const sigOk = verifyGovernancePolicyV2Signature({ policy: governancePolicy, trustedGovernanceRootPublicKeyByKeyId: trustedGovernanceRoots });
744
+ if (!sigOk.ok) return { ok: false, error: "governance policy signature invalid", detail: sigOk, warnings };
745
+
746
+ const refPath = String(governancePolicy?.revocationList?.path ?? "");
747
+ if (!refPath || !refPath.startsWith("governance/")) {
748
+ return { ok: false, error: "governance policy revocationList.path invalid", path: governancePolicy?.revocationList?.path ?? null, warnings };
749
+ }
750
+ const revJson = await readJson(path.join(dir, refPath));
751
+ const parsedList = parseRevocationListV1(revJson);
752
+ if (!parsedList.ok) return { ok: false, error: "invalid governance revocation list", detail: parsedList, warnings };
753
+ const listSigOk = verifyRevocationListV1Signature({ list: parsedList.list, trustedGovernanceRootPublicKeyByKeyId: trustedGovernanceRoots });
754
+ if (!listSigOk.ok) return { ok: false, error: "revocation list signature invalid", detail: listSigOk, warnings };
755
+ const expected = String(governancePolicy?.revocationList?.sha256 ?? "");
756
+ if (expected && expected !== String(parsedList.list?.listHash ?? "")) return { ok: false, error: "revocationList sha256 mismatch", expected, actual: parsedList.list?.listHash ?? null, warnings };
757
+ revocationTimelineByKeyId = deriveKeyTimelineFromRevocationList(parsedList.list);
758
+ trustedTimeAuthorities = trustedTimeAuthorityKeysFromEnv();
759
+ }
760
+
761
+ // Verify ClosePack head attestation/report if present (same posture as other bundles).
762
+ let headAttestation = null;
763
+ try {
764
+ headAttestation = await readJson(path.join(dir, "attestation", "bundle_head_attestation.json"));
765
+ } catch {
766
+ headAttestation = null;
767
+ }
768
+ if (strict && !headAttestation) return { ok: false, error: "missing attestation/bundle_head_attestation.json", warnings };
769
+ if (!strict && !headAttestation) warnings.push({ code: VERIFICATION_WARNING_CODE.BUNDLE_HEAD_ATTESTATION_MISSING_LENIENT });
770
+
771
+ if (headAttestation) {
772
+ const headOk = verifyBundleHeadAttestationV1({
773
+ attestation: headAttestation,
774
+ expectedManifestHash,
775
+ expectedTenantId: header?.tenantId ?? null,
776
+ expectedInvoiceId: header?.invoiceId ?? null,
777
+ invoiceManifestHash: embeddedInvoiceManifestHash,
778
+ invoiceAttestationHash: embeddedInvoiceAttestationHash,
779
+ governancePolicy,
780
+ revocationTimelineByKeyId,
781
+ trustedTimeAuthorities,
782
+ publicKeyByKeyId: jobPublicKeys?.ok ? jobPublicKeys.publicKeyByKeyId : new Map(),
783
+ keyMetaByKeyId: jobPublicKeys?.ok ? jobPublicKeys.keyMetaByKeyId : new Map(),
784
+ strict
785
+ });
786
+ if (!headOk.ok) return { ok: false, error: "bundle head attestation invalid", detail: headOk, warnings };
787
+ }
788
+
789
+ let verificationReport = null;
790
+ try {
791
+ verificationReport = await readJson(path.join(dir, "verify", "verification_report.json"));
792
+ } catch {
793
+ verificationReport = null;
794
+ }
795
+ if (strict && !verificationReport) return { ok: false, error: "missing verify/verification_report.json", warnings };
796
+ if (!strict && !verificationReport) warnings.push({ code: VERIFICATION_WARNING_CODE.VERIFICATION_REPORT_MISSING_LENIENT });
797
+
798
+ if (verificationReport) {
799
+ const repOk = verifyVerificationReportV1({
800
+ report: verificationReport,
801
+ expectedManifestHash,
802
+ publicKeys: jobPublicKeys?.ok ? jobPublicKeys : null,
803
+ governancePolicy,
804
+ revocationTimelineByKeyId,
805
+ trustedTimeAuthorities,
806
+ strict
807
+ });
808
+ if (!repOk.ok) return { ok: false, error: "verification report invalid", detail: repOk, warnings };
809
+ }
810
+
811
+ // Verify evidence index and optional SLA/acceptance computations.
812
+ let evidenceIndex = null;
813
+ try {
814
+ evidenceIndex = await readJson(path.join(dir, "evidence", "evidence_index.json"));
815
+ } catch {
816
+ evidenceIndex = null;
817
+ }
818
+ if (!evidenceIndex) return { ok: false, error: "missing evidence/evidence_index.json", warnings };
819
+ if (String(evidenceIndex?.schemaVersion ?? "") !== "EvidenceIndex.v1") return { ok: false, error: "unsupported evidence index schemaVersion", schemaVersion: evidenceIndex?.schemaVersion ?? null, warnings };
820
+
821
+ const metering = await readJson(path.join(invoiceDir, "metering", "metering_report.json"));
822
+ const jobProofBinding = metering?.jobProof ?? null;
823
+ const jobProofEmbeddedPathInvoice = typeof jobProofBinding?.embeddedPath === "string" ? jobProofBinding.embeddedPath : null;
824
+ const jobProofManifestHash = typeof jobProofBinding?.manifestHash === "string" ? jobProofBinding.manifestHash : null;
825
+ const jobProofHeadAttestationHash = typeof jobProofBinding?.headAttestationHash === "string" ? jobProofBinding.headAttestationHash : null;
826
+ if (!jobProofEmbeddedPathInvoice || !jobProofManifestHash || !jobProofHeadAttestationHash) {
827
+ return { ok: false, error: "meteringReport jobProof binding missing", warnings };
828
+ }
829
+
830
+ const jobEventsText = await fs.readFile(path.join(invoiceDir, jobProofEmbeddedPathInvoice, "events", "events.jsonl"), "utf8");
831
+ const jobEvents = parseJsonl(jobEventsText);
832
+ if (jobEvents.length === 0) return { ok: false, error: "job proof events missing", warnings };
833
+
834
+ const derivedEvidenceIndex = computeEvidenceIndexV1({
835
+ generatedAt: typeof evidenceIndex.generatedAt === "string" ? evidenceIndex.generatedAt : String(metering?.generatedAt ?? header?.createdAt ?? ""),
836
+ jobProofEmbeddedPath: `payload/invoice_bundle/${jobProofEmbeddedPathInvoice}`.replaceAll("\\", "/"),
837
+ jobProofManifestHash,
838
+ jobProofHeadAttestationHash,
839
+ jobEvents,
840
+ meteringReport: metering
841
+ });
842
+
843
+ if (canonicalJsonStringify(derivedEvidenceIndex) !== canonicalJsonStringify(evidenceIndex)) {
844
+ return { ok: false, error: "closepack evidence_index mismatch", warnings, detail: { expected: derivedEvidenceIndex, actual: evidenceIndex } };
845
+ }
846
+
847
+ // Optional SLA/acceptance surfaces: strict requires present+matching if any part is present.
848
+ let slaDefinition = null;
849
+ let slaEvaluation = null;
850
+ try {
851
+ slaDefinition = await readJson(path.join(dir, "sla", "sla_definition.json"));
852
+ } catch {
853
+ slaDefinition = null;
854
+ }
855
+ try {
856
+ slaEvaluation = await readJson(path.join(dir, "sla", "sla_evaluation.json"));
857
+ } catch {
858
+ slaEvaluation = null;
859
+ }
860
+ if (!slaDefinition && !strict) warnings.push({ code: VERIFICATION_WARNING_CODE.CLOSE_PACK_SLA_SURFACES_MISSING_LENIENT });
861
+ if ((slaDefinition !== null) !== (slaEvaluation !== null)) {
862
+ if (strict) return { ok: false, error: "closepack sla surfaces incomplete", warnings };
863
+ }
864
+ if (slaDefinition && slaEvaluation) {
865
+ if (String(slaDefinition.schemaVersion ?? "") !== "SlaDefinition.v1") return { ok: false, error: "unsupported sla definition schemaVersion", schemaVersion: slaDefinition.schemaVersion ?? null, warnings };
866
+ const derivedEval = computeSlaEvaluationV1({ generatedAt: String(slaEvaluation.generatedAt ?? header.createdAt ?? ""), slaDefinition, jobEvents });
867
+ if (canonicalJsonStringify(derivedEval) !== canonicalJsonStringify(slaEvaluation)) {
868
+ return { ok: false, error: "closepack sla_evaluation mismatch", warnings, detail: { expected: derivedEval, actual: slaEvaluation } };
869
+ }
870
+ }
871
+
872
+ let acceptanceCriteria = null;
873
+ let acceptanceEvaluation = null;
874
+ try {
875
+ acceptanceCriteria = await readJson(path.join(dir, "acceptance", "acceptance_criteria.json"));
876
+ } catch {
877
+ acceptanceCriteria = null;
878
+ }
879
+ try {
880
+ acceptanceEvaluation = await readJson(path.join(dir, "acceptance", "acceptance_evaluation.json"));
881
+ } catch {
882
+ acceptanceEvaluation = null;
883
+ }
884
+ if (!acceptanceCriteria && !strict) warnings.push({ code: VERIFICATION_WARNING_CODE.CLOSE_PACK_ACCEPTANCE_SURFACES_MISSING_LENIENT });
885
+ if ((acceptanceCriteria !== null) !== (acceptanceEvaluation !== null)) {
886
+ if (strict) return { ok: false, error: "closepack acceptance surfaces incomplete", warnings };
887
+ }
888
+ if (acceptanceCriteria && acceptanceEvaluation) {
889
+ if (String(acceptanceCriteria.schemaVersion ?? "") !== "AcceptanceCriteria.v1") return { ok: false, error: "unsupported acceptance criteria schemaVersion", schemaVersion: acceptanceCriteria.schemaVersion ?? null, warnings };
890
+ const derivedEval = computeAcceptanceEvaluationV1({
891
+ generatedAt: String(acceptanceEvaluation.generatedAt ?? header.createdAt ?? ""),
892
+ acceptanceCriteria,
893
+ jobEvents,
894
+ slaEvaluation
895
+ });
896
+ if (canonicalJsonStringify(derivedEval) !== canonicalJsonStringify(acceptanceEvaluation)) {
897
+ return { ok: false, error: "closepack acceptance_evaluation mismatch", warnings, detail: { expected: derivedEval, actual: acceptanceEvaluation } };
898
+ }
899
+ }
900
+
901
+ return {
902
+ ok: true,
903
+ kind: CLOSE_PACK_TYPE_V1,
904
+ tenantId: header?.tenantId ?? null,
905
+ invoiceId: header?.invoiceId ?? null,
906
+ createdAt: header?.createdAt ?? null,
907
+ protocol: header?.protocol ?? null,
908
+ manifestHash: expectedManifestHash,
909
+ headAttestation: headAttestation ?? null,
910
+ embeddedInvoice: { manifestHash: embeddedInvoiceManifestHash, headAttestationHash: embeddedInvoiceAttestationHash ?? null },
911
+ warnings
912
+ };
913
+ }
914
+