refactor: extract QueueStore and AuditStore to their own modules
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:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user