gaps

The gaps table preserves missing-period, provider-finality, retry, and resolution history. Resolved rows can remain as audit evidence.

Columns

Column Type Meaning
gap_start_open_time_ms INTEGER First missing bar open time
gap_id TEXT Opaque row identity
gap_start_open_time_utc TEXT UTC mirror of the start
gap_end_close_time_ms INTEGER Last missing bar close time
gap_end_close_time_utc TEXT UTC mirror of the end
missing_bars_count INTEGER Number of expected missing bars in the range
reason TEXT Why the range is tracked
status TEXT Current recovery/finality state
next_retry_at_ms INTEGER NULL Next eligible logical work time, when scheduled
next_retry_at_utc TEXT NULL UTC mirror of the next eligible time
attempts INTEGER Logical automatic confirmation/recovery operations issued from this row

The primary key is (gap_start_open_time_ms, gap_id). Use ORDER BY gap_start_open_time_ms, gap_id for deterministic chronological output.

Reason values

  1. pending_finalization: an expected provider row is absent and provider confirmation is not complete.
  2. provider_omitted: the provider returned no row after the applicable confirmation or check.
  3. provider_error: a localized provider or data request failure affected the range.

Status values

  1. pending: provider-finality work exists but is not yet due.
  2. open: provider input remains missing or affected; the row can be scheduled or intentionally unscheduled under provider policy.
  3. resolved: provider input arrived and the row remains only as audit history.
  4. exhausted: automatic recovery was allowed but reached its attempt limit.

Scheduling fields

next_retry_at_* contains Finality Due At for pending provider finality or the next logical recovery time for an eligible open gap. Intentionally unscheduled, resolved, and exhausted rows use NULL.

A due timestamp alone does not authorize recovery. The active Job, provider policy, reason/status eligibility, and remaining-attempt policy must also allow it.

Search documentation

Search across 46 documentation pages.