Skip to content

feat(sleep): add revert command to rollback adopted proposals - #280

Open
RohithPariki wants to merge 1 commit into
microsoft:mainfrom
RohithPariki:feat/247-revert-command
Open

feat(sleep): add revert command to rollback adopted proposals#280
RohithPariki wants to merge 1 commit into
microsoft:mainfrom
RohithPariki:feat/247-revert-command

Conversation

@RohithPariki

Copy link
Copy Markdown
Contributor

Resolves #247

Implements the skillopt-sleep revert command to allow users to cleanly undo adopted proposals by restoring state from their immutable backups.

Changes

  • CLI: Added revert subcommand to skillopt_sleep/__main__.py, matching the adopt interface (--staging, --skill, --all-skills, --legacy).
  • Core: Added revert_skills and revert in skillopt_sleep/staging.py to restore original bytes safely.
  • Safety:
    • Reversion refuses to run if the live file has been locally modified since adoption (protects user's work).
    • Automatically unlinks files that were originally created during the adoption, leaving no orphaned files.
  • Testing: Added test_sleep_revert.py with idempotent behavior validation.

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.

skillopt-sleep: adopt() writes a backup that nothing can restore — add a revert command

1 participant