Skip to main content

Module lease_kernel

Module lease_kernel 

Source
Expand description

AXON Runtime — LeaseKernel (§λ-L-E Fase 3.2)

Direct port of axon/runtime/lease_kernel.py.

τ-decay token manager implementing Decision D2:

  • Compile-time: a lease references an affine or linear resource. The type checker already rejected persistent leases (no τ to decay).
  • Runtime: acquire emits a revocable LeaseToken with explicit τ (acquired_at, expires_at). Post-expiry use raises LeaseExpired (CT-2 Anchor Breach) unless a permissive policy is set.
  • Policy: on_expire ∈ {anchor_breach, release, extend}.

The kernel is an in-process registry; distributed coordination is deferred to a later phase.

Structs§

LeaseKernel
In-process registry of active leases.
LeaseToken
A single-use capability over a resource, valid only while τ is in the [acquired_at, expires_at) window. The token is effectively frozen — extension is implemented by minting a new token and revoking the old, preserving the linearity invariant.

Enums§

UseOutcome
Return value from LeaseKernel::use_token:

Functions§

parse_duration
Convert an Axon duration literal into fractional seconds.

Type Aliases§

Clock
Pluggable wall-clock. Defaults to Utc::now; tests inject a controllable clock to verify τ-decay without sleeping.