refactor(backend): lift host-side validation onto the base class
test / unit (push) Successful in 12s
test / integration (push) Failing after 10s

Make BottleBackend.prepare a template method that runs a cross-backend
_validate step (agent exists, named skills present on host, SSH
IdentityFiles resolve) and then delegates to a subclass-implemented
_resolve_plan for backend-specific resolution.

A future backend that overrides _resolve_plan can no longer forget to
validate skills or SSH keys; the validation runs unconditionally via
prepare. Backends with additional preconditions can override _validate
and chain via super().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 10:51:19 -04:00
parent a23e89ef48
commit 339d40f8c9
3 changed files with 66 additions and 54 deletions
@@ -1,10 +1,10 @@
"""Copy host-side skill directories into a running Docker bottle.
Skills are validated on the host before launch by
`DockerBottleBackend.validate_skills`; this module assumes that
validation has already run. A skill disappearing between validation
and copy still dies loudly rather than silently producing a partial
container."""
Skills are validated on the host before launch by the base class's
`BottleBackend._validate_skills` (called from `prepare`); this module
assumes that validation has already run. A skill disappearing between
validation and copy still dies loudly rather than silently producing
a partial container."""
from __future__ import annotations