AGENTS

Agent persistence

Durable observations, decisions, publications, and restart behavior.

#Stores

VPS production uses /var/lib/overweight/overweight-engine.sqlite. Sites uses the configured D1 binding. Both preserve the same logical tables for snapshots, decisions, published agents, and heartbeat.

#Restart behavior

PM2 restarts do not delete the database. The engine reads the latest required observations by agent and symbol and continues calibration. The web process reads the same configured SQLite path.

#WAL and lease

SQLite uses WAL, NORMAL synchronous mode, a busy timeout, unique indexes, and a singleton engine lease. A second worker cannot take an unexpired lease and double-write cycles.

#Backups

Operators must copy the database with the SQLite backup command while keeping it outside release archives. Integrity checks and restore steps are documented under Operations / Database.