Scrub forgotten data and migrate SQLite stores to schema 7 #63
No reviewers
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:fire
svd:go
svd:hold
svd:respec
svd:skip
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/people-mind-mcp!63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/svd-dev-people-mind-mcp-54-forget-scrub-the-database-fil-e6d768fb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Forget now erases the forgotten Person's values from the store's database file, purges their addresses from the legacy pending checkpoint, and deletes derived Organisations that only they used (ADR 0003 Amendment 1, rules 1, 2, 4 and 5).
No application checkpoint and no per-Forget
VACUUMin production code. Litestream owns checkpointing. The legacy fetch-failure race inrun_passis out of scope (#59). Restore-safe Tombstones stay with #55.Evidence
test_identity.pyasserted the orphaned Organisation remained.test_writer_migrates_v6_store_to_v7_scrubbing_freed_pages: a schema-6 store written with explicitsecure_delete=OFFmigrates to 7, and a marker present in the file before the migration is gone after it.test_c08_concurrent_forget_suppresses_staged_queued_late_and_replayed: after a test-runwal_checkpoint(TRUNCATE), the forgotten address bytes are absent from the db file.test_forget_purges_legacy_pending_checkpoint[True|False]: the decoded checkpoint holds none of the forgotten addresses.test_forget_removes_only_orphaned_derived_organisations: the orphan goes; one shared by a Handle of another Person, one another Person relates to, and one with an alias all stay.make check: 387 passed, 5 skipped, 4 deselected.Merge Danger
Door: one-way
Schema 7 is a forward migration. Older binaries refuse a schema-7 store, so a rollback needs a pre-migration backup. Forget deletes are irreversible by design.
Blast Radius: store
The first writer open after deploy runs one
VACUUMover the whole live database, under Litestream replication.Post-deploy checklist (operator)
The one-time
VACUUMwas not measured on a production-sized store (architect ruling: a post-deploy check, not a merge gate). After the first deploy:peoplemind check --config /etc/peoplemind/config.tomlprintsstore=ok schema=7./healthz/syncok, against the db file size.make test-integration(container deployment tests, including theschema=7restore check) runs on a container-capable host; integrate did not run it.Closes #54
🤖 Generated with Claude Code
Co-Authored-By: gpt-6.1-sol noreply@openai.com