Skip to content

Enable Task Checkpointing and ReversionΒ #9

@marutilai

Description

@marutilai

🧩 Feature Request


πŸ” Summary

Enable task-level checkpointing and rollback to improve safety while experimenting.


βœ… Expected Behavior

Users can create checkpoints for tasks and revert to any previous checkpoint, similar to git revert but scoped to task states.


πŸ’‘ Suggested Fix (if any)

  • Maintain a history of checkpoints for each completed task.
  • Provide a way to revert a task to any prior checkpoint (irreversible rollback).
  • Implement task-level reversion behavior inspired by git revert.

πŸ”— Relevant Files / Code

  • Possibly modules handling task state, history, and mutation control.

βœ… Snapshot Command Definitions


/snapshot-create <message>

  • Description: Saves a snapshot of the current task state.
  • Behavior:
    • Auto-increments snapshot number: e.g., snapshot-0, snapshot-1, …
    • Stores a copy of all modified, newly added, or deleted files compared to the last snapshot (or initial state).
    • Associates the snapshot with the provided <message> (e.g., "Before refactoring parser").
    • Does not store diffs β€” full file contents are saved for simplicity and reliability.

/snapshot-restore <number>

  • Description: Restores the repo to the state of the specified snapshot.
  • Behavior:
    • Replaces or removes files based on the snapshot’s contents.
    • Unstaged/unrelated files are left untouched unless in conflict.
    • Writes to a restore log for traceability (e.g., .snapshots/restore.log).

/snapshot-list

  • Description: Lists all existing snapshots with their:
    • Snapshot number
    • Message
    • Timestamp

πŸ“¦ Storage Strategy

  • The first snapshot (snapshot-0, located at .katalyst/snapshot-0/) duplicates the entire repo.
  • Subsequent snapshots (.katalyst/snapshot-X/) only include:
    • Full copies of new or modified files
    • Metadata for deleted files

βœ… Additional Notes

  • File comparisons are based on content hashes or timestamps β€” not diffs.
  • Restoring a snapshot does not auto-create a backup unless explicitly invoked.
  • Simple to implement, safe to use, and resilient to file-level corruption or drift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfutureFeatures planned for a future release. Not urgent. Nice to have.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions