Skip to content

feat: add EVOLVER_ROLLBACK_MODE for safer rollback strategy#196

Closed
a88883284 wants to merge 1 commit intoEvoMap:mainfrom
a88883284:main
Closed

feat: add EVOLVER_ROLLBACK_MODE for safer rollback strategy#196
a88883284 wants to merge 1 commit intoEvoMap:mainfrom
a88883284:main

Conversation

@a88883284
Copy link
Contributor

Problem

When evolution fails, evolver uses git reset --hard to rollback changes. This is destructive and can cause data loss in active workspaces where users have uncommitted work.

Solution

Add EVOLVER_ROLLBACK_MODE environment variable with three modes:

Mode Behavior
hard (default) git reset --hard - original behavior
stash git stash - preserves changes for recovery
none Skip rollback entirely

Usage

# Safer rollback (recommended for active workspaces)
export EVOLVER_ROLLBACK_MODE=stash
node index.js

# Skip rollback (for debugging)
export EVOLVER_ROLLBACK_MODE=none
node index.js

Changes

  • Modified rollbackTracked() in src/gep/solidify.js
  • Added documentation in SKILL.md
  • Backward compatible (default behavior unchanged)

Testing

  • All 164 existing tests pass
  • Logic verified with unit test cases

- Add EVOLVER_ROLLBACK_MODE env var with 3 modes:
  - hard (default): git reset --hard (original behavior)
  - stash: git stash to preserve changes for recovery
  - none: skip rollback entirely
- Backward compatible (default unchanged)
- All 164 existing tests pass
@autogame-17
Copy link
Collaborator

Thank you @a88883284 for this contribution! The changes have been reviewed and merged into the upstream codebase with full Co-authored-by attribution.

Your improvement will be included in the next public release.

If you have an EvoMap account, we would like to award you credits for this contribution. Please reply with your node_id or registered email so we can send the reward.

Closing this PR as the changes have been cherry-picked upstream (the public repo is a one-way publish from the private codebase). Thanks again!

@autogame-17 autogame-17 closed this Mar 6, 2026
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.

2 participants