Skip to content

Fix evolve state mismatch on evolution failure and preserve manual build rollback ability after AI change rollback#40

Draft
Cas Linden (CasLinden) wants to merge 1 commit intomainfrom
cas/fix-lingering-evolve-on-rollback
Draft

Fix evolve state mismatch on evolution failure and preserve manual build rollback ability after AI change rollback#40
Cas Linden (CasLinden) wants to merge 1 commit intomainfrom
cas/fix-lingering-evolve-on-rollback

Conversation

@CasLinden
Copy link
Copy Markdown
Contributor

@CasLinden Cas Linden (CasLinden) commented Apr 22, 2026

Summary

  • Introduces manual_rollback_store_path to keep "Undo last build" available on ManualCommit across AI evolution/rollback cycles, independent of the AI rollback path
  • Fixes post-AI-rollback routing back to ManualCommit by anchoring the rollback snapshot to the live nix path and a recorded changeset at adoption time
  • Fixes restore_after_failure passing empty changes to state recomputation and leaving evolution-specific fields behind on fresh failure

Test Plan

Preserve rollback
Make a manual change, build it.
Try evolving, -> discard -> can still roll back build

Failed evolution
Make a manual change
Enter a prompt -> cancel before it finishes
Repo changes are restored, ~/Library/Application\ Support/com.darkmatter.nixmac/evolve-state.json -> reflects manual not evolve.
Caveat: this takes a watcher tick to fully resolve. Evolution errors do not return new evolve state object on failure. They pretend like nothing ever changed, which is good, but also why this fell through and was hard to find/fix.

Docs

  • [] TODO: might add this to the manual test flow

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Fails
🚫

This PR touches behavior-sensitive code that is documented in darkmatter/nixmac-web. Please either:

  • Open a companion docs PR and check Docs updated in the PR description, or
  • Check No docs update needed if the change doesn't affect user-facing behavior.
Warnings
⚠️ Please assign this PR to someone (usually yourself).

📋 PR Overview

Lines changed 138 (+98 / -40)
Files 0 added, 9 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

Generated by 🚫 dangerJS against 48c5243

@CasLinden Cas Linden (CasLinden) force-pushed the cas/fix-lingering-evolve-on-rollback branch from 9faeb8a to 48c5243 Compare April 23, 2026 09:16
@CasLinden Cas Linden (CasLinden) deleted the cas/fix-lingering-evolve-on-rollback branch April 23, 2026 09:38
@CasLinden Cas Linden (CasLinden) restored the cas/fix-lingering-evolve-on-rollback branch April 23, 2026 09:38
@CasLinden Cas Linden (CasLinden) marked this pull request as draft April 24, 2026 05:49
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