Skip to content

fix(mount): converge first empty-revision bootstrap#362

Merged
khaliqgant merged 3 commits into
mainfrom
fix/mount-empty-revision-bootstrap
Jul 19, 2026
Merged

fix(mount): converge first empty-revision bootstrap#362
khaliqgant merged 3 commits into
mainfrom
fix/mount-empty-revision-bootstrap

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 19, 2026

Copy link
Copy Markdown
Member

Fixes #360.

PR #361 added the persisted stall guard but did not implement the issue's root empty/empty revision advancement. This completes Track A:

  • treat empty last + empty observed as a legitimate first bootstrap observation
  • use persisted BootstrapComplete to keep later unversioned listings from confirming destructive deletes
  • add the missing unit cell and an end-to-end empty-revision convergence regression
  • preserve the existing established-mirror unversioned delete refusal

Validation:

  • RED: targeted tests failed on revisionAdvances("", "") and one blocked first observation
  • GREEN: targeted mountsync regression suite
  • go test ./... -count=1
  • go vet ./...
  • git diff --check

Review in cubic

@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!

@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@khaliqgant, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 32f358d0-87a6-4270-9349-605d42f6c30a

📥 Commits

Reviewing files that changed from the base of the PR and between bbc8ea8 and 37ca7f9.

📒 Files selected for processing (2)
  • internal/mountsync/syncer.go
  • internal/mountsync/tombstones_test.go
📝 Walkthrough

Walkthrough

The revision gate now recognizes an initial empty revision while refusing later unversioned delete passes after bootstrap. Tests cover revision advancement, persisted bootstrap state, successful convergence, mirrored files, and absence of snapshot-delete blocking.

Changes

Bootstrap revision gate

Layer / File(s) Summary
Empty revision advancement semantics
internal/mountsync/syncer.go, internal/mountsync/tombstones_test.go
revisionAdvances now treats "" as advancing only when the stored revision is also empty, with coverage for the initial empty pair.
Snapshot delete gate and bootstrap convergence
internal/mountsync/syncer.go, internal/mountsync/tombstones_test.go, internal/mountsync/bootstrap_test.go
Snapshot deletes remain blocked for repeated empty revisions after bootstrap, while the bootstrap regression test verifies completion and local mirroring without delete blocking.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: miyaontherelay

Poem

A rabbit watched the blank revision glow,
Then helped the first sync onward go.
Deletes stayed tucked beneath the gate,
While mirrored files arrived in state.
“Bootstrap complete!” the bunny sings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: bootstrap convergence for the first empty revision observation.
Description check ✅ Passed The description matches the implemented changes and regression coverage.
Linked Issues check ✅ Passed The changes address #360 by treating empty/empty as a valid first observation and adding regression coverage to complete bootstrap.
Out of Scope Changes check ✅ Passed The diff stays focused on mountsync bootstrap and revision-gate behavior, with no clear unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mount-empty-revision-bootstrap

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.

@khaliqgant

Copy link
Copy Markdown
Member Author

@codex review

@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-07-19T00-36-44-078Z-HEAD-provider
Mode: provider
Git SHA: f81221d

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@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: bbc8ea8c4b

ℹ️ 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 internal/mountsync/syncer.go Outdated
Comment on lines +4887 to +4888
if observed == "" {
return false
return last == ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep empty revisions out of generic ordering

This helper is also used by githubWorkingTreePathCandidatePreferred (internal/mountsync/syncer.go:7150), where it is expected to mean “strictly newer.” When a GitHub working-tree fallback has no resolved HeadSHA and two tracked @<sha>.json records map to the same local file with empty revisions, the sorted later path now replaces the earlier one merely because both revisions are empty. A subsequent local write is therefore routed to a different, potentially stale remote object. Keep the empty/empty bootstrap exception in the snapshot-delete gate rather than changing the shared revision ordering predicate.

Useful? React with 👍 / 👎.

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.

Addressed in a766328 (current follow-up commit). revisionAdvances("", "") is again false and has an explicit RED/GREEN assertion so GitHub candidate ordering remains strict. The empty/empty exception now exists only inside the snapshot-delete gate while BootstrapComplete == false; the end-to-end first-observation convergence regression and the established-mirror unversioned-delete refusal both remain green. Full go test ./... -count=1, go vet ./..., and diff check pass.

@khaliqgant

Copy link
Copy Markdown
Member 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: a766328639

ℹ️ 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 internal/mountsync/syncer.go Outdated
Comment on lines +4813 to +4817
revisionAdvanced := revisionAdvances(s.state.LastAppliedRevision, observedRevision)
if strings.TrimSpace(observedRevision) == "" &&
strings.TrimSpace(s.state.LastAppliedRevision) == "" &&
!s.state.BootstrapComplete {
revisionAdvanced = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep unversioned observations out of tombstone confirmation

When a pre-existing tombstone is present (for example, a state file created before BootstrapComplete existed), this makes the first empty-revision bootstrap enter the destructive pass and observePendingDelete will increment its attempt count and delete the local file immediately. An empty revision is explicitly an unknown snapshot signal, so a partial/unreliable unversioned listing can now supply the second tombstone confirmation even though it is not a strictly advancing revision; previously this path was refused. Limit this exception to completion bookkeeping or ensure unversioned observations cannot create or confirm tombstones.

Useful? React with 👍 / 👎.

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.

Fixed in 37ca7f9. The first empty-revision bootstrap now returns before tombstone creation or confirmation, while still allowing the caller to persist BootstrapComplete. Added a regression that seeds a tracked local file plus a legacy one-attempt tombstone and proves the unversioned bootstrap preserves both file/state and leaves the tombstone unchanged. Generic revisionAdvances remains strict, and later unversioned observations remain blocked. Full go test ./... and go vet ./... pass.

@khaliqgant

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 37ca7f9d7c

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

@khaliqgant
khaliqgant merged commit 9df49ec into main Jul 19, 2026
10 checks passed
@khaliqgant
khaliqgant deleted the fix/mount-empty-revision-bootstrap branch July 19, 2026 00:40
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.

relayfile-mount bootstrap never converges: empty observed revision loops "forcing full reconcile" forever, blocking the agent run

1 participant