Expand description
Postgres-backed state for the CLI.
Replaces the legacy filesystem::db SQLite tree. One sqlx PgPool
over the objectiveai-db cluster whose postgresql:// URL is
published in the db spawn lock (or a remote postgres pointed at
via db config address), lazily initialized by
Context::db_client(); every tier (tags, message_queue,
logs) takes &Pool and runs natively async.
Modules§
- agent_
continuations - Latest-continuation registry keyed by
agent_instance_hierarchy. - compartment
- Per-plugin/tool database compartments.
- instances
instancestier — aggregate enumeration backingagents instances {list, get}.- laboratory_
attachments - Laboratory IDs attached to an agent target, backed by the postgres
laboratory_attachmentstable. - logs
- Postgres-backed log writer.
- message_
queue - Deferred-message storage for
agents queue {add, list, read id}. - query
objectiveai db query— read-only SQL executor.- tag_
groups tag_groupstable — explicit grouping container that lets manytagsrows share one resolvedAgentSpec+ parent lineage.- tags
- Client-side agent tags backed by the postgres
tags+tag_groupstables. - time
- Time conversion helpers for CLI command responses.
Structs§
- DbHandle
- The live pool PLUS the admin coordinates it was built from —
what
super::compartmentneeds to mint derived per-plugin connection strings. Cached as a unit byContext::db_client; the password stays in memory exactly as long as the pool it authenticated. - Pool
Enums§
Functions§
- init
- Open the admin pool against
url(no database path — lands on the connecting user’s default database,postgres), ensuredatabaseexists, then open the application pool and apply the inline schema. Idempotent across cold and warm starts — re-running against an already-bootstrapped database is a no-op (every CREATE usesIF NOT EXISTS).