Skip to content

[dynapi] Capability gating for dynamically provided APIs (no new authority) #2005

Closed

Description

@Xuepoo

Priority: P1 | Area: plugins | Labels: feat,P1,area:plugins | Milestone: v0.1.0 | Design: dynamic extension-API registration (2/4)

Summary

Capability gating for dynamically provided APIs: a provided interface
can only project already-existing Core capability heads through a
grant — it can never mint new authority. Provide-side declares,
consume-side consents, execution stays argv-first and budgeted.

Trust model (non-negotiable, shared with 1/4)

Allowlist membership = participation only. A provided fetch-shaped
API from a listed extension still answers to the egress policy (#1905),
digest arbitration (#1906), consent levels, and budgets. The gate below
is what makes "trusted list" safe to have.

Current state

  • bitty.services.provide(iface, impl-table) takes 2 args with no
    capability linkage; a provided callable's underlying authority is
    undeclared and unmediated.
  • Manifest services.provided/required fields exist but carry no
    authority semantics.

Target state

  • Provide-side manifest declaration (extends services.provided):
    which interface, which version(s), and which Core capability head(s)
    back it (e.g. an http interface must name the network.egress
    head; unbacked provides are rejected at install/record time).
  • Consume-side: services.get requires the consumer's grant to cover
    the backing head; otherwise fail-closed (indistinguishable from
    absent, same posture as bitty.env).
  • Execution: argv-first invocation, deadlines, and per-call budgets
    unchanged; the broker records provider owner + backing head per call
    for the observability issue (4/4).

Acceptance criteria

  • Undeclared provide (no backing head) rejected at record/install
    time with a naming diagnostic.
  • Ungranted consume fails closed; granted consume works; grant
    revocation takes effect without restart where the store supports
    it (document where it does not).
  • Hostile tests: confused-deputy (A provides, B consumes without
    grant), head-spoofing (provide naming a head it was never granted).
  • No new ambient authority: rg clean for direct socket/process/fs
    paths from the broker.

Dependencies

Scheduling

Post-0.0.23, 0.0.24 window (milestone v0.1.0). No implementation until a
CarryCtx task is claimed; this issue is the 立案 record only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1area:pluginsfeat

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions