Skip to main content

Module capability

Module capability 

Source
Expand description

The typed capability — a single (resource, ability) grant — and the attenuation (⊆) relation that is the core ceiling invariant of S5 (#571).

A UCAN delegates authority as a set of capabilities. The cardinal rule of the whole epic (#547, design “ceiling/attenuation”) is that a delegation can only ever narrow, never widen: every capability a child UCAN claims must be covered by (⊆) some capability its delegator held. If it is not, the chain is rejected — fail-closed. The compiler then lowers the root of a validated chain into a TE ceiling that is guaranteed to be no wider than what was reviewed.

§What lives here vs. what is deferred

This module is deliberately vocabulary-independent (S5 milestone 1). A Capability is (Resource, Ability, Caveats) where:

  • Resource is a hierarchical URI-like string (mac://model/qwen-7b); the subset relation on resources is prefix/* containment — structural, not tied to any concrete app vocabulary.
  • Ability is the action verb (infer, model/*, *); subset is namespace containment (a/b ⊆ a/* ⊆ *).
  • Caveats is an opaque CBOR map of restrictions; for milestone 1 the subset rule is the conservative “more caveats = more restricted, and a child may only add caveats or keep them equal” — the safe default. The value-aware caveat algebra (e.g. numeric ranges) is a milestone-2 seam.

The mapping from an Ability/Resource to S3’s concrete ScopeAction/Operation + object types — i.e. what the verbs mean to the enforcement layer — is the action vocabulary that lands after S3 (#582). This module never needs it: attenuation is purely structural.

Structs§

Ability
An action/verb a capability authorizes, e.g. infer, model/read, *.
Capability
A single capability: authority to perform Ability on Resource subject to Caveats. The atom of UCAN delegation and the unit attenuation operates on.
Caveats
Opaque restriction map attached to a capability (UCAN “caveats”).
Resource
A hierarchical resource identifier a capability applies to.

Enums§

CaveatValue
A single caveat value. Kept as a small, comparable, deterministically serializable shape so caveat maps hash/compare stably. Rich/value-range caveats are milestone 2.

Functions§

set_attenuates
Is the capability set claimed entirely covered by the capability set held? True iff every claimed capability is authorized by at least one held capability. This is the set-level attenuation used between adjacent links of a delegation chain.