00565796e5
Review of #7 found the swap could corrupt or lose the database: the move of the live database out of the way was unchecked, so if it failed the next move put the new database *inside* the old directory and still reported success; the restore was unchecked too, and the `rm -rf "$TMP"` that followed could then delete the only remaining copy. All three are real. The root cause was doing the critical swap across filesystems, where a move is a copy that can half-finish. install_tracker() removes the class instead of patching the cases. The staged copy is brought alongside the live one first, so every step after that is a same-filesystem rename: it either happens or it does not. The previous database is removed only once the new one is in place, and every move is checked, with a loud message if a restore fails and leaves it parked. The caller collapses to one condition, which also removed a duplicated pair of warning branches. Proved rather than asserted, since this block has now been wrong twice. `mv` was stubbed to fail at each point in turn: - old-move fails -> rc=1, live database intact, no nesting, no leftovers - final rename fails -> rc=1, live database restored, no leftovers - missing source -> rc=1, live database intact A first attempt at the third case used chmod, which proves nothing as root; the stub is what actually exercises the path. The transient .incoming/.previous directories are gitignored so a crash mid-swap cannot leave untracked noise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DyHK7L8S1XDX3EihTnSKaX
41 lines
704 B
Plaintext
41 lines
704 B
Plaintext
target/
|
|
*.autosave
|
|
.DS_Store
|
|
/result
|
|
.direnv
|
|
[#]*
|
|
symbols.json
|
|
profile.json
|
|
profile.json.gz
|
|
bench/*.txt
|
|
|
|
# Added by git-smart-commit
|
|
*.patch
|
|
*.improv
|
|
!examples/*.improv
|
|
|
|
# Beads / Dolt files (added by bd init)
|
|
.dolt/
|
|
*.db
|
|
.beads-credential-key
|
|
.sqlhistory
|
|
backup.jsonl
|
|
|
|
# Added by git-smart-commit
|
|
*.swp
|
|
proptest-regressions/
|
|
.cursor
|
|
.claude/worktrees/
|
|
*~
|
|
/roadmap.html
|
|
|
|
# prolog-mcp session files (server writes ./prolog-sessions relative to cwd)
|
|
# ...except the checked-in seed knowledge base, which agents load at session start.
|
|
prolog-sessions/*
|
|
!prolog-sessions/kb.pl
|
|
|
|
# Beads runtime locks (bd creates these next to .beads/)
|
|
*.gate.lock*
|
|
.beads/embeddeddolt.incoming/
|
|
.beads/embeddeddolt.previous/
|