Skip to content

design(id): #806 signed journal replicas - #3822

Merged
dezren39 merged 3 commits into
mainfrom
design/id-806
Nov 1, 2026
Merged

dezren39 merged 3 commits into
mainfrom
design/id-806

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Decision-ready design for F12.13 journal replication and read-only replicas.

  • Recommends a dedicated signed replication stream with snapshots/resets for compaction and journal-version bumps, plus ordered durable tails.
  • Distinguishes the authoritative JSONL journal from the existing records-only iroh-docs mirror.
  • Specifies signer pinning, a hash-linked cursor, module hash verification, staged replica install, read-only spectator serving, invariants, acceptance tests, and five independently mergeable phases.
  • Records the F12.6 framing dependency gap and one Drew decision: offline admission of new spectators after possible unseen revocations.

Validation

  • Documentation-only change.
  • git diff --check origin/main...HEAD passed.

Closes no issue; #806 remains open.


View with [code]smith Autofix with [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 1, 2026 16:53
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d43de436-17d1-40d3-bdfd-4a08c9d4d153
Commits

Reviewing files that changed from the base of the PR and between 73423be and 0cff3f7.

Files selected for processing: 1
  • doc/2026-11-01_design_id806.md
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T18:51:05.960329Z 0cff3f7 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.

@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: 085d064f74

ℹ️ 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 on lines +158 to +161
- The replica reuses the restore/program reconstruction path in
`world_store::open_world`, but implementation must add a read-only open path:
validating an already-verified replica must not use the writer's mutating
`FileJournal::open` recovery/header-bump behavior. The replica exposes only

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 Preserve source presence during replica restore

When a snapshot is taken while participants remain connected to the writer, reusing the existing restore path changes program state beyond the signed cursor: WorldCore::restore (pkgs/id/src/world/core.rs:425-439) synthesizes leave events for every still-present participant, and restore_program feeds those events into the program. This affects actual records—for example, the territory program changes players' online status on presence events—so the replica would violate the promised writer-record parity even with an intact journal. Specify a replica restore mode that suppresses writer crash-recovery presence cleanup, alongside the non-mutating journal open path, and test parity with source sessions still connected.

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 ccf34b (design doc amendment, task 5832 worker). Verified the cited behavior at current main: WorldCore::restore synthesizes presence-off events into the replay for still-present participants. The design now specifies a presence-preserving replica restore mode (Replica lifecycle section): presence at the snapshot cursor is restored as session state without feeding synthesized presence events into the program, no synthetic event is journaled or counted against the verified cursor, and Phase 4 acceptance includes a snapshot taken with participants connected proving Records parity with the writer at the same cursor.

Comment thread doc/2026-11-01_design_id806.md Outdated
Comment on lines +291 to +292
- Replicating unrelated world stores (directory, petnames, or outbox) unless a
separately demonstrated spectator-serving dependency requires them.

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 Include the directory-dependent spectator authorization state

The spectator-serving dependency on the directory already exists: WorldCore::effective_scopes (pkgs/id/src/world/core.rs:789-806) checks account ceilings and requires a friendship for cross-account delegations, but the journal carries only account subjects, not those directory facts. Consequently, restoring the proposed journal-and-module replica with an empty directory rejects a valid friend-delegated spectator capability even while fully synchronized; the existing friendship-delegation test in world/tests.rs:2881-2950 demonstrates that snapshot access depends on this relationship. Resolve this dependency in the transfer and lifecycle contract—for example, by synchronizing the necessary authorization projection or supplying writer-signed spectator admissions—and test admission using an account-backed delegated capability.

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 ccf34b (design doc amendment, task 5832 worker). Verified at current main: WorldCore::effective_scopes (pkgs/id/src/world/core.rs:896) intersects directory account ceilings and zeroes cross-account delegations when directory.are_friends is false, and the journal carries only account subjects. The Non-goals section now scopes the directory partially IN: the directory facts effective_scopes consults (account ceilings + friendship graph for accounts in capability chains) are carried in the signed snapshot (bound into the snapshot digest) and kept current by the signed stream, and Phase 4 acceptance includes the friendship-delegation spectator case served by a replica with no writer contact.

… replica restore + directory facts for spectator auth
@dezren39
dezren39 merged commit 3dbc700 into main Nov 1, 2026
1 check passed
@dezren39
dezren39 deleted the design/id-806 branch November 1, 2026 18:49

@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: 0cff3f74a9

ℹ️ 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 on lines +167 to +169
therefore use a presence-preserving mode: presence at the snapshot cursor
is restored as session state without feeding synthesized presence events
into the program, and no synthetic event is ever journaled or counted

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 Persist writer recovery effects before resuming replication

If the writer crashes with participants connected, the presence-preserving replica reconstructs different records from the restarted writer. WorldCore::restore synthesizes leave events (pkgs/id/src/world/core.rs:425-439) and restore_program applies them, but neither journals those events nor forces a checkpoint. The writer can therefore resume streaming the identical cursor while its records mark participants offline and the replica still marks them online. Unlike the earlier live-writer restore issue, this concerns an unreplicated state change during the writer's own restart. Specify that source recovery effects are durably journaled or captured in a checkpoint/reset before replication resumes, and test a writer crash with connected participants.

Useful? React with 👍 / 👎.

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