fix(supervise): remove queue directory from db-backed flow
lint / lint (push) Successful in 2m4s
test / unit (pull_request) Successful in 59s
test / integration (pull_request) Successful in 20s
test / coverage (pull_request) Successful in 1m10s

This commit is contained in:
2026-07-01 19:50:38 +00:00
parent 3067b067d2
commit 29904609da
23 changed files with 212 additions and 270 deletions
+12 -17
View File
@@ -27,12 +27,10 @@ one-off persistence.
1. Supervise proposals and responses are persisted through SQLite.
2. Audit entries are persisted through SQLite.
3. Existing public supervise helpers keep their current call shape where
practical: `write_proposal`, `read_proposal`, `list_pending_proposals`,
`write_response`, `read_response`, `wait_for_response`,
`archive_proposal`, `write_audit_entry`, and `read_audit_entries`.
4. The sidecar queue mount still works across docker, smolmachines, and
macOS-container backends.
3. Supervise queue helpers use the bottle slug / queue key instead of a queue
directory path.
4. The sidecar receives the host database mount across docker, smolmachines,
and macOS-container backends.
5. The implementation stays stdlib-only.
6. Unit tests cover queue round-trips, pending discovery, response waits,
archive semantics, audit round-trips, and path creation.
@@ -57,11 +55,9 @@ Queue and audit state use the host-level local database:
The supervise sidecar receives that database as a writable bind mount at
`/run/supervise/bot-bottle.db` and gets the path through `SUPERVISE_DB_PATH`.
The existing per-slug queue directory mount remains in place for compatibility
with the supervise sidecar contract and any adjacent tooling that still expects a
queue directory, but the active queue records live in the host database. This
creates the shared host database that later forge/native lifecycle work can
extend in separate PRDs.
No per-slug queue directory is mounted into the sidecar. This creates the shared
host database that later forge/native lifecycle work can extend in separate
PRDs.
### Tables
@@ -113,9 +109,8 @@ CREATE TABLE supervise_audit_entries (
### Compatibility
The existing helper functions keep accepting `Path` arguments for queue
directories. Internally, they map the queue directory to a queue key and perform
equivalent operations against `~/.bot-bottle/bot-bottle.db`:
The queue helpers take a bottle slug / queue key and perform equivalent
operations against `~/.bot-bottle/bot-bottle.db`:
- `list_pending_proposals` returns non-archived proposals without a non-archived
response, sorted by arrival time.
@@ -123,9 +118,9 @@ equivalent operations against `~/.bot-bottle/bot-bottle.db`:
moving files into `processed/`.
- `wait_for_response` keeps the current polling behavior but polls SQLite.
The old path helpers (`queue_dir_for_slug`, `audit_dir`, `audit_log_path`) stay
available for compatibility. `audit_log_path` no longer describes the active
storage location; callers should use `read_audit_entries`.
The old audit path helpers (`audit_dir`, `audit_log_path`) stay available for
compatibility. `audit_log_path` no longer describes the active storage location;
callers should use `read_audit_entries`.
## Implementation chunks