feat(e2): make plan and state loading non-destructive#227
Open
agustif wants to merge 1 commit intopeteromallet:mainfrom
Open
feat(e2): make plan and state loading non-destructive#227agustif wants to merge 1 commit intopeteromallet:mainfrom
agustif wants to merge 1 commit intopeteromallet:mainfrom
Conversation
This was referenced Mar 4, 2026
5cd3f92 to
0674092
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Epic #208 and sub-issues #215 #216 #217 #218.
This PR removes destructive load-time fallback behavior for
plan/statepersistence and adds explicit safety controls.What Changed
1) Explicit persistence safety errors
PersistenceSafetyErrorfor deterministic persistence failures.DLP_PERSISTENCE_PLAN_*DLP_PERSISTENCE_STATE_*2) Quarantine snapshot recovery path
*.quarantine.*.jsonsnapshot with:3) Future schema guard
--allow-unsafe-coerce4) Non-destructive malformed-section handling
_load_quarantinerather than silently dropping data.5) Save-path hardening
save_plan/save_statenow block writes when_unsafe_load_reasonsexists.--allow-unsafe-coerce(manual recovery workflow).6) Runtime + CLI wiring
allow_unsafe_coerce.--allow-unsafe-coerce.Test Coverage Added/Updated
desloppify/tests/plan/test_persistence_safety.pydesloppify/tests/state/test_state.pyTest Evidence
Executed with local venv (
.venv):python -m pytest desloppify/tests/plan/test_persistence_safety.py desloppify/tests/state/test_state.py -q66 passedpython -m pytest desloppify/tests/plan/test_schema_migrations.py desloppify/tests/state/test_state_internal_direct.py desloppify/tests/core/test_runtime_state.py desloppify/tests/core/test_config.py -q54 passedpython -m pytest desloppify/tests/commands/test_cli.py -q97 passedpython -m compileall -q desloppifyTracking
Parent program: #206