feat(orchestration): Phase 5 — Aggregator + resume/retry (#1240)#1258
Merged
feat(orchestration): Phase 5 — Aggregator + resume/retry (#1240)#1258
Conversation
Add result aggregation and graph lifecycle management for the task orchestration system. ### New - `aggregator.rs`: `Aggregator` trait + `LlmAggregator` implementation. Synthesizes completed task outputs via a single LLM call with per-task character budget (`aggregator_max_tokens / num_completed_tasks`), `ContentSanitizer` spotlighting on all task outputs, skipped-task descriptions, and raw-concatenation fallback on LLM failure. - `dag::reset_for_retry()`: BFS-based reset — `Failed`→`Ready`, `Skipped`/`Canceled`→`Pending`. Enables targeted re-runs without discarding completed work. - `DagScheduler::resume_from()`: accepts `Paused`/`Failed` graphs, reconstructs `running` HashMap from in-flight tasks, sets `graph.status = Running`. ### Extended - `PlanCommand`: add `Resume(Option<String>)` and `Retry(Option<String>)` variants with graph-id validation. - `OrchestrationConfig`: add `aggregator_max_tokens` field (default 4096). - Agent loop: wire `handle_plan_resume`, `handle_plan_retry`, call aggregator on graph completion. - Dropped event guard upgraded to `error!`-level logging (PERF-SCHED-02). ### Tests (+8) - 6 tests for `DagScheduler::resume_from()` (MT-1/II4 fix) - 2 tests for `reset_for_retry()` with `Canceled` task handling (IC2 fix) ### Docs - `docs/src/concepts/task-orchestration.md`: Result Aggregation section, `/plan resume`/`/plan retry` documentation. - `docs/src/reference/configuration.md`: `dependency_context_budget`, `confirm_before_execute`, `aggregator_max_tokens` fields. - `README.md` and `crates/zeph-core/README.md` updated. Closes #1240. Part of epic #1235.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aggregatortrait andLlmAggregator: synthesizes completed task outputs into a single coherent response via LLM call with per-task character budget,ContentSanitizerspotlighting, skipped-task descriptions, and raw-concatenation fallback on LLM failureDagScheduler::resume_from(): resumesPaused/Failedgraphs, reconstructs running-task map, sets status toRunningdag::reset_for_retry(): BFS reset ofFailed→ReadyandSkipped/Canceled→Pendingfor targeted graph re-runsPlanCommandwithResume(Option<String>)andRetry(Option<String>)variants (with graph-id validation)/plan resumeand/plan retryin agent loop; call aggregator on graph completionaggregator_max_tokenstoOrchestrationConfig(default: 4096)resume_from()coverage (6) andreset_for_retry()with Canceled handling (2)Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --workspace --features full --lib --bins— 4297 pass (1 pre-existing failure inbootstrap::tests::create_skill_matcher_when_semantic_disabledonVersionMissing(23), present onmainbefore this branch)build_fallback()sanitizes viaContentSanitizer(SEC-P5-02)resume_from()reconstructsrunningmap fromRunningtasks in graph (IC1)reset_for_retry()resetsCanceled→Pendingin addition toFailed→Ready(IC2)handle_plan_retrycounts failed tasks before reset, not after (IC3)task-orchestration.md,configuration.md,README.md,crates/zeph-core/README.mdCloses #1240. Part of epic #1235.