Bundle / Bundle and Submodel
Bundle versus Submodel: the same child, wired once
A Submodel is how Foldkit nests one state machine inside another. The parent
holds the child's Model in a field, wraps the child's Messages in one of its
own variants, and forwards them in its update. That is the right design, and
a Bundle keeps every part of it. The cost is in the wiring. The parent wires
the child by hand, in up to five places, and it has to know what the child
contains to do it: whether it has Subscriptions and what they are called,
whether it holds a resource, and whether its init returns Commands.
That knowledge is copied into every parent, and nothing checks it. A Bundle moves it back into the child:
Submodel = the child's parts, wired into each parent by hand
Bundle = the child's parts in one value; a placement wires them for the parentOwnership does not change. In both, the parent Model owns the child's
state, the child's Messages travel as a variant of the parent Message, and
every transition goes through the parent's update. A Bundle adds no store,
no reducer and no runtime. A placement compiles to the same Foldkit calls you
would write by hand.