fix: a changed functional requirement is reached through its components
The change-case check asked for a changed Check whose source is the changed requirement. A functional requirement is carried by the components that serve it, so it is reached through a Check on an Element realising one. Plans record the first Change request with real models: a retention change made in 18 minutes for a third of its Baseline's tokens, touching seven Checks on one Element and nothing else, and the regression runs of cases 02, 03 and 04, all at 100%. Iteration 7 is complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -745,3 +745,30 @@ def test_the_change_case_loads_with_its_statement_of_change():
|
||||
|
||||
assert "7 years" in case.change
|
||||
assert all(not c.change for c in cases if c.id != case.id)
|
||||
|
||||
|
||||
def test_a_functional_requirement_is_reached_through_its_components_elements():
|
||||
"""The change case of 2026-10-09: a changed functional requirement whose Checks
|
||||
are sourced to a constraint, on the Element that realises its component."""
|
||||
from eval.scoring import score_change
|
||||
|
||||
def tighten(graph):
|
||||
# K-1 is on E-1, which realises C-1, which serves FR-1. Its source is NFR-1.
|
||||
graph["checks"][0]["statement"] = "The service runs at least three instances."
|
||||
|
||||
functional = change_interaction(tighten, requirement=False)
|
||||
requirements = json.loads(
|
||||
interaction_requirements := functional.state["deliverables"]["requirements"][
|
||||
"attachments"
|
||||
]["requirements.json"]
|
||||
)
|
||||
assert interaction_requirements
|
||||
requirements[0].update(change="changed", text="Accept events.", reason="Restated.")
|
||||
functional.state["deliverables"]["requirements"]["attachments"] = {
|
||||
"requirements.json": json.dumps(requirements)
|
||||
}
|
||||
|
||||
by_name = {check.name: check for check in score_change(functional, 4, 1)}
|
||||
|
||||
assert by_name["change_is_recorded"].detail == "FR-1 changed"
|
||||
assert by_name["changed_requirements_reach_checks"].passed
|
||||
|
||||
Reference in New Issue
Block a user