File: crates/web/src/state_bridge.rs:31 + Spec: docs/specs/2026-04-26-state-management-model-design.md
Severity: quality — design tension with documented WASM pattern
Obvious? no
The state-management spec lists Rc<RefCell<T>> as the canonical pattern for "WASM single-threaded interior mutability (web only)". The bridge instead uses Arc<Mutex<Option<U>>>.
The accompanying lock-ok comment (lines 23-30) justifies the lock as an actor-handler dedup cache and explicitly defers redesign to spec follow-up F2. Documented and intentional, but worth surfacing because the choice in WASM-only code contradicts the spec's stated table — a reader would want the rationale (Actor framework requires Send, hence Arc<Mutex> over Rc<RefCell>) repeated either in the spec or in the comment to close the loop.
Fix: add a one-liner to the spec's state-management table noting the actor-bridge exception, OR follow up on F2 to restructure DerivedStateActor.
Filed by /general-audit @ b901575 (2026-05-02). master: #513.
File:
crates/web/src/state_bridge.rs:31+ Spec:docs/specs/2026-04-26-state-management-model-design.mdSeverity: quality — design tension with documented WASM pattern
Obvious? no
The state-management spec lists
Rc<RefCell<T>>as the canonical pattern for "WASM single-threaded interior mutability (web only)". The bridge instead usesArc<Mutex<Option<U>>>.The accompanying
lock-okcomment (lines 23-30) justifies the lock as an actor-handler dedup cache and explicitly defers redesign to spec follow-up F2. Documented and intentional, but worth surfacing because the choice in WASM-only code contradicts the spec's stated table — a reader would want the rationale (Actor framework requiresSend, henceArc<Mutex>overRc<RefCell>) repeated either in the spec or in the comment to close the loop.Fix: add a one-liner to the spec's state-management table noting the actor-bridge exception, OR follow up on F2 to restructure DerivedStateActor.
Filed by
/general-audit@b901575(2026-05-02). master: #513.