GovernedHeddleNode
A Raft-governed HeddleNode: the H4 data-plane surface (reserve/complete/schedule/advertise plus the replicated ledger and liveness) with the H5 control-plane verbs (mint + topology) routed through the consensus log. Returned by heddleGoverned.
The control verbs suspend until their act commits and return a ControlOutcome — Applied ControlOutcome.Applied when admitted, or Conflict carrying a structured ControlConflict when the log serialized the act as a loser. A peer that halts at a log entry it cannot read while a call is in flight answers ControlOutcome.Indeterminate: that act may still commit, so do not treat it as a refusal. The data-plane verbs are the exact H4 calls and never coordinate.
The ungoverned lifecycle mutators (HeddleNode.prepare/activate/…) are deliberately not re-exposed here: routing them around the log would recreate the very LedgerConflict.DualActiveInbound fork the control plane serializes away. Only the governed verbs and the read/spend surface are public.
Properties
Whether this peer may author entitlement yet — the boot gate of docs/heddle-ledger-relocation-design.md §6.5 residual 3 and §13.2. It opens when this peer's own enroll(self) has committed and been applied here, and it closes again on restart. The apply loop moves it, in log order, when it applies this run's own enroll(self) or depart. Replaying an older run's entries moves nothing, and neither does a caller's fate: an enroll or depart that was cancelled or timed out still moves the gate when its entry applies, so never re-issue one just to repair the gate (#2921).
The replicated entitlement ledger as converged on this peer (the gossip-merged data-plane view).
Peer-liveness signals (design §8.1); the node takes no ledger action on either. An event is announced only after unreachable reflects it, and an event from a detector that no longer watches its peer is never announced (see HeddleNode.partitionEvents).
The readIndex()-fenced revocation seam (design §9 #3) — reclaiming a crashed peer's stranded holdings remains specified, not shipped in v1 (part of #1602). The advisory-retire strand is a distinct, log-serialized recovery: see reconcile.
Peers currently flagged unresponsive or lost by the liveness detectors.
Functions
Open delegation across edge, serialized through the log (design §9 #2). The reshape serialization point: if the log-order state already gives edge's child a live inbound generation, this act loses and returns ControlOutcome.Conflict with a ControlConflict.DualInbound. It is refused with a ControlConflict.WeightBudget when edge's weight, beside the children already active at its parent in log order, would put a product a pick forms out of Long, or make the set too fine for one full lease (#3353).
Advertise this peer's per-edge appetite (HeddleNode.advertise).
The §8.2 bound metrics at parent (HeddleNode.boundMetrics).
Cancel reservation id (HeddleNode.cancel).
Stop new delegation across edge, serialized through the log (EntitlementLedger.close).
Complete reservation id, charging actualCost (HeddleNode.complete).
Remove this peer from the log-known roster, serialized through the log. Idempotent.
Add replica to the log-known roster, serialized through the log — the set a later barrier quantifies its acknowledgments over (docs/heddle-ledger-relocation-design.md §6.2). Idempotent: enrolling an already-enrolled replica is ControlOutcome.Applied.
The replicas enrolled as of the control log this peer has applied — the log-order membership fact, not the seam's open, moment-to-moment peer set. Two peers that have applied the same log prefix return the same set.
Mint amount root supply to holder, serialized through the log (design §9 #1). Suspends until the act commits; a partitioned minority never returns (it can never reach quorum), so a split can never both mint. Bound with timeout to surface a leader crash instead of hanging — but a timeout only cancels the await, not the proposal: the act may still commit, and a fresh mint call is a new act (a retried mint can double-mint), so resubmit only if a read confirms the first did not land. Returns ControlOutcome.Applied.
parent's current virtual time on this peer (HeddleNode.parentVirtualTime) — an unfenced read of the gossip-merged view, for diagnostics. A null is not by itself evidence that parent has no children, and nothing needs it to be: seating is the scheduler's Gauge bump, not something a caller carries into a record (issue #1752).
parentVirtualTime as a VirtualTime, exact and never held (design §7.1).
Introduce a new attachment generation, serialized through the log (EntitlementLedger.prepare).
Reconcile the budget stranded on child's RETIRED inbound edge(s) by re-homing everything they carry — net inflow and already-charged service — onto child's live inbound generation, serialized through the log (design §9 #3, §5.4; issue #1665). It removes the permanent LedgerConflict.PersistentNegativeHoldings / LedgerConflict.PerEdgeSafety / ClosureViolation left by a raced advisory-retire followed by a legal reparent.
Earmark up to maximumCost against holdings at leaf leaf (HeddleNode.reserve), or GateClosed while the isWritable boot gate is closed — this peer must have enrolled before it may author entitlement. ReserveOutcome.NoHoldings keeps its ordinary meaning: the gate is open and the leaf cannot cover the request.
Retire edge, serialized through the log (EntitlementLedger.retire). Refused locally (before proposing, returning a ControlConflict.Refused at index ControlOutcome.NOT_COMMITTED) when the data-plane view shows the edge is not drained (EdgeSummary.outstanding != 0): retiring a non-drained edge would strand its outstanding entitlement, because a RETIRED edge drops off the live lineage the data plane drains through. Once past the local drain check, the committed retire is gated purely on the log-order lifecycle being CLOSING — a deterministic apply. A PREPARED edge is refused here even though EntitlementLedger.retire takes an unused one (#3198): a retire already in a log over a PREPARED edge was refused when it committed, and stays refused.
Run allocation rounds at parent, delegating holdings toward demand (HeddleNode.schedule). Answers what HeddleNode.schedule answers while the gate is open, or GateClosed — delegating nothing — while the isWritable boot gate is closed.