fix(p17b): close the flags multi-base mode neither carried nor refused [skip-docs]

Measured after the paid run, not before it: the across-bundle door honoured
fourteen flags and refused five, which left eight accepted and then dropped. The
worst of them was ``--mcp-config`` -- configured egress with nothing printed,
which this repo forbids outright -- and ``PROJECT_ID``/``--docs-dir``, which
would LOOK honoured while the dispatch read each base's project from that base's
own IR projection and used each base as its own docs dir.

The two anchoring flags are WIRED rather than refused. They are bundle concerns
and this dispatch hands ``run_project`` one bundle at a time, so they compose
exactly -- and ``--require-cost-baseline`` is the named remedy for the defect
this session's own paid run measured (``1.10.4``, a requirement number accepted
as a cost code on a base with no schedule: P19 F1, now reproduced on a second
base). Wiring the free drill too, so the dry run and the paid run cannot
disagree about what the run will do.

The two ``requires --bundle-dir`` guards no longer answer for this mode: falling
through would tell an operator to add the one flag this mode also refuses, which
is the repo's own standing objection to that pattern.

Mutation (v) -- the requirement reaches the dispatch and never the per-base runs
-- is red on its own arm against the whole suite. Suite 1781/5, golden unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-15 05:02:05 +02:00
commit c4e88003e2
2 changed files with 123 additions and 3 deletions

View file

@ -500,6 +500,11 @@ def test_the_flag_requires_the_three_things_a_multi_base_pass_cannot_invent(
["--explore", "en prompt"],
["--prepass-payload", "payload.json"],
["--proposals-from-mandate"],
["--docs-dir", "somewhere"],
["--mcp-config", "servers.json"],
["--semantic-retrieval"],
["--checkpoint-dir", "ckpt"],
["--review-inbox", "inbox"],
],
)
def test_the_flag_refuses_every_single_base_mode_by_name(
@ -520,3 +525,80 @@ def test_the_flag_refuses_every_single_base_mode_by_name(
assert run_module.main(argv) == 1
err = capsys.readouterr().err
assert "--across-bundle" in err and extra[0] in err
def test_a_positional_project_id_is_refused_rather_than_dropped(
tmp_path: Path, capsys: pytest.CaptureFixture[str]
) -> None:
"""Each base's project comes from THAT base's own IR projection, never from argv.
A caller-supplied constant could be right for one base out of N, and accepting it silently
would look honoured while the dispatch used something else the silent-drop class.
"""
base = _mount(tmp_path, _BYGG)[0]
argv = [
"EN-PROSJEKT-ID",
"--across-bundle",
base,
"--mandate",
_mandate_file(tmp_path, rows=[("a", "bygg-energi-mikro")]),
"--run-id",
"X",
"--outbox-dir",
str(tmp_path / "out"),
]
assert run_module.main(argv) == 1
err = capsys.readouterr().err
assert "PROJECT_ID" in err and "--across-bundle" in err
def test_the_anchoring_requirement_is_carried_to_every_base_not_dropped(
tmp_path: Path, capsys: pytest.CaptureFixture[str]
) -> None:
"""``--require-cost-baseline`` is HONOURED here, and refuses before the first model call.
P19 F1's named remedy, and P17b's own paid run is what makes it matter: a requirement number
was accepted as a cost code on a base with no schedule. Accepting the flag and dropping it
would be the F4 class on the one guarantee an operator asked for by name so the arm asserts
the REFUSAL, and its control asserts that the same argv without the flag runs to rc 0.
``bygg-energi-mikro`` ships no ``cost-baseline.json`` and ``tunnel-hauglia`` does, so the
refusal must come from the first base rather than from "neither is anchored".
"""
bases = _mount(tmp_path, _BYGG, _TUNNEL)
mandate = _mandate_file(tmp_path, rows=[("a", "bygg-energi-mikro"), ("b", "tunnel-hauglia")])
replies = _replies_file(tmp_path)
outbox = tmp_path / "out"
assert (
run_module.main(
_argv(
bases,
mandate=mandate,
run_id="X",
outbox=outbox,
replies=replies,
extra=["--require-cost-baseline"],
)
)
== 1
)
err = capsys.readouterr().err
assert "bygg-energi-mikro" in err or "cost baseline" in err.lower()
assert not (outbox / "X-bygg-energi-mikro-a-proposal.json").is_file(), (
"the refusal fired AFTER the run had already been paid for"
)
assert (
run_module.main(
_argv(
bases,
mandate=mandate,
run_id="Y",
outbox=outbox,
replies=replies,
extra=[],
)
)
== 0
), "control: the same argv without the flag runs"