refactor(state): write prepare-time scratch files under state/<slug>/ #34

Merged
didericis merged 1 commits from chunk-2-state-bind-mount into main 2026-05-25 23:01:19 -04:00
Owner

Summary

PRD 0018 chunk 2. Move each sidecar's prepare-time scratch files (pipelock yaml + CAs, egress routes.yaml + CAs, git-gate entrypoint + hooks, supervise current-config, agent env + prompt) from the ephemeral mktemp stage dir into ~/.claude-bottle/state/<slug>/<service>/. The state subdirs become the stable bind-mount sources that chunk 3's docker compose up will reference.

The SDK launch path is unchanged — docker cp still copies from the plan-held paths into containers, just from new locations on the host. Behavior is identical, only the host paths moved.

start.py's session-end cleanup moves into finally, which now also reaps the state subdir if we never reached the launch context (dry-run, preflight-N, prepare exception). Previously only the post-launch path called _settle_state; this picks up the new pre-launch cases without changing the preserve-marker semantics.

No new tests. The 424 existing unit tests + the 3 supervise integration tests still pass — the change is invisible to anything that doesn't grep for stage paths.

## Summary PRD 0018 chunk 2. Move each sidecar's prepare-time scratch files (pipelock yaml + CAs, egress routes.yaml + CAs, git-gate entrypoint + hooks, supervise current-config, agent env + prompt) from the ephemeral `mktemp` stage dir into `~/.claude-bottle/state/<slug>/<service>/`. The state subdirs become the stable bind-mount sources that chunk 3's `docker compose up` will reference. The SDK launch path is unchanged — `docker cp` still copies from the plan-held paths into containers, just from new locations on the host. Behavior is identical, only the host paths moved. start.py's session-end cleanup moves into `finally`, which now also reaps the state subdir if we never reached the launch context (dry-run, preflight-N, prepare exception). Previously only the post-launch path called `_settle_state`; this picks up the new pre-launch cases without changing the preserve-marker semantics. No new tests. The 424 existing unit tests + the 3 supervise integration tests still pass — the change is invisible to anything that doesn't grep for stage paths.
didericis added 1 commit 2026-05-25 22:53:58 -04:00
refactor(state): write prepare-time scratch files under state/<slug>/
test / unit (pull_request) Successful in 17s
test / integration (pull_request) Successful in 1m5s
cd82a48399
PRD 0018 chunk 2. Each sidecar's prepare-time output (pipelock yaml +
CAs, egress routes.yaml + CAs, git-gate entrypoint + hooks, supervise
current-config, agent env + prompt) now lands in
~/.claude-bottle/state/<slug>/<service>/ instead of an ephemeral
mktemp dir. The state subdirs become the stable bind-mount sources
that chunk 3's docker compose project will reference.

The SDK launch path is unchanged — `docker cp` still copies from the
plan-held paths into containers, just from new locations. start.py's
session-end cleanup is now in `finally`, which also reaps state dirs
left behind by dry-run / preflight-N / prepare-exception paths
(previously only the post-launch path settled state).
didericis merged commit b9f6889d09 into main 2026-05-25 23:01:19 -04:00
Sign in to join this conversation.