feat: every Operational requirement verified by a Check; eval spread and report

The operating model is refused while an Operational requirement is verified
by no Check, from it or from a Condition it comes from; the architect is
told so, and the operating-chain Skill lists it. Six of nine earlier runs
left a requirement unverified.

The evaluation checks it too, runs each case N times (--repeat), reports
the spread of people, cost, Roles, Checks and Capabilities (spread.json),
and writes report.md to publish. Result folders are relative to the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:32:05 +01:00
parent efe543e6e2
commit 6fdac22876
12 changed files with 356 additions and 23 deletions

View File

@@ -9,7 +9,7 @@ against one, and is not built.
from __future__ import annotations
import json
from collections.abc import Mapping
from collections.abc import Mapping, Sequence
from dataclasses import asdict, dataclass, field
from typing import Any
@@ -61,6 +61,26 @@ def _attachment(deliverables: Mapping[str, Any], kind: str, name: str) -> Any:
return None
def unverified(
requirements: Sequence[Mapping[str, Any]], model: Mapping[str, Any]
) -> list[str]:
"""The Operational requirements no Check verifies: none has the requirement, or
a Condition it comes from, as its source."""
carried = {str(check.get("source")) for check in model.get("checks") or []}
missing = []
for requirement in requirements:
named = requirement.get("source") or []
named = [named] if isinstance(named, str) else named
# A Check's source is a requirement or a Condition (the graph refuses
# anything else), so a source of the requirement that a Check carries is a
# Condition it comes from.
if str(requirement.get("id")) not in carried and not any(
str(source) in carried for source in named
):
missing.append(str(requirement.get("id")))
return missing
def score(
workflow: Workflow,
state: Mapping[str, Any],
@@ -155,6 +175,21 @@ def score(
_attachment(deliverables, TARGET_OPERATING_MODEL, "target-operating-model.json")
or {}
)
requirements = (
_attachment(
deliverables, "operational_requirements", "operational-requirements.json"
)
or []
)
missing = unverified(requirements, model)
checks.append(
Check(
"every Operational requirement is verified by a Check",
bool(requirements) and not missing,
f"{len(requirements) - len(missing)} of {len(requirements)}"
+ (f"; not verified: {', '.join(missing)}" if missing else ""),
)
)
figures = {
"items": len(spec.items(scope)),
"conditions": len(spec.conditions(scope)),
@@ -178,6 +213,7 @@ def score(
"parties": len(model.get("parties") or []),
"roles": len(model.get("roles") or []),
"checks": len(own),
"requirements_unverified": len(missing),
"checks_not_verifiable": sum(
1 for v in own if v.get("verdict") == "not_verifiable"
),