Repository navigation
test(backup): a restored store keeps its version chains and source links (#731, slice 5) - #984
Conversation
…nks (#731, slice 5) The #731 criterion "a consistent backup under concurrent writes, preserving source links and version chains" had no dedicated proof: the slice 4 test reads back one memory. Two tests now restore a SQLite store whose memories form a supersession chain written by supersede_atomic: once at rest (the restored rows equal the live rows), and five times while another thread keeps extending the chain. Every restored copy holds one chain with both directions of every link, a single head, and the source each version was written from. Refs #731 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYrcoSSQ9a5uRFL2DLD
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 2m 27s —— View job Review of PR #984 (review 1 of 3)
Summary: No Blockers. Three Notes, no action needed before merge:
Verdict: approve |
Review 1 of 3: PR #984The five reviews (code quality, performance, test coverage, documentation, security) are done. No Blockers. The tests use only Notes, no action before merge
Not run here: View job run |
Refs #731 (slice 5; the issue stays open, see "Still open").
Summary
Root cause.
The #731 criterion "a consistent backup under concurrent writes, preserving source links and version chains" had no dedicated proof. Slice 3 (#979) proved that a copy holds whole transactions; slice 4 (#983) reads back one memory and one wiki page. Nothing checked that the supersession chain (
supersedes_id/superseded_by_id) and each version'ssourcesurvive the backup and the restore.What.
Test only, no production change:
tests_py/handlers/test_backup_restore_lineage.py.test_a_chain_and_its_sources_are_restored_link_for_link: a liveSqliteMemoryStoreholds a chain of four versions written bysupersede_atomic; aftersnapshot_backupandrestore_backup, the restored rows (id, content, source, both link columns) equal the live rows.test_backups_taken_while_the_chain_grows_restore_one_whole_chain: five backups are taken while another thread keeps extending the chain. Each restored copy holds one chain: every link has its reverse, there is one head, the walk from the head back covers every row, and every version keeps its source. Restored sizes never decrease.Type of change
Tests only, no production change.
Test plan
pytest tests_py/handlers/test_backup_restore_lineage.py: 2 passed, 8 runs in a row (sizes seen in one run: 1, 6, 11, 15, 18 rows).pytest tests_py/handlers/test_backup_restore.py: 14 passed.ruff checkandruff format --checkon the new file: clean.scripts/check_craftsmanship.py: OK.Audit notes
Not verified:
Breaking changes
None.
Still open on #731
https://claude.ai/code/session_018kyZYrcoSSQ9a5uRFL2DLD
Generated by Claude Code