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

@@ -0,0 +1,18 @@
# Step 7 — Implementation Detail
1. `app/states/lessons.py`: `collect_lesson_candidates` builds one record when an Execution ends, from what the Execution already holds. Candidate types:
- `revision`: each reopen, with its reason and who asked.
- `revision_limit`: a reopen refused at the cap.
- `change_request`: the user's feedback on a Phase, with the Deliverables in it.
- `finding`: each entry of every submitted `findings.json`, with the attempt it came from.
- `refusal`: each tool reply that did nothing (`REJECTION_PREFIXES`, now in `app/adk/runtime.py`), with role, tool and Deliverable.
- `unfinished`: a Specialist that stopped or spent its budget.
2. Refusals are captured in the nodes, not the runtime: `_noting_refusals` wraps each tool, so any runtime, the fake included, produces them. Specialist refusals travel in the outcome record; the Orchestrator's are kept in state under `refusals`.
3. The record names the Execution, its status, each role's Skills and a version per Skill. `skill_version` in `app/skills/agent_skills.py` is a 12-character content hash of the Skill's files.
4. It is written twice: through `ExecutionRecorder.record_lesson_candidates` (the database recorder stores it as an artifact of type `lesson_candidates`), and to `lessons/candidates/<execution_id>.json` under the output root. That directory is gitignored.
Changed from the plan: the file is not inside `deliverables/executions/<id>/`. An Execution that ends with warnings must write no Deliverable files (an existing rule with a test), and those Executions are the ones most worth learning from.
On "no secrets and no discovered cloud data": a refusal from a `cloud_read` tool keeps only the words before its first colon, and every message is cut at 500 characters. Revision reasons, user feedback and finding evidence are kept whole, so a record can quote the user and name resources in generated Terraform. Treat the files as client data.
Tests: `tests/execution/test_lessons.py`.