A capability declares its own quota, config, and store
Parent: capabilities
mcp-capability-plugins explains that a builtin is a manifest plus an MCP process in a sandbox. This page is about the part the host used to hand-write for each one: how many times a code may use it, which settings the owner can tune, where its rows live, and what it may ask the host for. Each of those is now a declaration in the capability's own manifest.yaml, executed by a generic sub-package that contains no business word — no "booking", no "working_hours". The host reads three lines and enforces them; the capability owns the meaning. Every claim below cites the tree at 6eb8c0a64 (2026-09-26, after the everything-is-a-block rename: capabilities/cap* → plugin/block*). This is external-means-fully-external made concrete: an externalized capability owns its storage too, or it was only relocated.
The manifest is data
The on-disk shape is backend/blocks/<id>/manifest.yaml (go:embed-ed by backend/blocks/embed.go), parsed directly by backend/internal/plugin/load.go into the host's plugin.Manifest (backend/internal/plugin/manifest.go:74-135; the declaration types live in manifest_decls.go). The fields that matter here:
quota→Manifest.Quota Quota(manifest.go:128;manifest_decls.go:126-129): three strings —config_key(which field on the subject holds the cap, e.g.max_bookings),collection(which collection in the capability's own store holds usage, e.g.bookings),subject_field(which document field names the subject,subject_id). Incomplete → notUsable→ no gating: when the host cannot count, "don't gate" beats "gate blindly" (Usable,manifest_decls.go:139-141).claim_gate→ClaimGate ClaimGate(manifest.go:129;manifest_decls.go:149-162):tool+phrases. If the answer asserts the action is done, this turn must carry that tool's success receipt (F-A-37: four "Booked" lines with no tool call). Judged by the kernel at turn end; the manifest only declares.config/code_config/role_config→ three[]ConfigFieldmounted on owner / code / role (manifest.go:125-127;manifest_decls.go:84-91):key,label,type(string|int|bool|time|string_list,manifest.go:61-67),default(JSON-quoted per type byDefaultOf,manifest_decls.go:104-118),min/max. Defaults and validation live in exactly one place — the declaration. A role value freezes into the RoleSnapshot with the session (role-snapshot-frozen);notify_ownerused to be a kernel column touching nine generated files.visitor_tools→VisitorTools []VisitorTool(name +requires) + the derivedVisitorToolRequires() map[string][]string(manifest.go:123;manifest_decls.go:24-26,169): the tool-to-capability answer that must exist before dialing, plus per-tool action-qualified deps (calendar_bookrequirescalendar:events.insert) so a read-only calendar hides only the write tools (F-B-8). Both YAML spellings are accepted (VisitorTool.UnmarshalYAML,manifest_decls.go:51).owner_tools→OwnerTools []OwnerTool(manifest.go:124;manifest_decls.go:73-77): name / internal tool / description /input_schemaas literal JSON, validated at load (load.go:195-202) — the owner-MCP table must be enumerable at assembly without spinning up the sandbox.transport.sandbox.host_ops→Transport.Sandbox.HostOps []string(manifest.go:171-175): the names of host operations this capability wants opened. Names, not socket paths — the path is derived by the host (/run/standmeet/<id>.sock,hostop/op.go:29-32) and injected asSTANDMEET_HOST_SOCKETonly when the list is non-empty (load.go:147-156).acl→ACL string(the ACL (access-control list) gate,manifest.go:53-55,118-120):alwaysorrole_granted; anything else, including absent, is mapped torole_granted— a missing declaration never opens a capability to everyone (normalizeACL,source.go:170-175).
The sub-packages — each one a mechanism the host used to hand-write
blockstore— its own schema. One Postgres schema per(kind, id)—mcp_<id>/supplier_<id>/microsite_<id>(schema.go:24-40) — holding a genericrecords(id, collection, doc jsonb, created_at)table plus aclaims(collection, key, expires_at)table with a primary key on(collection, key)(backend/internal/plugin/blockstore/store.go:60-89). The document is opaque; queries are collection + JSON containment. The schema name is always derived from the host-trusted pair and must passassertDroppable(reserved prefix,[a-z0-9_]suffix, core-schema blocklist) before it is spliced into DDL (data definition language);Dropis the onlyDROP SCHEMAin the codebase (schema.go:61-88,store.go:91-113).Claimis a single-winner insert-or-take-over-expired with a 5-minute cap — the F-B-15 double-booking fix, a primary-key conflict rather than code ordering (claim.go:22-60).blockconfig— settings by declaration. AStoreis bound to(kind, blockID)at construction, so a handle can only read its own capability (blockconfig.go:38-49). Four attachment points, four collections:blockconfig(owner),blockconfig_code,blockconfig_role,blockconfig_key(scope.go:29-76). The declaration is authoritative both ways: a stored key no longer declared is never returned; an undeclared key on write is rejected (blockconfig.go:83-103,176-187). A field with no declared default reads as JSONnull, never""— the empty string once failed every read of booker's unset per-code cap and hidcalendar_bookfor authorized visitors (DefaultOf,plugin/manifest_decls.go:104-118). This closed the settings twin: beforecc5c1db47(2026-07-31) the host carried its own copy of booking policy and had already drifted from the sandbox (18:00/15 vs 17:00/0);aab8abe90(2026-08-01) made the per-code field a declaration and deletedbooker_code_config.go,booker_code_store.go,booker_quota.gofrom the composition root.blockquota— live counters in the capability's own store.Counterreads the limit from the subject's config byConfigKeyand counts rows in the capability's ownCollectionwhereSubjectFieldequals the subject id (backend/internal/plugin/blockquota/blockquota.go:73-139).AllowandRemainingare one count with two outputs — the #135 externalization once restored only the gate and leftquota_remainingnil for weeks (:12-16). Unset / null / ≤ 0 → unlimited (nil, never 0). The kernel's own per-code booking count (CountBookingsByCodeindb/queries/access_codes.sql, removed atf376b0432, 2026-07-25) and theaccess_codes.max_bookingscolumn (removed atb73c932bb) are the ledger this retired: the count now lives where the rows live.sandbox/sandboxws— two runners, one workspace manager.internal/infra/sandbox/sandbox.gois the one-shotdocker runfor owner-curated skill scripts (--network=none --read-only --tmpfs /tmp --memory --cpus --rm;SANDBOX_DRIVER=dockerelse disabled,:107-124,194-214).internal/infra/sandbox/stdio.gobuilds the bubblewrap (bwrap) argv for long-running MCP servers:/pluginread-only,/workspaceread-write when provisioned,--unshare-netunlessallow_net,--die-with-parent, host sockets bind-mounted by path (:81-98,124-185).sandboxwsowns the per-session workspace directories keyed by conversation id, lazily provisioned, swept by TTL (time to live) with a re-stat before removal (internal/infra/sandboxws/manager.go:55-69,106-153). Guards:real-third-party-mcp-sandboxed.spec.ts,sandbox-workspace-ttl-cron.spec.ts.hostdesk— the inbound convergence. A capability has no network; it reaches the host only through the named ops it declared.hostdesk.Collectgathershostop.Op{Name, Description, Invoke}from each domain's facade plus the two per-capability sources (its bound store, its bound config — served byinternal/routes/blockdesk) (backend/internal/routes/hostdesk/hostdesk.go:73-84);ServeAtopens exactly the requested names on the derived socket, and an unknown name is an error (:95-106,125-143) that the composition root turns into a startup panic (backend/cmd/server/wire/hostdesk.go:51-77). A capability that names nothing gets no socket at all —ask_visitoris fully offline. The mirror-image of the outbound dispatcher and the socket mechanics are on convergence-inbound-and-outbound and capsocket; not repeated here.
ACL = always — the trio
Three manifests say acl: always: ask_visitor, corpus.retrieval, summarize_conversation (backend/blocks/*/manifest.yaml, line 5–6 of each). calendar.book and mail.send are role_granted. At registration plugin/mount hands the always-list to the registry (SetAlwaysGranted, registry/registry.go:198-202; mount/register.go:59), and the frozen snapshot answers exposure with RoleSnapshot.AllowsBlock(blockID, aclAlways) — not code-denied AND (aclAlways || allowedTools contains it) (access/entity/role_snapshot.go:203-208). The same list feeds DockableBlockIDs (registry/registry.go:217), so the admin panel can no longer offer a dock button a visitor could never see (F-D-13).
How a Binding is assembled per session
- The input is per-session only; a capability holds its own deps as a closure.
AssembleInput{RoleSnapshot, OwnerID, Mode, Subject, Visitor, ConversationID}plus unexported bundle scratch fields (backend/internal/plugin/registry/types.go:59-81).Subject{Kind, ID}iscodeorapi_key(subject.go:15-38) — it used to beCodeID, so an outward key booked with zero gating (F-B-11). - Two gates before any dial.
exposablechecks the ACL, then the optionalSessionGate(plugin/mount/mounted.go:246-256). The quota gate is built per manifest from the declaredQuotaand translatesregistry.Subjectinto ablockconfig.Scopeat the composition root — the only place that sees both packages, with no fallback for an unknown kind (backend/cmd/server/blockwire/code_config.go:125-203). Exhaustion returnsErrQuotaExhausted, which wrapsErrHiddenso the chat face still hides the tool while the HTTP face can say why (types.go:26-41). - The result.
Binding{Tools, State, ClaimGate, Close}(types.go:103-112):State.QuotaRemainingis filled by the same counter'sRemaining;ClaimGateis carried as data and judged once by the kernel at turn end (registry/claimgate.go).dialAndListfolds a failed dial intoErrHiddenbut logs the real cause first — prod once ran withtools:0and nothing in the logs (F-A-1,mount/mounted.go:209-240).
Standing points and the honest ceiling
- Declaration is allowed to go stale, never silently.
VisitorToolsis reconciled against the realtools/liston every dial; a mismatch is logged and the real list wins (VisitorToolDrift,plugin/tool_drift.go:24). - Quota is per subject, not per session. Anonymous public/BYOAI (bring-your-own-AI) sessions have no subject and are never usage-gated (
subject.go:35-38); the cap on those tiers is gas, not count (feature-floor lists both). - The gate fails closed on a read error, and says so. A quota read failure hides the tool with a warn line naming cap + subject (
blockwire/code_config.go:182-190); before that line, a hidden tool looked identical to "unauthorized" and "no connector". - Claims still need a manifest.
blockstore.Claimexists, but onlycalendar.bookordersblockstore.claim/blockstore.release; any new peek-then-act capability must ask for them by name. - Only the builtins are on this path. The job-loop trio, skill runner, ext-mcp and openapi agent-tools are still
MustRegistered in-process (blockload/register_mechanisms.go:37-63) and declare none of this; that migration is the open structural work named on capabilities.
Built 2026-07-25 → 2026-08-01, extended through 2026-08-20. f376b0432 drained the kernel's booking ledger and gave capabilities their own store; cc5c1db47 (2026-07-31) added capconfig and deleted the host's settings twin; aab8abe90 (2026-08-01) added capquota + per-code declarations; 5cb8d8464 (2026-08-01) landed hostdesk + hostop.Op; the subject rename for API keys followed F-B-11 (2026-08-20). Guards: chat-book-quota-exhausted.spec.ts, api-key-booking-quota.spec.ts (an outward key is capped and the real calendar gains nothing), claim-needs-a-receipt.spec.ts, admin-gcal-policy-edit.spec.ts (declared defaults 09:00–18:00 / Mon–Fri / lead 2 / buffer 15 survive an edit), code-member-quota-concurrent.spec.ts, sandbox-workspace-ttl-cron.spec.ts, real-third-party-mcp-sandboxed.spec.ts.
Origin: #135 externalization (2026-07) and the F-B-8 / F-B-11 / F-B-15 / F-A-37 findings; verified against standmeet-new 6eb8c0a64 on 2026-09-26. docs/design/hostdesk.md and capability-acl-hierarchy.md are seeds, not cited as evidence.