Expand description
Project-controller SQLite state store.
This module owns every rusqlite::Connection interaction for the project
controller’s durable actor/lease/dispatch/diagnostic/layout state, plus the
storage and status types those queries read and write. It deliberately
depends only on rusqlite, serde_json, and std so that
agent-doc-orchestration can call into it without pulling the bundled
SQLite C build into its own compile graph.
Orchestration glue (ops-log, sessions.json/session-actors.json
projection, read_bootstrap, drift verification) stays in
agent-doc-orchestration; this module exposes the SQL primitives those
callers stitch together.
Structs§
- Actor
Last Transition - Actor
Record - Actor
Transition Status - Admin
Operation Status - Connection
- A connection to a SQLite database.
- Control
Plane Store Counts - Dispatch
Attempt Insert - Dispatch
Attempt Status - Projection
Diagnostic Insert - Projection
Diagnostic Status - Queue
Backpressure Insert - Queue
Backpressure Status - Queue
Control Insert - Queue
Control Status - Queue
Head Status - Session
Actor Closeout Commit - Session
Actor Closeout Mutation - Session
Operator Status - Supervisor
Lease Status
Enums§
Functions§
- actor_
documents_ empty - True when the
documentstable holds no rows yet. - actor_
record_ from_ row - commit_
session_ actor_ closeout_ in_ db - has_
any_ open_ in_ flight_ dispatch #ctlrecycle: is ANY dispatch in flight across every document/generation? The controller’s idle self-recycle (R1) uses this as its idle proof — it must never exit while a turn is mid-dispatch for any session it coordinates. Same open-set definition ashas_open_in_flight_dispatchwithout the document/generation filter.- has_
open_ in_ flight_ dispatch #qflood: is a dispatch already in flight (accepted, not yet consumed) for this document atgeneration? Mirrors the open-dispatch shape the restart reconciler keys on. An open dispatch means the current turn already has work queued/running, so an auto re-fire would only pile a redundant trigger into the busy pane.- initialize_
state_ db - insert_
actor_ transition - insert_
admin_ operation_ in_ db - insert_
crash_ recovery_ marker_ in_ db - insert_
dispatch_ attempt_ in_ db - insert_
projection_ diagnostic - insert_
projection_ diagnostic_ with_ metadata - insert_
queue_ backpressure_ in_ db - layout_
scope_ exists - load_
actor_ record_ from_ db - load_
actor_ store_ from_ db - load_
actor_ transitions_ from_ db - load_
admin_ operations_ from_ db - load_
control_ plane_ store_ counts - load_
dispatch_ attempts_ from_ db - load_
effective_ queue_ control_ from_ db - load_
layout_ state_ from_ db - load_
projection_ diagnostics_ from_ db - load_
queue_ backpressure_ from_ db - load_
queue_ control_ from_ db - load_
queue_ head_ from_ db - load_
session_ operator_ status_ from_ db - load_
supervisor_ lease_ from_ db - mark_
open_ dispatches_ consumed #qflood: mark every open in-flight dispatch for this document consumed. Called when the actor transitions toReady(the turn finished → its dispatch is done), keeping the open-dispatch set accurate for the next busy episode’s coalescing and for restart recovery. Returns the number of receipts released.- migrate_
actor_ store_ tx - Migrate a legacy
session-actors.jsonstore into the empty sqlite state. - open_
state_ db - sqlite_
i64 - sqlite_
u64 - state_
db_ path - store_
actor_ record_ tx - Run the compare-and-swap actor write transaction.
- store_
layout_ state_ in_ db - timestamp_
secs - upsert_
actor_ document - Upsert the authoritative
documentsrow for an actor. - upsert_
document_ cycle_ state_ in_ db - upsert_
queue_ control_ in_ db - upsert_
queue_ head_ in_ db - upsert_
supervisor_ lease_ in_ db