Lifecycle

@Serializable
enum Lifecycle : Enum<Lifecycle>

The lifecycle of one attachment generation — a four-point chain climbed in one direction only:

PREPARED < ACTIVE < CLOSING < RETIRED

Each edge's lifecycle is a max-register: the join of two observations is the higher one (maxOf, via the enum's declaration-order Comparable). That single rule delivers the design's key merge property for free — closure dominates activation (design §5.1, §10.10): a replica that has observed CLOSING can merge with any laggard still issuing across the edge and never regress to ACTIVE, because max(CLOSING, ACTIVE) = CLOSING. A concurrent re-activation cannot resurrect a closing edge; the promotion only ever moves forward.

The stored register is a per-edge Map<AttachmentId, Lifecycle> inside EntitlementLedger, merged componentwise by maxOf — a product of max-registers, itself a join-semilattice, so it slots into the ledger's product-of-lattices piece with no new merge machinery. Note: EntitlementLedger.lifecycle returns a derived read that defaults a known edge with no register entry to ACTIVE — that derived read is not the register value and can transiently regress before the edge's own entry has merged; the stored register itself never regresses. See that method's KDoc.

Semantics per state (design §5.1):

  • PREPARED — the edge exists, but no entitlement may cross it (delegation is refused down a prepared edge; it is not yet a live path).

  • ACTIVE — delegation is allowed; the edge is a live entitlement path.

  • CLOSINGno new delegation is admitted, but spend and release still flow so the edge can drain.

  • RETIRED — reached only once the edge has fully drained (EdgeSummary.outstanding == 0); nothing crosses it ever again, and its history stays queryable forever.

Entries

Link copied to clipboard

The edge exists but carries no entitlement yet — delegation down it is refused.

Link copied to clipboard

Delegation is allowed; the edge is a live entitlement path.

Link copied to clipboard

No new delegation is admitted; spend and release still drain the edge.

Link copied to clipboard

Fully drained (outstanding == 0); nothing crosses ever again, history stays queryable.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
fun valueOf(value: String): Lifecycle

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.