Skip to content

feat(id): persist server-config provisioning into live serving state (#5119 slice 3) - #8356

Merged
dezren39 merged 2 commits into
mainfrom
queue/14074-5119-slice3-persistence
Nov 11, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/14074-5119-slice3-persistence

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Slice 3 of #5119 (queue task 14074): startup provisioning now lands in the live serving state instead of a throwaway in-memory value.

What changed

  • groups::log::GroupLog::record_preformed — records an already-formed event keeping its ID and chain place; an event whose ID the log already holds is skipped, so seeding is a no-op after the first start.
  • server_config::Provisioned::from_parts — builds provisioning state from persisted parts (a journaled Directory + already-recorded group events); apply already skips what exists, so a restart creates nothing.
  • serve::start_server_config_persisted — serve now starts the config from persisted state: accounts into the journaled directory (directory.jsonl beside the groups log, the world-directory layout), preformed group events into the serve groups log itself — the same state live serving folds and replays. cmd_serve calls the persisted start; --server-config absent = unchanged behavior, and the slice-1 in-memory start_server_config remains for its existing tests/callers.

Acceptance mapping (#5119)

  • Config-provisioned accounts and preformed group events are persisted/seeded into the state used by live serving: yes — directory journal + groups log.
  • A restart loads them without recreating them or reporting new creations: proven by start_server_config_persisted_survives_a_restart (second start reports Report::default(), accounts resolvable, events loaded back).
  • No-config behavior preserved: the persisted path only runs when --server-config is given.

Tests

Still remaining for #5119 (not this PR)

Refs #5119


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

…5119 slice 3)

Provisioned::from_parts builds provisioning from a journaled Directory plus the serve groups log events; GroupLog::record_preformed seeds already-formed events by ID (skip if held). serve starts the config via start_server_config_persisted: accounts journal beside the groups log, group events into the groups log itself, so a restart loads them back and reports zero creations. Tests: record_preformed seeds-once-then-skips; persisted start survives a restart.
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 00:13
@coderabbitai

coderabbitai Bot commented Nov 11, 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 9 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: 4159e04c-263a-43b4-b142-3d7371a12aee
Commits

Reviewing files that changed from the base of the PR and between effdff2 and 19b2f44.

Files selected for processing: 3

  • pkgs/id/src/commands/serve.rs
  • pkgs/id/src/groups/log.rs
  • pkgs/id/src/server_config/provision.rs
  • 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 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T00:33:31.409218Z 19b2f44 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: 3be224385c

ℹ️ 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 pkgs/id/src/commands/serve.rs Resolved
Comment thread pkgs/id/src/groups/log.rs Resolved
#5119 slice 3, Codex P2s)

Provisioned::apply now completes a partially recorded group with exactly its missing events instead of skipping on the create ID, so a crash mid-group no longer leaves memberships permanently missing (an admin-removed member is not resurrected: its add event is still recorded, hence not missing). start_server_config_persisted seeds only the suffix this start added, so a restart no longer rescans the whole groups log. New test: test_an_interrupted_group_is_completed_by_the_next_apply.
@dezren39
dezren39 merged commit 63c5897 into main Nov 11, 2026
1 of 6 checks passed
@dezren39
dezren39 deleted the queue/14074-5119-slice3-persistence branch November 11, 2026 00:30
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked (another session actively owns this PR)

@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: 19b2f4408e

ℹ️ 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 +1075 to +1076
fn server_config_directory_path(groups_log: &Path) -> PathBuf {
groups_log.with_file_name("directory.jsonl")

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 configured accounts into the live world's directory

When serving a durable world with --server-config and the default groups-log path, this writes configured accounts to ./directory.jsonl, but ServeWorlds::open_world loads .id-worlds/<name>/directory.jsonl through world_store::open_world (world_store.rs:540–545). The provisioned directory is never passed into that live world. Consequently, startup reports successful account provisioning, yet those accounts remain absent from the live directory and directory_view.rs:68–71 treats their keys as anonymous. Resolve provisioning against the directory actually used by the serving world, or explicitly wire the provisioned directory into its state.

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.

Confirmed and fixed in PR #8413: slice 3 persisted configured accounts beside the groups log, but the live world loads .id-worlds//directory.jsonl. cmd_serve now seeds the default (startup) world directory from the loaded config via the extracted Provisioned::apply_users, idempotently; regression test seed_world_directory_provisions_configured_accounts covers it (serve suite 47/47, server_config suite 57/57 locally).

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