feat: start an Execution from a scope spec (ADR-0008, iteration 9 step 1)
Some checks failed
validation / verify (push) Failing after 10s
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:
@@ -14,15 +14,20 @@ nothing was delivered for it. history.json is the index of the case.
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from collections.abc import Mapping
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import yaml
|
||||
|
||||
from app.states.execution_state import case_dir
|
||||
|
||||
INTENT_DIR = "intent"
|
||||
HISTORY_FILENAME = "history.json"
|
||||
IN_PROGRESS = "in_progress"
|
||||
SCOPE_SUPPLIED = ".scope.yaml"
|
||||
SCOPE_COMPLETED = ".scope.completed.yaml"
|
||||
|
||||
|
||||
def intent_dir(output_root: Path, customer_case: str) -> Path:
|
||||
@@ -50,6 +55,8 @@ def record_intent(
|
||||
session_id: str,
|
||||
workflow_request: str,
|
||||
baseline: str | None = None,
|
||||
scope_supplied: str | None = None,
|
||||
scope_completed: Mapping[str, Any] | None = None,
|
||||
) -> int:
|
||||
"""Record a new statement of the customer's intent and return its version.
|
||||
|
||||
@@ -71,6 +78,19 @@ def record_intent(
|
||||
f"## What the customer wants\n\n{workflow_request.strip()}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
scope_files = None
|
||||
if scope_completed is not None:
|
||||
# The spec as supplied, unaltered, and the completed copy beside it.
|
||||
scope_files = {"completed": f"{INTENT_DIR}/{version:03d}{SCOPE_COMPLETED}"}
|
||||
(folder / f"{version:03d}{SCOPE_COMPLETED}").write_text(
|
||||
yaml.safe_dump(dict(scope_completed), sort_keys=False, allow_unicode=True),
|
||||
encoding="utf-8",
|
||||
)
|
||||
if scope_supplied:
|
||||
scope_files["supplied"] = f"{INTENT_DIR}/{version:03d}{SCOPE_SUPPLIED}"
|
||||
(folder / f"{version:03d}{SCOPE_SUPPLIED}").write_text(
|
||||
scope_supplied, encoding="utf-8"
|
||||
)
|
||||
history["intents"].append(
|
||||
{
|
||||
"version": version,
|
||||
@@ -82,6 +102,7 @@ def record_intent(
|
||||
"status": IN_PROGRESS,
|
||||
"execution": None,
|
||||
"baseline": baseline,
|
||||
"scope": scope_files,
|
||||
}
|
||||
)
|
||||
_write_history(folder, history)
|
||||
|
||||
Reference in New Issue
Block a user