-
Notifications
You must be signed in to change notification settings - Fork 7
fix: recover progress from a last-known-good state backup #45
Copy link
Copy link
Open
Labels
area: coreCore workspace, manifest, state, and runner behaviorCore workspace, manifest, state, and runner behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026help wantedExtra attention is neededExtra attention is neededsize: MMedium, self-contained contributionMedium, self-contained contribution
Description
Metadata
Metadata
Assignees
Labels
area: coreCore workspace, manifest, state, and runner behaviorCore workspace, manifest, state, and runner behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026help wantedExtra attention is neededExtra attention is neededsize: MMedium, self-contained contributionMedium, self-contained contribution
Motivation
Progress is valuable to a learner. The current recovery path renames a corrupt primary state file onto
state.json.bak, which can overwrite the only valid recovery point and then starts fresh instead of attempting recovery.Current evidence
pythonlings/core/state.py::load()renames an unreadablestate.jsontostate.json.bakand returns fresh state.docs-site/faq.mddescribes where progress lives and needs to match the recovery contract.Exact scope
Maintain a valid last-known-good
.pythonlings/state.json.bak, recover it when the primary state is corrupt, and quarantine bad primary data without overwriting the backup. Align FAQ wording and tests with the final behavior.Acceptance checklist
Explicit exclusions
Do not add cloud sync, change the state format version, delete corrupt data automatically, or alter unrelated workspace migration behavior.
Likely files
pythonlings/core/state.pytests/unit/test_state.pydocs-site/faq.mdVerification
Manually corrupt a primary state after creating valid progress and confirm the recovered progress is visible without overwriting
state.json.bak.Sprint coordination
See the sprint Discussion. This issue is unassigned and is not a reservation.