Skip to content

feat(editor,editormcp): persistent per-turn checkpoints under .nsgo/checkpoints and History panel - #1224

Open
houko wants to merge 1 commit into
mainfrom
feat/editor-turn-checkpoints-1018
Open

houko wants to merge 1 commit into
mainfrom
feat/editor-turn-checkpoints-1018

Conversation

@houko

@houko houko commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Closes #1018

Summary

  • Persistent per-turn checkpoints under .nsgo/checkpoints/:
    • Records every project file's pre-turn bytes before an agent turn first writes it (BeginAgentTurn / RunAgentTurn, RecordCheckpointFile, WriteAgentFile, DeleteAgentFile, History.beforeExecute, and automatic wrapping of editormcp ActionEdit calls)—covering scenes, prefabs, data tables, game.yaml, Go code, and verbatim binary media alike.
    • Stores a strict versioned YAML manifest (manifest.yaml, editor.CheckpointVersion = 1, JSON Schema checkpoint.v1.json) per checkpoint alongside raw saved files under files/<path>, writes .gitignore files automatically, and enforces a configurable byte cap (Editor.CheckpointMaxBytes, defaulting to 128 MiB) that drops the oldest completed checkpoints.
    • Autonomous tasks (TakeCheckpointBeforeTask, RunTaskWithCheckpoint) and automations (TakeCheckpointBeforeAutomation, RunAutomationWithCheckpoint, game_playtest, and automation-registered MCP edit tools) always persist a checkpoint before they start.
  • Project History panel (⌘Y) with read-only preview and one-step undoable Restore:
    • HistoryPanelView (Spec Dark & Light tokens matching Checkpoints.dc.html and Spec.dc.html) lists persisted checkpoints reloaded on OpenProject alongside current-session edits and Git milestones, grouped by day with All / You / Agent filters.
    • Clicking an entry previews its scene read-only in the viewport (Previewing … · editing is off; Esc or Now exits preview) without mutating Doc or History.
    • Clicking Restore (RestoreCheckpoint) atomically restores all touched files on disk, reloads open tabs and game.yaml, and records the restore as one undoable fallibleCommand so Undo (⌘Z) puts the entire turn back byte-for-byte.
  • MCP tools & docs:
    • Added checkpoint_list (ActionRead) and checkpoint_restore (ActionEdit) in editormcp.
    • Updated docs/en/{editor,formats}.md, docs/zh/{editor,formats}.md, apps/website/public/schemas/checkpoint.v1.json, changelog.d/editor-turn-checkpoints-1018.md, and .agents/notes/implemented/feature/2026-11-26-editor-turn-checkpoints.md.

Verification

  • env -u GOROOT go run ./cmd/gameschema -check
  • env -u GOROOT go tool nsgo check ./editor, ./editor/editormcp, ./editor/editorcmd (desktop & -target ios)
  • env -u GOROOT TMPDIR=/tmp go tool nsgo test ./editor/editormcp (39/39 passed)
  • env -u GOROOT TMPDIR=/tmp go tool nsgo test ./cmd/gameschema (24/24 passed)
  • env -u GOROOT TMPDIR=/tmp go tool nsgo test -run TestFormatsPage . (passed)
  • env -u GOROOT TMPDIR=/tmp go tool nsgo test on ./editor checkpoint, history, format conformance, locale, shortcut, command, save/revert, disk watch, and regression suites (all passed)
  • env -u GOROOT TMPDIR=/tmp go tool nsgo test -target macos -run TestHistoryCheckpointsMacOSScreenshots ./editor/editorcmd (real macOS screenshots captured and visually verified for Dark preview, Dark restored, and Light preview)
  • bun run verify-notes & env -u GOROOT go run ./tools/changelog check

@github-actions github-actions Bot added enhancement New feature or request size/XL documentation Improvements or additions to documentation pkg/cmd pkg/editor area/website pkg/game area/agents conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-turn-checkpoints-1018 branch 3 times, most recently from 6bb8596 to 863a23c Compare November 26, 2026 11:37
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-turn-checkpoints-1018 branch from 863a23c to 138e5fb Compare November 26, 2026 12:00
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-turn-checkpoints-1018 branch 2 times, most recently from 170a128 to 43dd6ff Compare November 26, 2026 12:36
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-turn-checkpoints-1018 branch from 43dd6ff to b2e4f01 Compare November 26, 2026 12:48
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents area/website conflict Conflicts with the target branch; resolve before merging documentation Improvements or additions to documentation enhancement New feature or request pkg/cmd pkg/editor pkg/game size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: a checkpoint of every file an agent turn touches, kept across sessions and restorable from History

1 participant