Skip to content

feat(orchestration): LLM-based task planner (Phase 2, #1237)#1251

Merged
bug-ops merged 1 commit intomainfrom
feat/m33/orchestration-planner
Mar 5, 2026
Merged

feat(orchestration): LLM-based task planner (Phase 2, #1237)#1251
bug-ops merged 1 commit intomainfrom
feat/m33/orchestration-planner

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

  • Add Planner trait and LlmPlanner<P: LlmProvider> for LLM-based goal decomposition into validated TaskGraph
  • Uses chat_typed for structured JSON output with automatic schema injection, retry-on-malformed, and code fence stripping
  • String task_id to TaskId(u32) mapping via HashMap, kebab-case validation (max 64 chars)
  • Agent hint validation against SubAgentDef catalog (warn on unknown, proceed with None)
  • Extend OrchestrationConfig with planner_model and planner_max_tokens fields
  • 24 tests (+24), all passing. Test count: 4174 → 4198

Parent: #1235
Blocked by: #1236 (merged)
Parallel with: #1238

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins — 4198 passed, 11 skipped
  • Valid JSON with string task_ids parsed into TaskGraph
  • Cyclic graphs rejected via dag::validate
  • Invalid agent hints warn but proceed
  • max_tasks enforcement
  • Empty goal rejection
  • Single-task goal produces single-node graph
  • Invalid task_id format rejection (empty, whitespace, non-kebab-case, >64 chars)
  • Duplicate task_id detection
  • Unknown dependency rejection
  • Invalid failure_strategy defaults to None with warning

…hase 2, #1237)

Add Planner trait and LlmPlanner implementation that decomposes user
goals into validated TaskGraphs via structured LLM output (chat_typed).

- Planner trait with async plan() method accepting goal and agent catalog
- LlmPlanner<P: LlmProvider> using chat_typed for JSON schema injection,
  retry-on-malformed, and code fence stripping
- PlannerResponse/PlannedTask with schemars::JsonSchema derives
- String task_id to TaskId(u32) mapping via HashMap with duplicate detection
- Kebab-case task_id validation (max 64 chars, [a-z0-9-])
- Agent hint validation against SubAgentDef catalog (warn on mismatch)
- Failure strategy parsing with warn on invalid values
- DAG validation via dag::validate after conversion
- OrchestrationConfig: add planner_model and planner_max_tokens fields
- 24 tests covering conversion, prompt building, and integration
@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 linked an issue Mar 5, 2026 that may be closed by this pull request
9 tasks
@bug-ops bug-ops merged commit 53431aa into main Mar 5, 2026
28 checks passed
@bug-ops bug-ops deleted the feat/m33/orchestration-planner branch March 5, 2026 23:36
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 2 — LLM Planner (goal decomposition)

1 participant