Files
bot-bottle/bot_bottle/supervisor/plan.py
T
didericis 3e2cbcab88
tracker-policy-pr / check-pr (pull_request) Successful in 8s
test / integration-docker (pull_request) Successful in 12s
test / unit (pull_request) Successful in 43s
lint / lint (push) Failing after 59s
test / integration-firecracker (pull_request) Successful in 3m16s
test / coverage (pull_request) Successful in 16s
test / publish-infra (pull_request) Has been skipped
refactor(supervise): fold Supervise into the facade as Supervisor; drop dead flat-fallbacks
Move the `Supervise` lifecycle out of its own `orchestrator/supervisor/
supervise.py` and into the package `__init__`, renaming the class to
`Supervisor`. Callers now import it from `bot_bottle.orchestrator.supervisor`
alongside the queue surface it belongs with.

Remove the dead `try/except ImportError` flat-import fallbacks from the
package-only store modules (db_store, audit_store, config_store, queue_store)
and image_cache. Those fallbacks existed for when the store files were
flat-copied into the gateway; post-PRD-0070 the data plane never opens the DB,
so these modules are only ever imported as part of the package. The two gateway
data-plane files that may still be loaded flat (egress_addon_core,
git_gate_render) keep their fallbacks.

Full unit suite green (2251).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:24:06 -04:00

27 lines
881 B
Python

"""`SupervisePlan` — the launch-time supervise staging DTO.
A pure value type (no store access), so it lives in the neutral package: the
backend builds it at launch and the orchestrator's `Supervisor.prepare` returns
it. The behaviour that fills it in — staging the host database — is the
orchestrator's, in `bot_bottle.orchestrator.supervisor.Supervisor`.
"""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
@dataclass(frozen=True)
class SupervisePlan:
"""Output of `Supervisor.prepare`; consumed by `.start`.
`db_path` is the host database bind-mounted into the gateway at
/run/supervise/bot-bottle.db. `internal_network` is empty at prepare time;
the backend's launch step fills it via `dataclasses.replace` before calling
`.start`."""
slug: str
db_path: Path
internal_network: str = ""