Skip to content

Implement cost.budget capability + BUDGET_EXHAUSTED error #25

@nficano

Description

@nficano

ARCP v1.1 §9.6 introduces cost.budget as a runtime-enforced lease capability with counters. Not implemented.

Steps:

  1. Add CostBudget capability type (max, unit, consumed) to lib/src/main/kotlin/dev/arcp/lease/
  2. Implement runtime counter in ARCPRuntime — increments on metric events tagged as cost
  3. When consumed >= max, raise BUDGET_EXHAUSTED error (see related error-code issue)
  4. Subset semantics: child budget must be ≤ parent
  5. Add samples/CostBudget/ mirroring typescript-sdk/examples/cost-budget/
  6. Add tests

Reference: spec §9.6, §13.5.


Audit reference: ARCP SDK Audit v1.1 (2026-05-19)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature implementationv1.1ARCP v1.1 feature work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions