Files
gcp_solution_architecture_a…/app/execution/toolkit.py
Jonathan Boniface f040493583 feat: run role files on the ADK runtime with scoped Skills
Increment 5 of .scratch/solution-architect-agent/spec.md, test-first.

- agents/*.md: provider-neutral role files for the Orchestrator, nine
  Specialists and the pillar advisor, with a shared Specialist protocol.
- app/agents/roles.py: load and validate role files; Skills, MCP
  servers and models come from the provider bundle.
- app/agents/adk_runtime.py: AgentRuntime on google-adk 2.9 with a
  per-run LlmAgent, role-scoped SkillToolset (no run_skill_script),
  step budgets, early stop on turn-ending tools, LiteLLM models.
- app/execution/pillars.py + toolkit.py: design advisor fans out to one
  advisor per WAF pillar in parallel.
- Specialists receive every earlier-Phase Deliverable as input.
- Bundle gains role_skills, pillar_skills and -latest Gemini aliases;
  pin google-adk[extensions]==2.9.0.
- 37 new tests; full suite 158 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 09:51:02 +01:00

34 lines
1.0 KiB
Python

"""Which extra tools each role gets beyond the Execution tools.
Increment 6 adds the local general and cloud-read tools and remote MCP servers here.
"""
from __future__ import annotations
from collections.abc import Mapping, Sequence
from app.agents.roles import PILLAR_ADVISOR
from app.agents.runtime import AgentRuntime, RoleSpec, ToolSpec
from app.execution.deliverables import DeliverableKind
from app.execution.graph import ToolFactory
from app.execution.pillars import pillar_consultation_tool
def make_tool_factory(
runtime: AgentRuntime,
roles: Mapping[str, RoleSpec],
pillar_skills: Mapping[str, str],
) -> ToolFactory:
consult = (
pillar_consultation_tool(runtime, roles[PILLAR_ADVISOR], pillar_skills)
if pillar_skills and PILLAR_ADVISOR in roles
else None
)
def tools_for(role: RoleSpec, deliverable: str | None) -> Sequence[ToolSpec]:
if consult and deliverable == DeliverableKind.DESIGN_RECOMMENDATIONS.value:
return [consult]
return []
return tools_for