CapSet

@Serializable
data class CapSet(val tokens: Set<String> = emptySet(), val attributes: Map<String, String> = emptyMap())

The set of capabilities a peer advertises about itself — the value carried in a peer's slot of the capability board (H8, design §14.6).

A CapSet is soft state: each peer publishes its own slot into an EphemeralMap (best-effort broadcast, aged out by local receive time), exactly like heddle's demand board. It is presence, not a ledger — a stale, duplicated, or expiring advertisement is fine, because the worst it can do is briefly misplace work, which warp's Results dedup and ring re-home already absorb. It can never authorize anything: eligibility introduces no conserved quantity, so it cannot touch conservation (design §14.6).

Two shapes of attribute are supported, both opaque to warp core:

  • tokens — boolean capabilities a peer either has or does not ("GPU", "AVX512", a held dataset id, a runtime name). Tested with has.

  • attributes — keyed capabilities with a value ("region" → "us-east", a memory class, a cost tier). Tested with attr.

The token/attribute strings are caller-defined; warp core never interprets them — it only evaluates an Affinity predicate against them.

Constructors

Link copied to clipboard
constructor(tokens: Set<String> = emptySet(), attributes: Map<String, String> = emptyMap())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the keyed capabilities this peer serves.

Link copied to clipboard

the boolean capabilities this peer serves.

Functions

Link copied to clipboard
fun attr(key: String): String?

The value this peer advertises for keyed capability key, or null if it advertises none.

Link copied to clipboard
fun has(token: String): Boolean

Whether this peer advertises the boolean capability token.