fix: preserve CAS integrity and recover missing chunks - #14
Conversation
Apply rustfmt changes reported by the first CI run to the new regression tests.
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e309d43ddc
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77060e9af6
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a380603d76
ℹ️ 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".
|
@codex review Please review the current head |
|
@codex review Please re-review the current final head |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
First implementation batch from the maintainer-requested HyperTide engineering review: harden CAS publication and recovery, reconcile chunk metadata with physical storage, repair stacked-PR CI coverage, and document a prioritized improvement plan.
Stacked on #13, which is stacked on #12. Existing upstream work is preserved and is not attributed to this PR.
mainhas not been modified, and nothing has been merged or deployed.Engineering review and improvement plan
Findings fixed
temp/<hash>, permitting truncation and shared-inode mutation around publication.create_new; handles are released before publication and each operation cleans only its own staging file.ReplaceFileWfor an existing Windows destination; version-state persistence uses the same helper.storage.existsbefore combining metadata/content presence.symlink_metadatabefore open, reject non-regular entries, then recheck the opened handle before hashing.main, so stacked PRs did not receive equivalent checks.TRUSTED_PROXY_CIDRS.Public API payloads, database schemas, CAS identities, and the object layout remain unchanged. No dependency was added.
Verified results
Final reviewed head:
4b14a6605a647b87c56ecf4ea40a75e0128e0c9f.GitHub Actions CI run 35483872323 checked this PR head against base
7812c58c71c201c765bac098a87f5d0871115961.cargo check --workspacecargo fmt --all -- --checkcargo clippy --workspace -- -D warningscargo test --workspacewindows-latest: 6/6 targeted testsWindows verification explicitly executed and passed both:
store_repairs_same_size_corruptionstore_repairs_wrong_size_corruptionThe Linux test run also explicitly passed:
fifo_object_path_is_rejected_before_read_openstorage_errors_propagate_even_when_chunk_is_unindexedexists_and_retrieve_reject_fifo_object_entriesThe PR now contains thirteen review-driven regression tests across CAS publication/repair and chunk reconciliation. The chunk unit tests use real temporary storage plus an injected metadata index; PostgreSQL-backed HTTP reconciliation remains follow-up coverage. The concurrency test uses independent managers in one process rather than separate OS processes.
Follow-up plan and limits
The committed review report defines four follow-up phases:
Additional restore hardening remains useful: verify archive checksums before extraction, make SQL restore errors unambiguously fail the operation, and seed/verify non-empty datasets in restore tests.
Deduplication now spends sequential read bandwidth to verify content. Overall transfers remain buffered. Missing-chunk reconciliation is a presence check, not a complete integrity scrub. Normal return paths clean private staging files; cancellation or process termination can still leave orphans. This PR does not implement multi-file workspace transactions or a complete power-loss durability model.
After #12/#13 integration, the PR target and final integrated checks should be reconfirmed, especially if upstream changes are squash-merged. No automatic merge is enabled.
Checklist
mainpreservedwindows-latest