Skip to content

feat(orchestration): DAG Scheduler, AgentRouter, SubAgentManager integration (Phase 3, #1235)#1252

Merged
bug-ops merged 3 commits intomainfrom
feat-m32-task-orchestration-1238
Mar 6, 2026
Merged

feat(orchestration): DAG Scheduler, AgentRouter, SubAgentManager integration (Phase 3, #1235)#1252
bug-ops merged 3 commits intomainfrom
feat-m32-task-orchestration-1238

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 5, 2026

Summary

Closes #1238. Part of epic #1235.

  • Add DagScheduler with tick-based execution loop, command pattern (SchedulerAction), mpsc event channel (TaskEvent/TaskOutcome), task timeout monitoring, cross-task context injection with ContentSanitizer integration, and stale event guard
  • Add AgentRouter trait and RuleBasedRouter with 3-step fallback chain (agent_hint, tool keyword matching, first available)
  • Add spawn_for_task() to SubAgentManager with JoinHandle wrapping for orchestration event delivery
  • Add dependency_context_budget and confirm_before_execute to OrchestrationConfig

New files

  • crates/zeph-core/src/orchestration/scheduler.rs
  • crates/zeph-core/src/orchestration/router.rs

Modified files

  • crates/zeph-core/src/orchestration/mod.rs — module declarations and re-exports
  • crates/zeph-core/src/orchestration/graph.rschrono_now() visibility
  • crates/zeph-core/src/config/types.rs — config fields
  • crates/zeph-core/src/subagent/manager.rsspawn_for_task()
  • docs/src/concepts/task-orchestration.md — scheduler, router, CLI docs
  • README.md, crates/zeph-core/README.md — orchestration feature updates
  • CHANGELOG.md

Key design decisions

  • ADR-026: Command pattern — scheduler produces SchedulerAction values, caller executes against manager
  • ADR-027: Single mpsc::Sender<TaskEvent> channel for agent completions
  • SEC-ORCH-01: ContentSanitizer applied to cross-task dependency outputs before prompt injection
  • Stale event guard prevents timed-out-then-retried agents from corrupting state

Test count

Before: 3782 → After: 4229 (+447)

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins — 4229 passed, 0 failed
  • 18 scheduler tests cover: linear chain, parallel spawn, completion downstream, abort/skip/retry propagation, timeout, deadlock detection, cancel_all, spawn failure, context injection with truncation, stale event rejection, duration tracking
  • 10 router tests cover: hint match, fallback, tool matching, allow/deny/inherit policies, empty available
  • Merge conflict with Phase 2 (planner) resolved — both modules coexist

bug-ops added 2 commits March 6, 2026 00:46
…gration (Phase 3, #1235) (#1238)

Add DagScheduler with tick-based execution loop, command pattern
(SchedulerAction), mpsc event channel (TaskEvent/TaskOutcome), task
timeout monitoring, cross-task context injection with ContentSanitizer,
and stale event guard.

Add AgentRouter trait and RuleBasedRouter with 3-step fallback chain
(agent_hint, tool keyword matching, first available).

Add spawn_for_task() to SubAgentManager with JoinHandle wrapping for
orchestration event delivery.

Add dependency_context_budget and confirm_before_execute to
OrchestrationConfig.
…ration-1238

Resolve conflicts in mod.rs (add both planner and scheduler/router
modules), types.rs (merge planner_model/planner_max_tokens with
dependency_context_budget/confirm_before_execute), README files,
CHANGELOG, docs, and config snapshot.
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate enhancement New feature or request size/XL Extra large PR (500+ lines) labels Mar 5, 2026
@bug-ops bug-ops merged commit 8fe5cdd into main Mar 6, 2026
28 checks passed
@bug-ops bug-ops deleted the feat-m32-task-orchestration-1238 branch March 6, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(orchestration): Phase 3 — DAG Scheduler + SubAgentManager integration

1 participant