Real Sprites API surface: server-versioned checkpoints + restore-by-id (v0.2.0) - #6
Merged
Conversation
…0.2.0)
The provisional v0.1.0 surface treated the caller's label as the checkpoint
id. The real Sprites API assigns the id (v1, v2, …) and the caller controls
only an optional comment. This corrects the emulator to match.
- Checkpoints are now an ordered list of {id, comment, fs} with sequential
server-assigned v<N> ids; create body is {comment?}, response is {id}.
- New GET /v1/sprites/{name}/checkpoints lists {id, comment} in creation order.
- Restore moves to POST /v1/sprites/{name}/checkpoints/{id}/restore (id in the
path, empty body); the old top-level /restore route is removed.
- GET view exposes checkpoints as [{id, comment}]; health lists the new paths.
- exec REST response shape kept unchanged, flagged provisional (TODO(confirm)):
real exec is WebSocket-primary and the REST shape is not published.
Tests, docs, and CHANGELOG updated to the new id-based surface.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects the checkpoint/restore surface to match the confirmed real Sprites API. The v0.1.0 provisional surface used caller labels + a body-based restore; the real API assigns version ids and restores by id in the path.
Changes
v1,v2, …); create body is{ comment? }, response{ id }.GET /v1/sprites/{id}/checkpoints→{ checkpoints: [{ id, comment }] }.POST /v1/sprites/{id}/checkpoints/{id}/restore(id in path); the oldPOST /v1/sprites/{name}/restoreis removed.implementedlist + docs updated. Exec REST response unchanged (WSS is the real primary; this REST shape stays a documentedTODO(confirm)).Verify
go build/vet/test/-racegreen; golangci-lint v2.12.2 0 issues. Live loop: checkpoint →{"id":"v1"}, list →[{"id":"v1","comment":"pre-run"}],./risky.shcorrupts,POST .../checkpoints/v1/restorerewinds the fs.Cuts as v0.2.0.
🤖 Generated with Claude Code