feat(sdk): add capabilities::enumerate for sys enumerate-capabilities#55
Conversation
Wraps astrid:sys/host.enumerate-capabilities (astrid-runtime/wit#13) as the infallible list dual of capabilities::check: returns the calling capsule's own held capability names — the categories declared in its [capabilities] manifest block (host_process, net_connect, fs_read, …), not the scoped arguments within them. Argument-free, returns Vec<String> with no error path (an empty list is the valid no-capabilities answer). Contracts submodule bumped to pick up the new sys function.
There was a problem hiding this comment.
Code Review
This pull request introduces capability introspection by adding the capabilities::enumerate function (and the underlying enumerate-capabilities WIT function) to list the calling capsule's own held capability names. The feedback identifies an issue with the intra-doc links [check] and [enumerate] in the capabilities module documentation, which will fail to resolve and should be fully qualified as [capabilities::check] and [capabilities::enumerate].
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What
Adds
capabilities::enumerate()toastrid-sdk— the ergonomic wrapper forastrid:sys/host.enumerate-capabilities(astrid-runtime/wit#13, merged), implemented kernel-side in unicity-astrid/astrid (feat(sys): implement enumerate-capabilities + complete check-capsule-capability).It is the infallible list dual of
capabilities::check: returns the calling capsule's own held capability names — the categories declared in its[capabilities]manifest block (host_process,net_connect,fs_read, …), not the scoped arguments within them. Argument-free, returnsVec<String>with no error path (an empty list is the valid "no capabilities" answer), so a reusable capsule can ground its behaviour in what it can actually do instead of hard-coding it.The
contractssubmodule is bumped to the merged9742f80soastrid-sysregenerates the binding;astrid-sys/wit-stagingrestaged.Stacking
Stacked on
feat/process-persistent-sdk(#53) — base is that branch, so the diff shows only the enumerate delta. Rebase ontomainand retarget once #53 lands.Verify
cargo build --workspaceandcargo clippy --workspace --all-targetsgreen.