GeezerVison is showing github.com — feat(id): phase 5 client/operations surface + gated enablement for region-seam handoff (#3904) by dezren39 · Pull Request #9175 · developing-today/code
Conversation
dezren39
commented
Nov 13, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements #3870 phase 5 (issue #3904) — client/operations surface + gated enablement for region-seam handoff, per design #2818 §8 packet 5. The hard gate is now satisfied: phase 4 issue #3903 closed via PR #9000 (merged 7904547).
Phases 1-4 built the journal, source fence, import primitive, and the Coordinator state machine, but the coordinator was wired to no client surface: no feature gate, no routing decision, no observability. This PR adds world::handoff_operations:
- Feature gate, disabled by default.
HandoffOperations::new starts with handoffs off; begin_handoff refuses with OpsError::HandoffsDisabled and journals nothing. Enablement is an explicit operator act (set_enabled). Turning the gate off strands nothing: in-flight handoffs keep status/routing answers and can still complete.
- Fail-closed client routing.
route_operation is the single decision for a client operation: while an entity is in transit, reads AND writes return the typed, retryable EntityInTransit status (design §4 — no entity snapshot projection exists, commands are never queued/replayed). A started handoff with no export yet still serves at the source.
- Stale-route response. A client presenting a route that disagrees with the owner map (e.g. the old source route after completion) gets typed
StaleRoute carrying the new owner epoch and region-map epoch, retryable through the coordinator. The fenced source never serves again; epochs are monotonic.
- Age/reason observability.
ops_snapshot(now) returns per-handoff age, time since last journaled progress, stage, machine-readable reason (awaiting_source_export / awaiting_destination_import / awaiting_coordinator_completion / stuck_no_progress_over_threshold), in-transit count, and the stuck count (60s threshold, STUCK_THRESHOLD_MS) that alerting keys off. Stuck remains an alert classification only — no completion, rollback, or re-route.
Coordinator::tracked_entities() added so the surface can enumerate the owner map without the map leaving the coordinator.
Acceptance suite (in-module tests): drives a full crossing with duplicate export delivery — no completion without a matching durable import, no write served at the source after export, exactly one completion/owner transition for repeated receipts, journal replay reproducing the post-completion routing — plus gate-default-off, fail-closed reads+writes, stuck boundary at exactly 60s, unknown-entity refusal, and gate-off-mid-flight.
Tests: cargo test -p id-worlds — 756 passed, 0 failed (7 new). Clippy clean for the new module.
Task 5867 (queue repo-health-code-pilot), lane code-c.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- New Features
- Added handoff routing that identifies entities in transit and flags outdated client routes with the current region and owner version.
- Handoff operations can be enabled or disabled; handoffs are disabled by default, while routing and status checks remain available.
- Added operation snapshots showing active handoffs, their progress and age, and which have stalled.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…gion-seam handoff (#3904)
HandoffOperations over the phase-4 Coordinator: feature gate disabled by default (begin_handoff refuses and journals nothing while off), fail-closed routing for reads and writes while in transit with the typed EntityInTransit status, typed StaleRoute response carrying the new owner epoch, and an ops snapshot exposing per-handoff age/reason plus the stuck count for alerting. Coordinator gains tracked_entities() for enumeration. Acceptance suite drives a full crossing with duplicate receipt delivery and journal replay: no completion without a matching durable import, no write served at the source after export, exactly one completion/owner transition, replay reproduces routing. Handoffs remain disabled by default; enablement is an explicit operator act.
coderabbitai
Bot
commented
Nov 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Caution
Review failed
The pull request is closed.
Walkthrough
-
The change adds a handoff operations API that wraps Coordinator. It gates handoff starts, routes reads and writes according to transit and ownership state, and reports active handoffs in snapshots. The world module re-exports the new types.
Changes: Handoff operations
| Layer / File(s) |
Summary |
Define routing and operations contracts pkgs/id/crates/id-worlds/src/world/coordinator.rs, pkgs/id/crates/id-worlds/src/world/handoff_operations.rs, pkgs/id/crates/id-worlds/src/world/mod.rs |
Coordinator::tracked_entities returns sorted entity references. The world module declares the operations module and re-exports its routing, operations, and snapshot types. |
Implement handoff operations pkgs/id/crates/id-worlds/src/world/handoff_operations.rs |
HandoffOperations gates handoff starts and provides transit-status lookup, operation routing, and snapshots with handoff age and stuck status. |
Validate routing, handoff progression, and recovery pkgs/id/crates/id-worlds/src/world/handoff_operations.rs |
Tests cover gate behavior, routing decisions, snapshots, handoff progression, generated operation sequences, and journal-prefix recovery. |
Estimated code review effort: 3 (Moderate) | ~30 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Client
participant HandoffOperations
participant Coordinator
Client->>HandoffOperations: route_operation(entity_ref, presented route)
HandoffOperations->>Coordinator: inspect transit and owner state
Coordinator-->>HandoffOperations: transit or current owner state
HandoffOperations-->>Client: RouteDecision
Loading
Merge Risk: Moderate · up to ca168
-
The new handoff operations feature works as described, but its acceptance tests use operations the project lints deny, without the required exemption. The repository's Clippy check will fail. Add the lint allowance to the test module before merging; production behavior is not affected.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning Some tools did not complete. Review the errors below.
Clippy (1.99.1)
-
Clippy execution timed out
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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
❌ Failed 2026-11-14T06:22:16.255598Z We couldn’t complete this review. Comment @codex review to try again. |
ca16812 |
New commits |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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: c3230b4e6f
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ng (#9793)
Extend the generated model to the phase-5 operations surface: proptest sequences drive gate toggles, begin_handoff, receipt observation, completion, cancellation and crash recovery through HandoffOperations, checking routing (both kinds; absent/correct/stale presented routes), the unknown-entity refusal, and the full ops_snapshot against an explicit model oracle after every transition. A deterministic companion test checks journal-prefix recovery against the same oracle. Dispositions the Codex P1 on PR #9175 (discussion r4558973564).
|
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, add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|