Repository navigation
feat: RUST with CMF and extensions. - #44
Merged
Merged
Conversation
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
Signed-off-by: Teryl Taylor <[email protected]>
terylt
marked this pull request as ready for review
May 1, 2026 16:49
Signed-off-by: Frederico Araujo <[email protected]>
araujof
added a commit
that referenced
this pull request
May 7, 2026
* feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]>
monshri
pushed a commit
to monshri/contextforge-plugins-framework
that referenced
this pull request
May 27, 2026
* feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]>
monshri
pushed a commit
to monshri/contextforge-plugins-framework
that referenced
this pull request
Jun 8, 2026
* feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]>
araujof
added a commit
that referenced
this pull request
Jun 10, 2026
* feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]>
araujof
added a commit
that referenced
this pull request
Jun 10, 2026
* feat: initial Rust Core (cpex-core and cpex-sdk) (#13) * feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> * feat: CPEX Rust config (#38) * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> * feat: RUST with CMF and extensions. (#44) * feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]> * feat: cgo Go bindings (#45) * feat: initial revision rust core. Signed-off-by: Teryl Taylor <[email protected]> * fix: addressed comments in PR. Updated PluginContext to match spec. Signed-off-by: Teryl Taylor <[email protected]> * feat: added yaml and routing rule support. Signed-off-by: Teryl Taylor <[email protected]> * feat: added example code to show how to load manager and plugins. Signed-off-by: Teryl Taylor <[email protected]> * fixes: updated plugin errors, configs to more match python. Signed-off-by: Teryl Taylor <[email protected]> * feat: RUST CMF initial revision. Signed-off-by: Teryl Taylor <[email protected]> * feat: added invoke named support, added constants, fixed reviewed code. Signed-off-by: Teryl Taylor <[email protected]> * feat: added owned extensions and did some refactoring. Signed-off-by: Teryl Taylor <[email protected]> * feat: added cgo and golang bindings, examples and readme. Signed-off-by: Teryl Taylor <[email protected]> * address P0/P1/P2 review findings (except #17) Signed-off-by: Teryl Taylor <[email protected]> * fix: address remaining P2/P3 review findings + testing gaps Signed-off-by: Teryl Taylor <[email protected]> * docs: add CPEX Go public API spec Signed-off-by: Frederico Araujo <[email protected]> * docs: renamed document Signed-off-by: Frederico Araujo <[email protected]> * feat(cpex-rust): CGO review passes 1-11 + lint cleanup + Makefile targets Signed-off-by: Teryl Taylor <[email protected]> * fix: address linting issues, updated makefile to support building examples. Signed-off-by: Teryl Taylor <[email protected]> * docs: updated the go spec to reflect recent changes. Signed-off-by: Teryl Taylor <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]> * docs: intial rust specification (#50) Co-authored-by: Teryl Taylor <[email protected]> * feat: change Plugin handler to async for performance (#49) Co-authored-by: Teryl Taylor <[email protected]> * fix: missing cmf-demo main.go file and gitignore fix that missed it (#52) Co-authored-by: Teryl Taylor <[email protected]> * feat: initial APL Rust implementation (#60) * fix: initial revision APL. * feat: apl-cpex bridge crate + plugin-registry-driven hook dispatch * feat: add support for plugin calling in APL routes. * feat: add more APL plugin support, unified config * feat: added cedar direct PDP. * feat: add identity hook and extensions. * feat: added token delegation hooks and tests. * feat: added plugin for jwt token identity, oauth and biscuit delegation, cedarling PDP. Signed-off-by: Teryl Taylor <[email protected]> * fix: updated identity and delegation to support keycloak. added delegate() function, and identity sections. * fix: added some sample plugins, added updates to support cedar. Signed-off-by: Teryl Taylor <[email protected]> * feat: added session support, serialize and parallel and full effects capabilities. * feat: add ffi pre-built .a library Signed-off-by: Frederico Araujo <[email protected]> * chore: add workflow_dispatch target Signed-off-by: Frederico Araujo <[email protected]> * fix: critical and high issues from review. * feat: add APL FFI and go bindings Signed-off-by: Frederico Araujo <[email protected]> * chore: add musl tools to musl runners Signed-off-by: Frederico Araujo <[email protected]> * fix: potential double free after use bug. * chore: update Go module paths after repo rename to cpex * feat: map identity extension into cpex ffi Signed-off-by: Frederico Araujo <[email protected]> * feat: add cpex_invoke_resolved abi Signed-off-by: Frederico Araujo <[email protected]> * fix: has_hook_for handling Signed-off-by: Frederico Araujo <[email protected]> * chore: update headers Signed-off-by: Frederico Araujo <[email protected]> --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Frederico Araujo <[email protected]> * fix: session binding Signed-off-by: Frederico Araujo <[email protected]> * chore: updated comments Signed-off-by: Frederico Araujo <[email protected]> * tests: added more session tests for Tier 1 ids. --------- Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: terylt <[email protected]> Co-authored-by: Teryl Taylor <[email protected]>
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.
Summary
Adds CMF (ContextForge Message Format) types, full extension model with 11 typed extensions, capability-gated
filtering, mutability tier enforcement (MonotonicSet, Guarded, WriteToken), and COW-based extension modification to
the CPEX Rust core.
Closes: #17
Changes
cmf/module — CMF Message, ContentPart (tagged enum), domain objects (ToolCall, ToolResult, Resource, etc.),enums, MessageView with OPA serialization
extensions/module — all 11 extension types matching Python: Security (with AgentIdentity), Http, Delegation,Agent, Request, Completion, Provenance, LLM, MCP, Framework, Meta
extensions/monotonic.rs—MonotonicSet<T>add-only set, noremove()at compile timeextensions/guarded.rs—Guarded<T>+WriteTokenfor capability-gated write accessextensions/filter.rs—filter_extensions()with granular security sub-field filtering, slot registry withpolicies
hooks/payload.rs—Extensionsexpanded to 11 slots with Arc immutable + owned mutable/monotonic,cow_copy()for zero-cost COW,
validate_immutable()for tamper detection, write token propagationexecutor.rs—filter_extensions()wired into all 4 phases, write tokens set from capabilities, tier validation(immutable + monotonic) on modified extensions
FilteredExtensionsremoved — singleExtensionstype, handlers receive&Extensions(immutable, zero-copy)cmf_capabilities_demoexample — CMF message + config-driven capability gating end-to-endrcfeature enabled for Arc serializationArchitecture highlights
&Extensions, no clone. 95% of plugins pay nothing.extensions.cow_copy()clones only mutable slots (Arc bumps for 8 of 12 immutableslots). Write tokens propagate from the executor, can't be forged (
pub(crate)constructor).MonotonicSethas noremove(),GuardedrequiresWriteTokenfor.write(). Plugin crates can't construct tokens.validate_immutable()usesArc::ptr_eqto detect immutable slot tampering. Monotonicsuperset check ensures labels only grow.
Arc<Extensions>shared across spawned tasks, one clone into the Arc, thenrefcount bumps per task.
Test plan
cargo run --example plugin_demoworkscargo run --example cmf_capabilities_demoworksNew test coverage