v0.21.0-alpha — managed backups dir + auto-save fix
A fix-and-cleanup release for the pre-execution recovery snapshots that execute_code writes before running generated code. Prompted by a contributor bug report (@FairlyInconspicuous) and a design proposal (@3dyuval).
Changed
- Recovery snapshots now live in a managed backups dir (#46) —
_auto_savewrites the pre-execution snapshot toCONFIG_DIR/backups/<name>.<hash>.ai-backup.FCStdinstead of dropping an.ai-backup.FCStdfile beside the user's document. The project folder stays clean; each source path maps to one stable, hash-tagged file that is overwritten in place (collision-safe across same-named documents in different folders).
Added
max_backupsconfig knob (#46, JSON-only) — count cap for the recovery snapshots inCONFIG_DIR/backups, pruned via the sharedprune_oldest_fileshelper (also honours the existingmax_retention_age_days). Defaults to0(keep all) to preserve prior behavior on upgrade; growth is naturally bounded since each document reuses one file. Recommended value for a hard cap:50.
Fixed
- Auto-save no longer compounds
.FCStdonto the document filename (#44, thanks @FairlyInconspicuous) —_auto_saverebuilt the document path by string-editing the name FreeCAD'ssaveAshad already mutated, leaving a trailing.FCStdand growing the filename by one extension on everyexecute_codecall (and littering the folder with never-reused snapshots). It now captures and restores the original path verbatim. Ships with unit-lane regression coverage.
Follow-up: restore-from-backup (surfacing these snapshots after a crash) is tracked in #49.
Full changelog: https://github.com/ghbalf/freecad-ai/blob/master/CHANGELOG.md