Skip to content

feat(orchestration): AdaptOrch topology-routing and Plan-Execute-Verify-Replan (#2219, #2202)#2235

Merged
bug-ops merged 2 commits intomainfrom
research-adaptorch-topology-ro
Mar 27, 2026
Merged

feat(orchestration): AdaptOrch topology-routing and Plan-Execute-Verify-Replan (#2219, #2202)#2235
bug-ops merged 2 commits intomainfrom
research-adaptorch-topology-ro

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

Breaking: suggest_max_parallel() removed; use analyze().max_parallel.

Tests: 6698/6698 pass with --features full (+62 vs main).

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --features full --workspace -- -D warnings passes
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 6698/6698 pass
  • cargo nextest run -p zeph-orchestration --lib — 242/242 pass (12 new verifier tests)
  • Topology variants FanIn/Hierarchical detected correctly on representative DAGs
  • verify_completeness = false (default) — no Verify actions emitted, no PlanVerifier instantiated
  • max_replans = 0 — Verify emitted but inject_tasks() skips injection (verify-only mode)

Closes #2219, #2202

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates config Configuration file changes size/XL Extra large PR (500+ lines) and removed enhancement New feature or request labels Mar 27, 2026
…fy-Replan (#2219, #2202)

Add topology-aware DAG dispatch and verification-driven replanning to zeph-core orchestration.

Topology-routing (#2219):
- Extend TopologyClassifier with FanIn and Hierarchical topology variants
- Add DispatchStrategy enum: FullParallel, Sequential, LevelBarrier, Adaptive
- Replace suggest_max_parallel() with analyze() returning full TopologyAnalysis
  including per-task depths as HashMap<TaskId, usize>
- DagScheduler uses LevelBarrier dispatch for hierarchical graphs; topology_dirty
  flag defers re-analysis to tick start after inject_tasks()

Plan-Execute-Verify-Replan (#2202):
- Add PlanVerifier<P: LlmProvider> in verifier.rs with verify() and replan()
- VerificationResult with structured Gap list and GapSeverity (Critical/Important/Minor)
- Fail-open on LLM error; consecutive failure tracking with ERROR log at >=3 failures
- SchedulerAction::Verify emitted when verify_completeness=true; budget enforced
  only in inject_tasks() (not in emission gate)
- Per-task replan caps (HashMap<TaskId, u32>) and global max_replans counter
- LevelBarrier current_level reset to min(current, shallowest_non_terminal_depth)
  after dirty re-analysis to prevent injected tasks from being silently skipped
- New config: verify_provider, verify_max_tokens, max_replans, verify_completeness
  with --migrate-config support

Breaking: suggest_max_parallel() removed; use analyze().max_parallel instead.

Closes #2219, #2202
@bug-ops bug-ops force-pushed the research-adaptorch-topology-ro branch from b54af60 to a84db0e Compare March 27, 2026 09:47
@github-actions github-actions bot added the enhancement New feature or request label Mar 27, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 27, 2026 09:48
@github-actions github-actions bot added the tests Test-related changes label Mar 27, 2026
@bug-ops bug-ops merged commit d7c45fc into main Mar 27, 2026
25 checks passed
@bug-ops bug-ops deleted the research-adaptorch-topology-ro branch March 27, 2026 10:01
bug-ops added a commit that referenced this pull request Mar 28, 2026
#2252)

Activate the existing PlanVerifier skeleton with per-task and whole-plan
verification gates, a completeness_threshold config field, and a single-cycle
gap-filling replan loop based on the VMAO paper (arXiv:2603.11445).

- Add completeness_threshold: f32 (default 0.7) to OrchestrationConfig with
  sanitizer clamping to [0.0, 1.0] and startup validation
- Add verify_plan() for whole-plan verification after DagScheduler completion
- Add replan_from_plan() generating root TaskNodes for plan-level gaps
- Wire SchedulerAction::Verify handler in agent loop (was a no-op since #2235)
- Add whole-plan verification step between Done{Completed} and aggregation
- Partial replan DAG runs in a separate DagScheduler with max_replans=0 and
  verify_completeness=false to prevent recursive loops (INV-2)
- Partial DAG outputs merged with original task outputs before aggregation
- Output truncated to verify_max_tokens*4 chars before verify_plan() call
- GapSeverity implements Display returning lowercase names consistent with
  serde snake_case serialization and LLM system prompt expectations
- All LLM error paths are fail-open: verify returns complete=true, replan
  returns empty Vec, whole-plan verify returns None
- 25 new unit tests across verifier.rs and experiment.rs
- verify_completeness = false by default; no behavior change when disabled

Closes #2252
bug-ops added a commit that referenced this pull request Mar 28, 2026
#2252)

Activate the existing PlanVerifier skeleton with per-task and whole-plan
verification gates, a completeness_threshold config field, and a single-cycle
gap-filling replan loop based on the VMAO paper (arXiv:2603.11445).

- Add completeness_threshold: f32 (default 0.7) to OrchestrationConfig with
  sanitizer clamping to [0.0, 1.0] and startup validation
- Add verify_plan() for whole-plan verification after DagScheduler completion
- Add replan_from_plan() generating root TaskNodes for plan-level gaps
- Wire SchedulerAction::Verify handler in agent loop (was a no-op since #2235)
- Add whole-plan verification step between Done{Completed} and aggregation
- Partial replan DAG runs in a separate DagScheduler with max_replans=0 and
  verify_completeness=false to prevent recursive loops (INV-2)
- Partial DAG outputs merged with original task outputs before aggregation
- Output truncated to verify_max_tokens*4 chars before verify_plan() call
- GapSeverity implements Display returning lowercase names consistent with
  serde snake_case serialization and LLM system prompt expectations
- All LLM error paths are fail-open: verify returns complete=true, replan
  returns empty Vec, whole-plan verify returns None
- 25 new unit tests across verifier.rs and experiment.rs
- verify_completeness = false by default; no behavior change when disabled

Closes #2252
bug-ops added a commit that referenced this pull request Mar 28, 2026
#2252) (#2346)

Activate the existing PlanVerifier skeleton with per-task and whole-plan
verification gates, a completeness_threshold config field, and a single-cycle
gap-filling replan loop based on the VMAO paper (arXiv:2603.11445).

- Add completeness_threshold: f32 (default 0.7) to OrchestrationConfig with
  sanitizer clamping to [0.0, 1.0] and startup validation
- Add verify_plan() for whole-plan verification after DagScheduler completion
- Add replan_from_plan() generating root TaskNodes for plan-level gaps
- Wire SchedulerAction::Verify handler in agent loop (was a no-op since #2235)
- Add whole-plan verification step between Done{Completed} and aggregation
- Partial replan DAG runs in a separate DagScheduler with max_replans=0 and
  verify_completeness=false to prevent recursive loops (INV-2)
- Partial DAG outputs merged with original task outputs before aggregation
- Output truncated to verify_max_tokens*4 chars before verify_plan() call
- GapSeverity implements Display returning lowercase names consistent with
  serde snake_case serialization and LLM system prompt expectations
- All LLM error paths are fail-open: verify returns complete=true, replan
  returns empty Vec, whole-plan verify returns None
- 25 new unit tests across verifier.rs and experiment.rs
- verify_completeness = false by default; no behavior change when disabled

Closes #2252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines) tests Test-related changes

Projects

None yet

1 participant