Surface / Surface and Bundle
Where Command, Mount, Subscription, and ManagedResource fit
Bundles and Surfaces compile down to (or derive from) the Foldkit effect categories. They do not replace them:
| Primitive | Answers | Owns state? | Speaks via |
|---|---|---|---|
Command | "Do this once because a transition said so." | No | Runs once, reports back as a declared Message |
Subscription | "Keep doing this while this Model slice says so." | No | Stream of Messages; restarts when its slice changes |
Mount | "Do this while this DOM element is live." | No | Emits Messages; cleans up on unmount |
ManagedResource | "Provide this stateful handle while this Model slice says so." | No — provides a dependency by tag | Effect service used by Commands / Subscriptions while live |
Submodel | "Which state machine owns this slice and these transitions?" | Yes — slice of parent Model | Wrapped parent Message variant routed to child update |
Bundle | Same as Submodel, packaged once for repeated placement | Yes — same as Submodel | Same as Submodel; also contributes lifted Subscriptions / resources / view |
Surface | "What may this feature observe, and which Messages may it cause?" | No | Allowlist only; routes nothing, runs nothing |
A placement contributes all of its child's parts: update through
Update.foldChildStep, Subscriptions through Subscription.lift, resources
through ManagedResource.lift, view through h.submodel. A wiring's
subscriptions / resources / init fields are the same categories, derived
from one list instead of hand-wired per package.