Skip to content

daemon: capability issuance — HTTP mint/list/revoke + shell mint verb (slice 4 of #47)#54

Merged
simyung-h1r merged 1 commit into
mainfrom
nova/slice-4-issuance
Jul 8, 2026
Merged

daemon: capability issuance — HTTP mint/list/revoke + shell mint verb (slice 4 of #47)#54
simyung-h1r merged 1 commit into
mainfrom
nova/slice-4-issuance

Conversation

@simyung-h1r

Copy link
Copy Markdown
Contributor

What

Capability issuance (#47 item 3) — retires manual capabilities.json seeding:

  • POST /capabilities mint → the only place the secret ever appears (201). Refuses: unknown workspace (404 — a capability must target a real agent), non-data verbs ("not on the system plane"), escaping path_prefix, non-positive ttl (all 400).
  • GET /capabilities[?agent_id=] — public records only, never secrets.
  • DELETE /capabilities/:tokenId — revoke; /describe now advertises capability-tokens.
  • Shell mint verb through the agent hub, sugar over the same route (one code path with pairing per the Q4 ruling):
    string agent capability mint --path outbox/report.pdf --verbs get --ttl 15m --single-use
    string agent capability list
    string agent capability revoke <token_id>
    
    --ttl accepts 90s/30m/1h/2d; --agent defaults to the current agent. Mint output warns the secret is shown once.
  • Client SDK: mintCapability / listCapabilities / revokeCapability.
  • Docs page runtime/system-api.md (root docs/apps/docs content is a symlink to it): two-planes model, boundary rule, fs status table, token model, and the requested worked outbound-attachment example (mint single-use read cap → hand String URI + cap to channel server → syscall GET → replay 401s) — doubles as atlas's integration recipe. Sidebar entry added; docs build clean.

Verification

  • Suite: 1188 passed / 0 failed. New capability-issuance.test.ts: live-minted token feeds fs with no restart/seeding (the exact failure mode from today's manual-seed episode), HTTP mint validation, list secrecy + agent filter, revoke kills fs access, HTTP-minted presigned single-use consumed exactly once, and a CLI e2e that walks the docs example verbatim (mint → PUT → single-use mint → presigned GET → replay 401 → list shows id but no secret → revoke → 401).
  • packages/string + packages/client typecheck clean; apps/docs astro build renders /runtime/system-api.

Slice 4 of the approved #47 plan. After merge: dogfooding daemon rebuild (atlas mints per-run against his own disposable agent — today's shared-fixture/teardown collision class disappears), then slice 5. Reviewer: Leo.

🤖 Generated with Claude Code

…#47 item 3)

POST /capabilities mints a scoped fs capability into an existing agent
workspace (404 if the workspace doesn't exist — a capability must target
a real workspace); the mint response is the ONLY place the secret ever
appears. GET /capabilities lists public records (optionally filtered by
agent_id, never includes secrets); DELETE /capabilities/:tokenId revokes.
/describe advertises 'capability-tokens'.

Pairing and shell minting share this one code path per the plan ruling
(pairing = /agents provisioning; slice 5 composes the two): the shell
verb is sugar over the same route —

  string agent capability mint --path outbox/report.pdf --verbs get \
    --ttl 15m --single-use
  string agent capability list
  string agent capability revoke <token_id>

wired through the agent hub (cmdAgentCapability in management.ts), with
--ttl accepting 90s/30m/1h/2d and --agent defaulting to the current
agent. Client SDK gains mintCapability/listCapabilities/revokeCapability.

New docs page runtime/system-api.md: the two-planes model, boundary
rule, fs verb semantics + status table, token model, and a worked
outbound-attachment example (mint single-use read cap → hand String URI
+ cap to the channel server → syscall GET → replay 401s) that doubles as
the TLDR integration recipe.

Tests (capability-issuance.test.ts): live-minted token feeds fs with no
restart/seeding, mint validation over HTTP (unknown agent 404, exec verb
400, escaping prefix 400, zero ttl 400), list secrecy + filtering,
revoke kills fs access, HTTP-minted presigned single-use consumed
exactly once, and a CLI e2e that walks the docs example verbatim.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying string with  Cloudflare Pages  Cloudflare Pages

Latest commit: 122bcdb
Status: ✅  Deploy successful!
Preview URL: https://82fcbe35.string-bm6.pages.dev
Branch Preview URL: https://nova-slice-4-issuance.string-bm6.pages.dev

View logs

@simyung-h1r simyung-h1r merged commit f7bff34 into main Jul 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant