Skip to content

Commit c996f97

Browse files
committed
release: v0.2.0 — self-rollback, delete node, publish Claude Code image
- CHANGELOG 0.2.0 - release workflow: also build + push the Claude Code env image to ghcr.io/css521/rewindable-claude (multi-arch) on tag - example README: pull-or-build the published image
1 parent ff0449b commit c996f97

3 files changed

Lines changed: 99 additions & 29 deletions

File tree

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,36 @@ jobs:
4545
args: release --clean
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
# The ready-to-use Claude Code environment image (examples/claude-code).
50+
# Heavier than the bare binary image (Node + Claude Code + a build-time seeded
51+
# rootfs), so it's its own job. Built multi-arch and pushed to
52+
# ghcr.io/css521/rewindable-claude:<tag> + :latest.
53+
claude-image:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: docker/setup-qemu-action@v3
59+
- uses: docker/setup-buildx-action@v3
60+
61+
- uses: docker/login-action@v3
62+
with:
63+
registry: ghcr.io
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: tag without leading v
68+
id: ver
69+
run: echo "v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
70+
71+
- name: build + push rewindable-claude
72+
uses: docker/build-push-action@v6
73+
with:
74+
context: .
75+
file: examples/claude-code/Dockerfile
76+
platforms: linux/amd64,linux/arm64
77+
push: true
78+
tags: |
79+
ghcr.io/css521/rewindable-claude:${{ steps.ver.outputs.v }}
80+
ghcr.io/css521/rewindable-claude:latest

CHANGELOG.md

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,66 @@ All notable changes to this project are documented here. The format is based on
44
[Keep a Changelog](https://keepachangelog.com/), and the project aims to follow
55
[Semantic Versioning](https://semver.org/).
66

7-
## [Unreleased]
7+
## [0.2.0] - 2026-06-16
8+
9+
The "agent rolls back itself" release: an agent can now explore, undo, and
10+
continue — from inside one running session — and prune dead ends, all via its
11+
own MCP tools, while still capturing system-level changes.
812

913
### Added
10-
- **Interactive `supervise`**: when stdin is a TTY, `agentenv supervise -- <agent>`
11-
now runs the agent on a PTY (so an interactive REPL like Claude Code works)
12-
while still serving the control socket. A rollback issued from another
13-
terminal (`agentenv ctl checkout <id>`) kills the agent and relaunches it
14-
from the restored environment — you never have to exit it. Without a TTY it
15-
keeps the previous headless (backgrounded + log-tail) behavior, so the same
16-
command covers both interactive and long-running autonomous agents.
17-
- `agentenv shell -- <cmd>` runs an arbitrary program inside the sandbox on a
18-
PTY (defaults to a login shell).
19-
- `AGENTENV_FORWARD=NAME,NAME,PREFIX_*` forwards named env vars (trailing `*`
20-
wildcard) into the sandbox by value-at-call-time — complementing the existing
21-
`AGENTENV_PASS_<VAR>=val` form. A wrapper image can bake
22-
`ENV AGENTENV_FORWARD=ANTHROPIC_*,CLAUDE_*` so users just pass
23-
`-e ANTHROPIC_API_KEY=...`.
24-
- `init --from` prints throttled copy progress (files + bytes) and a final
25-
summary; a multi-GB seed no longer looks like a hang.
14+
- **`supervise --self-rollback`**: the agent rolls back its OWN environment
15+
(via the `agentenv__checkout` MCP tool / `ctl checkout`) and KEEPS RUNNING.
16+
The control socket lives inside the sandbox (`work/current/.agentenv/
17+
control.sock`, an always-ignored dir) so the agent can reach the daemon from
18+
within the env; a checkout reverts the rootfs in place WITHOUT killing the
19+
agent. Survival works because the in-place sync only touches changed files —
20+
the agent's own runtime is unchanged across a session's snapshots.
21+
- **Interactive `supervise`**: with a TTY, runs the agent on a PTY (interactive
22+
REPLs like Claude Code work) while serving the control socket; without a TTY
23+
it stays headless (backgrounded + log-tail) for autonomous agents. One
24+
command covers both. Interactive mode is silent (no banner) so it doesn't
25+
pollute the agent's terminal.
26+
- **Delete a node**: `agentenv delete <node>` (+ `ctl delete`, + the
27+
`agentenv__delete` MCP tool). Splices the node out, re-parenting its children
28+
to its parent so descendants survive; refuses to delete HEAD or the only
29+
node. Safe even when children hardlink-share its files.
30+
- **Auto-route to a running session**: a lock-taking command (checkout / commit
31+
/ delete / exec / tag / gc / tournament) that can't get the repo lock because
32+
a daemon/supervise holds it is transparently routed through that session's
33+
control socket — so `agentenv checkout <id>` just works whether or not a
34+
daemon is up.
35+
- `agentenv shell -- <cmd>` runs an arbitrary program inside the sandbox on a PTY.
36+
- `AGENTENV_FORWARD=NAME,PREFIX_*` forwards named env vars into the sandbox by
37+
value-at-call-time (complements `AGENTENV_PASS_<VAR>=val`). Wrapper images
38+
bake `ENV AGENTENV_FORWARD=ANTHROPIC_*,CLAUDE_*` so users just pass `-e ...`.
39+
- `init --from` prints throttled copy progress + a final summary.
2640
- `Dockerfile.control` gains `--build-arg SEED_AT_BUILD=1` to bake the managed
27-
rootfs into the image at build time (cached layer) instead of seeding on
28-
first run. Build-time seeding also can't capture runtime-mounted K8s secrets.
41+
rootfs at build time (cached layer, instant start; also can't capture
42+
runtime-mounted K8s secrets).
2943
- `examples/claude-code/`: a ready-to-use rewindable Claude Code image —
30-
`docker run -it` lands you in the sandbox shell, start `claude` yourself,
31-
every change auto-snapshotted, rewind with `agentenv checkout`.
32-
- Release pipeline pushes multi-arch container images to
33-
`ghcr.io/css521/agentenv:<tag>` + `:latest` (goreleaser `dockers`).
34-
- `.devcontainer/`: bumped to a Go 1.26 image, dropped the redundant
35-
common-utils feature, and added an opt-in `AGENTENV_CN_MIRROR=1` apt mirror
36-
for slow networks. `.dockerignore` keeps the build context small.
44+
`docker run -it`, start `claude`, every change auto-snapshotted, and Claude
45+
can roll back / prune its own history via MCP. Published to
46+
`ghcr.io/css521/rewindable-claude`.
47+
- Release pipeline pushes multi-arch images for both the agentenv binary
48+
(`ghcr.io/css521/agentenv`) and the Claude Code env
49+
(`ghcr.io/css521/rewindable-claude`).
50+
- `.devcontainer/`: Go 1.26 image, opt-in `AGENTENV_CN_MIRROR=1` apt mirror.
51+
`.dockerignore` keeps the build context small.
52+
53+
### Changed
54+
- Snapshot ignore overhaul: glob/segment patterns matched at any path depth
55+
(`.claude*`, `*.tmp.*`), sensible built-in defaults (agent state + caches +
56+
atomic temp files), `AGENTENV_IGNORE` now EXTENDS rather than replaces, and a
57+
set of always-ignored runtime paths. Empty-change snapshots are skipped. Net
58+
effect: the DAG shows only real work, not the agent's bookkeeping churn.
59+
- `agentenv status` reports the backend's actual ignore patterns.
60+
61+
### Fixed
62+
- `agentenv ctl exec` propagates the inner command's exit code (was always 0).
63+
- Cross-uid daemon-socket connect reports both uids + a hint; daemon/headless
64+
supervise log their uid on startup.
65+
- apt works inside the rootless sandbox (`examples/claude-code` bakes
66+
`APT::Sandbox::User "root"` — userns forbids apt's setgroups privilege-drop).
3767

3868
## [0.1.1] - 2026-06-16
3969

@@ -149,6 +179,6 @@ drive rollback natively.
149179
incremental checkout (copy only the diff); `AGENTENV_IGNORE` excludes ephemeral
150180
paths; auto-snapshot labels list the changed files.
151181

152-
[Unreleased]: https://github.com/css521/agentenv/compare/v0.1.1...HEAD
182+
[0.2.0]: https://github.com/css521/agentenv/releases/tag/v0.2.0
153183
[0.1.1]: https://github.com/css521/agentenv/releases/tag/v0.1.1
154184
[0.1.0]: https://github.com/css521/agentenv/releases/tag/v0.1.0

examples/claude-code/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ The managed rootfs is baked at **build time** (`init --from /` runs once during
99
`docker build`, cached in a layer), so container start is instant — no slow
1010
per-start copy.
1111

12-
## Build
12+
## Pull (or build)
1313

14-
Context is the repo root (so the agentenv binary compiles from source):
14+
Published multi-arch on each release:
15+
16+
```bash
17+
docker pull ghcr.io/css521/rewindable-claude:latest
18+
# then use `ghcr.io/css521/rewindable-claude:latest` wherever `rewindable-claude` appears below
19+
```
20+
21+
Or build it yourself — context is the repo root (so the agentenv binary compiles from source):
1522

1623
```bash
1724
docker build -f examples/claude-code/Dockerfile -t rewindable-claude .

0 commit comments

Comments
 (0)