Skip to content

fix(cache): omit host paths from cache write errors (#3845) - #3849

Merged
EffortlessSteven merged 5 commits into
mainfrom
fix/cache-store-error-paths-3845
Sep 24, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
fix/cache-store-error-paths-3845

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Closes #3845. Contributes to #3795 control 6 and the cache-store failure-row privacy boundary.

Claim

Retained cache-write failures no longer contain absolute cache, destination, or temporary-file paths. Ordinary durable artifact writes keep their existing path-rich diagnostics.

Exact basis

base main: dc66cecc2fd8a2217e944f13723e53dac68e8f67
head:      75e0a484f47aaa2bbca30526ccf954e717610db8
regression merge: e62c7160d36848d2867c0e0ea1c75c47d8d5cc5e (#3837)

Implementation

crates/ripr/src/atomic_file.rs now gives the shared writer an explicit error-path policy:

write(...)       -> Include
write_cache(...) -> Omit

Every existing durable-write error retains the same wording and path placement. Cache-write errors retain the operation, caller-owned label, and underlying io::Error, but omit directory, destination, and generated temporary-file spellings before #3837 stores the message in a portable failure row.

No cache key, write algorithm, success path, sync policy, status label, classification, or canonical identity changes.

Discriminating controls added

  • cache directory-creation failure under a unique absolute sentinel root excludes the root, blocker, and destination;
  • cache final-publication failure after the temporary write excludes the root/destination;
  • the equivalent durable-write failure still contains the exact destination path;
  • equivalent directory failures under two different roots produce identical cache errors.

The fixtures use only owned temporary directories and do not depend on Unix permission denial or operator cache/home state.

Proof state

Not claimed as locally executed in this connector session: no Rust toolchain is available in the execution environment. The PR therefore relies on the repository's hosted checks and exact-head review before merge.

Expected focused commands:

cargo fmt --all -- --check
cargo test -p ripr --lib atomic_file -- --nocapture
cargo test -p ripr --lib analysis::seam_cache -- --nocapture
cargo clippy -p ripr --all-targets --all-features -- -D warnings
cargo xtask check-output-contracts
cargo xtask check-local-context
cargo xtask check-file-policy
cargo xtask check-pr
git diff --check

Review focus

  1. Cross-platform determinism of renaming a temporary file over an existing directory as the publish-failure fixture.
  2. Byte compatibility of write(...) diagnostics.
  3. Completeness: every write_with_sync error branch must use the path policy.
  4. No caller supplies host-specific data through the label argument.

Rollback and non-claims

Rollback is one-file and restores only cache error detail; it does not alter cache contents. This PR does not surface the #3837 rows, add retryability/error-class output, implement semantic reuse, or improve diff latency by itself.


Devin Review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 99b2884c-bd8c-49f2-a58e-2d0f43c943fa

📥 Commits

Reviewing files that changed from the base of the PR and between ed4b160 and 01e0a11.

📒 Files selected for processing (1)
  • crates/ripr/src/atomic_file.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exact-head review at 75e0a484f47aaa2bbca30526ccf954e717610db8.

I do not see a source-level blocker in this repair.

  • The path policy covers every error branch inside write_with_sync: directory creation, no-filename, temp create/write, permission preservation, fsync, and finalize.
  • write keeps Include, so durable artifact diagnostics retain their prior path placement.
  • write_cache alone selects Omit; the repository call sites use static labels (for example cache/fingerprint/file-fact cache families), so the label does not reintroduce a host path.
  • The directory-failure and finalize-failure controls exercise both pre-temp and post-temp failure positions; the durable-write counter-control guards against accidentally global redaction.
  • The equivalent-root assertion is appropriately root-portability proof, not a claim that platform-owned io::Error wording is cross-platform canonical identity.

Residual proof dependency: hosted Rust gates still need to establish that the finalize fixture behaves as expected on the routed platform and that formatting/clippy/full tests remain green.

Disposition from source review: REVIEW_COMPLETE_PENDING_HOSTED_PROOF.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reviewed_head_sha: fb2e4f8
integration_basis: dc66cec
claim_boundary: cache-writer diagnostics omit absolute directory/destination/temp paths while durable artifact-writer diagnostics remain path-rich

changed_surfaces_and_semantic_owners_inspected:

  • crates/ripr/src/atomic_file.rs
  • all default-branch atomic_file::write_cache call sites (cache, corpus fingerprint cache, and file-fact/cache families)
  • #3845 controls and #3795 equivalent-root/privacy boundary
  • follow-up commits 98126b2, 2c0c15b, and fb2e4f8

blocking_findings: none

review_findings:

  • ErrorPathPolicy is applied to every error-producing branch in write_with_sync: parent creation, missing filename, temp creation/write, permission preservation, fsync, and final rename.
  • write(...) selects Include; for that path the new format strings reproduce the old spaces and path placement, preserving durable artifact diagnostics.
  • write_cache(...) alone selects Omit; current callers pass static operation labels, so the label does not reintroduce a checkout/cache path.
  • the directory and final-publication fixtures discriminate failures before and after temp creation; the durable-write fixture prevents accidental global redaction; the equivalent-root fixture proves same-platform root portability.
  • the three commits after the initial source review change only rustfmt ordering/wrapping and replace repository-denied expect_err calls with explicit let Err(...) else; they do not alter the production path policy.

proof_observed:

  • PR Plan: success at this head
  • Security: success at this head
  • formatting preflight on the preceding run passed after the first repair

proof_pending:

  • current-head Routed Rust Small Rust gates are still in progress
  • current-head ub-review is still in progress
  • Windows advisory is not routed for this one-file change, so this review does not claim a native Windows fixture run

residual_assumptions_and_non_claims:

  • platform-owned io::Error text is retained and is not claimed to be byte-identical across operating systems; the claim is that repository/cache path spellings introduced by this writer are omitted
  • this repair does not surface store-failure rows, add retryability/error taxonomy, or improve diff latency

disposition: REVIEW_COMPLETE_PENDING_CURRENT_HEAD_HOSTED_PROOF

@EffortlessSteven EffortlessSteven added release-check Run package, publish dry-run, VSIX, server archive, and release-readiness proof. tooling labels Sep 22, 2026 — with ChatGPT Codex Connector

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reviewed_head_sha: 01e0a11
integration_basis: ed4b160
claim_boundary: cache-writer diagnostics omit absolute directory/destination/temp paths while durable artifact-writer diagnostics remain path-rich

currentness reconciliation:

  • head advanced only by merge commit 01e0a119, parents fb2e4f80681cb52cdd883f1c2690869acb1a29d8 and protected main ed4b160c297ec00e7c1a42b07c78447f40a285ce
  • the PR-relative patch remains exactly one changed file, crates/ripr/src/atomic_file.rs
  • no conflict or semantic interaction is visible with the newly merged target-affinity reverse-index work on main

changed_surfaces_and_semantic_owners_inspected:

  • current PR patch for crates/ripr/src/atomic_file.rs
  • all error-producing branches in write_with_sync
  • current default-branch write_cache labels/callers
  • #3845 and #3795 privacy/equivalent-root controls

blocking_findings: none

review_findings:

  • write(...) retains path-rich diagnostics with byte-compatible spacing/path placement through ErrorPathPolicy::Include
  • write_cache(...) alone selects Omit, covering directory creation, missing filename, temp create/write, permission preservation, fsync, and finalize errors
  • current cache callers supply fixed operation labels, so the label does not reintroduce a host path
  • tests discriminate pre-temp and post-temp failures, durable-write non-regression, and same-platform equivalent-root behavior
  • the protected-main merge does not alter the production implementation or test oracle

proof_observed_at_this_head:

  • Security: success
  • PR Plan: success

proof_pending_at_this_head:

  • Routed Rust Small required gate is queued
  • broader CI is running
  • ub-review is running
  • Windows Advisory is skipped, so this review does not claim native Windows execution

residual_assumptions_and_non_claims:

  • retained platform-owned io::Error wording is not claimed cross-platform canonical; repository/cache path spellings introduced by this writer are removed
  • this repair does not surface the rows, add retryability/error taxonomy, or improve diff latency

disposition: REVIEW_COMPLETE_PENDING_CURRENT_HEAD_HOSTED_PROOF

Copy link
Copy Markdown
Member Author

Fresh protected-main integration

Merged current protected main (ed4b160c297ec00e7c1a42b07c78447f40a285ce) into this branch without rewriting history.

new head: 01e0a119ae21a063dd517fa7261ee18a05d77fcc
parents:  fb2e4f80681cb52cdd883f1c2690869acb1a29d8
          ed4b160c297ec00e7c1a42b07c78447f40a285ce

The clean merge tree uses protected-main bytes plus this PR's crates/ripr/src/atomic_file.rs; #3839's target-affinity index is therefore included rather than bypassed. Fresh required checks are running at the merge head. No merge recommendation until the new Ripr Rust Small Result is green.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review (exact head 75e0a48)

Surfaces: crates/ripr/src/atomic_file.rs only (+161/-16).

  • Stimulus/oracle: four new tests discriminate the policy — cache dir-creation failure, cache finalize failure, durable finalize control retaining the path, and equal-errors-across-roots determinism. Fixtures use owned temp dirs, no Unix-permission or operator-state dependence; the rename-over-directory failure mode is cross-platform.
  • Completeness: every write_with_sync error branch (create_dir_all, file_name check, File::create, write_all, set_permissions, fsync, rename) routes through error_path_policy; no branch leaks a path under Omit.
  • Byte compatibility: write(...) keeps ErrorPathPolicy::Include, so durable diagnostics are unchanged; only cache (write_cache) drops directory/destination/temp spellings while keeping label and io::Error.
  • Validation: published-head required check Ripr Rust Small Result green; mergeStateStatus=CLEAN; Devin review reported no issues.

Residuals: none blocking. Non-claim: does not surface the #3837 rows or add retryability output, per PR body.

Disposition: REVIEW_READY, merging by squash.

@EffortlessSteven
EffortlessSteven merged commit e375575 into main Sep 24, 2026
24 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/cache-store-error-paths-3845 branch September 24, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-check Run package, publish dry-run, VSIX, server archive, and release-readiness proof.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cache): keep retained store failures free of absolute host paths

1 participant