ProcessAllocation class
The process family — drives a ProcessCapability over the process
transport (ADR-0009 D6). A one-shot (StepKind.job) is respawn-or-skip
(not adoptable, not detachable — the reconciler + frontier own respawn); a
StepKind.daemon is adopt-or-respawn + detach-capable (Track C wires the
daemon proof/detach; the base here spawns-and-reports, preserving P0's
Agent/Verify behavior exactly).
Owns its subscription + event→report mapping (via ProcessCapability.
interpretEvent); reports AllocationStarted on SessionStarted, then
ready/complete/failed per the capability's interpretation. Holds NO
writer — the Host persists every report.
- Inheritance
-
- Object
- Allocation
- ProcessAllocation
Constructors
- ProcessAllocation(ProcessCapability capability, AllocationInputs inputs)
-
Creates the process allocation for
capabilityfrominputs.
Properties
- address → AllocationAddress
-
This effect's stable address (
<sessionId>/<nodePath>).no setterinherited - adopted → bool
-
Whether a survivor was reattached instead of spawned (D4).
no setter
- capability → ProcessCapability
-
The pure process capability describing what to spawn and how to read it.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputs ↔ AllocationInputs
-
The effect's values and services (args/transport/address/env/sink/fence).
getter/setter pairinherited
- isAdoptable → bool
-
A daemon (StepKind.daemon) is adopt-capable + detach-capable; a one-shot
(StepKind.job) is respawn-or-skip (never adopts/detaches — D4).
no setteroverride
- isDetachable → bool
-
Whether this effect type is safe to LEAVE RUNNING on unmount and re-adopt
later (D4 — a per-type opt-in; the Host only calls detach when true).
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- started → bool
-
Whether the spawn was reached (the Host stops the group on unmount only
when true).
no setter
- state ↔ AllocationState
-
The current lifecycle state — a pure observation subclasses advance as
their effect progresses (the Host maps reports → the persisted cursor; this
field never writes).
getter/setter pairinherited
Methods
-
canUpdate(
Allocation next) → bool -
Whether this allocation can absorb
next's config in place, vs. the Host re-keying (dispose + recreate) — à la RenderObjectcanUpdate(D4). Update-vs-replace is a DOMAIN choice: a one-shot-pcoding agent replaces (false); a tmux session updates (true). Defaults to replace.inherited -
deliverEventForTest(
RuntimeEvent event, TreeContext treeContext) → void -
Test affordance: deliver
eventstraight to the event handler (exercises the Host's post-dispose guard in isolation from the subscription cancel). Production events always arrive via thetransportstream. -
detach(
) → Future< void> -
LEAVE the group RUNNING + keep its persisted handle (the per-node
pgid/pid/token cursor already IS the handle) so a later startOrAdopt
reattaches it (D4) — a DISTINCT verb from dispose (never stops the group,
never tears down side-processes). Only the per-incarnation subscription is
cancelled (this node stops observing); the OS group lives on. The
reconciler's orphan-sweep reaps a detached effect nobody re-adopts (Track D).
override
-
didChangeDependencies(
TreeWatchingReader reader, TreeDependencyScope scope) → void - Runs after initState and whenever a watched inherited value changes.
-
dispose(
) → Future< void> -
KILL the live effect (the default / floor unmount verb): the effect is
done/invalidated. A process family terminates its group; a service cancels
its body + runs teardown.
override
-
initState(
TreeSnapshotReader reader) → void -
Runs once when the participant enters the tree.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startOrAdopt(
TreeContext treeContext) → Future< void> -
Spawn a fresh effect OR prove-and-adopt a survivor at address (D4). The
engine owns only the stable address + no-adopt-on-faith (an adoptable
type must return proof of freshness; can't prove → spawn fresh). Reports
lifecycle through AllocationInputs.sink. The Host guards the single kick.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Allocation next) → Future< void> -
Mutate in place to serve
next's config (only called when canUpdate is true). TheTreeContextpassed to startOrAdopt is call-scoped and is NEVER retained across update. The default implementation rebinds only inputs. A subclass with canUpdate returning true must re-read tree values from theTreeContexthanded to each call, never cache one from an earlier call.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited