Skip to content

fix(id): refuse pre-restart wants on reopen (#839) - #4677

Merged
dezren39 merged 2 commits into
mainfrom
queue/6514-839-wants-reexec
Nov 11, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/6514-839-wants-reexec

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

open_world
  restore program from journal
  spawn_restored
    capture request ids already present in wants
    after_change refuses those ids as actor_denied / restarted
    requests issued after open execute normally

Adds an explicit restored-world spawn path and documents restart semantics: because handled request ids are memory-only, open-time requests may already have executed before the restart. Refusing them prevents a duplicate unattributed side effect.

Evidence

  • Before: handled_requests starts empty after reopen; open-time wants requests execute with world authority.
  • After: three regression tests cover the refusal and reason, fresh requests after open, and restored-vs-fresh spawn behavior.
  • cargo test --lib world::tests:: — 139 passed.
  • cargo test --lib world_store — 30 passed.
  • cargo test -p id-core — 263 passed, 1 pre-existing unrelated failure (membership::layer::tests::test_a_sequential_named_create_is_refused_even_with_the_smaller_id; reproduced when run alone).

Merge Danger

Door: two-way

Blast Radius: narrow

Only restored-world request IDs already present in wants are refused. Fresh worlds and post-open requests retain existing execution behavior. Reverting restores the previous at-least-once-on-restart behavior.


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 3, 2026 00:21
@coderabbitai

coderabbitai Bot commented Nov 3, 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 14 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: 125d9ef9-15db-461d-b2f9-9c617d209f13
Commits

Reviewing files that changed from the base of the PR and between effdff2 and 43dcdb9.

Files selected for processing: 5

  • pkgs/id/crates/id-core/src/world_caps.rs
  • pkgs/id/src/world/actor.rs
  • pkgs/id/src/world/handle.rs
  • pkgs/id/src/world/tests.rs
  • pkgs/id/src/world_store.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 3, 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:25:26.928443Z 43dcdb9 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.

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up

…839)

A reopen is not a fresh world: handled_requests is memory-only, so
requests the restored program already listed in wants may have
executed before the restart, unattributed. spawn_restored now
captures the open-time wants and the first after_change passes
refuse those ids with actor_denied/restarted, keeping
non-idempotent providers at-most-once per id across a reopen.
Requests issued after the open execute normally.

Regression tests: reopened_wants_are_refused_not_reexecuted,
spawn_restored_refuses_open_time_wants,
stale_wants_capture_reads_the_current_wants.
@dezren39
dezren39 force-pushed the queue/6514-839-wants-reexec branch from c90be8d to df04696 Compare November 11, 2026 00:00
@dezren39

Copy link
Copy Markdown
Member Author

Agent note - picked up - lane code-b, task 14750 (pr_shepherd, PR #4677, batch issue #7297, linked issue #839).

Fresh revalidation: PR #4677 OPEN, no labels on the PR (no hard stops), issue #839 OPEN. The branch carries one substantive commit on current main: refuse pre-restart wants at reopen instead of re-executing them, with three new tests (reopened_wants_are_refused_not_reexecuted, spawn_restored_refuses_open_time_wants, stale_wants_capture_reads_the_current_wants). No Codex review findings exist on the PR. This shift: current origin/main merged into the branch in worktree fleet/14750 (diff unchanged, 5 files), targeted lib tests running on the laptop. Next: merge under the standing criteria when the tests pass, otherwise park with the evidence.

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked (resumable — verification build still running)

@dezren39
dezren39 merged commit 652f470 into main Nov 11, 2026
1 of 7 checks passed
@dezren39
dezren39 deleted the queue/6514-839-wants-reexec branch November 11, 2026 00:24
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