portfolio-optimiser/docs/plan
Kjell Tore Guttormsen d6f3359fae feat(step5): the falsification that informed the next hypothesis now leaves the loop
generate_via_llm consumed each validator Rejection internally (`last`), fed it into the
next attempt's prompt, and dropped it. So Step 5 was real but unobservable: a caller could
see THAT a proposal validated, never that it validated on attempt 2 after the deterministic
validator falsified attempt 1. It was the one step of the eight with no output to show.

The seam is a typed return value -- GenerationResult(outcome, refinements) -- rather than an
out-parameter or a callback: a returned value cannot be silently lost by a caller that forgets
to pass a collector, and mypy forces every call site to acknowledge it.

refinements carries ONLY rejections that were actually fed back. When the attempt budget runs
out the final rejection IS outcome; counting it here would be double-counting, and the bounded
control test goes red on the collect-everything implementation that gets this wrong.

The loop's bound is untouched: max_attempts and meter.tick_round stand, and `last` still drives
the prompt alone, so prompt growth is unchanged. run.py accumulates across _evaluate calls, so
_evaluate_mandate is untouched; RunResult.refinements defaults (the coverage precedent) and is
concatenated across approaches rather than keyed per approach -- stated as an honesty limit.

The simulation now shows it: the scripted proposer overclaims 250000, which the validator
falsifies against P90 = 90000, and the corrected 30000 validates. Only the overclaim is
scripted -- the rejection is computed. scripted_factory takes a per-role reply selector so this
needs no second scripted client body.

README records the two accuracy changes only (Step 5 is now inspectable; the simulation trace
shows the correction). The level-2 publishing claim stays deferred until after the demo (O4).

Load-bearing MEASURED against the full suite with a control, four mutations all red:
detach the returned history (4 tests) - collect-everything (control only) - detach the run
wiring (2 tests) - revert the simulation's proposer to a constant (the demo-protection test).
Control: 759 passed / 4 skipped; ruff, format and mypy clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CcWFcREUi6YPjEpN3ACDP
2026-08-06 15:12:06 +02:00
..
2026-06-23-incremental-plan.md docs: add cost-discipline + 90% principle as locked decisions (D5, D6) 2026-06-23 22:11:48 +02:00
2026-06-26-maalbilde-agentic-loop.md docs(maalbilde): konsolidert agentisk-loop baseline + OKF-kontekstarkitektur 2026-06-26 20:56:14 +02:00
2026-07-02-sesjonsplan.md docs(plan): session-by-session execution plan from the 2026-07-02 status analysis 2026-07-02 17:11:10 +02:00
2026-07-03-maalbilde-ingest-lag.md docs(plan): målbilde + gated sesjonsplan for ingest-programmet 2026-07-03 13:45:14 +02:00
2026-07-03-program-brief-ingest-konnektorer.md docs(plan): program-brief for ingest-lag — tools/konnektorer mot reelle datakilder 2026-07-03 11:24:24 +02:00
2026-07-03-sammenligningsprotokoll.md docs(plan): S3 — comparison protocol (pinned ref, metrics, liveness asymmetry) 2026-07-03 01:10:05 +02:00
2026-07-03-sesjonsplan-ingest.md docs(plan): ingest-rammer — Opus 4.8 xhigh alle økter, ingen Fable 5 2026-07-04 17:17:09 +02:00
2026-07-06-reell-kjoring-analyse-plan.md docs(plan): utrulling D-F–D-I — sesjonsplan (D-F–D-I i §2, S3.5/S3.6/S5.4, graf+T0), roadmap-revisjonsblokk, commons-amendment-utkast (Step-1-analyse: NEI → minimal amendment), toolkit-repo-brief 2026-07-15 05:29:41 +02:00
2026-07-10-sesjonsplan-fase2-6.md docs(repo): meet the org repo-standard gate — 0 ERROR 2026-08-03 21:56:19 +02:00
2026-07-14-commons-amendment-utkast.md docs(plan): utrulling D-F–D-I — sesjonsplan (D-F–D-I i §2, S3.5/S3.6/S5.4, graf+T0), roadmap-revisjonsblokk, commons-amendment-utkast (Step-1-analyse: NEI → minimal amendment), toolkit-repo-brief 2026-07-15 05:29:41 +02:00
2026-07-14-revisjonspakke-DF-DI.md docs(plan): utrulling D-F–D-I — sesjonsplan (D-F–D-I i §2, S3.5/S3.6/S5.4, graf+T0), roadmap-revisjonsblokk, commons-amendment-utkast (Step-1-analyse: NEI → minimal amendment), toolkit-repo-brief 2026-07-15 05:29:41 +02:00
2026-07-14-toolkit-repo-brief.md docs(plan): utrulling D-F–D-I — sesjonsplan (D-F–D-I i §2, S3.5/S3.6/S5.4, graf+T0), roadmap-revisjonsblokk, commons-amendment-utkast (Step-1-analyse: NEI → minimal amendment), toolkit-repo-brief 2026-07-15 05:29:41 +02:00
2026-07-16-llm-ingestion-guard-inclusion.md docs(security): plan llm-ingestion-guard inclusion at ingest/inbox persist-gates 2026-07-16 07:43:30 +02:00
2026-08-06-demo-uke-plan.md feat(step5): the falsification that informed the next hypothesis now leaves the loop 2026-08-06 15:12:06 +02:00
2026-08-06-intensjons-qa.md docs(qa): the four decisions the QA surfaced, with what constrains them 2026-08-06 13:20:52 +02:00