Repository navigation
Description
Epic: CPEX Rust Core (#12)
Summary
Implement the full CMF extension type system in cpex-core with compile-time enforcement of mutability tiers. Replace the current Phase 1 stubs (Extensions, FilteredExtensions) with the complete typed extension model matching the Python implementation.
Motivation
The current Rust core has stub extensions with only labels and custom fields. The full extension model — with immutable, monotonic, guarded, and mutable tiers — is needed for real policy evaluation, identity resolution, and session management.
Scope
Extension Types
SecurityExtension—MonotonicSet<String>for labels (add-only, no remove),SubjectExtension(immutable),ObjectSecurityProfile,DataPolicyDelegationExtension— append-only chain with scope narrowing enforcementMetaExtension— immutable tags, scope, propertiesHttpExtension—Guarded<T>requiringWriteTokenfor mutationRequestExtension,AgentExtension,MCPExtension,CompletionExtension,ProvenanceExtension,LLMExtension,FrameworkExtension— all immutableExtensionscontainer with all slots
Capability-Gated Filtering
filter_extensions()— buildFilteredExtensionsper plugin based on declared capabilities- Slot registry mapping each extension field to its mutability tier and required capability
- Read/write capability semantics (write implies read, subject sub-field capabilities)
Merge and Validation
merge_extensions()— accept back only writable slots, validate tier constraintsvalidate_tier_constraints()— immutable rejected, monotonic superset-checked, guarded requires capability
Acceptance Criteria
MonotonicSethas noremove()— compile-time enforcedDelegationExtension.push()rejects scope escalationGuarded<T>requiresWriteTokenfor write accessfilter_extensions()hides extensions the plugin hasn't declared capabilities formerge_extensions()rejects immutable modifications and monotonic removals
References
- CMF Specification
cpex/framework/extensions/(Python implementation)cpex/framework/extensions/tiers.py(slot registry, filter, merge)cpex/framework/session.py(session store)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Projects
- StatusShow more project fieldsDone
Activity
address P0/P1/P2 review findings (except #17)
feat: cgo Go bindings (#45)
feat: cgo Go bindings (#45)
feat: cgo Go bindings (#45)
feat: cgo Go bindings (contextforge-org#45)
feat: cgo Go bindings (contextforge-org#45)
feat: cgo Go bindings (#45)
fix: subject-bind client-supplied session ids in the resolver (#66)