Split the shared data types out of core/pipeline
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
- 35/100
Hướng nghiên cứu
Start by reading the listed data files in core/pipeline, especially extensions.go, session.go, promptcontext.go, client.go, and context.go, then trace their imports into core/session and core/cost/event. The issue leaves package boundaries and the transition strategy open, so settle those design questions before moving types. Done means the named session and cost packages build without importing core/pipeline and go test ./... passes in every module.
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 shipped Cortex–Praxis integration today (the paused
cmd/cortex-praxisconverter is not one), and the interim path is not decided (LLM traffic to praxis-ai as an inference server, or all traffic through Praxis via #1491). This is a refactor with no behaviour change: it is useful to Cortex on its own, and would make a possible move to Praxis easier whichever path is taken.
Problem
core/pipeline (about 6,900 non-blank lines) holds two different things:
- Shared data types: the parsed request (
InferenceExtension,MCPExtension,A2AExtension), the recorded event (SessionEvent),PromptContext,EventClient. - The plugin engine: the request context
Context, actions, plugin capabilities, redirects, the runner.
46 non-test packages import it (39 in core, plus cmd/cortex, cmd/cortex-envoy, four agentop packages and scripts/readme-demo). Several use only the data half directly:
| Package | Uses from core/pipeline directly |
|---|---|
core/cost/pricing |
InferenceExtension only |
core/session/archive |
SessionEvent, RawJSON |
core/cost/usage |
event and parsed-request types, plus the client and agent-name helpers (ParseUserAgent, IsKnownAgent, AgentName, IsControlRune) |
core/cost/ledger |
event types, plus AgentName, IsControlRune, ParseUserAgent, UnknownClientLabel (pipeline.Context appears only in a test) |
But they also reach the engine indirectly:
core/sessionimports pipeline, and returns*pipeline.SessionViewfromView,ViewTailandViewPage. The archive importscore/session(Recorder,History,Interner,SummaryFold), and the ledger imports it for one compile-time check (var _ session.Recorder,writer.go:335).core/cost/eventimports pipeline (event.go:569,:594), and usage and ledger both import it.
So anything that wants to read or store a Cortex event — the session store, the archive, the cost ledger, agentop — pulls in the whole plugin engine with it.
Proposal
Move the data types into their own package (e.g. core/event or core/model) that imports no engine code, and have core/pipeline re-export or import them.
What moves to the data package:
- the parsed-request types,
SessionEventandsessionEventWirewith its JSON (un)marshalling; PromptContext,EventClient, and the client and agent-name helpers inclient.go;Directionand its constants and JSON methods (they live incontext.go:45);SessionViewand its query methods (session.go:675-787): pure data plus filters over events, andcore/sessionreturns it. Alternatively, have the store return[]SessionEventand leaveSessionViewin the engine;SnapshotInferenceandPluginEventSuffix.
What stays in the engine: Context, SetState/GetState (they take *Context), the *Context helpers in snapshot.go, and Extensions.Custom.
Obstacles found (checked by compiling the data files as a standalone package, with no cycle):
extensions.gomixes data withSetState/GetState, so it has to be split.content.go'sFragments()methods implementcapabilities.ContentSource, and methods can't leave their type's package, so the data package importscore/capabilities(a leaf; no cycle).cost/eventalso has to move off pipeline, and ledger'ssession.Recorderassertion move or go.
Also:
- agentop uses some engine symbols too (
ErrorPolicy*,Metric/MetricsProvider), so it won't drop the engine import entirely. - Unused exported
SessionViewmethods (Intents,ToolCalls,ToolResponses,FailedEvents,LastError) are public API; keep them.
This should land before #1503 and #1504, so their libraries and decision cores can depend on the data package instead of the engine.
Design questions
- One data package, or one per concern (
inference,event,client)? - Type aliases in
core/pipelinefor a transition period, or a single rename across the tree?coreis consumed outside this repo:core/README.mdnames the operator and rossoctl-cli. Today both pin the old module path…/authbridge/authlib, so they break only when they bump, which is a module-path move anyway.- Aliases work for types. Constants and functions need re-declared wrappers.
Done when
core/session,core/session/archive,core/cost/eventandcore/cost/{ledger,usage,pricing}build without importingcore/pipeline(go list -deps).go test ./...passes in every module with no test changed other than imports.
Evidence read at main @ e455a04 (2026-10-25); not built.
- Ngôn ngữ chính
- Go
- Star
- 21
- Fork
- 43
- Merge trung bình
- 13 giờ 8 phút
- Pull request đã merge (30 ngày)
- 267
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
UI shows costs for all sessions even when drilled into a sessionCó thể đã có người làm @esnible đã nhận 16 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
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Cost/session layering: ledger snapshot logic in the HTTP layer; import edges point both waysĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/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ự
-
automation doc-healer documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/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 90/100
tsukumogami/tsuku#2804 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptCó thể đã có người làm @Shayan12456 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ollama/ollama#19415 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
raised-by:verifier
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
medici-finance/assay#5039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned upCó thể đã có người làm @barbierajput378-pixel đã nhận hôm nay. Đang mởkind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Project-HAMi/HAMi#3343 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày