Skip to content

docs(spec): an async actor stays off the server through its own fxs, not its spawn - #11829

Merged
mike-thompson-day8 merged 1 commit into
mainfrom
worker/spec005-spawn-platforms
Oct 30, 2026
Merged

mike-thompson-day8 merged 1 commit into
mainfrom
worker/spec005-spawn-platforms

Conversation

@mike-thompson-day8

Copy link
Copy Markdown
Contributor

Summary

Spec 005 §SSR mode ("Machines are synchronous-only under SSR") said two things the framework does not do: that :platforms-style suppression applies at the spawn-fx layer, and that a child actor can be spawned "from a client-gated event handler". This rewrites those two sentences and leaves the rest of the paragraph untouched.

  • :rf.machine/spawn is registered with a :doc only and carries no :platforms (implementation/machines/src/re_frame/machines.cljc), so it defaults to both platforms and the spawn runs on a server frame.
  • :platforms on an event registration is stored metadata the router never reads (Spec 011 §Effect handling on the server, rule 5), so an event handler cannot be client-gated.

The paragraph now says what does keep an async actor off the server: register the actor's own async fxs :platforms #{:client} (the server's fx resolver skips them and emits :rf.fx/skipped-on-platform), or dispatch the spawning event only from client code, for example after ssr/hydrate! returns. It cross-links Spec 011 §Effect handling on the server, and agrees with spec/Pattern-WebSocket.md §SSR at trunk.

Witness: JVM probe

A scratch deps project outside the tree, with :local/root on this branch's implementation/core, run with clojure -M -e on an inline form: an event registered {:platforms #{:client}} that sets a flag and emits a {:platforms #{:client}} fx, dispatched on a {:platform :server} frame.

Captured exit: 0. Output (final line):

:debug-enabled? true :handler-ran? true :fx-fired? false :skips [#:rf.fx{:id :probe/browser-only, :platform :server, :registered-platforms #{:client}}]

The event handler ran on the server frame despite its :platforms #{:client}; the control, its :platforms #{:client} fx, was skipped with one :rf.fx/skipped-on-platform trace.

Quality gates

  • py -3.14 scripts/check_doc_slugs.py, run by absolute path: exit 0.
  • Plant (proves the slug gate read this tree): the new cross-link's anchor changed to #effect-handling-on-the-server-planted (single-line anchor, 1 match). Slug gate exit 1:
    1 broken anchor link(s) found:
    
      BROKEN ANCHOR: spec\005-StateMachines.md:2548 -> 011-SSR.md#effect-handling-on-the-server-planted
          (target: spec\011-SSR.md)
    
    Restored with git checkout HEAD --; the working file's default-form blob hash 8b4c5fa546cf2c9e2e0c53819141f675c4132b10 equals the committed blob hash, and git diff --quiet HEAD exits 0. Line endings unchanged (CR == CRLF, no bare LF).
  • py -3.14 -m mkdocs build --strict: exit 0 (the built page carries the new text).
  • Prose ratchets over the tree (check_retired_spellings, check_retired_composition_vocab, check_keyword_catalogue_drift, check_flattened_lists, check_escaped_continuations, check_inject_cofx_residue, check_view_lifetime_residue, check_egress_walker_residue, check_ep_status_sync, check-no-hardcoded-paths.sh): each exit 0.
  • Final-base gate: this PR's CI. The local runs above predate a rebase onto a trunk that moved only by a tracker checkpoint.

Nothing validates markdown prose or rendering; the paragraph was read by hand.

…not its spawn

Spec 005 SSR mode said the spawn fx is :platforms-gated and that an event
handler can be client-gated. Neither holds: :rf.machine/spawn carries no
:platforms, and :platforms on an event registration gates nothing (Spec 011
Effect handling on the server). The paragraph now names what does keep an
async actor off the server, agreeing with Pattern-WebSocket SSR.
@mike-thompson-day8
mike-thompson-day8 marked this pull request as ready for review October 30, 2026 01:23
@mike-thompson-day8
mike-thompson-day8 merged commit 4306fc7 into main Oct 30, 2026
76 checks passed
@mike-thompson-day8
mike-thompson-day8 deleted the worker/spec005-spawn-platforms branch October 30, 2026 01:23
mike-thompson-day8 added a commit that referenced this pull request Oct 30, 2026
Merge: 4306fc7 at 2026-10-30T01:23:52Z.
Completeness: Both misleading Spec 005 sentences from rf2-2be6n are corrected and cross-linked to the owning Spec 011 contract. Full patch and complete source bead read.
Correctness: The text agrees with the spawn registration inspected in the preceding review, Spec 011 platform rules, and the WebSocket guidance. Reported JVM control proves an event runs while its client-only effect skips. No finding.
Implementation quality: A tightly scoped prose correction teaches one existing mechanism and avoids adding another platform-gating API.
Findings: none.
Source forward pointers: none.
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