Repository navigation
Give each Bridge its own Person store - #110
Merged
Merged
Conversation
Resolves the bridge.rs conflict from origin/main's mechanical test-file split (d821b21, "Split ff.rs, metadata.rs, bridge.rs, ..."), which moved the inline `mod tests { ... }` block this branch's Person commit (efb3dd1) had edited out into per-group files. Both mod-declaration conflicts in bridge.rs are resolved by taking origin/main's split-file form; the Person-owner tests and helper functions efb3dd1 added to the old inline mod tests block are carried into the corresponding split file, app/session_dispatch_tests.rs and app/viewstate_directory_policy_tests.rs. Also applies the ViewState::pump 3-arg (person callback) signature change from efb3dd1 to app/session_dispatch_tests.rs's endpoint_outcomes_cross_central_dispatch_machine_bridge_and_boot test, which the split carried forward with the old 2-arg call since main predates the Person store's ownership commit. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Enter/Uncover decided whether to emit PersonCmd::Open by reading the store synchronously, but Close and Open are both deferred AppFx::Store effects applied after screen event delivery in the same drain. A stack eviction (ui::containers::stack::evict at CAP) delivers Unmount to an evicted body — queuing Close for the identity it still holds — in the same Push drain that mounts and Enter(Fresh)s a new page for that same identity: the new page's guard sees the store still holding the identity and skips Open, then the queued Close lands after it, leaving the store empty under a page that never re-requests it (e.g. reopening an actor's cast credit once the stack is CAP bodies deep, or a PopTo across two same-person pages). Reproduced with a dispatcher-level test that fills a stack to exactly CAP live bodies with a Person A page at the bottom, then reopens the same Person A identity — the Push evicts the bottom body in the same drain as the new page's Enter(Fresh). Watched red on the unfixed code. Fix: person::open is now idempotent on the identity it already holds — an early return before any generation bump, fetch-claim clear or retry-backoff reset, and before the Person is rebuilt — so a redundant Open for the already-held (sid, key) is a true no-op (no refetch storm, no dropped live landing). screens::person's Enter(_) | Uncover arm now calls request_store unconditionally instead of only when its own person(cx) read is None: a same-identity Close queued earlier in the drain is now harmless (Open re-requests it), and a same-identity page already correctly held costs nothing (Open no-ops). Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Person notices are bumped for idempotent or otherwise unchanged commands; propagate actual change status and add repeated-Open coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves Person state and transport from process-wide globals to per-Bridge ownership, with updated screens, tests, documentation, and dependency gates.
Changes:
- Adds per-Bridge
PersonStoreandPersonView. - Routes optimistic updates and lifecycle commands through the owning Bridge.
- Adds ownership isolation and regression coverage.
File summaries
| File | Description |
|---|---|
tests/test_harness.py |
Adds dependency-gate tests. |
rust-modules/src/viewstate.rs |
Routes Person optimistic updates. |
rust-modules/src/ui/CLAUDE.md |
Updates UI architecture guidance. |
rust-modules/src/stores/viewstate.rs |
Threads Person ownership through ViewState. |
rust-modules/src/stores/person.rs |
Implements Person state and notices. |
rust-modules/src/stores/mod.rs |
Integrates Person into Stores. |
rust-modules/src/screens/registry.rs |
Adds PersonLike access. |
rust-modules/src/screens/person.rs |
Uses owner-bound Person data and lifecycle. |
rust-modules/src/screens/person_bio.rs |
Uses owner-bound biography data. |
rust-modules/src/screens/filmography.rs |
Uses owner-bound filmography data. |
rust-modules/src/person.rs |
Replaces global Person state. |
rust-modules/src/lib.rs |
Updates ownership documentation. |
rust-modules/src/dev/scenarios.rs |
Uses Bridge-owned Person state. |
rust-modules/src/app/viewstate_directory_policy_tests.rs |
Tests ownership isolation. |
rust-modules/src/app/session_dispatch_tests.rs |
Updates dispatch coverage. |
rust-modules/src/app/search_owned_tests.rs |
Updates Person view fixtures. |
rust-modules/src/app/run.rs |
Pumps the Bridge-owned store. |
rust-modules/src/app/person_lifecycle_tests.rs |
Adds lifecycle regression coverage. |
rust-modules/src/app/library_shelf_action_tests.rs |
Updates Person view fixtures. |
rust-modules/src/app/bridge.rs |
Wires and dispatches Person state. |
rust-modules/src/app/boot.rs |
Resets owned Person state. |
docs/stores-as-machines.md |
Documents store ownership. |
docs/agent-reference.md |
Updates architecture reference. |
ci/check-deps.sh |
Adds the Person ownership gate. |
Review details
- Files reviewed: 24/24 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+71
to
+72
| let changed = self.state.run(&self.adapter, cmd); | ||
| self.bump(); |
This was referenced Sep 17, 2026
GLinnik21
added a commit
that referenced
this pull request
Sep 18, 2026
The store-ownership migration's last owed item was the device pass; layers #110/#111/#112/#119 and the cleanup #121 were host-verified only until now. The player-lane scrub legs (paused scrub, tap commit, dropped-keyup net) all passed on the real pipeline. The ownership legs showed a clean boot-time activation reset, but the reused-Bridge case #119 was actually about could not be reached: the only in-app route to a second activation on a live Bridge is the profile picker, and that route is broken for a managed user. Two new findings came out of hitting that dead end: the profile chip and account overlay name the account holder rather than the signed-in managed user, and "Change profile" as a managed user spins forever on a 401 from the home-roster endpoints with no error, nothing logged, and Back inert — only Sign out escapes. Filed as separate issues, along with the pointer scrub path having no device-drivable coverage at all (no held-pointer token in the FIFO, and the one reachable synthetic click didn't engage the scrub band). Claude-Session: https://claude.ai/code/session_01Em5yYDNi5A2peYR6oPMXwD Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bridge(viaStores), following Browse (aff24392) and ViewState (4b390cdd). The process-wideCURRENT/GEN/FETCH/RETRY_CD/HELDstatics, the global notice and the freeperson::current/loading/pumpfacades are gone; screens readPersonViewthroughPersonLike.ViewState::pumptakes a Person callback, so optimistic watched edits fan out only to the owning Bridge's Person store.check-depsgate: person-owner has zero global storage, transport, selectors or free facades (no allowlist).person::openis idempotent on the identity already held, andPersonScreenrequestsOpenon every Enter/Uncover. Before this, a stack eviction atCAPcould queue aClosefor the same actor in the same drain as a new page'sEnter, leaving that page blank.Tests
separate_bridges_do_not_share_any_person_owner_state_or_notice: two owners share no state, landings or notice. Red was simulated (both owners aliased to one Bridge).reopening_an_evicted_same_identity_person_leaves_the_store_holding_it: fills the stack toCAPwith Person A at the bottom and reopens A. Watched red before the fix.make check(both feature passes),--no-default-featurescheck, ARMmake,ci/check-deps.shall green.Open questions (not fixed here, out of scope)
tests/focusfp.sh) is refused onmainitself: the committed fixtures have been stale since9ab256b7, becauseSCREEN_SHAPES_PINwas bumped by later PRs without re-recording. They will be re-recorded once, at the end of the store-ownership migration. Amake checkassertion that fixturestate_fpmatches the live one would stop this from recurring.a_fresh_filmography_reads_only_the_person_view_it_is_giventakes notestlock, althoughPersonCmd::Openreads the global server registry.bootstrap::stores::poll("person", …),stores::take_landing(StoreId::Person, …)) are still process-wide. Harmless with one production Bridge.🤖 Generated with Claude Code
https://claude.ai/code/session_01Em5yYDNi5A2peYR6oPMXwD