feat: Change requests against a Baseline (ADR-0006)

A caller restates a request to say how requirements have changed, naming a
completed Execution of the same Customer case as the Baseline.

- app/baseline.py reads a Baseline from its files and refuses one that
  does not exist, did not complete or belongs to another case, before
  anything runs or is recorded. A Baseline is never modified.
- Requirements carry a change (unchanged, added, changed, removed) and a
  reason. Submission is refused when a Baseline requirement disappears, an
  id is reused, or an unchanged requirement's text differs. A removed
  requirement stays on record and asks nothing downstream.
- Each Specialist starts from its delivered version; the graph and the code
  are its working copy, and the description is carried over when the
  design's shape is the same.
- app/workflows/changes.py compares versions by id and traces what each
  changed requirement reaches; anything else that changed is listed as
  unrequested. Approvals show the change for their Phase, and changes.json
  is written with the full Deliverables.
- Intake no longer starts a message read as a change: it names the
  Execution to give as the Baseline.
- A fifth evaluation case runs a request and then a change to it, with
  four checks that the change is recorded, reaches Checks, stays contained
  and costs less than its Baseline.

Tested with scripted agents only; no Change request has run with real
models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 11:38:15 +01:00
parent db28d02f56
commit 5ef434d00e
32 changed files with 1824 additions and 40 deletions

View File

@@ -30,6 +30,7 @@ from app.workflows.chain import (
check_verdicts,
graph_structure,
)
from app.workflows.changes import check_requirement_changes
from app.workflows.target_architecture import GRAPH_ATTACHMENT
@@ -286,11 +287,14 @@ def check_submission(
content: str,
attachments: Mapping[str, str],
upstream: Upstream | None = None,
baseline: Mapping[str, object] | None = None,
) -> tuple[str, ...]:
"""Return what a submission lacks against its contract; empty means it's complete.
`upstream` is the Deliverables this one builds on, by kind. With it, the links
along the Requirements chain are checked too.
along the Requirements chain are checked too. `baseline` is the Baseline's
version of this Deliverable in a Change request; with it, the account of what
changed is checked.
"""
if not content.strip():
return ("content: must not be empty",)
@@ -311,4 +315,11 @@ def check_submission(
name, check = DATA_CHECKS[kind]
if attachments.get(name, "").strip():
missing.extend(check(attachments, upstream))
if (
baseline is not None
and kind is DeliverableKind.REQUIREMENTS
and attachments.get(REQUIREMENTS_FILE, "").strip()
and not missing
):
missing.extend(check_requirement_changes(attachments, baseline))
return tuple(missing)