Skip to content

refactor(engine): redesign pipeline graph with typed action nodes#48

Open
martsokha wants to merge 6 commits intomainfrom
feature/operations
Open

refactor(engine): redesign pipeline graph with typed action nodes#48
martsokha wants to merge 6 commits intomainfrom
feature/operations

Conversation

@martsokha
Copy link
Member

No description provided.

… phase ordering

Replace the generic Source/Action/Target node model with a strongly-typed
GraphNodeKind enum where each variant carries its own configuration struct.
Split action configs into dedicated files (context, extraction, recognition,
refinement, lifecycle). Add phase-based pipeline ordering validation, action-
level config validation, and structural checks (self-loops, duplicate edges).
Move Compiler into DefaultEngineInner for reuse across runs. Rename error.rs
`source` parameter to `component` to align with the internal field name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@martsokha martsokha self-assigned this Mar 13, 2026
@martsokha martsokha added docs improvements, updates or additions to docs feat request for or implementation of a new feature labels Mar 13, 2026
martsokha and others added 5 commits March 14, 2026 17:24
…m graph types

- Rewrite runs/mod.rs to pure data types (RunSnapshot, NodeSnapshot,
  RunStatus, NodeStatus, RunSummary, RunFilter); delete RunManager
- Add Runs trait (get_run, list_runs, cancel_run) and implement on
  DefaultEngine with internal RunEntry + RwLock<HashMap> state
- Wire run lifecycle (Pending→Running→Succeeded/PartialFailure/Failed)
  into Engine::run() with CancellationToken passed to run_graph
- Add cooperative cancellation via tokio::select! in execute_node
- Make confidence_threshold optional on NamedEntityRecognition (None
  disables filtering)
- Remove Action suffix from all graph config structs (LoadContextAction
  → LoadContext, etc.)
- Remove RunOutput from EngineOutput (query via Runs::get_run instead);
  make NodeOutput/RunOutput pub(super)
- Move compiler/ → graph/, pipeline/runs.rs → runs/mod.rs, config.rs →
  config/mod.rs, add pipeline/plan/ module

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tor, move config into engine

- Merge process handlers into runs: POST /runs (full pipeline),
  POST /runs/scan (read-only), removing /process/* endpoints entirely
- Add ActorId custom header extractor (X-Actor-Id) replacing ActorQuery
  params and actor_id request body fields across all handlers
- Move RuntimeConfig into DefaultEngine (with_config builder), removing
  it from ServiceState and per-handler State extraction
- Remove redundant data_dir field from ServiceState, delegate to
  Registry::base_dir()
- Rename request/process.rs → request/runs.rs, delete response/process.rs
  (RunResult merged into response/runs.rs)
- Use derive_more for Deref/Display on ActorId
- Simplify EngineInput: replace ocr/llm/stt/tts fields with
  config: Option<RuntimeConfig> for per-request overrides

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d code

Wire Import/Export dispatch in NodeExecutor with Arc<DocumentEnvelope>
channels, populate EngineOutput from collected envelopes, and connect
the analytics endpoint to live engine run data.

- Add NodeExecutor struct replacing free execute_node/execute_action fns
- Add EngineAnalytics trait + AnalyticsSnapshot in pipeline/analytics module
- Rename Runs → EngineRuns, Analytics → EngineAnalytics for clarity
- Remove dead ExecutionPlan fields (index_map, phases, roots, leaves)
- Remove PhaseGroup type and phase.rs, phase field from ResolvedNode
- Remove unused Explainable/Explanation (covered by provenance module)
- Make pipeline::policy private, re-export compiled types
- Flatten config/mod.rs → config.rs
- Wire server analytics handler via EngineAnalytics::snapshot()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ze policy extraction

Make Registry a required constructor parameter for DefaultEngine
instead of an optional field set externally. The engine now owns
all its dependencies and auto-extracts retry/timeout policies from
RuntimeConfig in with_config(), removing that responsibility from
the server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs improvements, updates or additions to docs feat request for or implementation of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant