Commit Graph

5 Commits

Author SHA1 Message Date
didericis-claude 8ab24726fe refactor(commit): introduce Freezer class hierarchy across backends
lint / lint (push) Failing after 1m38s
test / unit (pull_request) Successful in 31s
test / integration (pull_request) Successful in 15s
Adds a Freezer ABC (backend/freeze.py) that encapsulates the
stop-commit-mark-preserved flow for all backends, following the same
pattern as BottleBackend. Each backend gets its own Freezer subclass:

  DockerFreezer           — docker commit
  MacosContainerFreezer   — container export + image rebuild; prompts
                            to stop if the container is running
  SmolmachinesFreezer     — smolvm pack create --from-vm

The base class owns write_committed_image, mark_preserved, and the
resume hint. Subclasses implement _freeze() and optionally override
_export_hint() for migration instructions.

Freezer.commit(agent, bottle) is the primary entry point for use
within a live launch context. Freezer.commit_slug(slug) is a
convenience wrapper for cmd_commit, which no longer branches on
backend names itself.

get_freezer(backend_name) is the factory, analogous to
get_bottle_backend(). CommitCancelled is raised by MacosContainerFreezer
when the user declines the stop prompt; cmd_commit catches it and
returns 0.
2026-06-23 07:41:48 +00:00
didericis-claude 3cd4a7acd9 fix(commit): stop running macos-container bottle before committing
lint / lint (push) Successful in 1m38s
test / unit (pull_request) Successful in 32s
test / integration (pull_request) Successful in 17s
`container export` requires the container to be stopped first. When a
running bottle is detected, prompt the user to confirm, stop the
container, then commit. Adds `container_is_running` and
`stop_container` helpers to the macos-container util.

Addresses #240 (comment)
2026-06-23 07:22:33 +00:00
didericis d4f4846667 feat: support macos-container bottle commits
lint / lint (push) Failing after 1m40s
test / unit (pull_request) Failing after 34s
test / integration (pull_request) Successful in 19s
2026-06-23 00:43:17 -04:00
didericis-codex 16020a6a09 feat: support smolmachines bottle commit
lint / lint (push) Failing after 1m55s
test / unit (pull_request) Failing after 40s
test / integration (pull_request) Successful in 29s
2026-06-23 00:35:13 -04:00
didericis-claude 3484c3aed0 feat(cli): add commit command to snapshot running bottle state
Adds `./cli.py commit [<slug>]` which runs `docker commit` on the
active agent container and stores the resulting image tag in per-bottle
state. The next `./cli.py resume <slug>` automatically boots from the
committed snapshot instead of rebuilding from the Dockerfile, preserving
all in-container state across restarts and migrations.

- bottle_state: add write_committed_image / read_committed_image helpers
- docker/util: add commit_container wrapper around `docker commit`
- docker/launch: check for a committed image before the Dockerfile build
  step; fall back to normal build if the image is absent from the daemon
- cli/commit: new command with interactive slug picker; errors clearly on
  non-Docker backends
- 50 new unit tests covering all paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 00:35:13 -04:00