Skip to content

Documentation / @etherfold/core / REORG_COUNTER_KEY

Variable: REORG_COUNTER_KEY ​

const REORG_COUNTER_KEY: Readonly<Record<ReorgCause, string>>

Defined in: packages/core/src/reorgCounters.ts:40

The DURABLE NAMES the counts are kept under, which live here because the writer and the reader are deliberately in different packages.

A reorg is concluded by the fold, so whoever OWNS the store writes the count (ADR-0050); the process that READS it back may own no store at all -- a read tier is a database connection and an HTTP surface and nothing else. Two packages therefore have to agree on one key, and the only package both of them already depend on is the one that decides what a ReorgCause IS. Spelling the strings twice is how the two silently stop describing the same database.

They are opaque keys, not a schema: WHERE they are stored (today a _meta row per key in the libSQL artifact) is the store owner's business, and nothing here knows about SQL.