Usage: rebar fsck [--output json] [--repair [--only=stale-channel] [--dry-run] [--limit=N]]

Store integrity validator. Checks JSON validity, CREATE presence, stale
index.lock, and SNAPSHOT source_event_uuids consistency.

  --repair             Drive the store to fsck-zero (A3 remediation): retire
                       still-present folded sources (SNAPSHOT_INCONSISTENT) and
                       rebuild snapshots that dropped an AUTO-RECOVER orphan.
                       Pre-tags pre-a3-remediation, commits+pushes per batch, and
                       aborts on a push failure. Order-sensitive orphans are
                       surfaced for human triage, not auto-rebuilt.
  --only=stale-channel With --repair: rebuild only stale creation-channel
                       snapshots through the same batched commit-and-push path.
                       Refuses tickets that also have SNAPSHOT_INCONSISTENT or
                       ORPHAN_EVENT findings; it does not run the ensure sweep.
  --dry-run            With --repair: print the per-ticket plan; write nothing.
  --limit=N            With --repair: repair at most N tickets this run (resumable).
  --repair-snapshots   Broad legacy rebuild of snapshots with a merged-in orphan
                       or stale creation channel; it does not batch, push, or
                       refuse mixed faults.
