Skip to content

id: F12.13 phase 5 slice 4 — operator replica follow/serve CLI (#806) - #9806

Merged
dezren39 merged 1 commit into
mainfrom
queue/15853-806-replica-cli
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15853-806-replica-cli

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

What

Slice 4 of F12.13 phase 5 for #806 (task 15853): the operator CLI for durable replicas. Slices 1–3 (lease primitive #9389, admission enforcement #9400, durable-open admission + ReplicaStatus #9407) had no CLI caller; this slice wires them together.

Library (id-worlds, world_replication_net) — the test-only feed client pattern is promoted into a real client:

  • sync_replica_once(endpoint, addr, world, admin_token, receiver) — one replication session, absorbs the writer's snapshot into a DurableReceiver, returns the verified chain cursor. Any failure aborts the session and leaves the previous committed cursor standing.
  • follow_replica_session(...) — same session kept open for live tail batches, on_commit per durable cursor; a session that committed at least once returns its count instead of the stream error, so follow loops can reconnect (every new session re-snapshots — a reconnect cannot lose a batch).
  • Fresh non-zero session nonce per session; 30 s frame-silence timeout matching the server's frame-write bound (id(world-replication): frame writes have no timeout — a stalled peer holds the world lease and session permit indefinitely (PR #4589) #4726).

CLI (id-cli) — new id world replica <NODE>:

  • Syncs --dir from the pinned writer (--source defaults to the writer's node ID, the key it signs the feed with), opens it via open_replica_with_admission with an optional --lease <FILE> (JSON SignedAdmissionLease), and prints one status JSON object: source, world, cursor (entries/sequence/header_version), chain cursor (ordinal/digest), lease expiry + remaining admission window, admits_new_spectators.
  • Default mode then serves the replica's world sessions (WorldProtocol over a single-world hub) until Ctrl-C. The replica deliberately does not re-export the replication ALPN — it cannot sign for the pinned source.
  • --once syncs + reports only; --follow keeps the journal current across reconnects, one JSON line per commit, without serving.

Oracle / tests

  • New test sync_replica_once_absorbs_the_writer_snapshot (oracle: acceptance item 1 of id: F12.13 journal replication (read replicas over a signed stream) #806 phase 5): a client session absorbs a live writer's snapshot into a durable receiver; a wrong admin token commits nothing and the prior cursor stands.
  • Full suites: cargo test -p id-worlds --lib — 640 passed; cargo test -p id-cli --lib — 671 passed.
  • Live end-to-end (this branch's binary): writer id serve --world --world-name lobby + id world replica <node> --once →
    {"admits_new_spectators":false,"chain_cursor":{"digest":"df4f4a42…","ordinal":1},"cursor":{"entries":1,"header_version":1,"sequence":0},…,"source":"322034fb…","world":"lobby"} — gated with no lease held, exactly the policy-B posture; a second run resyncs in place to the identical cursor; a wrong admin token fails with replication stream closed by the writer and commits nothing.

Remaining on #806 (stays open)

  • Item 2: authenticated provision/refresh of module artifacts + effective_scopes directory facts tied to the pinned source/cursor (today open_replica consumes local sidecars fixed at open).
  • Item 3: resilience exercises on the durable path (writer outage, restart, reconnect, compaction/reset).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 06:29
@chatgpt-codex-connector

Copy link
Copy Markdown
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:29:46.313227Z
We couldn’t complete this review. Comment @codex review to try again.
dedf133 PR opened
ℹ️ 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.

@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, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1 — Codex gate disposition for PR #9806 (task 15853)

The Codex code review on commit dedf133 FAILED TO RUN (Codex usage limits, per the connector's own summary comment: status failed, review not completed) and produced ZERO findings — there are no review comments on any file (verified via the pulls comments API: []). Nothing exists to disposition. Same failure mode and disposition as slices 2 (PR #9400) and 3 (PR #9407) of this task. Merging on the strength of: id-worlds lib 640/640, id-cli lib 671/671, and a live writer/replica end-to-end run recorded in the PR body.

@dezren39
dezren39 merged commit c208fc0 into main Nov 14, 2026
@dezren39
dezren39 deleted the queue/15853-806-replica-cli branch November 14, 2026 06:30
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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.

1 participant