Skip to main content

Module store

Module store 

Source
Expand description

Machine-local embedded database (redb).

One redb file per config dir at <app-support>/stores/<stable-key>.redb holds that config dir’s durable per-machine state. The key is a SHA-256 of the canonicalised config-dir path, so a Rust release cannot move it; the single-instance lock keeps its own digest and is unaffected. redb takes an exclusive file lock on open, so a second opener on the same path fails here rather than corrupting.

This wrapper is deliberately general - open plus the raw handle. Table logic lives per-tenant in the submodules: biometric enrolments (biometric), Gotify subscriptions (gotify), Slack subscriptions (slack), durable crons (cron) and the schedules their fired prompts came from (cron_names), session identities (sessions), review threads (review), forge state (state, the account-usage cache), the usage scan’s per-file token summaries (token_usage), cached model pricing (pricing), plugin update history (plugins), and the catalog’s per-file worker-tag scans (session_tags).

dynamic_workers is the retired worker table: nothing writes it, and it holds only until the boot sweep has moved every row onto sessions.

model_catalog is retired rather than live: it exists only to drop the table the deleted catalog machinery left behind in older stores.

settings is the same, for the table the /spinner override lived in.

Re-exports§

use std::path::Path; 🔒
use anyhow::Context; 🔒

Modules§

bench_results
What this machine’s benches measured, keyed by what they were about.
biometric
Biometric enrolments on the redb biometric_enrolments table.
cron
Durable forge-cron persistence on the redb crons table.
cron_names
The schedule each fired prompt came from, keyed by the prompt’s own id.
dictate_models
What this machine has downloaded from the dictation feed, and which model each role was last set to run.
dynamic_workers
The retired dynamic_workers table, kept only to drain it.
gotify
Gotify subscription CRUD on the redb subscriptions table.
handoffs
The handoff log: one row per swap, with the numbers at_percent is tuned from.
model_catalog
The retired model_catalog table, kept only to drop it.
plugins
Plugin update history on the redb plugin_updates table: one row per installed entry (key plugin_id|scope), holding the latest update forge applied to it - what moved, from where, and the marketplace ref a rollback can restore. Values are serde-json.
pricing
Cached LiteLLM pricing on the redb pricing_cache table.
review
Review-thread persistence on the redb review_threads table.
session_tags
Per-file worker-tag scan cache on the redb session_tags table.
sessions
Session identity on the redb sessions table.
settings
The retired settings table, kept only to drop it.
slack
Slack subscription CRUD on the redb slack_subscriptions table.
speaking_models
What this machine has installed for the speaking role, keyed by variant.
speaking_results
What this machine’s speaking benches measured, keyed by what they ran.
state
Machine-local forge state on the redb account_usage table: the per-account usage cache, one row per account. Values are serde-json; no field schema on disk.
task_archive
Durable archive: task rows whose tree has closed.
task_chases
Durable chase log: the newest firing of each rung per subject.
task_history
Durable task history: one append-only row per status transition.
tasks
Durable task persistence on the redb tasks table.
token_usage
Per-file usage-summary cache on the redb token_usage table.

Structs§

Db
Handle to the machine-local redb database.

Functions§

path_for
This config dir’s store file: <app_support>/stores/<stable-key>.redb.