Add opt-in in-memory message boards for Guardian v3 (#62373)

## What changed

Set `features.guardianv3.message_board_in_memory = true` to give each
new or cleared root thread an in-memory SQLite board. The housekeeper
and reviewer share the board until the last handle closes. The reviewer
can read evidence and update its own subscriptions. On-disk storage
remains the default.

With in-memory storage enabled, the attached reviewer is unavailable
on resumed roots because evidence intake starts at the end of history
and a fresh board has no earlier evidence.

## Testing

Exercise evidence catch-up and later post delivery with both storage
modes. Check that only the on-disk mode creates a database file, the
reviewer cannot update channels, and a cold resume skips evidence intake
in memory mode.

GitOrigin-RevId: 338f44720fca510b2baf40fd4b3a4b30245d4fc2
This commit is contained in:
felixxia-oai
2026-11-18 21:57:35 +00:00
committed by copyberry
parent 8bbe7c7d66
commit d7c289ec25
8 changed files with 208 additions and 49 deletions
+18
View File
@@ -447,6 +447,24 @@ impl SqliteConfig {
Ok(pool)
}
/// Open a private database that lasts for the lifetime of this pool.
pub async fn open_in_memory_pool() -> Result<SqlitePool, Error> {
// Keep the sole connection alive. Disabling the checkout ping also keeps
// a cancelled acquire from discarding the connection and its database.
SqlitePoolOptions::new()
.max_connections(1)
.max_lifetime(None)
.idle_timeout(None)
.test_before_acquire(false)
.connect_with(
SqliteConnectOptions::new()
.in_memory(true)
.pragma("temp_store", "MEMORY")
.log_statements(LevelFilter::Off),
)
.await
}
/// Open a writable Codex SQLite database, creating it if necessary.
/// Keep this configuration alive to retain the cleanup lock for local logs.
pub async fn open_read_write_pool(&self, path: &Path) -> anyhow::Result<SqlitePool> {