Skip to content

Add production-ready Rust coordinator migration path - #541

Closed
Gajesh2007 wants to merge 56 commits into
masterfrom
cursor/bc-72094919-1b0e-4b8c-933c-720a393a9a67-c777
Closed

Gajesh2007 wants to merge 56 commits into
masterfrom
cursor/bc-72094919-1b0e-4b8c-933c-720a393a9a67-c777

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Adds the production Rust coordinator and a safe migration path while retaining the Go coordinator as a rollback-compatible fallback. This includes frozen cross-language contracts, protocol v2 and Swift provider support, durable owner-fenced billing/recovery, full HTTP surface parity, external migrations, dual-stack deployment, observability, fault/load validation, and signed cutover gates.

Before

flowchart LR
  subgraph Behavior_Before[Behavior]
    C1[Consumer request] --> G1[Go coordinator]
    G1 --> V1[Swift provider protocol v1]
    V1 --> G1 --> C1
  end
  subgraph Code_Before[Code]
    H1[Go HTTP handlers] --> R1[Go registry and routing]
    R1 --> S1[Go store and billing]
    S1 --> D1[PostgreSQL]
  end
Loading

After

flowchart LR
  subgraph Behavior_After[Behavior]
    C2[Consumer request] --> A2[Rust API adapters]
    A2 --> F2[FleetActor and RequestTask]
    F2 --> V2[Swift provider protocol v2]
    V2 --> J2[Signed durable terminal]
    J2 --> L2[Atomic ledger settlement]
    L2 --> C2
  end
  subgraph Code_After[Code]
    P2[Versioned protocol and pure reducers] --> W2[Supervised Rust warm plane]
    W2 --> Q2[Durable jobs ledger and recovery]
    Q2 --> D2[Externally migrated PostgreSQL]
    O2[Ownership handoff deploy and cutover gates] --> W2
    O2 --> G2[Go guarded fallback]
  end
Loading

Linked issue

Not linked.

Test plan

  • go test ./coordinator/... -count=1
  • Real-PostgreSQL store, migration, ownership, rollback, ledger, and recovery suites
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-features --locked
  • cargo build --workspace --all-features --locked
  • SQLx offline metadata check against the latest migrated schema
  • make contracts-check
  • make coordinator-rs-fault-test
  • Python pilot/load/cutover regression suites and shell cutover security tests
  • Swift protocol files parsed/typechecked during implementation; full MLX-backed swift test remains a macOS CI/hardware gate
  • Docker dual-stack image build and rollback rehearsal (added as CI validation; Docker unavailable in the local agent VM)

Components touched

  • coordinator (Go)
  • coordinator-rs (Rust replacement)
  • provider (Rust, legacy)
  • provider-swift (Swift CLI)
  • console-ui (Next.js)
  • enclave (Swift)
  • infra / CI / release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — protocol v2, negotiation, binary framing, durable terminal/ACK, replay fencing, HTTP/config/CLI surfaces, and matching Rust/Swift contract tests are included

Notes for reviewers

  • Go remains built into the dual-stack image and can serve only after the additive-schema rollback guard passes.
  • Serving startup performs no schema mutation; coordinator-migrate owns all DDL/checksums.
  • Paid starts are single-attempt and durable: reserve → prepare → resize/authorize → start → signed terminal → atomic settlement → ACK.
  • Essential tasks, mailboxes, provider writers, request pipes, DB workers, telemetry, and external calls are bounded and supervised.
  • No production deploy or cutover was performed. Remaining operational gates are intentionally external: macOS MLX hardware validation, Docker rehearsal, reviewed scheduled soak baseline, staged human-approved cutover/bakes, and 90-day Go-retirement evidence.
Open in Web Open in Cursor 

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview Jul 13, 2026 6:52am
d-inference-console-ui-dev Ready Ready Preview Jul 13, 2026 6:52am
d-inference-landing Ready Ready Preview Jul 13, 2026 6:52am

Request Review

Comment thread scripts/pilot_load/client.py Fixed
Comment thread scripts/pilot_load/processes.py Fixed
Comment thread scripts/pilot_load/processes.py Fixed
Comment thread scripts/pilot_load/processes.py Fixed
Comment thread scripts/pilot_load/processes.py Fixed
Comment thread scripts/pilot_load/processes.py Fixed
Comment thread scripts/tests/test_cutover_readiness.py Fixed
Comment thread scripts/tests/test_fault_matrix.py Fixed
Comment thread scripts/tests/test_pilot_load.py Fixed
@Gajesh2007
Gajesh2007 marked this pull request as ready for review July 13, 2026 05:52
cursoragent and others added 27 commits July 13, 2026 05:53
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
Co-authored-by: gajcodex <gajcodex@users.noreply.github.com>
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