Skip to content

lance-graph-hydrate: merge hydrate_dir/hydrate_file staging bodies - #959

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/hydrate-staging-merge
Aug 17, 2026
Merged

lance-graph-hydrate: merge hydrate_dir/hydrate_file staging bodies#959
AdaWorldAPI merged 1 commit into
mainfrom
claude/hydrate-staging-merge

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

  • Closes ISS-HYDRATE-DIR-AND-FILE-DUPLICATE-THEIR-STAGING-BODIES, filed by the 2026-08-17 5+3 hardening council (5+3 council: harden lance-graph-hydrate (fast-follow to merged #957) #958) and deliberately deferred there — the council judged the uniqueness fix (staging_suffix) worth landing immediately and this larger merge worth doing deliberately, cheap specifically because the crate had zero consumers. That window was still open, so this closes it before any consumer (q2, OGAR) wires the crate in.
  • New crates/lance-graph-hydrate/src/publish.rs extracts the PUBLISH half shared by hydrate_dir and hydrate_file: pre-rename re-check → rename → cleanup-on-error → rename-race remap (publish_by_rename). Both callers' fetch-error and empty/checksum-reject cleanup paths also now route through the same remove_staging, so the "cleanup ladder" half of the original finding is closed as completely as the "rename-race remap" half.
  • The FETCH half (list+get many objects vs stream+hash one object) stays per-caller — genuinely different in shape; merging it would obscure more than it clarifies.

Not just deduplication — a real narrowing

publish_by_rename runs BOTH a pre-rename re-check AND a post-rename ENOTEMPTY remap, for BOTH callers. Before this: hydrate_dir only had the post-rename remap (no pre-check); hydrate_file only had the pre-check (its real defense — POSIX file-onto-file rename SILENTLY CLOBBERS rather than erroring, so a post-rename remap can't see that danger case). Unifying to both strictly narrows each window; it weakens neither.

Test plan

  • 4 new falsifiers in publish.rs, two of which could not exist before this seam did: a directory-race and a file-race test, each constructing a competing publisher already at the destination and asserting BOTH that the loser is reported AlreadyPublished (not a raw I/O error) AND that the winner's content survives untouched.
  • All 4 pre-existing hydrate_dir/hydrate_file tests unchanged — the merge is behavior-preserving at every previously-tested path (verified by careful manual review of every call site, not by running the suite — see caveat below).
  • Not locally compiled in this session's container — same disk constraint (building the lance/arrow/aws-lc-rs sub-tree exhausted disk twice earlier this session) as the two prior PRs on this crate (Mint lance-graph-hydrate: generic SoA->S3->volume->Lance hydration pattern #957, 5+3 council: harden lance-graph-hydrate (fast-follow to merged #957) #958), both of which went green on this repo's real CI. Watching this PR's CI as the actual gate.

Board hygiene in the same commit: LATEST_STATE.md new dated entry, ISSUES.md regrade (RESOLVED, append-only — the original entry's reasoning is left intact, the resolution appended below it).

🤖 Generated with Claude Code


Generated by Claude Code

Closes ISS-HYDRATE-DIR-AND-FILE-DUPLICATE-THEIR-STAGING-BODIES, filed by
the 2026-08-17 5+3 hardening council (PR #958) and deliberately deferred
there: the council judged the uniqueness fix (staging_suffix) worth
landing immediately and this larger merge worth doing deliberately, cheap
specifically because the crate had zero consumers. That window was still
open, so this follow-up closes it before any consumer wires the crate in.

New crates/lance-graph-hydrate/src/publish.rs extracts the PUBLISH half
shared by hydrate_dir and hydrate_file: pre-rename re-check, rename,
cleanup-on-error, and rename-race remap (publish_by_rename), plus the
staging removal both fetch-error and empty/checksum-reject paths in both
callers also now route through (remove_staging). The FETCH half stays
per-caller (list+get many objects vs stream+hash one object) - genuinely
different in shape, merging it would obscure more than clarify.

Not just deduplication: publish_by_rename runs BOTH a pre-rename re-check
AND a post-rename ENOTEMPTY remap for BOTH callers. Before this,
hydrate_dir only had the post-rename remap (no pre-check) and
hydrate_file only had the pre-check (its real defense, since POSIX
file-onto-file rename silently clobbers rather than erroring - a
post-rename remap can't see that danger case). Unifying to both strictly
narrows each window; it weakens neither existing guarantee.

4 new falsifiers in publish.rs, two of which could not exist before this
seam did: a directory-race and a file-race test, each constructing a
competing publisher already at the destination and asserting both that
the loser is reported AlreadyPublished (not a raw I/O error) and that the
winner's content survives untouched. All 4 pre-existing hydrate_dir/
hydrate_file tests pass unchanged - the merge is behavior-preserving at
every previously-tested path.

Board hygiene in the same commit: LATEST_STATE.md new dated entry,
ISSUES.md regrade (RESOLVED, append-only - the original entry's reasoning
is left intact, the resolution appended below it).

Verification status: not locally compiled in this session's container
(same disk constraint as the two prior PRs on this crate) - real
verification is this repo's CI, watched per the standing PR-ownership
protocol.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NMeiLmtDKhomJNSo2ecbJw
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b05d80b0-1009-4c0a-98e9-2e8eafb001fd


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.

@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_02d88616-7ef0-498a-9aab-6c9b2e8af711)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review August 17, 2026 23:00
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AdaWorldAPI
AdaWorldAPI merged commit 1bc0474 into main Aug 17, 2026
7 checks passed
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.

2 participants