feat: start an Execution from a scope spec (ADR-0008, iteration 9 step 1)
Some checks failed
validation / verify (push) Failing after 10s

A scope spec is a YAML file of what the customer wants and the facts a design
depends on, complete or partly filled. It sits beside the Intent, which stays
in the customer's words.

- skills/scoping holds a provider-neutral catalogue of 63 fields; the Cloud
  provider's bundle supplies the values it allows for the fields left to it.
- app/scope.py reads a spec against the catalogue with no model: it refuses an
  unknown field or a value of the wrong type, and yields what is stated, what
  is left to the agent, what is unknown and how pressing each gap is. A field
  may say ask, decide or not_applicable.
- ExecutionEngine.start(scope=...), /generate, A2A metadata and evaluation
  cases accept one. Its statement is the request, its engagement reference
  names the Customer case, and its run options apply. A pre-approved start is
  refused when an essential field is not settled.
- The spec as supplied is kept unaltered beside a completed copy with
  assumptions, gaps, provenance, readiness and a status.
- Every Specialist is shown the spec and given the Skill: a stated choice
  binds, exclusions are out of scope.
- Covers workloads and platform foundations; case-08-landing-zone starts from
  a benchmark spec.

Plans for scoping (iteration 9) and the work breakdown structure (iteration
10, nothing built), and the design spec they come from. Not run with real
models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 17:53:00 +01:00
parent a48468d477
commit afe78640f8
27 changed files with 2122 additions and 8 deletions

View File

@@ -18,6 +18,8 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
import yaml
from app.adk.runtime import ToolResult
from app.agent import Interaction
from app.tools.assessment import QUALITY_BAR, QUALITY_RUBRIC, checklist_question
@@ -73,6 +75,8 @@ class CaseSpec:
overlay_skills: tuple[str, ...] = ()
# Whether the case's Executions opt into published Terraform modules.
terraform_modules: bool = False
# A scope spec (ADR-0008), as YAML text, that the case's Execution starts from.
scope: str = ""
# What the infrastructure code must and must not contain, as regular
# expressions over all of it: how a case checks that standards from an overlay
# Skill reached the code. Each is {"name", "require"} or {"name", "forbid"}.
@@ -106,12 +110,27 @@ class CaseResult:
return self.score >= PASS_THRESHOLD
def _scope_of(path: Path, item: Mapping[str, Any]) -> str:
"""The text of the scope spec a case names, from the specs folder beside the
dataset; "" when it names none."""
name = item.get("scope")
return (path.parent / "specs" / str(name)).read_text("utf-8") if name else ""
def _request_of(item: Mapping[str, Any], scope: str) -> str:
"""A case's request: its own, or the statement of intent in its scope spec."""
if item.get("workflow_request"):
return str(item["workflow_request"])
spec = yaml.safe_load(scope) if scope else {}
return str(((spec or {}).get("intent") or {}).get("statement", "")).strip()
def load_cases(path: Path) -> list[CaseSpec]:
return [
CaseSpec(
id=item["id"],
name=item["name"],
workflow_request=item["workflow_request"],
workflow_request=_request_of(item, _scope_of(path, item)),
required_products=tuple(item["required_products"]),
scripted_answers=tuple(
tuple(pair) for pair in item.get("scripted_answers", [])
@@ -121,6 +140,7 @@ def load_cases(path: Path) -> list[CaseSpec]:
change=str(item.get("change", "")),
overlay_skills=tuple(item.get("overlay_skills", ())),
terraform_modules=bool(item.get("terraform_modules", False)),
scope=_scope_of(path, item),
code_standards=tuple(item.get("code_standards", ())),
)
for item in json.loads(path.read_text(encoding="utf-8"))