Expand description
§phi-cap
Capability vocabulary for the phi family: one declaration language, one decision vocabulary.
Two layers, one refinement point:
CapabilitySpec (scoped declaration) --class_of--> Capability (coarse decision)
fs:read{paths} read_fs
net:http{hosts} net
process:spawn{programs} process
device:input{targets} device
device:capture{targets} device- Declaration layer — what a plugin manifest or capability pack writes. Scopes are mandatory; undeclared = not granted (fail-closed).
- Decision layer — what
Policymatches on. Coarse action-surface classes; never data semantics (a remote DB query isnet, the same query on a local file isread_fs).
The only translation is class_of. New dimensions extend
CapabilitySpec variants — never a third enum (iron rule 2).
Zero hard dependencies; enable serde for wire formats (plugin
manifests). Wire tags keep the dotted face:scope names
("fs:read", "net:http", …).
O7 cross-class rule: a method carrying several capabilities resolves to the highest-risk class (`device > process > net > write_fs > read_fs
pure
) — see [class_of_all`].
Structs§
- Device
Capture Spec - Device capture face (
device:capture): screenshots and friends. - Device
Input Spec - Device input face (
device:input): pointer / keyboard / touch injection. - FsRead
Spec - Readable directories/files (resolved to absolute paths and pinned by the registry at install time — “whoever declares, pins”).
- NetHttp
Spec - Outbound HTTP host allow-list (normalized and pinned at install time).
- Process
Spawn Spec - Process spawn face (
process:spawn).
Enums§
- Capability
- Coarse capability class — the decision key handed to
Policy::allow. - Capability
Spec - Capability allow-list entry — the declaration form (fail-closed: undeclared = not granted).
- Resolved
Capability - A declaration with its scope resolved/pinned — the registry’s view.
- Scope
Kind - What kind of scope a declaration carries. The registry pins exactly this (“whoever declares, pins”): paths become absolute, hosts normalized, targets/programs kept as declared.
Functions§
- class_
of - The refinement: declaration → decision class (sdk-assembly §4.1).
- class_
of_ all - Collapse a multi-capability method to one policy key (O7): take the
highest-risk class — a method that both reads files and spawns
processes is decided as
process. - device_
capture device:capture{targets}— helper for declarations.- device_
input device:input{targets}— helper for declarations.- fs_read
fs:read{paths}— helper for declarations.- net_
http net:http{hosts}— helper for declarations.- process_
spawn process:spawn{}(unrestricted) — helper for declarations.- process_
spawn_ programs process:spawn{programs}— helper for declarations.- resolve
- Resolve a declaration into its pinned form — scope is preserved verbatim
here; path/host pinning is the installer’s job (see agent-works
resolve_capabilities, which this type set sinks from). - scope_
kind - The scope kind a declaration carries.