{
  "schemaVersion": 1,
  "generatedAt": "2026-10-20T22:32:08.469Z",
  "dataset": {
    "kind": "synthetic",
    "title": "Recorded EVM-shaped recovery fixtures",
    "notice": "Replay demonstration, not live chain data or evidence of a historical mainnet reorg.",
    "startHeight": 100,
    "endHeight": 111,
    "chainId": 31337
  },
  "healthy": true,
  "scenarios": [
    {
      "id": "duplicates",
      "title": "Duplicate delivery",
      "description": "Every Transfer arrives twice. Primary keys and payload comparison accept one copy; a restart and identical rerun write zero blocks.",
      "before": {
        "healthy": false,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": false
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": false
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": false
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": false
          }
        ],
        "sourceHead": 111,
        "checkpoint": 99,
        "canonicalBlocks": 0,
        "canonicalEvents": 0,
        "missingBlocks": 12,
        "brokenParents": 0,
        "mismatchedBlocks": 0,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 0,
        "duplicatesIgnored": 0,
        "reorgs": 0,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "0",
            "sourceAmountRaw": "2439000000002839506147",
            "reconciled": false
          }
        ],
        "fingerprintsMatch": false,
        "timeline": [
          {
            "height": 100,
            "present": false,
            "events": 0
          },
          {
            "height": 101,
            "present": false,
            "events": 0
          },
          {
            "height": 102,
            "present": false,
            "events": 0
          },
          {
            "height": 103,
            "present": false,
            "events": 0
          },
          {
            "height": 104,
            "present": false,
            "events": 0
          },
          {
            "height": 105,
            "present": false,
            "events": 0
          },
          {
            "height": 106,
            "present": false,
            "events": 0
          },
          {
            "height": 107,
            "present": false,
            "events": 0
          },
          {
            "height": 108,
            "present": false,
            "events": 0
          },
          {
            "height": 109,
            "present": false,
            "events": 0
          },
          {
            "height": 110,
            "present": false,
            "events": 0
          },
          {
            "height": 111,
            "present": false,
            "events": 0
          }
        ]
      },
      "after": {
        "healthy": true,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": true
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": true
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": true
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": true
          }
        ],
        "sourceHead": 111,
        "checkpoint": 111,
        "canonicalBlocks": 12,
        "canonicalEvents": 23,
        "missingBlocks": 0,
        "brokenParents": 0,
        "mismatchedBlocks": 0,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 0,
        "duplicatesIgnored": 23,
        "reorgs": 0,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "2439000000002839506147",
            "sourceAmountRaw": "2439000000002839506147",
            "reconciled": true
          }
        ],
        "fingerprintsMatch": true,
        "timeline": [
          {
            "height": 100,
            "present": true,
            "events": 2
          },
          {
            "height": 101,
            "present": true,
            "events": 3
          },
          {
            "height": 102,
            "present": true,
            "events": 1
          },
          {
            "height": 103,
            "present": true,
            "events": 2
          },
          {
            "height": 104,
            "present": true,
            "events": 3
          },
          {
            "height": 105,
            "present": true,
            "events": 0
          },
          {
            "height": 106,
            "present": true,
            "events": 2
          },
          {
            "height": 107,
            "present": true,
            "events": 3
          },
          {
            "height": 108,
            "present": true,
            "events": 1
          },
          {
            "height": 109,
            "present": true,
            "events": 2
          },
          {
            "height": 110,
            "present": true,
            "events": 3
          },
          {
            "height": 111,
            "present": true,
            "events": 1
          }
        ]
      },
      "evidence": {
        "duplicatesIgnored": 23,
        "blocksWrittenOnRerun": 0
      },
      "steps": [
        "Replay duplicated events",
        "Compare identical event payloads",
        "Commit one normalized copy",
        "Restart and rerun: zero writes"
      ]
    },
    {
      "id": "gap",
      "title": "Missing blocks",
      "description": "The source cannot serve block 106. The batch stops at durable checkpoint 105. A restarted worker resumes at 106 and fills the six-block backlog.",
      "before": {
        "healthy": false,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": false
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": false
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": false
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": false
          }
        ],
        "sourceHead": 111,
        "checkpoint": 105,
        "canonicalBlocks": 6,
        "canonicalEvents": 11,
        "missingBlocks": 6,
        "brokenParents": 0,
        "mismatchedBlocks": 0,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 0,
        "duplicatesIgnored": 0,
        "reorgs": 0,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "1131000000001358024679",
            "sourceAmountRaw": "2439000000002839506147",
            "reconciled": false
          }
        ],
        "fingerprintsMatch": false,
        "timeline": [
          {
            "height": 100,
            "present": true,
            "events": 2
          },
          {
            "height": 101,
            "present": true,
            "events": 3
          },
          {
            "height": 102,
            "present": true,
            "events": 1
          },
          {
            "height": 103,
            "present": true,
            "events": 2
          },
          {
            "height": 104,
            "present": true,
            "events": 3
          },
          {
            "height": 105,
            "present": true,
            "events": 0
          },
          {
            "height": 106,
            "present": false,
            "events": 0
          },
          {
            "height": 107,
            "present": false,
            "events": 0
          },
          {
            "height": 108,
            "present": false,
            "events": 0
          },
          {
            "height": 109,
            "present": false,
            "events": 0
          },
          {
            "height": 110,
            "present": false,
            "events": 0
          },
          {
            "height": 111,
            "present": false,
            "events": 0
          }
        ]
      },
      "after": {
        "healthy": true,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": true
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": true
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": true
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": true
          }
        ],
        "sourceHead": 111,
        "checkpoint": 111,
        "canonicalBlocks": 12,
        "canonicalEvents": 23,
        "missingBlocks": 0,
        "brokenParents": 0,
        "mismatchedBlocks": 0,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 0,
        "duplicatesIgnored": 0,
        "reorgs": 0,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "2439000000002839506147",
            "sourceAmountRaw": "2439000000002839506147",
            "reconciled": true
          }
        ],
        "fingerprintsMatch": true,
        "timeline": [
          {
            "height": 100,
            "present": true,
            "events": 2
          },
          {
            "height": 101,
            "present": true,
            "events": 3
          },
          {
            "height": 102,
            "present": true,
            "events": 1
          },
          {
            "height": 103,
            "present": true,
            "events": 2
          },
          {
            "height": 104,
            "present": true,
            "events": 3
          },
          {
            "height": 105,
            "present": true,
            "events": 0
          },
          {
            "height": 106,
            "present": true,
            "events": 2
          },
          {
            "height": 107,
            "present": true,
            "events": 3
          },
          {
            "height": 108,
            "present": true,
            "events": 1
          },
          {
            "height": 109,
            "present": true,
            "events": 2
          },
          {
            "height": 110,
            "present": true,
            "events": 3
          },
          {
            "height": 111,
            "present": true,
            "events": 1
          }
        ]
      },
      "evidence": {
        "checkpointBeforeRestart": 105,
        "resumedFrom": 106,
        "blocksRecovered": 6
      },
      "steps": [
        "Source block 106 unavailable",
        "Fail batch; preserve checkpoint 105",
        "Restart from persisted SQL",
        "Backfill blocks 106–111"
      ]
    },
    {
      "id": "reorg",
      "title": "Recorded fork replay",
      "description": "A recorded synthetic branch replaces blocks 109–111 at the same head height. The worker finds ancestor 108, replays the replacement, and excludes orphaned transfers from totals.",
      "before": {
        "healthy": false,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": true
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": false
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": false
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": true
          }
        ],
        "sourceHead": 111,
        "checkpoint": 111,
        "canonicalBlocks": 12,
        "canonicalEvents": 23,
        "missingBlocks": 0,
        "brokenParents": 0,
        "mismatchedBlocks": 3,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 0,
        "duplicatesIgnored": 0,
        "reorgs": 0,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "2439000000002839506147",
            "sourceAmountRaw": "2541000000002839506147",
            "reconciled": false
          }
        ],
        "fingerprintsMatch": false,
        "timeline": [
          {
            "height": 100,
            "present": true,
            "events": 2
          },
          {
            "height": 101,
            "present": true,
            "events": 3
          },
          {
            "height": 102,
            "present": true,
            "events": 1
          },
          {
            "height": 103,
            "present": true,
            "events": 2
          },
          {
            "height": 104,
            "present": true,
            "events": 3
          },
          {
            "height": 105,
            "present": true,
            "events": 0
          },
          {
            "height": 106,
            "present": true,
            "events": 2
          },
          {
            "height": 107,
            "present": true,
            "events": 3
          },
          {
            "height": 108,
            "present": true,
            "events": 1
          },
          {
            "height": 109,
            "present": true,
            "events": 2
          },
          {
            "height": 110,
            "present": true,
            "events": 3
          },
          {
            "height": 111,
            "present": true,
            "events": 1
          }
        ]
      },
      "after": {
        "healthy": true,
        "checks": [
          {
            "name": "Source available and stable",
            "passed": true
          },
          {
            "name": "Complete block coverage",
            "passed": true
          },
          {
            "name": "Continuous parent links",
            "passed": true
          },
          {
            "name": "Canonical hashes and events match source",
            "passed": true
          },
          {
            "name": "Normalized projection completeness",
            "passed": true
          },
          {
            "name": "Exact integer transfer totals",
            "passed": true
          },
          {
            "name": "Foreign keys and SQL integrity",
            "passed": true
          },
          {
            "name": "Checkpoint equals verified tip",
            "passed": true
          }
        ],
        "sourceHead": 111,
        "checkpoint": 111,
        "canonicalBlocks": 12,
        "canonicalEvents": 23,
        "missingBlocks": 0,
        "brokenParents": 0,
        "mismatchedBlocks": 0,
        "projectionErrors": 0,
        "foreignKeyErrors": 0,
        "orphanBlocks": 3,
        "duplicatesIgnored": 0,
        "reorgs": 1,
        "gapRepairs": 0,
        "tokenTotals": [
          {
            "symbol": "DEMO",
            "decimals": 18,
            "amountRaw": "2541000000002839506147",
            "sourceAmountRaw": "2541000000002839506147",
            "reconciled": true
          }
        ],
        "fingerprintsMatch": true,
        "timeline": [
          {
            "height": 100,
            "present": true,
            "events": 2
          },
          {
            "height": 101,
            "present": true,
            "events": 3
          },
          {
            "height": 102,
            "present": true,
            "events": 1
          },
          {
            "height": 103,
            "present": true,
            "events": 2
          },
          {
            "height": 104,
            "present": true,
            "events": 3
          },
          {
            "height": 105,
            "present": true,
            "events": 0
          },
          {
            "height": 106,
            "present": true,
            "events": 2
          },
          {
            "height": 107,
            "present": true,
            "events": 3
          },
          {
            "height": 108,
            "present": true,
            "events": 1
          },
          {
            "height": 109,
            "present": true,
            "events": 2
          },
          {
            "height": 110,
            "present": true,
            "events": 3
          },
          {
            "height": 111,
            "present": true,
            "events": 1
          }
        ]
      },
      "evidence": {
        "commonAncestor": 108,
        "orphanBlocksRetained": 3,
        "replacementBlocks": 3
      },
      "steps": [
        "Detect changed head hash",
        "Find common ancestor 108",
        "Rewind and replay replacement",
        "Retain orphans; exclude their totals"
      ]
    }
  ],
  "tables": [
    "chains",
    "blocks",
    "canonical_blocks",
    "tokens",
    "transactions",
    "event_logs",
    "transfers",
    "checkpoints",
    "ingestion_runs",
    "recoveries"
  ]
}
