Skip to content

Fail closed on malformed prune paths#130

Merged
brucehart merged 5 commits into
pr-128-feedbackfrom
pr-129-feedback
Jul 13, 2026
Merged

Fail closed on malformed prune paths#130
brucehart merged 5 commits into
pr-128-feedbackfrom
pr-129-feedback

Conversation

@brucehart

@brucehart brucehart commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • propagate SQLite type/decoding errors while collecting external paths referenced by surviving blobs
  • roll back prune before filesystem deletion when an untrusted database contains malformed path values
  • back up an existing destination database and all SQLite sidecars as a recoverable set before staged publication
  • keep PII and general redaction orphan cleanup inside their mutation transactions
  • clean rollback-journal sidecars alongside WAL and SHM files
  • add regressions for malformed paths, destination restore/replacement/install failure, sidecar cleanup, and orphan-cleanup rollback

Validation

  • cargo test --all-features --locked (212 passed)
  • cargo clippy --all-features --all-targets --locked (passes; existing warnings only)
  • cargo check --no-default-features --locked
  • cargo check --no-default-features --features parquet --locked
  • git diff --check

Context

Addresses recursive review feedback on #129:

Stacked on #129.

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.
@brucehart

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abd0db304a

ℹ️ 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".

Comment thread src/commands/prune.rs
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.
@brucehart

Copy link
Copy Markdown
Owner Author

@codex review

Simulate a failed final rename and verify the prior destination database and every SQLite sidecar are restored without leaving a backup directory.
@brucehart

Copy link
Copy Markdown
Owner Author

@codex review

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.
@brucehart

Copy link
Copy Markdown
Owner Author

Addressed the remaining fail-open prune finding in stacked PR #131: #131

All three prune row-decoding passes now propagate malformed SQLite values before commit. New regressions cover a BLOB-typed external path on the blob being pruned and a BLOB-typed entry hash; both preserve the import and database/filesystem state. Full validation passes (214 tests).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 3a8b4b7e2c

ℹ️ 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".

Fail closed on every prune row decode
@brucehart
brucehart merged commit 0161ad4 into pr-128-feedback Jul 13, 2026
4 checks passed
@brucehart
brucehart deleted the pr-129-feedback branch July 13, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant