Repository navigation
feat(orchestration/planner): wire StrategyPlanner → skill_router for plan-time skill resolution (#7268 Phase 1) - #7432
Merged
Merged
Conversation
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
…plan-time skill resolution (#7268 Phase 1) ADR-006 (Skill-Bound Planning) calls for the live planner to consult ``skill_router`` per step at plan time, binding each step to a concrete ``(skill_name, action)`` before the plan is finalized — so the ``SkillRegistry`` becomes visible to planning instead of only at execute time, and capability gaps surface during planning rather than mid-run. This PR implements **Phase 1** of #7268: the plan-time binding side. Phase 2 (executor consumption) and Phase 3 (async gap-fill resume) are filed as #7430 and #7431 respectively. Conservative defaults chosen for Phase 1, deferring the 3 open questions in #7268 to Phase 2/3 where the choices have less reach: - **Sync vs async gap-fill**: NEITHER at plan time. Lookup is ``dry_run=True`` so no auto-enable, no Phase 3 gap-fill on every plan-build. Phase 3 (#7431) handles the async resume path. - **Cache policy**: per-planner. ``SkillRouterSkill`` instance is lazily created on first ``build_workflow_plan`` and cached for the planner's lifetime. Per-session/per-tenant nuance is a Phase 3 concern (#7431). - **Removed-skill behavior**: deferred to Phase 2 (#7430). At execute time, ``WorkflowExecutor`` will check skill availability and decide whether to re-route or fail. ## Changes - ``WorkflowTask`` (canonical, ``autobot_shared/workflow/types.py``) gains 3 fields: ``skill_name``, ``skill_action``, ``skill_resolution_method`` — all default ``None``. Existing ``WorkflowTask(...)`` constructors keep working unchanged. - ``StrategyPlanner.build_workflow_plan`` becomes ``async`` and invokes a new ``_bind_skill_to_task`` helper after each task is constructed. The helper calls ``skill_router.execute("find_skill", {"task": …, "dry_run": True})`` and attaches the returned skill to the task on success. Failures are best-effort: any exception or ``success: False`` leaves ``skill_name=None``, falling back to the existing capability-based agent routing. - ``orchestrator.py:748`` updated to ``await`` the now-async method (the only call site outside the module; already inside an ``async def``). - New test file ``workflow_planning_test.py`` with 7 cases covering: field surface, async signature, dry_run-only lookup (no auto-enable), successful population, no-match fallback, exception fallback, and router-unavailable graceful degradation. ## Acceptance criteria addressed (#7268) - [x] **StrategyPlanner.build_workflow_plan iterates each step and resolves it via skill_router.execute(...)** — implemented. - [x] **Resolved (skill_name, action) attached to the step** — fields added to canonical ``WorkflowTask``, populated by ``_bind_skill_to_task``. - [ ] Phase 3 gap-fill handling — deferred to #7431 (intentional; ``dry_run=True`` skips Phase 3 at plan time per ADR-006 rec). - [ ] WorkflowExecutor consumes the bound plan — deferred to #7430. - [ ] Integration tests + ADR-006 status flip — deferred to Phase 2/3. #7268 stays open until Phases 2 and 3 land. This commit substantially realizes ADR-006 Phase 1 of the planning path. Refs #7268, #7430 (Phase 2), #7431 (Phase 3), ADR-006
This was referenced May 10, 2026
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
ADR-006 (Skill-Bound Planning) calls for the live planner to consult `skill_router` per step at plan time, binding each step to a concrete `(skill_name, action)` before the plan is finalized. Phase 1 of #7268 implements the plan-time binding side.
Phase 2 (executor consumption) and Phase 3 (async gap-fill resume) are filed as #7430 and #7431 respectively. #7268 stays open until all three land.
Conservative defaults chosen for Phase 1
The 3 open ADR-006 questions are deferred to Phase 2/3 where they have less reach. Phase 1 picks the safest defaults:
Changes
Test plan
```
$ pytest autobot-backend/enhanced_orchestration/workflow_planning_test.py -v
test_workflow_task_has_skill_binding_fields PASSED
test_build_workflow_plan_is_async PASSED
test_skill_router_dry_run_only_no_auto_enable PASSED
test_successful_lookup_populates_skill_fields PASSED
test_no_match_leaves_skill_fields_none PASSED
test_router_exception_leaves_skill_fields_none PASSED
test_router_unavailable_silent_fallback PASSED
7 passed in 0.82s
```
Acceptance criteria addressed (#7268)
Why this is partial closure, not closure
Per CLAUDE.md's premature-closure rule, #7268 stays OPEN until Phases 2 and 3 land. This PR substantially realizes ADR-006 Phase 1 of the planning path; the executor side and the async-resume path are filed as concrete trackers.
Refs #7268, #7430 (Phase 2), #7431 (Phase 3), ADR-006
🤖 Generated with Claude Code