refactor(state): write prepare-time scratch files under state/<slug>/ #34
Reference in New Issue
Block a user
Delete Branch "chunk-2-state-bind-mount"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
mktempstage dir into~/.claude-bottle/state/<slug>/<service>/. The state subdirs become the stable bind-mount sources that chunk 3'sdocker compose upwill reference.The SDK launch path is unchanged —
docker cpstill 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.