{"ok":true,"checkedAt":"2026-07-17T20:53:18.417Z","contractVersion":"moral-trade-matching-clearing-v0.1-2026-06","purpose":"Fail-closed matching-clearing governance for deterministic frozen input bundles, reproducibility checks, privacy-safe result hashes, and fresh matched-trade lock proposals before donation-offset batches, pledge-swap previews, broad match candidates, or public-goods clearing can become payable, reliance-bearing, or publicly counted.","validation":{"status":"pass","validatorName":"moral-trade-matching-clearing-contract","validatorVersion":"moral-trade-matching-clearing-validator-v0.1","contractVersion":"moral-trade-matching-clearing-v0.1-2026-06","checks":[{"id":"record-table-coverage","label":"Matching-clearing has first-class run, lock proposal, and reproducibility check tables","status":"pass","evidence":"moral_trade_matching_clearing_runs, moral_trade_matched_trade_lock_proposals, moral_trade_matching_clearing_reproducibility_checks"},{"id":"execution-record-table-coverage","label":"Matching-clearing execution and replay packets have append-only execution records","status":"pass","evidence":"moral_trade_matching_clearing_execution_records"},{"id":"execution-route-coverage","label":"Matching-clearing execution route is authenticated and append-only","status":"pass","evidence":"POST /api/moral-trade/matching-clearing/execute authenticated append_only_execution_record"},{"id":"policy-subject-coverage","label":"Matching-clearing and matched-trade locks are frozen policy-snapshot subjects","status":"pass","evidence":"matching_clearing, matched_trade_lock"},{"id":"flow-coverage","label":"Donation offsets, pledge swaps, broad candidates, and public-goods rounds are covered","status":"pass","evidence":"donation_offset_batch, pledge_swap_preview, broad_match_candidate, public_goods_round"},{"id":"status-coverage","label":"Run and lock-proposal lifecycles include draft, review, lock, stale, and superseded states","status":"pass","evidence":"draft, dry_run, reviewed, blocked, locked, superseded, expired; draft, participant_review, confirmed, locked, declined, expired, superseded, blocked"},{"id":"fail-closed-coverage","label":"Fail-closed statuses cover reproducibility, privacy, final confirmation, ratio, baseline, destination, reservation, and atomic settlement blockers","status":"pass","evidence":"run_missing, algorithm_version_missing, deterministic_algorithm_missing, input_bundle_hash_missing, input_bundle_hash_invalid, privacy_policy_missing, state_interpretation_policy_missing, excluded_records_missing, excluded_records_hash_invalid, result_hash_missing, result_hash_invalid, run_not_reviewed, run_blocked, run_stale, run_superseded, manual_override_unapproved, database_order_matching, hidden_match_reasoning, payable_without_run, reliance_without_run, reproducibility_check_missing, reproducibility_check_failed, lock_proposal_missing, lock_proposal_not_current, lock_proposal_stale, lock_proposal_superseded, lock_terms_hash_missing, lock_terms_hash_invalid, counterparty_bucket_hash_missing, matched_volume_hash_missing, participant_confirmation_missing, participant_confirmation_stale, participant_confirmation_scope_mismatch, ratio_bounds_failed, baseline_snapshot_missing, destination_verification_missing, commitment_reservation_missing, atomic_settlement_missing, fallback_terms_hash_missing, evidence_standard_hash_missing, private_counterparty_data_public, invalid_run_hash, invalid_proposal_hash"},{"id":"flow-definition-coverage","label":"Every matching-clearing flow lists required records and blocked transitions","status":"pass","evidence":"donation_offset_batch:3, pledge_swap_preview:3, broad_match_candidate:1, public_goods_round:2"},{"id":"sample-evaluation-coverage","label":"Sample evaluations prove donation-offset clearing can pass and pledge-swap reliance blocks without reproducible run and lock proposal","status":"pass","evidence":"donation_offset_batch:pass, pledge_swap_preview:blocked"},{"id":"contract-test-coverage","label":"Contract lists route, schema, health, and fail-closed tests","status":"pass","evidence":"matching_clearing_contract_validator, matching_clearing_evaluator_fail_closed, matching_clearing_execute_route_contract, matching_clearing_execution_record_schema_contract, matching_clearing_route_contract, matching_clearing_schema_contract, matching_clearing_health_contract"}],"blockers":[]},"publicContract":{"privacyRule":"Public matching-clearing contract responses expose only static flow names, table names, statuses, validation blockers, and sample pass/block states; they never expose raw input bundles, private counterparty data, exact private constraints, hidden match reasoning, reviewer notes, or participant-specific final confirmations.","failClosedRule":"Ad hoc matching is not clearing: missing matching_clearing_run, mutable or unreproducible inputs, database-order matching, hidden match reasoning, missing privacy or state policy, missing reproducibility check, missing matched_trade_lock_proposal, stale final confirmations, failed ratio bounds, missing baseline snapshots, unverified destination, missing commitment reservation, or missing atomic settlement blocks payable and reliance-bearing clearing.","replayRule":"Authenticated matching-clearing execution records only the deterministic evaluation or replay packet. It writes an append-only moral_trade_matching_clearing_execution_records row and cannot create a lock proposal, authorize payment, authorize reliance, or publish public metrics by itself.","firstClassRecordTables":["moral_trade_matching_clearing_runs","moral_trade_matched_trade_lock_proposals","moral_trade_matching_clearing_reproducibility_checks"],"executionRecordTables":["moral_trade_matching_clearing_execution_records"],"executionRoute":{"method":"POST","path":"/api/moral-trade/matching-clearing/execute","auth":"authenticated","stateMutation":"append_only_execution_record"},"policySnapshotSubjects":["matching_clearing","matched_trade_lock"],"flowTypes":["donation_offset_batch","pledge_swap_preview","broad_match_candidate","public_goods_round"],"runStatuses":["draft","dry_run","reviewed","blocked","locked","superseded","expired"],"lockProposalStatuses":["draft","participant_review","confirmed","locked","declined","expired","superseded","blocked"],"lockProposalSubjects":["donation_offset_batch","pledge_swap_match","broad_match_candidate","public_goods_round"],"failClosedStatuses":["run_missing","algorithm_version_missing","deterministic_algorithm_missing","input_bundle_hash_missing","input_bundle_hash_invalid","privacy_policy_missing","state_interpretation_policy_missing","excluded_records_missing","excluded_records_hash_invalid","result_hash_missing","result_hash_invalid","run_not_reviewed","run_blocked","run_stale","run_superseded","manual_override_unapproved","database_order_matching","hidden_match_reasoning","payable_without_run","reliance_without_run","reproducibility_check_missing","reproducibility_check_failed","lock_proposal_missing","lock_proposal_not_current","lock_proposal_stale","lock_proposal_superseded","lock_terms_hash_missing","lock_terms_hash_invalid","counterparty_bucket_hash_missing","matched_volume_hash_missing","participant_confirmation_missing","participant_confirmation_stale","participant_confirmation_scope_mismatch","ratio_bounds_failed","baseline_snapshot_missing","destination_verification_missing","commitment_reservation_missing","atomic_settlement_missing","fallback_terms_hash_missing","evidence_standard_hash_missing","private_counterparty_data_public","invalid_run_hash","invalid_proposal_hash"],"flowDefinitions":[{"key":"donation_offset_batch","protectedBoundary":"batch clearing cannot become payable until a deterministic run and matched-trade lock proposal are frozen and confirmed","requiredRecords":["moral_trade_matching_clearing_runs","moral_trade_matched_trade_lock_proposals","moral_trade_matching_clearing_reproducibility_checks"],"blocksTransitions":["payment_capture","cleared_trade_lock","public_completed_claim"]},{"key":"pledge_swap_preview","protectedBoundary":"reliance-bearing pledge swaps cannot use hidden reasoning, operator judgment, or database-order matching","requiredRecords":["moral_trade_matching_clearing_runs","moral_trade_matched_trade_lock_proposals","moral_trade_matching_clearing_reproducibility_checks"],"blocksTransitions":["reliance_bearing_preview","matched_trade_lock","performance_start"]},{"key":"broad_match_candidate","protectedBoundary":"broad candidates are generated from frozen privacy-safe input bundles without exposing private counterparties","requiredRecords":["moral_trade_matching_clearing_runs"],"blocksTransitions":["candidate_publication","counterparty_preview","matched_trade_lock_candidate"]},{"key":"public_goods_round","protectedBoundary":"round-level clearing previews bind to deterministic algorithm and frozen result hashes before public metrics","requiredRecords":["moral_trade_matching_clearing_runs","moral_trade_matching_clearing_reproducibility_checks"],"blocksTransitions":["round_close_publication","bonus_allocation","public_money_metric"]}],"matchingClearingSampleEvaluationStatuses":{"donation_offset_batch":"pass","pledge_swap_preview":"blocked"},"contractTests":["matching_clearing_contract_validator","matching_clearing_evaluator_fail_closed","matching_clearing_execute_route_contract","matching_clearing_execution_record_schema_contract","matching_clearing_route_contract","matching_clearing_schema_contract","matching_clearing_health_contract"]},"blockers":[]}