Query editor
-- Physical-state preflight for the two daily hot receipts. Exactly two passing,-- unexpired rows prove that both receipts still match their current live facts.-- This deliberately does not certify Tycho provenance, Unallocated publication,-- or q8075080 completion; callers must require the completed owning graph before-- treating the physical rows as consumer-ready.WITHtycho_live AS (SELECTCOUNT(*) AS router_call_row_count,MAX(block_time) AS router_call_max_block_timeFROM dune.propeller_heads.result_tycho_router_call_fact_v3_live),tycho_fee_live AS (SELECTCOUNT(*) AS fee_recipient_row_count,MAX(block_time) AS fee_recipient_max_block_timeFROM dune.propeller_heads.result_tycho_fee_recipient_fact_v3_live),tycho AS (SELECT'tycho' AS product,COUNT(r.checkpoint_completed_at) AS receipt_row_count,COUNT_IF(COALESCE(r.receipt_status, 'fail') <> 'pass') AS failed_receipt_rows,COUNT_IF(COALESCE(r.pipeline_revision, '') <> 'tycho_router_fee_daily_hot_v1')AS wrong_revision_rows,COUNT_IF(r.router_integrity_check_count <> 8OR r.router_integrity_failure_count <> 0OR r.fee_integrity_check_count <> 10OR r.fee_integrity_failure_count <> 0OR r.unknown_selector_failure_count <> 0) AS bad_integrity_rows,COUNT_IF(r.indexing_check_count <> 8OR r.indexing_failure_count <> 0OR COALESCE(r.coverage_status, '') NOT IN ('complete', 'provisional')OR (r.coverage_status = 'provisional'AND COALESCE(r.incomplete_chain, '') <> 'robinhood')OR (r.coverage_status = 'complete' AND r.incomplete_chain IS NOT NULL)OR r.supported_chain_indexed_through IS NULLOR (r.coverage_status = 'complete' AND r.all_chain_indexed_through IS NULL)OR r.checkpoint_completed_at < date_trunc('day', CURRENT_TIMESTAMP)OR r.supported_chain_indexed_through < date_trunc('day', CURRENT_TIMESTAMP)OR (r.coverage_status = 'complete'AND r.all_chain_indexed_through < date_trunc('day', CURRENT_TIMESTAMP))) AS bad_indexing_rows,COUNT_IF(r.router_call_row_count <= 0OR r.fee_recipient_row_count <= 0OR r.router_call_max_block_time IS NULLOR r.fee_recipient_max_block_time IS NULL) AS bad_fact_summary_rows,COUNT_IF(date_diff('hour', r.checkpoint_completed_at, r.refresh_due_at) <> 24)AS bad_due_window_rows,COUNT_IF(date_diff('hour', r.checkpoint_completed_at, r.checkpoint_expires_at) <> 48)AS bad_expiry_window_rows,COUNT_IF(r.checkpoint_completed_at > CURRENT_TIMESTAMP + INTERVAL '5' MINUTE)AS future_checkpoint_rows,COUNT_IF(CURRENT_TIMESTAMP > r.checkpoint_expires_at) AS expired_checkpoint_rows,COUNT_IF(