Decouple plugins from Go pipeline internals: parser test data, session facts, serializable records
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, developer-experience
Hướng nghiên cứu
Start with the referenced parser packages, core/pipeline/extensions.go, the three plugins that read session history, and core/session/store.go; the issue links to each entry point. First inspect how parsers create extensions and how the store builds session views. The stated done conditions cover fixtures and schemas, session facts, and removing per request Store.View calls, so this is broad work with open design questions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of #1437 (assessment: laptop data plane on Praxis) · prep work, useful to Cortex on its own
Status: there is no Cortex–Praxis integration today, and the interim path is not decided (LLM traffic to praxis-ai as an inference server, or all traffic through Praxis via #1491). Nothing here depends on that choice: each item is useful to Cortex now, and makes an eventual move to Praxis easier whichever path is taken.
Problem
If Cortex moves to Praxis, its plugins would move one at a time, as praxis-ai filters or PPE policy plugins. Three things would make each move harder than it needs to be, and two of them already cost Cortex today:
- Plugins share data through Go structs. The parsed request is read by most plugins as a Go type, with no written contract. Praxis passes data between filters as
filter_metadatastrings orstructured_metadataJSON. - Three plugins read session history, which Praxis does not keep, so they could not move at all as written.
- No saved test cases exist for the parsers, so a Rust port can only be checked by reading the Go code.
What Cortex does today
The parsed request is a Go struct.
InferenceExtensionandMCPExtensioncarry JSON tags, but have no schema or fixtures.MCPExtension.Paramsand.Resultaremap[string]any(extensions.go:102-103). Tool schemas were already moved toRawJSONfor the same reason.
Only three plugins read session history:
- ibac:
pctx.Session.LastIntent() - sparc:
pctx.Session.InferenceRequests() - inference-router:
view.Events
context-guru, session-budget, script and cpex read only Session.ID; tool-prune reads nothing from the session.
Building the view copies every event. Store.View copies the whole session for each request that hydrates one (forwardproxy/server.go:1471). With session.max_events unset (the default), that grows without limit. Not measured.
Plugin-to-plugin records. tool-prune reads the cost record as a Go value out of Extensions.Custom (toolprune/plugin.go:549).
Saved test data. The only testdata/ under core/ is core/cost/pricing/testdata.
Praxis has built-ins that cover three plugins:
- opa (746 non-blank lines): PPE ships an OPA engine (
praxis-proxy/policy,crates/builtins/src/pdps/opa). - jwt-validation (747): PPE
identity_jwt. - static-inject (283): Praxis's
headerandcredential_injectionfilters.
Proposal
- Saved test cases for the parsers. Add
testdata/to inference-parser, mcp-parser and a2a-parser: real request and response bodies (JSON and SSE), each paired with the expected extension JSON, driven by one table test per parser. A Rust port runs the same files. - Write down the parsed-request contract. A JSON schema for
InferenceExtension,MCPExtensionandA2AExtension, generated or checked from the Go types, linked fromdocs/session-api.md. Move MCPParams/ResulttoRawJSON. - Session facts instead of the session view.
- Add a plain
pctx.SessionID, and move the four ID-only plugins to it. - Give ibac, sparc and the router the one fact each needs: the last intent text; recent inference requests; the server the session last went to.
- Each is maintained by the store when events are appended, rather than rebuilt from a copied view.
- Add a plain
- Serializable records between plugins. Make the cost record a documented JSON shape, and read it through a decoder rather than a Go type assertion.
- Consider freezing opa, static-inject and jwt-validation: add no new features while the move to Praxis is being decided, since Praxis has built-ins for all three.
Design questions
- Fixture format: one file per case (request, response, expected), or one golden file per parser?
- Should session facts be fields on
pctx, or a smallSessionFactsinterface the store implements? - Should new policy checks be written for PPE / praxis-ai rather than as Go plugins? That depends on the path decision and is not proposed here.
- Which plugin would move first? tool-prune is the smallest with no session dependency; sparc is the smallest of the three that need facts.
Done when
- Each parser has saved test cases that cover both directions and SSE, and a schema the tests check against.
- ibac, sparc and inference-router no longer call
pctx.Sessionviews; no plugin readsSession.Events. Store.Viewis no longer called per request on the forward path.- (If agreed) the plugin catalog marks the three frozen plugins.
Evidence read at main @ e455a04 (2026-10-25); not built or run.
- Ngôn ngữ chính
- Go
- Star
- 18
- Fork
- 42
- Merge trung bình
- 12 giờ 20 phút
- Pull request đã merge (30 ngày)
- 229
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rossoctl/cortex
-
UI shows costs for all sessions even when drilled into a sessionCó thể đã có người làm @esnible đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
rossoctl/cortex#1116 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 40/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Feed recording, sessions and cost through one input that does not depend on the Go listenersĐang mởenhancement laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
stage-fail
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
siyuan-note/bazaar#2405 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: high workstream:cache
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rossoctl/context-guru#707 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
prime-radiant-inc/evener#5028 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100