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.
- package/Dockerfile +45 -0
- package/README.md +150 -0
- package/SETTLD_VERSION +1 -0
- package/bin/settld.js +212 -0
- package/conformance/README.md +14 -0
- package/conformance/kernel-v0/README.md +60 -0
- package/conformance/kernel-v0/cases.json +19 -0
- package/conformance/kernel-v0/run.mjs +830 -0
- package/conformance/v1/README.md +77 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/evidence/evidence_index.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- 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
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- 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
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/settld.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/payload/invoice_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/settld.json +1 -0
- package/conformance/v1/bundles/closepack/nonstrict-pass-missing-sla-acceptance/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/acceptance/acceptance_criteria.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/acceptance/acceptance_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/evidence/evidence_index.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- 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
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- 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
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/payload/invoice_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/sla/sla_definition.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/sla/sla_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-embedded-invoice-fails/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/acceptance/acceptance_criteria.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/acceptance/acceptance_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/evidence/evidence_index.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- 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
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- 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
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/payload/invoice_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/sla/sla_definition.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/sla/sla_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-fail-evidence-index-mismatch/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/acceptance/acceptance_criteria.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/acceptance/acceptance_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/evidence/evidence_index.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/payload/invoice_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/settld.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/sla/sla_definition.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/sla/sla_evaluation.json +1 -0
- package/conformance/v1/bundles/closepack/strict-pass/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/GLBatch.v1.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/JournalCsv.v1.csv +2 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/JournalCsv.v1.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/finance/reconcile.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/verify/report.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/month/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/settld.json +1 -0
- package/conformance/v1/bundles/financepack/pass-with-tool-version-unknown-warning/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/GLBatch.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/JournalCsv.v1.csv +2 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/JournalCsv.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/finance/reconcile.json +2 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/verify/report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/month/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/settld.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/GLBatch.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/JournalCsv.v1.csv +2 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/JournalCsv.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/finance/reconcile.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/verify/report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/month/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-fail-missing-verification-report/settld.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/finance/GLBatch.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/finance/JournalCsv.v1.csv +2 -0
- package/conformance/v1/bundles/financepack/strict-pass/finance/JournalCsv.v1.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/finance/reconcile.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/policy.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/revocations.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/manifest.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/verify/report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/month/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/settld.json +1 -0
- package/conformance/v1/bundles/financepack/strict-pass/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-missing-verification-report/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/nonstrict-pass-unsigned-pricing-matrix-warning/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-evidence-sha-mismatch/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invalid-pricing-matrix-signature/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-invoice-total-mismatch/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-pricing-matrix-signature/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-missing-verification-report/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-fail-pricing-code-unknown/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/invoice/invoice_claim.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/metering/metering_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/policy.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/revocations.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/job/snapshot.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/manifest.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/verify/report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/payload/job_proof_bundle/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/pricing/pricing_matrix.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/pricing/pricing_matrix_signatures.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/settld.json +1 -0
- package/conformance/v1/bundles/invoicebundle/strict-pass/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/job/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/manifest.json +1 -0
- package/conformance/v1/bundles/jobproof/nonstrict-pass-missing-verification-report/verify/report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/policy.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/revocations.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/job/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/manifest.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/verify/report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/policy.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/revocations.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/job/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/manifest.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/verify/report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-fail-unauthorized-signer/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/policy.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/revocations.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/jobproof/strict-pass/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/job/snapshot.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/manifest.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/verify/report.json +1 -0
- package/conformance/v1/bundles/jobproof/strict-pass/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/policy.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/revocations.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/manifest.json +1 -0
- package/conformance/v1/bundles/monthproof/nonstrict-pass-missing-verification-report/verify/report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/events/events.jsonl +2 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/policy.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/revocations.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/manifest.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/verify/report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-manifest-tamper/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/policy.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/revocations.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/manifest.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/verify/report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-fail-unauthorized-signer/verify/verification_report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/attestation/bundle_head_attestation.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/global/events/events.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/global/events/payload_material.jsonl +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/global/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/policy.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/revocations.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/events/events.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/events/payload_material.jsonl +0 -0
- package/conformance/v1/bundles/monthproof/strict-pass/governance/tenant/snapshot.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/keys/public_keys.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/manifest.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/verify/report.json +1 -0
- package/conformance/v1/bundles/monthproof/strict-pass/verify/verification_report.json +1 -0
- package/conformance/v1/cases.json +381 -0
- package/conformance/v1/expected/closepack_nonstrict_pass_missing_sla_acceptance.json +9 -0
- package/conformance/v1/expected/closepack_strict_fail_embedded_invoice_fails.json +9 -0
- package/conformance/v1/expected/closepack_strict_fail_evidence_index_mismatch.json +9 -0
- package/conformance/v1/expected/closepack_strict_pass.json +9 -0
- package/conformance/v1/expected/financepack_strict_fail_missing_verification_report.json +9 -0
- package/conformance/v1/expected/financepack_strict_fail_on_warnings_tool_version_unknown.json +9 -0
- package/conformance/v1/expected/financepack_strict_fail_trust_roots_missing.json +9 -0
- package/conformance/v1/expected/financepack_strict_fail_trust_roots_wrong.json +9 -0
- package/conformance/v1/expected/financepack_strict_pass.json +9 -0
- package/conformance/v1/expected/invoicebundle_nonstrict_pass_missing_verification_report.json +9 -0
- package/conformance/v1/expected/invoicebundle_nonstrict_pass_unsigned_pricing_matrix_warning.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_evidence_sha_mismatch.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_invalid_pricing_matrix_signature.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_invoice_total_mismatch.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_missing_pricing_matrix_signature.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_missing_verification_report.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_fail_pricing_code_unknown.json +9 -0
- package/conformance/v1/expected/invoicebundle_strict_pass.json +9 -0
- package/conformance/v1/expected/jobproof_nonstrict_pass_missing_verification_report.json +9 -0
- package/conformance/v1/expected/jobproof_strict_fail_manifest_tamper.json +9 -0
- package/conformance/v1/expected/jobproof_strict_fail_unauthorized_signer.json +9 -0
- package/conformance/v1/expected/jobproof_strict_pass.json +9 -0
- package/conformance/v1/expected/monthproof_nonstrict_pass_missing_verification_report.json +9 -0
- package/conformance/v1/expected/monthproof_strict_fail_manifest_tamper.json +9 -0
- package/conformance/v1/expected/monthproof_strict_fail_unauthorized_signer.json +9 -0
- package/conformance/v1/expected/monthproof_strict_pass.json +9 -0
- package/conformance/v1/expected/security_bundle_symlink_outside.json +9 -0
- package/conformance/v1/expected/security_manifest_case_collision.json +8 -0
- package/conformance/v1/expected/security_manifest_duplicate_paths.json +9 -0
- package/conformance/v1/expected/security_manifest_path_traversal.json +9 -0
- package/conformance/v1/lib/harness.mjs +78 -0
- package/conformance/v1/lib/mutations.mjs +61 -0
- package/conformance/v1/produce-cases.json +75 -0
- package/conformance/v1/producer/bad-plugin-invalid-provider.mjs +4 -0
- package/conformance/v1/producer/bad-plugin-no-export.mjs +3 -0
- package/conformance/v1/producer/fixture_keypairs.json +18 -0
- package/conformance/v1/producer/inmemory-signer-plugin.mjs +47 -0
- package/conformance/v1/producer/signer-stdio-bad-json.mjs +54 -0
- package/conformance/v1/producer/signer-stdio-partial-stdout-exit1.mjs +51 -0
- package/conformance/v1/producer/signer-stdio-stderr-only-exit1.mjs +46 -0
- package/conformance/v1/producer/signer-stdio-stub.mjs +134 -0
- package/conformance/v1/protocol-vectors/v1.json +81 -0
- package/conformance/v1/release-cases.json +111 -0
- package/conformance/v1/release-trust-quorum.json +15 -0
- package/conformance/v1/release-trust-revoked.json +16 -0
- package/conformance/v1/release-trust.json +15 -0
- package/conformance/v1/releases/release_fail_asset_hash_mismatch/a.tgz +1 -0
- package/conformance/v1/releases/release_fail_asset_hash_mismatch/b.tar.gz +1 -0
- package/conformance/v1/releases/release_fail_asset_hash_mismatch/release_index_v1.json +1 -0
- package/conformance/v1/releases/release_fail_asset_hash_mismatch/release_index_v1.sig +1 -0
- package/conformance/v1/releases/release_fail_missing_asset/a.tgz +1 -0
- package/conformance/v1/releases/release_fail_missing_asset/release_index_v1.json +1 -0
- package/conformance/v1/releases/release_fail_missing_asset/release_index_v1.sig +1 -0
- package/conformance/v1/releases/release_fail_signature_invalid/a.tgz +1 -0
- package/conformance/v1/releases/release_fail_signature_invalid/b.tar.gz +1 -0
- package/conformance/v1/releases/release_fail_signature_invalid/release_index_v1.json +1 -0
- package/conformance/v1/releases/release_fail_signature_invalid/release_index_v1.sig +1 -0
- package/conformance/v1/releases/release_pass/a.tgz +1 -0
- package/conformance/v1/releases/release_pass/b.tar.gz +1 -0
- package/conformance/v1/releases/release_pass/release_index_v1.json +1 -0
- package/conformance/v1/releases/release_pass/release_index_v1.sig +1 -0
- package/conformance/v1/run-produce.mjs +507 -0
- package/conformance/v1/run-release.mjs +129 -0
- package/conformance/v1/run.mjs +229 -0
- package/conformance/v1/trust.json +11 -0
- package/docker-compose.yml +154 -0
- package/package.json +98 -0
- package/packages/artifact-verify/src/bundle-path.js +60 -0
- package/packages/artifact-verify/src/canonical-json.js +48 -0
- package/packages/artifact-verify/src/close-pack-bundle.js +914 -0
- package/packages/artifact-verify/src/crypto.js +18 -0
- package/packages/artifact-verify/src/finance-pack-bundle.js +750 -0
- package/packages/artifact-verify/src/governance-policy.js +312 -0
- package/packages/artifact-verify/src/hash-file.js +38 -0
- package/packages/artifact-verify/src/index.js +100 -0
- package/packages/artifact-verify/src/invoice-bundle.js +865 -0
- package/packages/artifact-verify/src/job-proof-bundle.js +1996 -0
- package/packages/artifact-verify/src/map-with-concurrency.js +32 -0
- package/packages/artifact-verify/src/reconcile.js +135 -0
- package/packages/artifact-verify/src/release/release-index-lib.js +190 -0
- package/packages/artifact-verify/src/release/verify-release.js +187 -0
- package/packages/artifact-verify/src/revocation-list.js +119 -0
- package/packages/artifact-verify/src/safe-unzip.js +335 -0
- package/packages/artifact-verify/src/settlement-decision-report.js +61 -0
- package/packages/artifact-verify/src/timestamp-proof.js +49 -0
- package/packages/artifact-verify/src/tool-provenance.js +49 -0
- package/packages/artifact-verify/src/trust.js +54 -0
- package/packages/artifact-verify/src/verification-warnings.js +34 -0
- package/scripts/closepack/export.mjs +101 -0
- package/scripts/closepack/lib.mjs +1068 -0
- package/scripts/closepack/verify.mjs +65 -0
- package/scripts/init/capability.mjs +556 -0
- package/scripts/init/postinstall-sanity.mjs +18 -0
- package/services/finance-sink/README.md +37 -0
- package/services/finance-sink/package.json +6 -0
- package/services/finance-sink/src/ack-worker.js +152 -0
- package/services/finance-sink/src/config.js +176 -0
- package/services/finance-sink/src/dedupe-store.js +232 -0
- package/services/finance-sink/src/s3-store.js +139 -0
- package/services/finance-sink/src/server.js +391 -0
- package/services/receiver/README.md +49 -0
- package/services/receiver/package.json +6 -0
- package/services/receiver/src/ack-worker.js +166 -0
- package/services/receiver/src/config.js +178 -0
- package/services/receiver/src/dedupe-store.js +232 -0
- package/services/receiver/src/s3-store.js +111 -0
- package/services/receiver/src/server.js +304 -0
- package/src/agent/agent-sim.js +167 -0
- package/src/api/app.js +31794 -0
- package/src/api/http.js +124 -0
- package/src/api/maintenance.js +174 -0
- package/src/api/middleware/auth.js +105 -0
- package/src/api/middleware/authz.js +19 -0
- package/src/api/openapi.js +5684 -0
- package/src/api/outbox.js +93 -0
- package/src/api/persistence.js +628 -0
- package/src/api/server.js +100 -0
- package/src/api/store.js +2088 -0
- package/src/api/workers/artifacts.js +574 -0
- package/src/api/workers/deliveries.js +628 -0
- package/src/api/workers/proof.js +374 -0
- package/src/core/acceptance-criteria.js +78 -0
- package/src/core/access.js +130 -0
- package/src/core/agent-reputation.js +311 -0
- package/src/core/agent-runs.js +253 -0
- package/src/core/agent-wallets.js +883 -0
- package/src/core/allocations.js +160 -0
- package/src/core/artifact-verification-status.js +216 -0
- package/src/core/artifacts.js +938 -0
- package/src/core/assist.js +106 -0
- package/src/core/audit-export.js +68 -0
- package/src/core/auth.js +189 -0
- package/src/core/billing-plans.js +187 -0
- package/src/core/booking.js +268 -0
- package/src/core/cancellation.js +34 -0
- package/src/core/canonical-json.js +104 -0
- package/src/core/claims.js +152 -0
- package/src/core/close-pack-bundle.js +527 -0
- package/src/core/config.js +272 -0
- package/src/core/contract-compiler.js +68 -0
- package/src/core/contract-document.js +226 -0
- package/src/core/contract-selection.js +152 -0
- package/src/core/contracts.js +439 -0
- package/src/core/crypto.js +30 -0
- package/src/core/deterministic-zip.js +169 -0
- package/src/core/dispatch-events.js +113 -0
- package/src/core/dispatch.js +26 -0
- package/src/core/dispute-open-envelope.js +163 -0
- package/src/core/escrow-ledger.js +329 -0
- package/src/core/event-chain.js +114 -0
- package/src/core/event-policy.js +120 -0
- package/src/core/evidence-linker.js +93 -0
- package/src/core/evidence-store.js +286 -0
- package/src/core/evidence.js +119 -0
- package/src/core/failpoints.js +30 -0
- package/src/core/finance-account-map.js +59 -0
- package/src/core/finance-pack-bundle.js +554 -0
- package/src/core/funding-hold.js +185 -0
- package/src/core/gl-batch.js +107 -0
- package/src/core/governance-policy.js +174 -0
- package/src/core/governance.js +92 -0
- package/src/core/hold-exposure.js +74 -0
- package/src/core/idempotency.js +51 -0
- package/src/core/ids.js +21 -0
- package/src/core/incidents.js +75 -0
- package/src/core/insurer-reimbursements.js +58 -0
- package/src/core/interaction-directions.js +170 -0
- package/src/core/invoice-bundle.js +564 -0
- package/src/core/job-reducer.js +702 -0
- package/src/core/job-state-machine.js +266 -0
- package/src/core/journal-csv.js +94 -0
- package/src/core/ledger-postings-finance.js +31 -0
- package/src/core/ledger-postings.js +476 -0
- package/src/core/ledger.js +59 -0
- package/src/core/liveness.js +154 -0
- package/src/core/log.js +156 -0
- package/src/core/maintenance-locks.js +3 -0
- package/src/core/marketplace-kernel.js +243 -0
- package/src/core/metrics.js +133 -0
- package/src/core/money-rail-adapters.js +735 -0
- package/src/core/month-close-hold-policy.js +19 -0
- package/src/core/month-close.js +159 -0
- package/src/core/operator-cost.js +79 -0
- package/src/core/operator-coverage.js +46 -0
- package/src/core/operator-reducer.js +73 -0
- package/src/core/operators.js +52 -0
- package/src/core/ops-audit.js +45 -0
- package/src/core/party-statements.js +145 -0
- package/src/core/pilot-templates.js +26 -0
- package/src/core/policy.js +76 -0
- package/src/core/pricing.js +71 -0
- package/src/core/proof-bundle.js +1153 -0
- package/src/core/proof-events.js +88 -0
- package/src/core/proof-verifier.js +261 -0
- package/src/core/proof.js +46 -0
- package/src/core/protocol.js +105 -0
- package/src/core/quotas.js +32 -0
- package/src/core/reputation-event.js +203 -0
- package/src/core/rescheduling.js +51 -0
- package/src/core/retention.js +32 -0
- package/src/core/revocation-list.js +70 -0
- package/src/core/risk.js +383 -0
- package/src/core/robot-health.js +111 -0
- package/src/core/robot-reducer.js +198 -0
- package/src/core/robots.js +152 -0
- package/src/core/s3-presign.js +111 -0
- package/src/core/secrets.js +128 -0
- package/src/core/settlement-adjustment.js +151 -0
- package/src/core/settlement-kernel.js +405 -0
- package/src/core/settlement-policy.js +206 -0
- package/src/core/settlement-splits.js +46 -0
- package/src/core/signer-keys.js +33 -0
- package/src/core/skills.js +86 -0
- package/src/core/sla-events.js +229 -0
- package/src/core/sla-metering.js +169 -0
- package/src/core/sla-policy-templates.js +340 -0
- package/src/core/sla.js +29 -0
- package/src/core/statements.js +426 -0
- package/src/core/tenancy.js +55 -0
- package/src/core/timestamp-proof.js +36 -0
- package/src/core/tool-manifest.js +116 -0
- package/src/core/tool-provenance.js +36 -0
- package/src/core/url-safety.js +263 -0
- package/src/core/verification-warnings.js +53 -0
- package/src/core/zone-coverage.js +59 -0
- package/src/core/zones.js +8 -0
- package/src/core/zoneset.js +67 -0
- package/src/db/migrate.js +61 -0
- package/src/db/migrations/001_init.sql +92 -0
- package/src/db/migrations/002_robot_reservations.sql +23 -0
- package/src/db/migrations/003_idempotency_v2.sql +32 -0
- package/src/db/migrations/004_notifications.sql +12 -0
- package/src/db/migrations/005_multi_tenant.sql +106 -0
- package/src/db/migrations/006_contracts.sql +27 -0
- package/src/db/migrations/007_artifacts_deliveries_correlations.sql +53 -0
- package/src/db/migrations/008_delivery_ingest_hardening.sql +52 -0
- package/src/db/migrations/009_auth_keys.sql +21 -0
- package/src/db/migrations/010_signer_keys.sql +25 -0
- package/src/db/migrations/011_ops_audit.sql +33 -0
- package/src/db/migrations/012_retention.sql +16 -0
- package/src/db/migrations/013_perf_indexes.sql +18 -0
- package/src/db/migrations/014_contracts_v2.sql +68 -0
- package/src/db/migrations/015_parties.sql +16 -0
- package/src/db/migrations/016_ledger_allocations.sql +18 -0
- package/src/db/migrations/017_party_statements.sql +31 -0
- package/src/db/migrations/018_finance_account_map.sql +12 -0
- package/src/db/migrations/019_ledger_allocations_account_id.sql +7 -0
- package/src/db/migrations/020_artifacts_source_event_unique.sql +10 -0
- package/src/db/migrations/021_artifacts_by_job_created_at_id.sql +6 -0
- package/src/db/migrations/022_governance_uniqueness.sql +28 -0
- package/src/db/migrations/023_marketplace_tasks.sql +45 -0
- package/src/db/migrations/024_agent_runtime_state.sql +70 -0
- package/src/db/migrations/025_tenant_settlement_policies.sql +19 -0
- package/src/db/migrations/026_money_rails_billable_events.sql +82 -0
- package/src/db/migrations/027_tenant_billing_config.sql +10 -0
- package/src/db/migrations/028_marketplace_rfq_storage.sql +121 -0
- package/src/db/pg.js +123 -0
- package/src/db/store-pg.js +6465 -0
|
@@ -0,0 +1,883 @@
|
|
|
1
|
+
export const AGENT_WALLET_SCHEMA_VERSION = "AgentWallet.v1";
|
|
2
|
+
export const AGENT_RUN_SETTLEMENT_SCHEMA_VERSION = "AgentRunSettlement.v1";
|
|
3
|
+
export const DEFAULT_AGENT_WALLET_CURRENCY = "USD";
|
|
4
|
+
|
|
5
|
+
export const AGENT_RUN_SETTLEMENT_STATUS = Object.freeze({
|
|
6
|
+
LOCKED: "locked",
|
|
7
|
+
RELEASED: "released",
|
|
8
|
+
REFUNDED: "refunded"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_STATUS = Object.freeze({
|
|
12
|
+
NONE: "none",
|
|
13
|
+
OPEN: "open",
|
|
14
|
+
CLOSED: "closed"
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_KIND = Object.freeze({
|
|
18
|
+
QUALITY: "quality",
|
|
19
|
+
DELIVERY: "delivery",
|
|
20
|
+
FRAUD: "fraud",
|
|
21
|
+
POLICY: "policy",
|
|
22
|
+
PAYMENT: "payment",
|
|
23
|
+
OTHER: "other"
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_PRIORITY = Object.freeze({
|
|
27
|
+
LOW: "low",
|
|
28
|
+
NORMAL: "normal",
|
|
29
|
+
HIGH: "high",
|
|
30
|
+
CRITICAL: "critical"
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_CHANNEL = Object.freeze({
|
|
34
|
+
COUNTERPARTY: "counterparty",
|
|
35
|
+
POLICY_ENGINE: "policy_engine",
|
|
36
|
+
ARBITER: "arbiter",
|
|
37
|
+
EXTERNAL: "external"
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL = Object.freeze({
|
|
41
|
+
L1_COUNTERPARTY: "l1_counterparty",
|
|
42
|
+
L2_ARBITER: "l2_arbiter",
|
|
43
|
+
L3_EXTERNAL: "l3_external"
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const AGENT_RUN_SETTLEMENT_DISPUTE_RESOLUTION_OUTCOME = Object.freeze({
|
|
47
|
+
ACCEPTED: "accepted",
|
|
48
|
+
REJECTED: "rejected",
|
|
49
|
+
PARTIAL: "partial",
|
|
50
|
+
WITHDRAWN: "withdrawn",
|
|
51
|
+
UNRESOLVED: "unresolved"
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const AGENT_RUN_SETTLEMENT_DECISION_STATUS = Object.freeze({
|
|
55
|
+
PENDING: "pending",
|
|
56
|
+
AUTO_RESOLVED: "auto_resolved",
|
|
57
|
+
MANUAL_REVIEW_REQUIRED: "manual_review_required",
|
|
58
|
+
MANUAL_RESOLVED: "manual_resolved"
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const AGENT_RUN_SETTLEMENT_DECISION_MODE = Object.freeze({
|
|
62
|
+
AUTOMATIC: "automatic",
|
|
63
|
+
MANUAL_REVIEW: "manual-review"
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
function assertPlainObject(value, name) {
|
|
67
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${name} must be an object`);
|
|
68
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
69
|
+
throw new TypeError(`${name} must be a plain object`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function assertNonEmptyString(value, name) {
|
|
74
|
+
if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${name} must be a non-empty string`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function assertAmountCents(value, name, { allowZero = false } = {}) {
|
|
78
|
+
if (!Number.isSafeInteger(value)) throw new TypeError(`${name} must be a safe integer`);
|
|
79
|
+
const min = allowZero ? 0 : 1;
|
|
80
|
+
if (value < min) throw new TypeError(`${name} must be >= ${min}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function assertIsoDate(value, name) {
|
|
84
|
+
assertNonEmptyString(value, name);
|
|
85
|
+
if (!Number.isFinite(Date.parse(value))) throw new TypeError(`${name} must be an ISO date string`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function normalizeEnumValue(value, name, allowedValues) {
|
|
89
|
+
const normalized = String(value ?? "").trim().toLowerCase();
|
|
90
|
+
if (!allowedValues.includes(normalized)) {
|
|
91
|
+
throw new TypeError(`${name} must be one of: ${allowedValues.join("|")}`);
|
|
92
|
+
}
|
|
93
|
+
return normalized;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function normalizeDisputeEvidenceRefs(value, name) {
|
|
97
|
+
if (value === null || value === undefined) return [];
|
|
98
|
+
if (!Array.isArray(value)) throw new TypeError(`${name} must be an array`);
|
|
99
|
+
const out = [];
|
|
100
|
+
const seen = new Set();
|
|
101
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
102
|
+
const item = value[index];
|
|
103
|
+
if (typeof item !== "string" || item.trim() === "") {
|
|
104
|
+
throw new TypeError(`${name}[${index}] must be a non-empty string`);
|
|
105
|
+
}
|
|
106
|
+
const normalized = item.trim();
|
|
107
|
+
if (seen.has(normalized)) continue;
|
|
108
|
+
seen.add(normalized);
|
|
109
|
+
out.push(normalized);
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function normalizeDisputeContext(disputeContext, { name = "settlement.disputeContext", defaultEscalationLevel = null } = {}) {
|
|
115
|
+
if (disputeContext === null || disputeContext === undefined) return null;
|
|
116
|
+
assertPlainObject(disputeContext, name);
|
|
117
|
+
const kind = normalizeEnumValue(
|
|
118
|
+
disputeContext.type ?? AGENT_RUN_SETTLEMENT_DISPUTE_KIND.OTHER,
|
|
119
|
+
`${name}.type`,
|
|
120
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_KIND)
|
|
121
|
+
);
|
|
122
|
+
const priority = normalizeEnumValue(
|
|
123
|
+
disputeContext.priority ?? AGENT_RUN_SETTLEMENT_DISPUTE_PRIORITY.NORMAL,
|
|
124
|
+
`${name}.priority`,
|
|
125
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_PRIORITY)
|
|
126
|
+
);
|
|
127
|
+
const channel = normalizeEnumValue(
|
|
128
|
+
disputeContext.channel ?? AGENT_RUN_SETTLEMENT_DISPUTE_CHANNEL.COUNTERPARTY,
|
|
129
|
+
`${name}.channel`,
|
|
130
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_CHANNEL)
|
|
131
|
+
);
|
|
132
|
+
const escalationLevel = normalizeEnumValue(
|
|
133
|
+
disputeContext.escalationLevel ??
|
|
134
|
+
defaultEscalationLevel ??
|
|
135
|
+
AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL.L1_COUNTERPARTY,
|
|
136
|
+
`${name}.escalationLevel`,
|
|
137
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL)
|
|
138
|
+
);
|
|
139
|
+
const openedByAgentId =
|
|
140
|
+
disputeContext.openedByAgentId === null || disputeContext.openedByAgentId === undefined
|
|
141
|
+
? null
|
|
142
|
+
: String(disputeContext.openedByAgentId).trim();
|
|
143
|
+
if (openedByAgentId !== null && openedByAgentId === "") {
|
|
144
|
+
throw new TypeError(`${name}.openedByAgentId must be a non-empty string when provided`);
|
|
145
|
+
}
|
|
146
|
+
const reason =
|
|
147
|
+
disputeContext.reason === null || disputeContext.reason === undefined ? null : String(disputeContext.reason).trim();
|
|
148
|
+
if (reason !== null && reason === "") {
|
|
149
|
+
throw new TypeError(`${name}.reason must be a non-empty string when provided`);
|
|
150
|
+
}
|
|
151
|
+
const evidenceRefs = normalizeDisputeEvidenceRefs(disputeContext.evidenceRefs, `${name}.evidenceRefs`);
|
|
152
|
+
return {
|
|
153
|
+
type: kind,
|
|
154
|
+
priority,
|
|
155
|
+
channel,
|
|
156
|
+
escalationLevel,
|
|
157
|
+
openedByAgentId,
|
|
158
|
+
reason,
|
|
159
|
+
evidenceRefs
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function normalizeDisputeResolution(disputeResolution, { name = "settlement.disputeResolution", defaultClosedAt = null } = {}) {
|
|
164
|
+
if (disputeResolution === null || disputeResolution === undefined) return null;
|
|
165
|
+
assertPlainObject(disputeResolution, name);
|
|
166
|
+
const outcome = normalizeEnumValue(
|
|
167
|
+
disputeResolution.outcome ?? AGENT_RUN_SETTLEMENT_DISPUTE_RESOLUTION_OUTCOME.UNRESOLVED,
|
|
168
|
+
`${name}.outcome`,
|
|
169
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_RESOLUTION_OUTCOME)
|
|
170
|
+
);
|
|
171
|
+
const escalationLevel = normalizeEnumValue(
|
|
172
|
+
disputeResolution.escalationLevel ?? AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL.L1_COUNTERPARTY,
|
|
173
|
+
`${name}.escalationLevel`,
|
|
174
|
+
Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL)
|
|
175
|
+
);
|
|
176
|
+
const closedByAgentId =
|
|
177
|
+
disputeResolution.closedByAgentId === null || disputeResolution.closedByAgentId === undefined
|
|
178
|
+
? null
|
|
179
|
+
: String(disputeResolution.closedByAgentId).trim();
|
|
180
|
+
if (closedByAgentId !== null && closedByAgentId === "") {
|
|
181
|
+
throw new TypeError(`${name}.closedByAgentId must be a non-empty string when provided`);
|
|
182
|
+
}
|
|
183
|
+
const summary =
|
|
184
|
+
disputeResolution.summary === null || disputeResolution.summary === undefined ? null : String(disputeResolution.summary).trim();
|
|
185
|
+
if (summary !== null && summary === "") {
|
|
186
|
+
throw new TypeError(`${name}.summary must be a non-empty string when provided`);
|
|
187
|
+
}
|
|
188
|
+
const closedAtRaw = disputeResolution.closedAt ?? defaultClosedAt ?? null;
|
|
189
|
+
const closedAt = closedAtRaw === null || closedAtRaw === undefined ? null : String(closedAtRaw).trim();
|
|
190
|
+
if (closedAt !== null) assertIsoDate(closedAt, `${name}.closedAt`);
|
|
191
|
+
const evidenceRefs = normalizeDisputeEvidenceRefs(disputeResolution.evidenceRefs, `${name}.evidenceRefs`);
|
|
192
|
+
return {
|
|
193
|
+
outcome,
|
|
194
|
+
escalationLevel,
|
|
195
|
+
closedByAgentId,
|
|
196
|
+
summary,
|
|
197
|
+
closedAt,
|
|
198
|
+
evidenceRefs
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function normalizeCurrency(currency) {
|
|
203
|
+
const raw = typeof currency === "string" && currency.trim() !== "" ? currency : DEFAULT_AGENT_WALLET_CURRENCY;
|
|
204
|
+
const normalized = raw.trim().toUpperCase();
|
|
205
|
+
if (!/^[A-Z][A-Z0-9_]{2,11}$/.test(normalized)) throw new TypeError("currency must match ^[A-Z][A-Z0-9_]{2,11}$");
|
|
206
|
+
return normalized;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function normalizeWalletRecord(wallet) {
|
|
210
|
+
assertPlainObject(wallet, "wallet");
|
|
211
|
+
assertNonEmptyString(wallet.schemaVersion, "wallet.schemaVersion");
|
|
212
|
+
if (wallet.schemaVersion !== AGENT_WALLET_SCHEMA_VERSION) throw new TypeError(`wallet.schemaVersion must be ${AGENT_WALLET_SCHEMA_VERSION}`);
|
|
213
|
+
assertNonEmptyString(wallet.walletId, "wallet.walletId");
|
|
214
|
+
assertNonEmptyString(wallet.agentId, "wallet.agentId");
|
|
215
|
+
assertNonEmptyString(wallet.tenantId, "wallet.tenantId");
|
|
216
|
+
const currency = normalizeCurrency(wallet.currency);
|
|
217
|
+
const availableCents = Number(wallet.availableCents ?? 0);
|
|
218
|
+
const escrowLockedCents = Number(wallet.escrowLockedCents ?? 0);
|
|
219
|
+
const totalDebitedCents = Number(wallet.totalDebitedCents ?? 0);
|
|
220
|
+
const totalCreditedCents = Number(wallet.totalCreditedCents ?? 0);
|
|
221
|
+
assertAmountCents(availableCents, "wallet.availableCents", { allowZero: true });
|
|
222
|
+
assertAmountCents(escrowLockedCents, "wallet.escrowLockedCents", { allowZero: true });
|
|
223
|
+
assertAmountCents(totalDebitedCents, "wallet.totalDebitedCents", { allowZero: true });
|
|
224
|
+
assertAmountCents(totalCreditedCents, "wallet.totalCreditedCents", { allowZero: true });
|
|
225
|
+
if (!Number.isSafeInteger(wallet.revision ?? 0) || Number(wallet.revision ?? 0) < 0) {
|
|
226
|
+
throw new TypeError("wallet.revision must be a non-negative safe integer");
|
|
227
|
+
}
|
|
228
|
+
assertIsoDate(wallet.createdAt, "wallet.createdAt");
|
|
229
|
+
assertIsoDate(wallet.updatedAt, "wallet.updatedAt");
|
|
230
|
+
return {
|
|
231
|
+
schemaVersion: AGENT_WALLET_SCHEMA_VERSION,
|
|
232
|
+
walletId: String(wallet.walletId),
|
|
233
|
+
agentId: String(wallet.agentId),
|
|
234
|
+
tenantId: String(wallet.tenantId),
|
|
235
|
+
currency,
|
|
236
|
+
availableCents,
|
|
237
|
+
escrowLockedCents,
|
|
238
|
+
totalDebitedCents,
|
|
239
|
+
totalCreditedCents,
|
|
240
|
+
revision: Number(wallet.revision ?? 0),
|
|
241
|
+
createdAt: wallet.createdAt,
|
|
242
|
+
updatedAt: wallet.updatedAt
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function createAgentWallet({ tenantId, agentId, currency = DEFAULT_AGENT_WALLET_CURRENCY, at }) {
|
|
247
|
+
assertNonEmptyString(tenantId, "tenantId");
|
|
248
|
+
assertNonEmptyString(agentId, "agentId");
|
|
249
|
+
const timestamp = at ?? new Date().toISOString();
|
|
250
|
+
assertIsoDate(timestamp, "at");
|
|
251
|
+
return {
|
|
252
|
+
schemaVersion: AGENT_WALLET_SCHEMA_VERSION,
|
|
253
|
+
walletId: `wallet_${String(agentId)}`,
|
|
254
|
+
tenantId: String(tenantId),
|
|
255
|
+
agentId: String(agentId),
|
|
256
|
+
currency: normalizeCurrency(currency),
|
|
257
|
+
availableCents: 0,
|
|
258
|
+
escrowLockedCents: 0,
|
|
259
|
+
totalDebitedCents: 0,
|
|
260
|
+
totalCreditedCents: 0,
|
|
261
|
+
revision: 0,
|
|
262
|
+
createdAt: timestamp,
|
|
263
|
+
updatedAt: timestamp
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export function ensureAgentWallet({ wallet, tenantId, agentId, currency = DEFAULT_AGENT_WALLET_CURRENCY, at }) {
|
|
268
|
+
if (!wallet) return createAgentWallet({ tenantId, agentId, currency, at });
|
|
269
|
+
const normalized = normalizeWalletRecord(wallet);
|
|
270
|
+
if (normalized.tenantId !== String(tenantId)) throw new TypeError("wallet.tenantId must match tenantId");
|
|
271
|
+
if (normalized.agentId !== String(agentId)) throw new TypeError("wallet.agentId must match agentId");
|
|
272
|
+
if (normalized.currency !== normalizeCurrency(currency)) throw new TypeError("wallet.currency must match requested currency");
|
|
273
|
+
return normalized;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function withWalletUpdate(wallet, updater, { at }) {
|
|
277
|
+
const base = normalizeWalletRecord(wallet);
|
|
278
|
+
const next = updater(base);
|
|
279
|
+
assertPlainObject(next, "wallet update");
|
|
280
|
+
return normalizeWalletRecord({
|
|
281
|
+
...base,
|
|
282
|
+
...next,
|
|
283
|
+
revision: base.revision + 1,
|
|
284
|
+
updatedAt: at
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function creditAgentWallet({ wallet, amountCents, at = new Date().toISOString() }) {
|
|
289
|
+
assertIsoDate(at, "at");
|
|
290
|
+
assertAmountCents(amountCents, "amountCents");
|
|
291
|
+
return withWalletUpdate(
|
|
292
|
+
wallet,
|
|
293
|
+
(base) => ({
|
|
294
|
+
availableCents: base.availableCents + amountCents,
|
|
295
|
+
totalCreditedCents: base.totalCreditedCents + amountCents
|
|
296
|
+
}),
|
|
297
|
+
{ at }
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export function lockAgentWalletEscrow({ wallet, amountCents, at = new Date().toISOString() }) {
|
|
302
|
+
assertIsoDate(at, "at");
|
|
303
|
+
assertAmountCents(amountCents, "amountCents");
|
|
304
|
+
return withWalletUpdate(
|
|
305
|
+
wallet,
|
|
306
|
+
(base) => {
|
|
307
|
+
if (base.availableCents < amountCents) {
|
|
308
|
+
const err = new Error("insufficient wallet balance");
|
|
309
|
+
err.code = "INSUFFICIENT_WALLET_BALANCE";
|
|
310
|
+
throw err;
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
availableCents: base.availableCents - amountCents,
|
|
314
|
+
escrowLockedCents: base.escrowLockedCents + amountCents
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
{ at }
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export function releaseAgentWalletEscrowToPayee({ payerWallet, payeeWallet, amountCents, at = new Date().toISOString() }) {
|
|
322
|
+
assertIsoDate(at, "at");
|
|
323
|
+
assertAmountCents(amountCents, "amountCents");
|
|
324
|
+
const payer = withWalletUpdate(
|
|
325
|
+
payerWallet,
|
|
326
|
+
(base) => {
|
|
327
|
+
if (base.escrowLockedCents < amountCents) {
|
|
328
|
+
const err = new Error("insufficient escrow balance");
|
|
329
|
+
err.code = "INSUFFICIENT_ESCROW_BALANCE";
|
|
330
|
+
throw err;
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
escrowLockedCents: base.escrowLockedCents - amountCents,
|
|
334
|
+
totalDebitedCents: base.totalDebitedCents + amountCents
|
|
335
|
+
};
|
|
336
|
+
},
|
|
337
|
+
{ at }
|
|
338
|
+
);
|
|
339
|
+
const payee = withWalletUpdate(
|
|
340
|
+
payeeWallet,
|
|
341
|
+
(base) => ({
|
|
342
|
+
availableCents: base.availableCents + amountCents,
|
|
343
|
+
totalCreditedCents: base.totalCreditedCents + amountCents
|
|
344
|
+
}),
|
|
345
|
+
{ at }
|
|
346
|
+
);
|
|
347
|
+
return { payerWallet: payer, payeeWallet: payee };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function refundAgentWalletEscrow({ wallet, amountCents, at = new Date().toISOString() }) {
|
|
351
|
+
assertIsoDate(at, "at");
|
|
352
|
+
assertAmountCents(amountCents, "amountCents");
|
|
353
|
+
return withWalletUpdate(
|
|
354
|
+
wallet,
|
|
355
|
+
(base) => {
|
|
356
|
+
if (base.escrowLockedCents < amountCents) {
|
|
357
|
+
const err = new Error("insufficient escrow balance");
|
|
358
|
+
err.code = "INSUFFICIENT_ESCROW_BALANCE";
|
|
359
|
+
throw err;
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
escrowLockedCents: base.escrowLockedCents - amountCents,
|
|
363
|
+
availableCents: base.availableCents + amountCents,
|
|
364
|
+
totalCreditedCents: base.totalCreditedCents + amountCents
|
|
365
|
+
};
|
|
366
|
+
},
|
|
367
|
+
{ at }
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export function validateAgentRunSettlementRequest(payload) {
|
|
372
|
+
assertPlainObject(payload, "settlement");
|
|
373
|
+
assertNonEmptyString(payload.payerAgentId, "settlement.payerAgentId");
|
|
374
|
+
const amountCents = Number(payload.amountCents);
|
|
375
|
+
assertAmountCents(amountCents, "settlement.amountCents");
|
|
376
|
+
const currency = normalizeCurrency(payload.currency ?? DEFAULT_AGENT_WALLET_CURRENCY);
|
|
377
|
+
const disputeWindowDaysRaw = payload.disputeWindowDays;
|
|
378
|
+
let disputeWindowDays = 0;
|
|
379
|
+
if (disputeWindowDaysRaw !== undefined && disputeWindowDaysRaw !== null) {
|
|
380
|
+
const parsed = Number(disputeWindowDaysRaw);
|
|
381
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0) {
|
|
382
|
+
throw new TypeError("settlement.disputeWindowDays must be a non-negative safe integer");
|
|
383
|
+
}
|
|
384
|
+
disputeWindowDays = parsed;
|
|
385
|
+
}
|
|
386
|
+
return { payerAgentId: String(payload.payerAgentId), amountCents, currency, disputeWindowDays };
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function normalizeSettlementRecord(settlement) {
|
|
390
|
+
assertPlainObject(settlement, "settlement");
|
|
391
|
+
if (settlement.schemaVersion !== AGENT_RUN_SETTLEMENT_SCHEMA_VERSION) {
|
|
392
|
+
throw new TypeError(`settlement.schemaVersion must be ${AGENT_RUN_SETTLEMENT_SCHEMA_VERSION}`);
|
|
393
|
+
}
|
|
394
|
+
assertNonEmptyString(settlement.settlementId, "settlement.settlementId");
|
|
395
|
+
assertNonEmptyString(settlement.runId, "settlement.runId");
|
|
396
|
+
assertNonEmptyString(settlement.tenantId, "settlement.tenantId");
|
|
397
|
+
assertNonEmptyString(settlement.agentId, "settlement.agentId");
|
|
398
|
+
assertNonEmptyString(settlement.payerAgentId, "settlement.payerAgentId");
|
|
399
|
+
const amountCents = Number(settlement.amountCents);
|
|
400
|
+
assertAmountCents(amountCents, "settlement.amountCents");
|
|
401
|
+
const currency = normalizeCurrency(settlement.currency);
|
|
402
|
+
const status = String(settlement.status ?? "").toLowerCase();
|
|
403
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_STATUS).includes(status)) {
|
|
404
|
+
throw new TypeError("settlement.status must be locked|released|refunded");
|
|
405
|
+
}
|
|
406
|
+
assertIsoDate(settlement.lockedAt, "settlement.lockedAt");
|
|
407
|
+
if (settlement.resolvedAt !== null && settlement.resolvedAt !== undefined) assertIsoDate(settlement.resolvedAt, "settlement.resolvedAt");
|
|
408
|
+
if (settlement.resolutionEventId !== null && settlement.resolutionEventId !== undefined) {
|
|
409
|
+
assertNonEmptyString(settlement.resolutionEventId, "settlement.resolutionEventId");
|
|
410
|
+
}
|
|
411
|
+
if (settlement.runStatus !== null && settlement.runStatus !== undefined) {
|
|
412
|
+
assertNonEmptyString(settlement.runStatus, "settlement.runStatus");
|
|
413
|
+
}
|
|
414
|
+
const releasedAmountCents = Number(settlement.releasedAmountCents ?? 0);
|
|
415
|
+
const refundedAmountCents = Number(settlement.refundedAmountCents ?? 0);
|
|
416
|
+
assertAmountCents(releasedAmountCents, "settlement.releasedAmountCents", { allowZero: true });
|
|
417
|
+
assertAmountCents(refundedAmountCents, "settlement.refundedAmountCents", { allowZero: true });
|
|
418
|
+
if (releasedAmountCents + refundedAmountCents > amountCents) {
|
|
419
|
+
throw new TypeError("settlement released+refunded amounts exceed amountCents");
|
|
420
|
+
}
|
|
421
|
+
const releaseRatePctRaw = settlement.releaseRatePct;
|
|
422
|
+
const releaseRatePct =
|
|
423
|
+
releaseRatePctRaw === null || releaseRatePctRaw === undefined
|
|
424
|
+
? null
|
|
425
|
+
: Number.isSafeInteger(Number(releaseRatePctRaw))
|
|
426
|
+
? Number(releaseRatePctRaw)
|
|
427
|
+
: NaN;
|
|
428
|
+
if (releaseRatePct !== null && (!Number.isSafeInteger(releaseRatePct) || releaseRatePct < 0 || releaseRatePct > 100)) {
|
|
429
|
+
throw new TypeError("settlement.releaseRatePct must be an integer within 0..100");
|
|
430
|
+
}
|
|
431
|
+
const disputeWindowDays = Number(settlement.disputeWindowDays ?? 0);
|
|
432
|
+
if (!Number.isSafeInteger(disputeWindowDays) || disputeWindowDays < 0) {
|
|
433
|
+
throw new TypeError("settlement.disputeWindowDays must be a non-negative safe integer");
|
|
434
|
+
}
|
|
435
|
+
if (settlement.disputeWindowEndsAt !== null && settlement.disputeWindowEndsAt !== undefined) {
|
|
436
|
+
assertIsoDate(settlement.disputeWindowEndsAt, "settlement.disputeWindowEndsAt");
|
|
437
|
+
}
|
|
438
|
+
const disputeStatus = String(settlement.disputeStatus ?? AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.NONE).toLowerCase();
|
|
439
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DISPUTE_STATUS).includes(disputeStatus)) {
|
|
440
|
+
throw new TypeError("settlement.disputeStatus must be none|open|closed");
|
|
441
|
+
}
|
|
442
|
+
if (settlement.disputeId !== null && settlement.disputeId !== undefined) {
|
|
443
|
+
assertNonEmptyString(settlement.disputeId, "settlement.disputeId");
|
|
444
|
+
}
|
|
445
|
+
if (settlement.disputeOpenedAt !== null && settlement.disputeOpenedAt !== undefined) {
|
|
446
|
+
assertIsoDate(settlement.disputeOpenedAt, "settlement.disputeOpenedAt");
|
|
447
|
+
}
|
|
448
|
+
if (settlement.disputeClosedAt !== null && settlement.disputeClosedAt !== undefined) {
|
|
449
|
+
assertIsoDate(settlement.disputeClosedAt, "settlement.disputeClosedAt");
|
|
450
|
+
}
|
|
451
|
+
if (settlement.disputeVerdictId !== null && settlement.disputeVerdictId !== undefined) {
|
|
452
|
+
assertNonEmptyString(settlement.disputeVerdictId, "settlement.disputeVerdictId");
|
|
453
|
+
}
|
|
454
|
+
if (settlement.disputeVerdictHash !== null && settlement.disputeVerdictHash !== undefined) {
|
|
455
|
+
assertNonEmptyString(settlement.disputeVerdictHash, "settlement.disputeVerdictHash");
|
|
456
|
+
}
|
|
457
|
+
if (settlement.disputeVerdictArtifactId !== null && settlement.disputeVerdictArtifactId !== undefined) {
|
|
458
|
+
assertNonEmptyString(settlement.disputeVerdictArtifactId, "settlement.disputeVerdictArtifactId");
|
|
459
|
+
}
|
|
460
|
+
if (settlement.disputeVerdictSignerKeyId !== null && settlement.disputeVerdictSignerKeyId !== undefined) {
|
|
461
|
+
assertNonEmptyString(settlement.disputeVerdictSignerKeyId, "settlement.disputeVerdictSignerKeyId");
|
|
462
|
+
}
|
|
463
|
+
if (settlement.disputeVerdictIssuedAt !== null && settlement.disputeVerdictIssuedAt !== undefined) {
|
|
464
|
+
assertIsoDate(settlement.disputeVerdictIssuedAt, "settlement.disputeVerdictIssuedAt");
|
|
465
|
+
}
|
|
466
|
+
const disputeContext = normalizeDisputeContext(settlement.disputeContext, {
|
|
467
|
+
name: "settlement.disputeContext"
|
|
468
|
+
});
|
|
469
|
+
const disputeResolution = normalizeDisputeResolution(settlement.disputeResolution, {
|
|
470
|
+
name: "settlement.disputeResolution",
|
|
471
|
+
defaultClosedAt: settlement.disputeClosedAt ?? null
|
|
472
|
+
});
|
|
473
|
+
const decisionStatus = String(settlement.decisionStatus ?? AGENT_RUN_SETTLEMENT_DECISION_STATUS.PENDING).toLowerCase();
|
|
474
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_STATUS).includes(decisionStatus)) {
|
|
475
|
+
throw new TypeError("settlement.decisionStatus must be pending|auto_resolved|manual_review_required|manual_resolved");
|
|
476
|
+
}
|
|
477
|
+
const decisionMode = String(settlement.decisionMode ?? AGENT_RUN_SETTLEMENT_DECISION_MODE.AUTOMATIC).toLowerCase();
|
|
478
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_MODE).includes(decisionMode)) {
|
|
479
|
+
throw new TypeError("settlement.decisionMode must be automatic|manual-review");
|
|
480
|
+
}
|
|
481
|
+
if (settlement.decisionPolicyHash !== null && settlement.decisionPolicyHash !== undefined) {
|
|
482
|
+
assertNonEmptyString(settlement.decisionPolicyHash, "settlement.decisionPolicyHash");
|
|
483
|
+
}
|
|
484
|
+
if (settlement.decisionReason !== null && settlement.decisionReason !== undefined) {
|
|
485
|
+
assertNonEmptyString(settlement.decisionReason, "settlement.decisionReason");
|
|
486
|
+
}
|
|
487
|
+
if (settlement.decisionTrace !== null && settlement.decisionTrace !== undefined) {
|
|
488
|
+
assertPlainObject(settlement.decisionTrace, "settlement.decisionTrace");
|
|
489
|
+
}
|
|
490
|
+
if (settlement.decisionUpdatedAt !== null && settlement.decisionUpdatedAt !== undefined) {
|
|
491
|
+
assertIsoDate(settlement.decisionUpdatedAt, "settlement.decisionUpdatedAt");
|
|
492
|
+
}
|
|
493
|
+
if (!Number.isSafeInteger(settlement.revision ?? 0) || Number(settlement.revision ?? 0) < 0) {
|
|
494
|
+
throw new TypeError("settlement.revision must be a non-negative safe integer");
|
|
495
|
+
}
|
|
496
|
+
assertIsoDate(settlement.createdAt, "settlement.createdAt");
|
|
497
|
+
assertIsoDate(settlement.updatedAt, "settlement.updatedAt");
|
|
498
|
+
return {
|
|
499
|
+
schemaVersion: AGENT_RUN_SETTLEMENT_SCHEMA_VERSION,
|
|
500
|
+
settlementId: String(settlement.settlementId),
|
|
501
|
+
runId: String(settlement.runId),
|
|
502
|
+
tenantId: String(settlement.tenantId),
|
|
503
|
+
agentId: String(settlement.agentId),
|
|
504
|
+
payerAgentId: String(settlement.payerAgentId),
|
|
505
|
+
amountCents,
|
|
506
|
+
currency,
|
|
507
|
+
status,
|
|
508
|
+
lockedAt: settlement.lockedAt,
|
|
509
|
+
resolvedAt: settlement.resolvedAt ?? null,
|
|
510
|
+
resolutionEventId: settlement.resolutionEventId ?? null,
|
|
511
|
+
runStatus: settlement.runStatus ?? null,
|
|
512
|
+
releasedAmountCents,
|
|
513
|
+
refundedAmountCents,
|
|
514
|
+
releaseRatePct,
|
|
515
|
+
disputeWindowDays,
|
|
516
|
+
disputeWindowEndsAt: settlement.disputeWindowEndsAt ?? null,
|
|
517
|
+
disputeStatus,
|
|
518
|
+
disputeId: settlement.disputeId ?? null,
|
|
519
|
+
disputeOpenedAt: settlement.disputeOpenedAt ?? null,
|
|
520
|
+
disputeClosedAt: settlement.disputeClosedAt ?? null,
|
|
521
|
+
disputeVerdictId: settlement.disputeVerdictId ?? null,
|
|
522
|
+
disputeVerdictHash: settlement.disputeVerdictHash ?? null,
|
|
523
|
+
disputeVerdictArtifactId: settlement.disputeVerdictArtifactId ?? null,
|
|
524
|
+
disputeVerdictSignerKeyId: settlement.disputeVerdictSignerKeyId ?? null,
|
|
525
|
+
disputeVerdictIssuedAt: settlement.disputeVerdictIssuedAt ?? null,
|
|
526
|
+
disputeContext,
|
|
527
|
+
disputeResolution,
|
|
528
|
+
decisionStatus,
|
|
529
|
+
decisionMode,
|
|
530
|
+
decisionPolicyHash: settlement.decisionPolicyHash ?? null,
|
|
531
|
+
decisionReason: settlement.decisionReason ?? null,
|
|
532
|
+
decisionTrace: settlement.decisionTrace ?? null,
|
|
533
|
+
decisionUpdatedAt: settlement.decisionUpdatedAt ?? null,
|
|
534
|
+
revision: Number(settlement.revision ?? 0),
|
|
535
|
+
createdAt: settlement.createdAt,
|
|
536
|
+
updatedAt: settlement.updatedAt
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export function createAgentRunSettlement({
|
|
541
|
+
tenantId,
|
|
542
|
+
runId,
|
|
543
|
+
agentId,
|
|
544
|
+
payerAgentId,
|
|
545
|
+
amountCents,
|
|
546
|
+
currency,
|
|
547
|
+
disputeWindowDays = 0,
|
|
548
|
+
at = new Date().toISOString()
|
|
549
|
+
}) {
|
|
550
|
+
assertNonEmptyString(tenantId, "tenantId");
|
|
551
|
+
assertNonEmptyString(runId, "runId");
|
|
552
|
+
assertNonEmptyString(agentId, "agentId");
|
|
553
|
+
assertNonEmptyString(payerAgentId, "payerAgentId");
|
|
554
|
+
assertAmountCents(amountCents, "amountCents");
|
|
555
|
+
if (!Number.isSafeInteger(Number(disputeWindowDays)) || Number(disputeWindowDays) < 0) {
|
|
556
|
+
throw new TypeError("disputeWindowDays must be a non-negative safe integer");
|
|
557
|
+
}
|
|
558
|
+
assertIsoDate(at, "at");
|
|
559
|
+
return normalizeSettlementRecord({
|
|
560
|
+
schemaVersion: AGENT_RUN_SETTLEMENT_SCHEMA_VERSION,
|
|
561
|
+
settlementId: `setl_${String(runId)}`,
|
|
562
|
+
runId: String(runId),
|
|
563
|
+
tenantId: String(tenantId),
|
|
564
|
+
agentId: String(agentId),
|
|
565
|
+
payerAgentId: String(payerAgentId),
|
|
566
|
+
amountCents,
|
|
567
|
+
currency: normalizeCurrency(currency),
|
|
568
|
+
status: AGENT_RUN_SETTLEMENT_STATUS.LOCKED,
|
|
569
|
+
lockedAt: at,
|
|
570
|
+
resolvedAt: null,
|
|
571
|
+
resolutionEventId: null,
|
|
572
|
+
runStatus: null,
|
|
573
|
+
releasedAmountCents: 0,
|
|
574
|
+
refundedAmountCents: 0,
|
|
575
|
+
releaseRatePct: null,
|
|
576
|
+
disputeWindowDays: Number(disputeWindowDays),
|
|
577
|
+
disputeWindowEndsAt: null,
|
|
578
|
+
disputeStatus: AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.NONE,
|
|
579
|
+
disputeId: null,
|
|
580
|
+
disputeOpenedAt: null,
|
|
581
|
+
disputeClosedAt: null,
|
|
582
|
+
disputeVerdictId: null,
|
|
583
|
+
disputeVerdictHash: null,
|
|
584
|
+
disputeVerdictArtifactId: null,
|
|
585
|
+
disputeVerdictSignerKeyId: null,
|
|
586
|
+
disputeVerdictIssuedAt: null,
|
|
587
|
+
disputeContext: null,
|
|
588
|
+
disputeResolution: null,
|
|
589
|
+
decisionStatus: AGENT_RUN_SETTLEMENT_DECISION_STATUS.PENDING,
|
|
590
|
+
decisionMode: AGENT_RUN_SETTLEMENT_DECISION_MODE.AUTOMATIC,
|
|
591
|
+
decisionPolicyHash: null,
|
|
592
|
+
decisionReason: null,
|
|
593
|
+
decisionTrace: null,
|
|
594
|
+
decisionUpdatedAt: at,
|
|
595
|
+
revision: 0,
|
|
596
|
+
createdAt: at,
|
|
597
|
+
updatedAt: at
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export function resolveAgentRunSettlement({
|
|
602
|
+
settlement,
|
|
603
|
+
status,
|
|
604
|
+
runStatus,
|
|
605
|
+
releasedAmountCents = null,
|
|
606
|
+
refundedAmountCents = null,
|
|
607
|
+
releaseRatePct = null,
|
|
608
|
+
disputeWindowDays = null,
|
|
609
|
+
decisionStatus = AGENT_RUN_SETTLEMENT_DECISION_STATUS.AUTO_RESOLVED,
|
|
610
|
+
decisionMode = AGENT_RUN_SETTLEMENT_DECISION_MODE.AUTOMATIC,
|
|
611
|
+
decisionPolicyHash = null,
|
|
612
|
+
decisionReason = null,
|
|
613
|
+
decisionTrace = null,
|
|
614
|
+
resolutionEventId = null,
|
|
615
|
+
at = new Date().toISOString()
|
|
616
|
+
}) {
|
|
617
|
+
const current = normalizeSettlementRecord(settlement);
|
|
618
|
+
const nextStatus = String(status ?? "").toLowerCase();
|
|
619
|
+
if (nextStatus !== AGENT_RUN_SETTLEMENT_STATUS.RELEASED && nextStatus !== AGENT_RUN_SETTLEMENT_STATUS.REFUNDED) {
|
|
620
|
+
throw new TypeError("status must be released|refunded");
|
|
621
|
+
}
|
|
622
|
+
if (current.status !== AGENT_RUN_SETTLEMENT_STATUS.LOCKED) throw new TypeError("settlement already resolved");
|
|
623
|
+
assertNonEmptyString(runStatus, "runStatus");
|
|
624
|
+
assertIsoDate(at, "at");
|
|
625
|
+
if (resolutionEventId !== null && resolutionEventId !== undefined) assertNonEmptyString(resolutionEventId, "resolutionEventId");
|
|
626
|
+
let nextReleasedAmountCents = releasedAmountCents === null || releasedAmountCents === undefined ? null : Number(releasedAmountCents);
|
|
627
|
+
let nextRefundedAmountCents = refundedAmountCents === null || refundedAmountCents === undefined ? null : Number(refundedAmountCents);
|
|
628
|
+
if (nextStatus === AGENT_RUN_SETTLEMENT_STATUS.RELEASED) {
|
|
629
|
+
if (nextReleasedAmountCents === null) nextReleasedAmountCents = current.amountCents;
|
|
630
|
+
if (nextRefundedAmountCents === null) nextRefundedAmountCents = current.amountCents - nextReleasedAmountCents;
|
|
631
|
+
} else {
|
|
632
|
+
if (nextReleasedAmountCents === null) nextReleasedAmountCents = 0;
|
|
633
|
+
if (nextRefundedAmountCents === null) nextRefundedAmountCents = current.amountCents;
|
|
634
|
+
}
|
|
635
|
+
assertAmountCents(nextReleasedAmountCents, "releasedAmountCents", { allowZero: true });
|
|
636
|
+
assertAmountCents(nextRefundedAmountCents, "refundedAmountCents", { allowZero: true });
|
|
637
|
+
if (nextReleasedAmountCents + nextRefundedAmountCents !== current.amountCents) {
|
|
638
|
+
throw new TypeError("releasedAmountCents + refundedAmountCents must equal settlement.amountCents");
|
|
639
|
+
}
|
|
640
|
+
const nextReleaseRatePct =
|
|
641
|
+
releaseRatePct === null || releaseRatePct === undefined
|
|
642
|
+
? current.amountCents > 0
|
|
643
|
+
? Math.round((nextReleasedAmountCents * 100) / current.amountCents)
|
|
644
|
+
: 0
|
|
645
|
+
: Number(releaseRatePct);
|
|
646
|
+
if (!Number.isSafeInteger(nextReleaseRatePct) || nextReleaseRatePct < 0 || nextReleaseRatePct > 100) {
|
|
647
|
+
throw new TypeError("releaseRatePct must be an integer within 0..100");
|
|
648
|
+
}
|
|
649
|
+
let nextDisputeWindowDays = disputeWindowDays === null || disputeWindowDays === undefined ? current.disputeWindowDays ?? 0 : Number(disputeWindowDays);
|
|
650
|
+
if (!Number.isSafeInteger(nextDisputeWindowDays) || nextDisputeWindowDays < 0) {
|
|
651
|
+
throw new TypeError("disputeWindowDays must be a non-negative safe integer");
|
|
652
|
+
}
|
|
653
|
+
let nextDisputeWindowEndsAt = null;
|
|
654
|
+
if (nextDisputeWindowDays > 0) {
|
|
655
|
+
const baseMs = Date.parse(at);
|
|
656
|
+
const endMs = baseMs + nextDisputeWindowDays * 24 * 60 * 60_000;
|
|
657
|
+
nextDisputeWindowEndsAt = new Date(endMs).toISOString();
|
|
658
|
+
}
|
|
659
|
+
const normalizedDecisionStatus = String(decisionStatus ?? AGENT_RUN_SETTLEMENT_DECISION_STATUS.AUTO_RESOLVED).toLowerCase();
|
|
660
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_STATUS).includes(normalizedDecisionStatus)) {
|
|
661
|
+
throw new TypeError("decisionStatus must be pending|auto_resolved|manual_review_required|manual_resolved");
|
|
662
|
+
}
|
|
663
|
+
const normalizedDecisionMode = String(decisionMode ?? AGENT_RUN_SETTLEMENT_DECISION_MODE.AUTOMATIC).toLowerCase();
|
|
664
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_MODE).includes(normalizedDecisionMode)) {
|
|
665
|
+
throw new TypeError("decisionMode must be automatic|manual-review");
|
|
666
|
+
}
|
|
667
|
+
const normalizedDecisionPolicyHash =
|
|
668
|
+
decisionPolicyHash === null || decisionPolicyHash === undefined ? null : String(decisionPolicyHash).trim();
|
|
669
|
+
if (normalizedDecisionPolicyHash !== null && normalizedDecisionPolicyHash === "") {
|
|
670
|
+
throw new TypeError("decisionPolicyHash must be a non-empty string when provided");
|
|
671
|
+
}
|
|
672
|
+
const normalizedDecisionReason = decisionReason === null || decisionReason === undefined ? null : String(decisionReason).trim();
|
|
673
|
+
if (normalizedDecisionReason !== null && normalizedDecisionReason === "") {
|
|
674
|
+
throw new TypeError("decisionReason must be a non-empty string when provided");
|
|
675
|
+
}
|
|
676
|
+
if (decisionTrace !== null && decisionTrace !== undefined) {
|
|
677
|
+
assertPlainObject(decisionTrace, "decisionTrace");
|
|
678
|
+
}
|
|
679
|
+
return normalizeSettlementRecord({
|
|
680
|
+
...current,
|
|
681
|
+
status: nextStatus,
|
|
682
|
+
runStatus: String(runStatus),
|
|
683
|
+
releasedAmountCents: nextReleasedAmountCents,
|
|
684
|
+
refundedAmountCents: nextRefundedAmountCents,
|
|
685
|
+
releaseRatePct: nextReleaseRatePct,
|
|
686
|
+
disputeWindowDays: nextDisputeWindowDays,
|
|
687
|
+
disputeWindowEndsAt: nextDisputeWindowEndsAt,
|
|
688
|
+
disputeStatus: AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.NONE,
|
|
689
|
+
disputeId: null,
|
|
690
|
+
disputeOpenedAt: null,
|
|
691
|
+
disputeClosedAt: null,
|
|
692
|
+
disputeContext: null,
|
|
693
|
+
disputeResolution: null,
|
|
694
|
+
decisionStatus: normalizedDecisionStatus,
|
|
695
|
+
decisionMode: normalizedDecisionMode,
|
|
696
|
+
decisionPolicyHash: normalizedDecisionPolicyHash,
|
|
697
|
+
decisionReason: normalizedDecisionReason,
|
|
698
|
+
decisionTrace: decisionTrace ?? null,
|
|
699
|
+
decisionUpdatedAt: at,
|
|
700
|
+
resolvedAt: at,
|
|
701
|
+
resolutionEventId: resolutionEventId ?? null,
|
|
702
|
+
revision: current.revision + 1,
|
|
703
|
+
updatedAt: at
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export function updateAgentRunSettlementDecision({
|
|
708
|
+
settlement,
|
|
709
|
+
decisionStatus = null,
|
|
710
|
+
decisionMode = null,
|
|
711
|
+
decisionPolicyHash = null,
|
|
712
|
+
decisionReason = null,
|
|
713
|
+
decisionTrace = null,
|
|
714
|
+
at = new Date().toISOString()
|
|
715
|
+
}) {
|
|
716
|
+
const current = normalizeSettlementRecord(settlement);
|
|
717
|
+
if (current.status !== AGENT_RUN_SETTLEMENT_STATUS.LOCKED) {
|
|
718
|
+
throw new TypeError("decision updates are only valid for locked settlements");
|
|
719
|
+
}
|
|
720
|
+
assertIsoDate(at, "at");
|
|
721
|
+
const nextDecisionStatus =
|
|
722
|
+
decisionStatus === null || decisionStatus === undefined
|
|
723
|
+
? current.decisionStatus
|
|
724
|
+
: String(decisionStatus).toLowerCase();
|
|
725
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_STATUS).includes(nextDecisionStatus)) {
|
|
726
|
+
throw new TypeError("decisionStatus must be pending|auto_resolved|manual_review_required|manual_resolved");
|
|
727
|
+
}
|
|
728
|
+
const nextDecisionMode =
|
|
729
|
+
decisionMode === null || decisionMode === undefined
|
|
730
|
+
? current.decisionMode
|
|
731
|
+
: String(decisionMode).toLowerCase();
|
|
732
|
+
if (!Object.values(AGENT_RUN_SETTLEMENT_DECISION_MODE).includes(nextDecisionMode)) {
|
|
733
|
+
throw new TypeError("decisionMode must be automatic|manual-review");
|
|
734
|
+
}
|
|
735
|
+
const nextDecisionPolicyHash =
|
|
736
|
+
decisionPolicyHash === null || decisionPolicyHash === undefined
|
|
737
|
+
? current.decisionPolicyHash
|
|
738
|
+
: String(decisionPolicyHash).trim();
|
|
739
|
+
if (nextDecisionPolicyHash !== null && nextDecisionPolicyHash === "") {
|
|
740
|
+
throw new TypeError("decisionPolicyHash must be a non-empty string when provided");
|
|
741
|
+
}
|
|
742
|
+
const nextDecisionReason =
|
|
743
|
+
decisionReason === null || decisionReason === undefined
|
|
744
|
+
? current.decisionReason
|
|
745
|
+
: String(decisionReason).trim();
|
|
746
|
+
if (nextDecisionReason !== null && nextDecisionReason === "") {
|
|
747
|
+
throw new TypeError("decisionReason must be a non-empty string when provided");
|
|
748
|
+
}
|
|
749
|
+
if (decisionTrace !== null && decisionTrace !== undefined) {
|
|
750
|
+
assertPlainObject(decisionTrace, "decisionTrace");
|
|
751
|
+
}
|
|
752
|
+
return normalizeSettlementRecord({
|
|
753
|
+
...current,
|
|
754
|
+
decisionStatus: nextDecisionStatus,
|
|
755
|
+
decisionMode: nextDecisionMode,
|
|
756
|
+
decisionPolicyHash: nextDecisionPolicyHash,
|
|
757
|
+
decisionReason: nextDecisionReason,
|
|
758
|
+
decisionTrace: decisionTrace ?? current.decisionTrace ?? null,
|
|
759
|
+
decisionUpdatedAt: at,
|
|
760
|
+
revision: current.revision + 1,
|
|
761
|
+
updatedAt: at
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
export function updateAgentRunSettlementDispute({
|
|
766
|
+
settlement,
|
|
767
|
+
action,
|
|
768
|
+
disputeId = null,
|
|
769
|
+
contextInput = null,
|
|
770
|
+
resolutionInput = null,
|
|
771
|
+
at = new Date().toISOString()
|
|
772
|
+
}) {
|
|
773
|
+
const current = normalizeSettlementRecord(settlement);
|
|
774
|
+
const nextAction = String(action ?? "").toLowerCase();
|
|
775
|
+
assertIsoDate(at, "at");
|
|
776
|
+
if (nextAction !== "open" && nextAction !== "close") throw new TypeError("action must be open|close");
|
|
777
|
+
if (nextAction === "open") {
|
|
778
|
+
if (current.disputeStatus === AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.OPEN) {
|
|
779
|
+
throw new TypeError("dispute is already open");
|
|
780
|
+
}
|
|
781
|
+
if (disputeId !== null && disputeId !== undefined) assertNonEmptyString(disputeId, "disputeId");
|
|
782
|
+
const nextDisputeContext = normalizeDisputeContext(contextInput ?? {}, {
|
|
783
|
+
name: "contextInput",
|
|
784
|
+
defaultEscalationLevel: AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL.L1_COUNTERPARTY
|
|
785
|
+
});
|
|
786
|
+
return normalizeSettlementRecord({
|
|
787
|
+
...current,
|
|
788
|
+
disputeStatus: AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.OPEN,
|
|
789
|
+
disputeId: disputeId ?? current.disputeId ?? `dsp_${current.runId}`,
|
|
790
|
+
disputeOpenedAt: at,
|
|
791
|
+
disputeClosedAt: null,
|
|
792
|
+
disputeContext: nextDisputeContext,
|
|
793
|
+
disputeResolution: null,
|
|
794
|
+
revision: current.revision + 1,
|
|
795
|
+
updatedAt: at
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
if (current.disputeStatus !== AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.OPEN) {
|
|
799
|
+
throw new TypeError("dispute is not open");
|
|
800
|
+
}
|
|
801
|
+
if (disputeId !== null && disputeId !== undefined && String(disputeId) !== String(current.disputeId ?? "")) {
|
|
802
|
+
throw new TypeError("disputeId does not match open dispute");
|
|
803
|
+
}
|
|
804
|
+
const nextDisputeResolution = normalizeDisputeResolution(
|
|
805
|
+
resolutionInput ?? {},
|
|
806
|
+
{
|
|
807
|
+
name: "resolutionInput",
|
|
808
|
+
defaultClosedAt: at
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
return normalizeSettlementRecord({
|
|
812
|
+
...current,
|
|
813
|
+
disputeStatus: AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.CLOSED,
|
|
814
|
+
disputeClosedAt: at,
|
|
815
|
+
disputeResolution: nextDisputeResolution,
|
|
816
|
+
revision: current.revision + 1,
|
|
817
|
+
updatedAt: at
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export function patchAgentRunSettlementDisputeContext({
|
|
822
|
+
settlement,
|
|
823
|
+
contextPatch = null,
|
|
824
|
+
appendEvidenceRefs = null,
|
|
825
|
+
at = new Date().toISOString()
|
|
826
|
+
}) {
|
|
827
|
+
const current = normalizeSettlementRecord(settlement);
|
|
828
|
+
assertIsoDate(at, "at");
|
|
829
|
+
if (current.disputeStatus !== AGENT_RUN_SETTLEMENT_DISPUTE_STATUS.OPEN) {
|
|
830
|
+
throw new TypeError("dispute is not open");
|
|
831
|
+
}
|
|
832
|
+
const existingContext = normalizeDisputeContext(current.disputeContext ?? {}, {
|
|
833
|
+
name: "settlement.disputeContext",
|
|
834
|
+
defaultEscalationLevel: AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL.L1_COUNTERPARTY
|
|
835
|
+
});
|
|
836
|
+
let patch = {};
|
|
837
|
+
if (contextPatch !== null && contextPatch !== undefined) {
|
|
838
|
+
assertPlainObject(contextPatch, "contextPatch");
|
|
839
|
+
patch = { ...contextPatch };
|
|
840
|
+
}
|
|
841
|
+
const mergedEvidenceRefs = [];
|
|
842
|
+
const seenEvidenceRefs = new Set();
|
|
843
|
+
const pushEvidenceRef = (value, sourceName, index = null) => {
|
|
844
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
845
|
+
const suffix = index === null ? "" : `[${index}]`;
|
|
846
|
+
throw new TypeError(`${sourceName}${suffix} must be a non-empty string`);
|
|
847
|
+
}
|
|
848
|
+
const normalized = value.trim();
|
|
849
|
+
if (seenEvidenceRefs.has(normalized)) return;
|
|
850
|
+
seenEvidenceRefs.add(normalized);
|
|
851
|
+
mergedEvidenceRefs.push(normalized);
|
|
852
|
+
};
|
|
853
|
+
const existingEvidenceRefs = Array.isArray(existingContext?.evidenceRefs) ? existingContext.evidenceRefs : [];
|
|
854
|
+
for (let index = 0; index < existingEvidenceRefs.length; index += 1) {
|
|
855
|
+
pushEvidenceRef(existingEvidenceRefs[index], "settlement.disputeContext.evidenceRefs", index);
|
|
856
|
+
}
|
|
857
|
+
const patchEvidenceRefs = contextPatch && Array.isArray(contextPatch.evidenceRefs) ? contextPatch.evidenceRefs : [];
|
|
858
|
+
for (let index = 0; index < patchEvidenceRefs.length; index += 1) {
|
|
859
|
+
pushEvidenceRef(patchEvidenceRefs[index], "contextPatch.evidenceRefs", index);
|
|
860
|
+
}
|
|
861
|
+
const appended = appendEvidenceRefs === null || appendEvidenceRefs === undefined ? [] : appendEvidenceRefs;
|
|
862
|
+
if (!Array.isArray(appended)) throw new TypeError("appendEvidenceRefs must be an array when provided");
|
|
863
|
+
for (let index = 0; index < appended.length; index += 1) {
|
|
864
|
+
pushEvidenceRef(appended[index], "appendEvidenceRefs", index);
|
|
865
|
+
}
|
|
866
|
+
patch.evidenceRefs = mergedEvidenceRefs;
|
|
867
|
+
const nextContext = normalizeDisputeContext(
|
|
868
|
+
{
|
|
869
|
+
...existingContext,
|
|
870
|
+
...patch
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
name: "contextPatch",
|
|
874
|
+
defaultEscalationLevel: existingContext?.escalationLevel ?? AGENT_RUN_SETTLEMENT_DISPUTE_ESCALATION_LEVEL.L1_COUNTERPARTY
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
return normalizeSettlementRecord({
|
|
878
|
+
...current,
|
|
879
|
+
disputeContext: nextContext,
|
|
880
|
+
revision: current.revision + 1,
|
|
881
|
+
updatedAt: at
|
|
882
|
+
});
|
|
883
|
+
}
|