fix(p16): the pre-call announcement must state the cap the run will use, not the constants

announce() read _DEFAULT_MAX_ROUNDS/_DEFAULT_MAX_TOKENS directly, which was correct only while
main() could not do otherwise. MEASURED on the first free drill after --max-rounds landed: the same
stdout said "Stops at: 3 rounds / 100000 tokens" two lines above "max_rounds=8, max_tokens=120000".
The announcement is the ONE thing printed before the first paid call and its whole job is to say
what the run will do -- the Fase-3 class, introduced by the very flag being announced.

Load-bearing MEASURED: arm (f) red before the fix; M16 (read the constants again) -> 1 red, that
arm ALONE. Green control 1670/5, golden BYTE-UNCHANGED (ea8c534...).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-14 12:21:29 +02:00
commit a61a3ccda7
3 changed files with 55 additions and 2 deletions

View file

@ -2466,6 +2466,12 @@ Python ≥3.10. MAF (`agent-framework-core` 1.16.0, `-orchestrations` 1.1.1 —
`--bundle-dir` er oppgitt og `docs_dir` er ubrukt pa bundle-stien — den dokumenterte kommandoen
ville nektet av DEN grunnen ogsaa; READMEs egen form (`--docs-dir <bundle> --bundle-dir <bundle>`)
er det som virker, og a lose opp guarden er en egen operatorbeslutning.
**ANNONSERINGEN LES KONSTANTENE, og flagget gjorde den USANN i samme trekk:** `announce` er det
ENE som printes FOR forste betalte kall, og hele jobben dens er a si hva kjoringen VIL gjore —
a lese `_DEFAULT_*` var korrekt kun sa lenge `main()` ikke kunne gjore annet. MALT pa den forste
gratis-turen etter at flaggene landet: samme stdout sa «Stops at: 3 rounds / 100000 tokens» TO
linjer over «max_rounds=8, max_tokens=120000» — Fase-3-klassen, innfort av nettopp det flagget
som annonseres. Rettet til argv; M16 (les konstantene igjen) → 1 rod, den armen ALENE.
- **STATE.md er local-only** (gitignored). Voyage session-state er efemert; STATE.md er kanonisk kontinuitet.
- Prosess: Voyage-plugin (`/trekbrief → /trekplan → /trekexecute → /trekreview`) per større fase.

View file

@ -3726,8 +3726,15 @@ def main(argv: list[str] | None = None) -> int:
announce(
mandate,
project_id=args.project_id or "the portfolio",
max_rounds=_DEFAULT_MAX_ROUNDS,
max_tokens=_DEFAULT_MAX_TOKENS,
# From ARGV, never the constants (P16 B2). The announcement is the one thing
# printed BEFORE the first paid call, and its whole job is to say what this run
# will do; reading the defaults was correct only while main() could not do
# otherwise. MEASURED on the first free drill after --max-rounds landed: the same
# stdout said "Stops at: 3 rounds / 100000 tokens" two lines above
# "max_rounds=8, max_tokens=120000" -- the Fase-3 class, introduced by the very
# flag being announced.
max_rounds=args.max_rounds,
max_tokens=args.max_tokens,
dimension_label=dimension_label,
external_services=service_labels(mcp_servers),
)

View file

@ -143,3 +143,43 @@ def test_e_the_documented_dry_run_command_form_is_accepted(tmp_path: Path) -> No
)
assert "unrecognized arguments" not in proc.stderr, proc.stderr
assert proc.returncode == 0, proc.stderr
def test_f_the_announcement_states_the_cap_the_run_will_actually_use(
tmp_path: Path, capsys: pytest.CaptureFixture[str]
) -> None:
"""``announce`` is the ONE thing printed BEFORE the first paid call, and its whole job is to
say what the run will do. It read ``_DEFAULT_MAX_ROUNDS``/``_DEFAULT_MAX_TOKENS`` directly,
which was correct only by accident while ``main()`` could not do otherwise. MEASURED on the
first free drill after the flags landed: the same stdout said ``Stops at: 3 rounds /
100000 tokens`` two lines above ``max_rounds=8, max_tokens=120000`` the Fase-3 class (a
claim the surface makes about itself), introduced by the flag it announces."""
base = _base(tmp_path)
mandate = tmp_path / "m.json"
mandate.write_text(
'{"objective":"o","success_criteria":"s","approaches":'
'[{"id":"a1","label":"L","affected_codes":["C"],"claimed_saving_nok":1.0}]}',
encoding="utf-8",
)
rc = run_module.main(
[
"P1",
"--profile",
"local",
"--docs-dir",
str(base),
"--bundle-dir",
str(base),
"--mandate",
str(mandate),
"--max-rounds",
"8",
"--max-tokens",
"120000",
"--live-dry-run",
]
)
assert rc == 0
out = capsys.readouterr().out
assert "Stops at: 8 rounds / 120000 tokens" in out, out
assert "3 rounds / 100000 tokens" not in out