feat(capabilities): compound capability predicates (66b) - #289
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backlog item 66b — compound capability predicates. Adds a structured, enumerable predicate over the bound operation call to
CapabilityFact, evaluated by a new collecting APIviolations_for(bound_call) -> frozenset[CapabilityFact], alongside an unchangedcapability_for.What
schema.py):ClauseOp(EQ/IN/IS_SET/IS_NULL/IS_LITERAL/MATCHES_CLASS),Clause,Predicate(canonical-ordered, order-insensitive eq/hash), andCapabilityFact.predicatewith registration validation (BUILD-only, value-agnostic, GATE-only, UNSUPPORTED/EXPR_CAPABLE only, param-is-a-clause-root).predicates.py):BoundCall,bind_expression_call, path resolution (declared-field/enum/mapping traversal, loudValueErroron missing, rootLiteralNodeunwrap), clause evaluation (§4.4 dynamic-arg semantics), and a sound subsumption/overlap lattice.registry.py): a separate_predicate_factsstore (predicate facts carryoption_value=None/value_class=Noneand must not collide with value-agnostic facts),violations_for, a registration-time conflict check (block-vs-permit, dialect-scope-compatible, strict-subsumption resolves), and snapshot/restore/reset coverage.violations_foronce per call, in addition to the existing per-param loops.fact_sort_keytotals over predicate facts; the argument-probe filter excludes them.Design decisions (spec rev 3, post adversarial review)
IS_SETis pure §4.2 value semantics (the §5 "reads supplied" conjunction made the subsumption lattice unsound);BoundCall.suppliedis still recorded.violations_forcollects only UNSUPPORTED GATE predicate facts;EXPR_CAPABLEparticipates in the conflict check only.Verification
ruff:checkclean.mypy: 97 pre-existingimport-untypederrors, none in changed files.Spec:
2026-07-28-compound-capability-predicates-design.md; plan:2026-08-15-compound-capability-predicates.md.