Expand description
Capability computation — CAP-AIR pass.
Computes capability requirements for each function in a module by:
- Annotation extraction —
@requires(Capability.Network, ...)annotations are parsed from each function’s annotation list. - Effect correlation — IO effects imply platform capabilities
(e.g.
Log→Io.Stdout,Http→Io.Network). - Call-graph propagation — required capabilities from callees are unioned into the caller’s capability set.
- Verification — declared (
@requires) capabilities are checked against inferred requirements per strictness level.
§Strictness
Sketch: no diagnostics; capabilities are inferred silently.Development: missing@requireson public functions produces warnings.Production: missing@requireson all functions produces errors.
§@requires additivity
Per spec, @requires is additive: a declaration’s capability set is
the union of the module-level @requires and its own @requires.
This pass operates purely at the function level; module-level annotations
are collected first and unioned into every declaration’s declared set.
Re-exports§
pub use crate::Strictness;
Structs§
- Capability
- A platform/language capability required or provided by a node.
- Effect
Ref - A reference to an algebraic effect, identified by its fully-qualified name.
Functions§
- compute_
capabilities - Compute capability requirements for every function in
module. - verify_
capabilities - Verify capability declarations in
moduleagainst actual usage.
Type Aliases§
- Capability
Set - The set of capabilities required by a node.