Make sensitive rewrites and prune cleanup atomic#129
Conversation
Stage output database copies until redaction completes so failures preserve any existing destination. Wrap PII entry rewrites in a single transaction, defer prune filesystem deletion until after commit, and retain external files still referenced by surviving blobs. Add regressions for rollback, publication failure, overwrite, and shared external paths.
|
@codex review |
Recursive review summaryBlockersNone. Must-fix
Nice-to-haveNone. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e987692da9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Propagate SQLite decoding errors while protecting surviving external blob paths so malformed databases roll back before filesystem deletion. Clean rollback-journal sidecars with staged databases and add regressions for both cases.
|
Addressed the must-fix finding in stacked PR #130: #130 Prune now propagates surviving-path decoding failures and rolls the transaction back before filesystem deletion. The regression reproduces a dynamically typed SQLite |
Back up an existing destination database and its SQLite sidecars as a recoverable set before publishing staged output. Move orphaned-blob cleanup into the PII and redact transactions so cleanup errors roll back every logical rewrite. Add restore, replacement, and cleanup-failure regressions.
Simulate a failed final rename and verify the prior destination database and every SQLite sidecar are restored without leaving a backup directory.
Propagate malformed entry hashes, orphan blob hashes, and pruned external paths instead of silently skipping them. Add regressions proving malformed pruned paths and entry hashes roll back the import transaction.
Fail closed on every prune row decode
Fail closed on malformed prune paths
Summary
Validation
cargo test --all-features --locked(201 passed)cargo clippy --all-features --all-targets --locked(passes; existing warnings only)cargo check --no-default-features --lockedcargo check --no-default-features --features parquet --lockedgit diff --checkContext
Addresses the must-fix findings from the recursive review of #128: #128 (comment)
Stacked on #128 so the original security-hardening PR remains unchanged.