Skip to main content

Module sqlite_store

Module sqlite_store 

Source

Re-exports§

pub use clock::ClockFloorRejected;
pub use clock::ClockFloors;
pub use clock::ClockState;
pub use clock::ClockUntrusted;
pub use clock::HLC_CEILING_MICROS;
pub use clock::INCARNATION_EPOCH_SECS;
pub use clock::NEW_LAYOUT_MIN;
pub use clock::SystemClock;
pub use clock::WallClock;

Modules§

clock
encrypt_migration

Structs§

AccessDenied
A user asked to change a memory it may not change.
ActiveSession
A top-level Claude Code session with transcript lines in a window.
AgentNote
What an agent records about its own session. Stored as the content of an agent-note memory in the text render writes, which parse reads back, so the fields survive sync and redaction without a column of their own.
ArchivedRaws
Archived raw memories split at an age bound, each side newest first.
AtRestKeys
The keys for one purpose. Until settled, files may still be plaintext or sealed under a retired key, and their owner reseals them, then calls SqliteStore::settle_at_rest_keys.
BackupCopy
BelowFloor
A page read from below log_floor would silently miss the rows a truncation dropped, so it is refused and the reader merges a snapshot.
ChunkWork
A live memory whose stored chunk set is missing or no longer matches its content: the chunks to embed and the hash store_chunks must be handed back so a set split from since-changed content is refused.
ColdPassReport
ColdPurge
ColdStats
Corrected
DeleteCounts
DeleteReport
DeleteStatus
One delete run on this store, and how far each floor neighbour has acknowledged this store’s log past it.
EncryptedRecord
FailedCounts
FailedRecord
A record that failed to apply, kept with its content so it is retried here rather than pulled again, and so a later binary can replay it.
FloorHealth
What /health reports about the floor. Silent neighbours hold F back; a stuck one keeps acking without its ack moving.
FloorPass
IndexableMemory
IngestedSession
KindCounts
MemoryChunk
MergeOutcome
MergeProgress
OutboxRow
PeerAck
PeerDeleteAck
PruneCounts
ReadDeadline
Bounds the wait for a pooled read connection on this thread until the guard drops: a read that finds the pool empty waits at most until deadline, then opens a connection of its own, which closes on drop. That open is bounded by BUSY_TIMEOUT, not by the deadline, and if it fails the read waits for the pool as an unbounded read would. Thread-local because every store read takes a connection through reader() and a recall’s reads all run on the one thread that holds the guard; the guard is not Send, so it cannot be dropped on another.
RedactionReport
RedactionRun
ReplayCounts
RetryCounts
SealedSegment
SkippedRow
A row the pass could not parse. Its text was redacted in place (a chunk row was deleted) without syncing or re-embedding it. row is rowid N, local_seq N for sync_log, or from_id/to_id/relation_type for relations; it and reason are redacted, since a corrupt value or an error message can echo a secret.
SnapshotChunk
SnapshotMerge
A merge in progress. Rows go in through push in the snapshot’s order; those a previous attempt already applied are passed over.
SnapshotOptions
SnapshotState
What the exporter states about the rows it wrote, all read in the same transaction as the rows.
SqliteStore
Every write (via with_txn or a direct execute) goes through writer, the single connection WAL reserves for the one process-wide writer. Reads go through readers: a pool of separate connections in file-backed mode, or the same connection as the writer for in_memory, where a second connection would just see an empty, unrelated database.
VacuumSpace
Free space against what a VACUUM of this store needs, on the filesystem with the least room to spare.

Enums§

AtRestPurpose
What a set of files beside the store is sealed for. Each purpose has its own keys, so each owner reseals its files on its own schedule.
BootstrapState
Where a device paired into an identity stands before its first ingest.
ColdSeal
What one call to seal_cold_segment did.
CorrectRefusal
DeleteScope
What one delete removes: a memory by id, everything a Claude Code session produced (its transcript’s raws, its subagents’, notes filed under it), or everything filed under a stored project path.
NoteKind
Principal
Who is asking. The self-hosted daemon serves one user and acts as Owner; a store shared by several users (a kiln tenant) names each caller as a User.
RawMemoryState
What became of the raw memory a transcript passage was cut from.
RedactionPhase
Where the one-time pass over stored content stands. A cursor is the last rowid its phase finished, so a restart resumes after it. Relations have no rowid, so that phase restarts from the top; redacted rows no longer match, which makes the rescan cheap and the outcome the same.
RetireOutcome
Store-side shape the index drainer consumes; body is context + content, the same text the embedding was computed over.
RewriteOutcome
SnapshotRow
One row of a snapshot, in the order the exporter writes them: tombstones first, then live rows parents before children, then the carried log tail, and the dedup ranges last, so they are merged only once every row is.
Truncation

Constants§

BASELINE_VERSION
The user_version of a store created by schema.sql alone, before any ladder step. Stores that old carry no schema_migrations table.
FLOOR_TICK_MICROS
How often the daemon advances the uptime clock.
MERGE_CHUNK
Rows applied per write transaction, so a merge runs between other writes.
NOTE_COVERED
The distillation_log status of a raw retired because an agent note covers its session, so no LLM ever saw it.
SCHEMA_VERSION
Derived from the ladder length, not hand-maintained: bumping the schema means appending to MIGRATIONS, never editing a version number here.
TRAVERSE_MAX_RESULTS
Cap on what one traverse call returns. The walk also stops expanding after TRAVERSE_MAX_WALK (id, depth) pairs, because a hub entity can connect one memory to tens of thousands and the context pack that asks only shows a handful.

Functions§

can_change
Only a memory’s author changes it, shared or not.
can_read
A user reads its own memories and every shared one. A memory with no author predates attribution and belongs to no user.
is_transient
A busy writer or an I/O fault says nothing about the record, so it never settles; anything else (a parse failure, a constraint, an unsupported shape) fails the same way on every attempt. Parsers in this crate wrap their failures in io::Error::other, so those kinds are content.
replay_build
The binary and schema a replay runs under, recorded on each record as it settles so only a replay by a later build counts towards dropping it.
session_of
The Claude Code session a transcript path belongs to: its file stem, or for a subagent transcript (<session>/subagents/<agent>.jsonl) the directory above subagents. An agent note’s source_id is the bare session id, which is its own stem.