# `Concord.Sync.ChangeLog`
[🔗](https://github.com/gsmlg-dev/concord/blob/main/lib/concord/sync/change_log.ex#L1)

ETS-backed bounded change log for Concord.

Stores `%Event{}` records keyed by `{revision, op_index}` in an
`:ordered_set` ETS table. Supports range queries for historical replay
and automatic compaction to bound memory usage.

# `append`

```elixir
@spec append([Concord.Sync.Event.t()]) :: :ok
```

Appends events to the change log. Called from the state machine
on every mutation.

# `changes`

```elixir
@spec changes(non_neg_integer(), non_neg_integer(), keyword()) :: [
  Concord.Sync.Event.t()
]
```

Returns events in the revision range `[from, to]` (inclusive).

# `compact`

```elixir
@spec compact(non_neg_integer()) :: non_neg_integer()
```

Compacts the change log to keep only entries after `keep_revision`.

# `earliest_revision`

```elixir
@spec earliest_revision() :: non_neg_integer()
```

Returns the earliest revision still in the change log, or `0` if empty.

# `ensure_table`

Ensures the change log ETS table exists.

