fix(p20): code_forms follows ITS OWN approach, and the announcement has a witness [skip-docs]
Two defects the mutation battery and the paid round found, both measured before being touched. (1) code_forms described the WRONG candidate. Every per-approach artefact copied the run's stamp and overrode only validator_decision, so an artefact about approach 2 reported approach 1's codes. Measured in BOTH round 3 and round 4 -- and stress.py, which reads this field before re-deriving, then produced an EMPTY prose_codes for every approach but the first, which is what round 3's table was built on. The field's own comment already says it is stamped "off the proposal being stamped"; run-level was the drift, not the intent. Model, citations and token usage stay the run's, because they are the run's. (2) The C2 announcement seam had no witness. Mutation C-iii reverted the call site to `args.project_id or "the portfolio"` and the WHOLE suite stayed green (1808/5): all three arms drove announced_subject directly. The missing arm drives main() on a free dry run and reads the announcement off STDOUT, where an operator reads it, and is red against exactly that mutation. Sixteen mutations, ALL red against the whole suite. Green control 1809/5 (from 1781, +28, 0 removed), golden demo-transcript.stdout BYTE-UNCHANGED (shasum -a 1 of the CONTENT = ea8c534773acdbe41ae68f2c55724d69aaf8be4f). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
c8f0c8f7c4
commit
e513bc97ad
4 changed files with 139 additions and 3 deletions
|
|
@ -28,9 +28,12 @@ What each arm pins:
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from portfolio_optimiser.budget import Budget, TokenMeter
|
||||
from portfolio_optimiser.generate import ParseFailure, _build_messages, generate_via_llm
|
||||
from portfolio_optimiser.reference_domain import Project
|
||||
|
|
@ -122,6 +125,42 @@ def test_an_unresolvable_base_falls_back_to_its_directory_name(tmp_path: Path) -
|
|||
assert announced_subject(None, (str(missing),)) == "not-a-base"
|
||||
|
||||
|
||||
def test_the_cli_prints_the_routed_bases(
|
||||
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
||||
) -> None:
|
||||
"""(e2) The WIRING, not the renderer.
|
||||
|
||||
MEASURED: mutation C-iii reverted the call site to ``args.project_id or "the portfolio"`` and
|
||||
the WHOLE suite stayed green (1808/5) — the renderer had three arms and the call site none, so
|
||||
the seam C2 exists for was unwitnessed. This arm drives ``main()`` on a free dry run and reads
|
||||
the announcement off stdout, which is where an operator reads it.
|
||||
"""
|
||||
from portfolio_optimiser.run import main
|
||||
|
||||
mandate = tmp_path / "m.json"
|
||||
mandate.write_text(
|
||||
json.dumps({"objective": "cut cost", "approaches": [], "allow_own_proposals": True}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
rc = main(
|
||||
[
|
||||
"--across-bundle",
|
||||
str(_TUNNEL),
|
||||
"--mandate",
|
||||
str(mandate),
|
||||
"--run-id",
|
||||
"r1",
|
||||
"--outbox-dir",
|
||||
str(tmp_path / "out"),
|
||||
"--live-dry-run",
|
||||
]
|
||||
)
|
||||
out = capsys.readouterr().out
|
||||
assert rc == 0, out
|
||||
assert "Run mandate for tunnel-hauglia" in out
|
||||
assert "the portfolio" not in out
|
||||
|
||||
|
||||
def test_the_two_older_subjects_are_unchanged() -> None:
|
||||
"""(g) A named project wins; no bases at all is still the portfolio."""
|
||||
assert announced_subject("proj-1", ()) == "proj-1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue