governance: retain lineage_event skeleton on SQLite erase (SEC-016 parity) - #300
Conversation
…16 parity) On user-data erase, SQLite hard-DELETEd lineage_event rows referencing erased entities, while Supabase retains the content-free lineage skeleton (never touches lineage_event — it's in neither the purge nor delete set; #219/#383 content-purge design). Converge: stop deleting. lineage_event has no PII/content column, no FKs, no FTS/vec, so retaining is safe and reconstruction is helped. Removed the delete block + now-dead erased_entity_ids/request_ids/import json. Inverted the test that codified count==0 to assert the skeleton is retained (==1).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe governance erase execution logic in the SQLite storage mixin no longer deletes ChangesLineage retention on governance erase
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
SEC-016 — cross-backend GDPR-erase parity on
lineage_event. On user-data erase, SQLite hard-DELETEdlineage_eventrows referencing erased entities, while Supabase retains the content-free lineage skeleton (its erase path never enumerateslineage_event— it's in neither the purge nor the delete set; the #219/#383 content-purge design keeps a content-free skeleton and purges PII on the entity tables). This converges SQLite onto the intended model.Change
lineage_eventon erase (sqlite_storage/governance/_erase_execution.py). Safe becauselineage_eventhas no PII/content column, no foreign keys, no FTS/vec shadow tables — retaining the row is exactly the content-free skeleton the design intends, and lineage reconstruction is helped (the retainedstatus_changesignal survives). Removed the delete block + now-deaderased_entity_ids/request_ids/import json. Entity-table deletes +purge_contentcalls are untouched.test_governance_storage.py):test_apply_governance_user_data_delete_retains_lineage_skeletonnow asserts the pre-seeded skeleton row still exists (== 1) after erase, instead of== 0.Note on scope
The retained values are opaque surrogate IDs (
profile_id/request_id/entity_id) in a content-free table — this matches the already-shipped Supabase behavior, so this is a convergence, not a new retention decision. (If those internal IDs should ever be treated as PII, that's a separate cross-backend change requiring Supabase to scrub too.)Verification
governance/erase/lineage/purgetests: 473 passed; full sqlite storage suite: 390 passed; ruff + pyright clean.Summary by CodeRabbit
Bug Fixes
Tests