Named Capability Sets (capset)

6 sections

Overview

Implement capset — named transparent aliases for groups of capabilities. A capset declaration introduces a name that expands to its constituent capability list during name resolution, before type checking. Capsets are not traits, types, or runtime constructs.

Planned

6 sections
Section 1 Not Started

Lexer — capset keyword

Recognize the `capset` keyword and emit a dedicated TokenKind::Capset token. Pre-existing source uses `capset` as an identifier in some narrow contexts (e.g. comment text); reservation must not break existing valid programs.

0/0 tasks
Section 2 Not Started

Parser — capset_decl dispatch + AST node

Parse `capset Name = Cap1, Cap2, ...;` declarations into a CapsetDecl AST node attached to the module's declaration list. Reject malformed forms with structured E1xxx errors.

0/0 tasks
Section 3 Not Started

Typeck — capset expansion in uses clauses, cycle detection, visibility

Expand every capset reference in `uses` clauses to its transitive constituent capabilities, deduplicated. Reject cycles and visibility violations. Per proposal §Expansion + §Validation.

0/0 tasks
Section 4 Not Started

Diagnostics — E1221 / E1222 / E1223 / E1224 (capset errors)

Emit clear, actionable diagnostics for every capset-validation failure: empty member list, cycle, invalid member, visibility violation. Each error code is stable API per impl-hygiene.md §Error Handling.

0/0 tasks
Section 5 Not Started

Spec tests — capset declarations, expansion, validation

Author the Ori spec test corpus exercising every capset success path and every documented failure mode. Lands as the public-facing conformance surface for the proposal.

0/0 tasks
Section 6 Not Started

LSP support — capset expansion on hover, autocomplete in uses clauses

Surface capset expansion + autocomplete in the LSP integration so users see what capabilities a capset names without hand-grepping the source.

0/0 tasks