daemon: capability issuance — HTTP mint/list/revoke + shell mint verb (slice 4 of #47)#54
Merged
Merged
Conversation
…#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>
Deploying string with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Capability issuance (#47 item 3) — retires manual
capabilities.jsonseeding:POST /capabilitiesmint → 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"), escapingpath_prefix, non-positive ttl (all 400).GET /capabilities[?agent_id=]— public records only, never secrets.DELETE /capabilities/:tokenId— revoke;/describenow advertisescapability-tokens.--ttlaccepts90s/30m/1h/2d;--agentdefaults to the current agent. Mint output warns the secret is shown once.mintCapability/listCapabilities/revokeCapability.runtime/system-api.md(rootdocs/—apps/docscontent 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
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/clienttypecheck clean;apps/docsastro 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