refactor: extract QueueStore and AuditStore to their own modules
lint / lint (push) Successful in 2m2s
test / unit (pull_request) Successful in 56s
test / integration (pull_request) Successful in 20s
test / coverage (pull_request) Failing after 59s

Moves _QueueStore → bot_bottle/queue_store.py (public QueueStore) and
_AuditStore → bot_bottle/audit_store.py (public AuditStore). Removes
the public queue_db_path() function; QueueStore resolves the DB path
via host_db_path() on the host, or via the SUPERVISE_DB_PATH env var
in the sidecar container (internal mechanism, not public API).

Adds queue_store.py and audit_store.py to Dockerfile.sidecars so the
sidecar bundle picks them up. Updates __all__ in supervise.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 21:45:08 +00:00
parent 29904609da
commit 244ad6a914
6 changed files with 394 additions and 312 deletions
+1 -2
View File
@@ -20,7 +20,6 @@ from bot_bottle.supervise import (
archive_proposal,
host_db_path,
list_pending_proposals,
queue_db_path,
read_audit_entries,
read_proposal,
read_response,
@@ -132,7 +131,7 @@ class TestQueueIO(unittest.TestCase):
p = _proposal()
path = write_proposal(p)
self.assertTrue(path.exists())
self.assertEqual(queue_db_path(), path)
self.assertEqual(host_db_path(), path)
self.assertEqual(0o600, path.stat().st_mode & 0o777)
loaded = read_proposal(self.slug, p.id)
self.assertEqual(p, loaded)
-3
View File
@@ -38,9 +38,6 @@ class TestPathHelpers(unittest.TestCase):
def test_bot_bottle_root(self) -> None:
self.assertTrue(str(supervise.bot_bottle_root()).endswith(".bot-bottle"))
def test_queue_db_path_is_host_db_path(self) -> None:
self.assertEqual(supervise.host_db_path(), supervise.queue_db_path())
class TestReadMalformed(unittest.TestCase):
def test_read_proposal_missing_row(self) -> None: