Skip to content

feat(checkpoint): add canonical restore manifest guard - #5

Draft
luoye520ww wants to merge 4 commits into
developfrom
feat/checkpoint-restore-manifest-canonical
Draft

feat(checkpoint): add canonical restore manifest guard#5
luoye520ww wants to merge 4 commits into
developfrom
feat/checkpoint-restore-manifest-canonical

Conversation

@luoye520ww

@luoye520ww luoye520ww commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Partial implementation for the rejected KunAgent#696 checkpoint restore-manifest/canonical-path replacement.

Problem

The previous rejected work failed around macOS canonical paths, especially raw comparisons of /var/folders/... and /private/var/folders/....

Changes implemented

  • Added src/main/services/git-checkpoint-manifest.ts with:
    • GitCheckpointManifestV1
    • canonical path helper using realpath()
    • manifest construction from metadata-like input
    • expected restore context validation for thread/workspace
  • Added focused tests for canonical manifest helper behavior.
  • Removed the non-code .kun/review-plans file from this PR scope.

Still required before this PR is reviewable

  • Integrate manifest.json write/read into src/main/services/git-checkpoint-service.ts.
  • Keep metadata.json compatibility for legacy checkpoints.
  • Extend restore params/IPC schema with expected context if upstream wants that guard exposed.
  • Add destructive-restore tests that prove wrong thread/workspace is rejected before git reset/clean.
  • Add explicit macOS /var vs /private/var fixture or mock-realpath regression.

Validation to run locally

npm run typecheck
npm test

I could not run local commands from this environment, so this remains draft.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant