Package-level declarations

Types

Link copied to clipboard
data class BoundMetrics(val parent: GroupId, val configuredWorstCase: Long, val currentBound: Long, val observedDeviation: Long, @IntroducedAt(version = "0.7.5") val peakPositionFraction: Double = 0.0)

The three consistent pieces of the temporary fairness-error bound at one parent (design §8.2). While peers are unreconciled — mid-partition, before anti-entropy heals — different peers can independently steer entitlement among a parent's children, so the observed fairness error is bounded, not zero. This exposes the bound's pieces as derived metrics; the module "must not claim tighter than it proves" (design §8.2), so all three are reported and the tests assert they stay ordered observedDeviation ≤ currentBound ≤ configuredWorstCase.

Link copied to clipboard
sealed interface ControlConflict

Why a serialized (or locally pre-checked) control act was refused (see ControlOutcome.Conflict).

Link copied to clipboard
sealed interface ControlOutcome

The outcome of a committed control act, keyed to the log index it committed at. Because every peer applies the committed log against a log-pure projection (see HeddleControlPlane), every peer derives the same outcome for a given index — the proposer reads back its own act's outcome.

Link copied to clipboard
@Serializable
data class DemandBoard(val perEdge: Map<AttachmentId, Demand> = emptyMap())

One peer's advertised appetite across the edges it serves — the value carried in a peer's slot of the demand board (design §6).

Link copied to clipboard

The coordination-free spend/reserve surface a consumer gates work on — the honest "either node type" contract shared by both heddle front doors.

Link copied to clipboard
data class GateClosed(val replica: ReplicaId, val reason: GateClosed.Reason) : ReserveOutcome, ScheduleOutcome

The write gate is closed: this peer may not author entitlement, so it neither reserved nor delegated anything. Returned by GovernedHeddleNode.reserve and GovernedHeddleNode.schedule; a static HeddleNode has no gate and never returns it.

Link copied to clipboard

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.

Link copied to clipboard
data class HeddleConfig(val policy: PolicyConfig, val maxHoldingsPerPeer: Long, val demandTtl: Duration = 30.seconds, val quilter: QuilterConfig = QuilterConfig(), val heartbeat: HeartbeatConfig = HeartbeatConfig(), val random: Random = Random.Default)

Everything a HeddleNode needs beyond the fabric: the reference policy's quanta and caps, the §8.2 bound caps, the demand board's staleness window, and the injected randomness/replication/liveness knobs.

Link copied to clipboard

One peer's live view of a weighted fair-share session over a Seam — the join point of the fair-share layer (design §15 Phase 4). It bonds four coordination-free pieces onto one fabric:

Link copied to clipboard
sealed interface ReconcileOwnOutcome

What HeddleNode.reconcileOwn did: it moved this peer's own share of a retired edge's accounts, found none of its own left to move, could not move yet, or must not move at all.

Link copied to clipboard

Identity of one local reservation — a leaf earmark awaiting completion (design §4.4).

Link copied to clipboard
sealed interface ReserveOutcome

What FairShareExecution.reserve did — a reservation, an honest "nothing to spend here", or a refusal because this peer may not author entitlement at all yet.

Link copied to clipboard
sealed interface RevocationOutcome

The result of a RevocationSeam.revoke request.

Link copied to clipboard
interface RevocationSeam

The readIndex()-fenced revocation seam of design §9 #3 — specified, not shipped in v1.

Link copied to clipboard
sealed interface ScheduleOutcome

What HeddleNode.schedule and GovernedHeddleNode.schedule did: delegated something, found nothing to delegate, stopped because the parent cannot be ordered or its pick met the lifetime limit, or, on a governed node only, was refused because this peer may not author entitlement yet (issue #1892).

Functions

Link copied to clipboard
fun CoroutineScope.heddleGoverned(seam: Seam, self: ReplicaId, raft: RaftNode, root: GroupId, clock: () -> Instant, config: HeddleConfig, incarnation: String, epoch: Long): GovernedHeddleNode

Bootstrap a Raft-governed HeddleNode over seam — the consensus-backed front door of design §9, parallel to heddleStatic. The data plane is unchanged from H4 (a replicated ledger, demand board, reservations, and liveness over the seam); what governance adds is that the non-monotone acts — mint and topology reconfiguration — are serialized through the raft log rather than applied locally:

Link copied to clipboard
fun CoroutineScope.heddleStatic(seam: Seam, self: ReplicaId, root: GroupId, mint: Map<ReplicaId, Long>, topology: List<AttachmentRecord> = emptyList(), clock: () -> Instant, config: HeddleConfig, epoch: Long): HeddleNode

Bootstrap a HeddleNode over seam with a fixed roster and a pre-partitioned mint supplied at bootstrap — the static front door of design §9. There is no runtime mint and no consensus dependency: entitlement is created once here, topology changes are local strict-drain operations (HeddleNode.prepare/HeddleNode.activate/…), and any overlapping reshape simply surfaces as a conflict for the operator to drain. This is the right shape for small fixed rosters and tests; when supply or shape must change at runtime, use its sibling heddleGoverned, which serializes mint and reshapes on a Raft log.