feat: establish the Target architecture as a graph before code

Design is now approved before any infrastructure code is written (ADR-0005).
A new target-architect Specialist produces one graph of Elements,
Relationships and Checks; the diagram is rendered from it, deployment
guidance must account for every Check, and validation gives a verdict per
Check. Requirements, components, products and recommendations carry ids in
data files, and a submission with a gap in the Requirements chain is refused.

Also in this commit:
- Customer cases group Executions, with an intent history per case
- lesson candidates are captured when an Execution ends
- evaluation gains chain, verdict, judged and interactive checks, and
  per-case thresholds
- Terraform providers are cached between checks
- the requirements analyst proposes defaults instead of asking
- the legacy-baseline case and the checks that only read it are removed
- ADR-0006 (Change requests) accepted; ADR-0004 and ADR-0007 proposed
- plans for iterations 4 to 7 under .agents/plans/

Unproven with a real model: no evaluation run has completed on this design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 13:59:09 +01:00
parent 7ee49ab352
commit e9246828b3
586 changed files with 5166 additions and 22432 deletions

View File

@@ -7,10 +7,11 @@ Cloud-read gating is applied later, per Execution, by `specialist_tools`.
from __future__ import annotations
from collections.abc import Mapping, Sequence
from collections.abc import Mapping, MutableMapping, Sequence
from typing import Any
from app.adk.roles import PILLAR_ADVISOR
from app.adk.runtime import AgentRuntime, RoleSpec, ToolFactory, ToolSpec
from app.adk.runtime import AgentRuntime, RoleSpec, RunLimiter, ToolFactory, ToolSpec
from app.tools.mcp import McpCatalog
from app.tools.pillars import pillar_consultation_tool
from app.workflows.deliverables import DeliverableKind
@@ -23,26 +24,41 @@ def make_tool_factory(
*,
local_tools: Sequence[ToolSpec] = (),
catalog: McpCatalog | None = None,
limiter: RunLimiter | None = None,
) -> ToolFactory:
local_by_name = {tool.name: tool for tool in local_tools}
def mcp_tools(role: RoleSpec) -> list[ToolSpec]:
return catalog.tools_for(role.mcp_servers) if catalog else []
consult = None
advisor = roles.get(PILLAR_ADVISOR)
if pillar_skills and advisor:
# Pillar advisors can't ask for permission, so they get general-tier tools only.
advisor_tools = [tool for tool in mcp_tools(advisor) if tool.tier == "general"]
consult = pillar_consultation_tool(
runtime, advisor, pillar_skills, extra_tools=advisor_tools
)
# Pillar advisors can't ask for permission, so they get general-tier tools only.
advisor_tools = (
[tool for tool in mcp_tools(advisor) if tool.tier == "general"]
if advisor
else []
)
def tools_for(role: RoleSpec, deliverable: str | None) -> Sequence[ToolSpec]:
def tools_for(
role: RoleSpec, deliverable: str | None, working: MutableMapping[str, Any]
) -> Sequence[ToolSpec]:
tools = [local_by_name[name] for name in role.tools if name in local_by_name]
tools += mcp_tools(role)
if consult and deliverable == DeliverableKind.DESIGN_RECOMMENDATIONS.value:
tools.append(consult)
if (
pillar_skills
and advisor
and deliverable == DeliverableKind.DESIGN_RECOMMENDATIONS.value
):
tools.append(
pillar_consultation_tool(
runtime,
advisor,
pillar_skills,
extra_tools=advisor_tools,
memory=working,
limiter=limiter,
)
)
return tools
return tools_for