Repository navigation
feat: hook system and plugin support design spec - #63
Conversation
|
@shaneutt Thanks for 0f0f656. It addresses the listener-wide collapse by removing the precedence rung that let one filter promote the whole listener to all-or-nothing buffered mode, and per-request Net: the spec's §4.1 Cost 1 is resolved at the architectural level. I'll update the plugins doc to reference per-request One small thing: the |
|
@araujof 👋 just checking in: is it your intention that this be marked ready for review? |
|
@shaneutt please allow me to push an update to the spec based on 1) the recent changes made to Praxis, and 2) the implementation of CPEX Rust we just completed this week. I will mark the PR ready for your review, so we can start on the initial implementation next week. Btw, here are the references to the CPEX Rust (in |
Signed-off-by: Ian Molloy <[email protected]> Signed-off-by: Teryl Taylor <[email protected]> Signed-off-by: Frederico Araujo <[email protected]> Co-authored-by: Ian Molloy <[email protected]> Co-authored-by: Teryl Taylor <[email protected]> Co-authored-by: Frederico Araujo <[email protected]>
…ateway filter Restructure the plugin spec from a lifecycle-only design into a complete v1 specification covering protocol-semantic hooks. Major additions: MCP gateway filter (§4.4), route-driven body mode (§4.3), identity hooks (I1/I2), CMF-based tool hook payloads, capability-gated Extensions with WriteToken enforcement, and a phased rollout plan. Replaces the deferred layering model with a concrete gateway-filter-now / protocol-native-later decision. Updates CPEX integration from hypothetical versioned crates to pinned git dependency on cpex-core. Signed-off-by: Frederico Araujo <[email protected]>
PR too largeThis PR adds 1065 lines (limit: 250). Large PRs are difficult to review and more likely to introduce subtle bugs. Please break this contribution into smaller, focused PRs that each address a single concern. See our coding conventions for guidance.
|
|
@shaneutt I rewrote the hook system spec to align with latest Praxis (including our discussions and fix for the buffer collapse issue) and the implemented CPEX Rust API. The prior version deferred all protocol-semantic hooks to a future protocol-native service; this revision brings MCP tool hooks into v1 scope via a concrete delivery mechanism. Key changes:
The hook catalog is now 12 hooks across startup, TLS, HTTP, identity, and MCP families, with TCP and additional protocol-semantic hooks reserved for promotion when a consumer warrants it. |
|
@usize tagging you here too for feedback. Thanks! |
|
I'm providing my feedback in the discussion that was opened: #188 Given the addition of process, directory and template for proposals in |
|
@shaneutt great! let's take the discussion over there (I tried to follow the new process by creating it 👼 ). If you don't mind, let's keep this PR open as the living proposal. As we shape the discussion in the other thread, I will make updates here (just to avoid opening other PRs, if that's okay). |
Sounds good. If we can retro-bump this PR to use the proposal template, find an issue it ties well with (#164 is probably right), and move it into the |
shaneutt
left a comment
There was a problem hiding this comment.
Going to merge this and convert it to a holding state while we continue to discuss
Remove remaining em-dashes per project conventions. Clarify that auto-registered duplicates panic because there is no caller to propagate the Result to, while manual registry.register() continues to return Result. Add boundary note distinguishing filter registration from plugin/hook discovery (praxis-proxy#63). Signed-off-by: Sébastien Han <[email protected]>
* fix(ci): fix bash syntax error and regex bug in conventions workflow (#456) Signed-off-by: Sébastien Han <[email protected]> * docs(filter): add build-time filter registry proposal Propose a build.rs + cargo metadata discovery mechanism that lets external filter crates self-register into the FilterRegistry at build time. Operators add a Cargo.toml dependency and write YAML config with zero Rust code changes to Praxis. Signed-off-by: Sébastien Han <[email protected]> * docs(filter): remove How? section per proposal guidelines Submit What? and Why? first. How? will be added in a follow-up after the proposal direction is accepted. Also add missing discussion field to frontmatter. Signed-off-by: Sébastien Han <[email protected]> * docs(filter): address PR review feedback Remove remaining em-dashes per project conventions. Clarify that auto-registered duplicates panic because there is no caller to propagate the Result to, while manual registry.register() continues to return Result. Add boundary note distinguishing filter registration from plugin/hook discovery (#63). Signed-off-by: Sébastien Han <[email protected]>
* fix(ci): fix bash syntax error and regex bug in conventions workflow (praxis-proxy#456) Signed-off-by: Sébastien Han <[email protected]> * docs(filter): add build-time filter registry proposal Propose a build.rs + cargo metadata discovery mechanism that lets external filter crates self-register into the FilterRegistry at build time. Operators add a Cargo.toml dependency and write YAML config with zero Rust code changes to Praxis. Signed-off-by: Sébastien Han <[email protected]> * docs(filter): remove How? section per proposal guidelines Submit What? and Why? first. How? will be added in a follow-up after the proposal direction is accepted. Also add missing discussion field to frontmatter. Signed-off-by: Sébastien Han <[email protected]> * docs(filter): address PR review feedback Remove remaining em-dashes per project conventions. Clarify that auto-registered duplicates panic because there is no caller to propagate the Result to, while manual registry.register() continues to return Result. Add boundary note distinguishing filter registration from plugin/hook discovery (praxis-proxy#63). Signed-off-by: Sébastien Han <[email protected]>
Description
A proposal for a second extension surface in Praxis, complementing the existing HttpFilter / TcpFilter surface with typed, lifecycle-anchored hooks backed by the CPEX runtime embedded in-process.
Specification
Closes: praxis-proxy/ai#180
What it adds
Hooks sit at well-defined points across the server lifecycle: startup, TLS handshake, TCP accept and session, and the HTTP request and response path. Each has a typed payload and a declared interaction class (observe, mutate, or policy), so plugin authors know what they can touch and the dispatcher knows how to compose results.
Plugins run as native shared libraries or WASM modules; Python is excluded because the latency budget does not accommodate it. A plugin call is an in-process function call, not an IPC hop, and a deployment with no plugins configured pays nothing beyond a single atomic check per call site.
The central structural property is tighten-only composition. Policy hooks can strengthen any of Praxis' built-in security boundaries but never weaken them, and this is enforced by the dispatcher rather than left to plugin discipline.
What it defers
Protocol-semantic concerns, such as MCP resource and prompt invocations, A2A tasks, LLM inputs and outputs, are named and reserved but intentionally unregistered. Hot reload, Python, and sidecar hosts for synchronous paths are also out of scope for v1.
@shaneutt There is a design tradeoff discussed for protocol-semantic hooks.
Operational surface
Configuration is YAML-driven, with per-hook timeouts, error policies, and priorities. Plugins that span multiple hooks, for example deciding at request-time and auditing at session-end, get a typed request-scoped state channel rather than having to smuggle state through headers. Body-handling hooks have cumulative budgets at the chunk, request, and plugin level, and a circuit breaker auto-disables plugins that repeatedly misbehave. Metrics and tracing cover invocations, rejections, short-circuits, and the time the plugin chain contributes to each request.
Rollout
The work is staged so each phase is independently shippable.
cc: @terylt @imolloy