Tearleads

document_discovery_sequence Client SQLite table

Local request order, independent of untrusted server epoch claims.

Declared in packages/client-sdk/src/data/sqlite/schema/documentDiscoveryEvidenceSchema.ts

Columns

  • idtext
    • primary key
    • not null

    Always requests: the table holds one row.

  • generationinteger
    • not null

    Last generation handed out. Each discovery request, and each cache eviction on a remote reset, takes the next one.

  • invalidated_throughinteger
    • not null
    • default 0

    Highest generation an eviction invalidated, or 0 before any eviction. A request at or below it is no longer current and writes no evidence.

DDL

The statements the client runs to create this table and its indexes.

CREATE TABLE IF NOT EXISTS "document_discovery_sequence" (
  "id" TEXT NOT NULL PRIMARY KEY,
  "generation" INTEGER NOT NULL,
  "invalidated_through" INTEGER NOT NULL DEFAULT 0
);