portfolio-optimiser-claude/tests
Kjell Tore Guttormsen 544655b4c8 test(validator): the gate was pinned in its arithmetic, not in its decision [mutation-ok]
[mutation-ok] rationale: no mutation is pinned in code. `src/` is byte-identical
to HEAD (git diff HEAD -- src/ is empty; `if False` occurs 0 times under src/).
The three matches the guard found are PROSE in the docs note and the test file's
docstring, quoting the detach mutation that was run and restored. Every harness
run in this session verified its restore by sha256 from disk.

S2.7 is the D7 mirroring queue's topmost unmeasured candidate. The MAF sibling
tightened its validator in two halves -- (a) a structural block on
`claimed > nominal_feasible`, (b) an IR invariant `low <= unit_cost <= high`.
Both halves are GATED here on D-A pkt. 1 + a commons pull, and the defect they
answer is confirmed on our side as C-F2. So neither is built. The question this
answers is the one that is answerable offline: is today's boundary -- "the ONE
numeric gate is p90" -- load-bearing?

One rule, structurally: a claim is numerically bounded in exactly two places in
src, each with its own spec role (ir.py:50 §7.1, validator.py:68 §3 Step 4).
The sibling's drift shape does not exist here.

But the coverage splits cleanly across the rule. Measured with
scripts/mutation_harness.py, denominator tests/ (all 955), each run
sha256-restored: everything the gate COMPUTES is red, because the golden
fixture freezes it -- policy cap, band branch, band endpoint order, MC seed,
p90 cut point, nominal_feasible. Everything the gate DECIDES WITH is
green-but-dead -- bound to p10, bound to nominal_feasible, and loosening the
comparison each left all 955 green. The golden freezes what the validator
produces, so it cannot help with the one thing it does not observe: which bound
the gate reads. Swapping p90 for nominal_feasible IS the gated S2.7 half (a),
and it would have landed with the suite green, before D-A was decided.

Closed by tests/test_validator_gate_loadbearing.py (8 tests, 955 -> 963). Each
clause is green before and red after exactly its own mutation, with the golden
figures green in BOTH runs -- which shows mechanically that the mutation moved
the decision, not the arithmetic. The two IR tests are pinned with --red-at
against the invariant's own message, since they die in a helper. The AST
population control was proved against a BEHAVIOUR-PRESERVING mutation (the gate
widened to a logically equivalent conjunction) with all three behavioural
controls green: a new gate site is invisible to any behavioural test, which is
why it is there.

Two things the measurement gave in addition. Under the containment mutation the
golden test stayed green, confirming mechanically that half (b) is
golden-compatible when D-A lands. And the IR carries no ORDER on band endpoints
either -- strictly more than C-F2 names: (1.40, 0.70) is accepted, and while
random.uniform still draws from [0.70, 1.40], it walks the seeded stream
backwards, which is a different p90 (120456.91 against 121057.09).

Honest limit: pinning that a claim above nominal_feasible validates today is not
an endorsement of it. C-F2 calls that a MAJOR spec-level defect and the fix is
gated, not declined. These tests make the gated work arrive as a visible red
test and a decision, never as a silent swap. No src change, no spec text
touched, the fasit untouched.

Dated under the D7 frame: work AFTER 2026-08-09, not independent convergence.

Co-Authored-By: Claude <claude-opus-5>
2026-09-07 00:07:19 +02:00
..
data feat(portfolio): K11 — per-run value report, pure projection over the three layers (parity row 25) [skip-docs] 2026-07-25 06:25:02 +02:00
_scripted.py feat(loop): S8 — D7 agentic loop: budget meter, maker-checker gate, informed refinement 2026-07-03 07:21:02 +02:00
test_budget.py feat(portfolio): C3.5 — pre-call run-total USD budget belt (parity row 16/31) [skip-docs] 2026-07-23 22:45:37 +02:00
test_bygg_energi_mikro.py feat(validator): S6 — deterministic backbone: typed IR, golden-frozen validator, provenance stamp 2026-07-03 06:27:40 +02:00
test_checker_gate_loadbearing.py feat(loop): S8 — D7 agentic loop: budget meter, maker-checker gate, informed refinement 2026-07-03 07:21:02 +02:00
test_cli_paritet_loadbearing.py feat(harness): the procedure rebuilt ten times gets the four controls it kept skipping 2026-08-25 08:57:06 +02:00
test_contracts.py feat(portfolio): K2 — sequential multi-project run (parity row 4) 2026-07-23 21:39:39 +02:00
test_costsim.py test(loadbearing): positive controls for the static-guard half of the sibling-vacuity class 2026-08-01 20:01:21 +02:00
test_dry_run_loadbearing.py feat(portfolio): K8 — live-run drill, pre-call artifact capture (parity row 21) [skip-docs] 2026-07-24 06:54:58 +02:00
test_goals.py feat(ledger): K1 — savings ledger + goal contract (parity rows 2-3) 2026-07-17 04:00:14 +02:00
test_hitl_loadbearing.py test(loadbearing): measure the last 8 all-negative tests instead of assuming them 2026-08-09 10:08:12 +02:00
test_ingest.py chore(deps): re-pin llm-ingestion-okf to v0.3.1 + migrate tests to stable error codes 2026-07-20 07:22:09 +02:00
test_ingest_adoption.py chore(deps): re-pin llm-ingestion-okf to v0.3.1 + migrate tests to stable error codes 2026-07-20 07:22:09 +02:00
test_ingest_golden.py feat(ingest): I3 — D7-speil av ingest (filkatalog/CSV), bygget fra commons-spec alene 2026-07-04 06:12:43 +02:00
test_ingest_loadbearing.py test(loadbearing): the spec moved to O2 and the emitter did not — ratchet the gap 2026-08-09 10:19:40 +02:00
test_ingest_spec_loadbearing.py test(ingest-spec): §11's two tables get the §12 row-anchor form 2026-08-20 23:18:23 +02:00
test_ingest_sql.py chore(deps): re-pin llm-ingestion-okf to v0.3.1 + migrate tests to stable error codes 2026-07-20 07:22:09 +02:00
test_ingest_sql_golden.py feat(ingest): I5 — SQL D7-speil, bygget fra commons-spec alene 2026-07-04 07:18:59 +02:00
test_ingest_sql_loadbearing.py test(loadbearing): the spec moved to O2 and the emitter did not — ratchet the gap 2026-08-09 10:19:40 +02:00
test_ingest_stamp_conformance_loadbearing.py test(loadbearing): the spec moved to O2 and the emitter did not — ratchet the gap 2026-08-09 10:19:40 +02:00
test_ir.py fix(validator): C2.6 — finiteness hardening, Infinity can no longer vacuously clear the gate (closes R-2) 2026-07-16 20:10:12 +02:00
test_ledger_loadbearing.py fix(ledger): normalize every load rejection to ValueError at the ledger's own entrance 2026-07-25 15:29:27 +02:00
test_loop.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_method_spec_loadbearing.py test(loadbearing): positive controls for the static-guard half of the sibling-vacuity class 2026-08-01 20:01:21 +02:00
test_method_spec_rule_phrases_loadbearing.py test(loadbearing): bind a rule phrase to every section the shape guard cannot see 2026-08-09 10:25:55 +02:00
test_mutation_harness.py feat(harness): the procedure rebuilt ten times gets the four controls it kept skipping 2026-08-25 08:57:06 +02:00
test_notify_loadbearing.py test(loadbearing): positive controls for the static-guard half of the sibling-vacuity class 2026-08-01 20:01:21 +02:00
test_notify_seam_loadbearing.py feat(portfolio): K10 — notification/notifier seam, opt-in webhook egress (parity row 23) [skip-docs] 2026-07-24 20:16:56 +02:00
test_okf.py test(loadbearing): positive controls for the static-guard half of the sibling-vacuity class 2026-08-01 20:01:21 +02:00
test_okf_unquote_loadbearing.py test(okf): the one unquoting rule was pinned at its edge, not in its three clauses 2026-08-31 23:31:17 +02:00
test_outbox_loadbearing.py feat(portfolio): K5 — outbox persistence, run_id-named pairs (parity row 7) [skip-docs] 2026-07-23 22:31:18 +02:00
test_persona_skill_loadbearing.py feat(learning): S9 — D7 læringssløyfe: verdict-inbox, fail-closed promoteringsgate, artefakt-sourced persona 2026-07-03 07:36:15 +02:00
test_portfolio.py feat(portfolio): K2 — sequential multi-project run (parity row 4) 2026-07-23 21:39:39 +02:00
test_portfolio_learning_loadbearing.py test(loadbearing): measure the last 8 all-negative tests instead of assuming them 2026-08-09 10:08:12 +02:00
test_preflight.py test(sdk): the pin was a permission, so give the premises a proof 2026-08-18 16:57:57 +02:00
test_provenance.py feat(validator): S6 — deterministic backbone: typed IR, golden-frozen validator, provenance stamp 2026-07-03 06:27:40 +02:00
test_provenance_sdk_version_loadbearing.py feat(run): stamp the drill's SDK build in the dry-run run-config [skip-docs] 2026-07-25 15:35:16 +02:00
test_readme_anchors_loadbearing.py fix(readme): the four dead TOC anchors, and a guard that reads the renderer instead of modelling it 2026-08-17 11:28:46 +02:00
test_run_entrance_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_s10_run_layer.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_sdk_isolation.py test(sdk): the pin was a permission, so give the premises a proof 2026-08-18 16:57:57 +02:00
test_sdk_tool_namespace_loadbearing.py test(sdk): the server knows its own name, and the tool never hears it 2026-08-25 08:33:07 +02:00
test_sdk_version_guard.py test(sdk): the pin was a permission, so give the premises a proof 2026-08-18 16:57:57 +02:00
test_simulation_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_step1_expel_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_step5_refine_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_step7_async_loop_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_step8_promotion_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_validator.py fix(validator): C2.6 — finiteness hardening, Infinity can no longer vacuously clear the gate (closes R-2) 2026-07-16 20:10:12 +02:00
test_validator_gate_loadbearing.py test(validator): the gate was pinned in its arithmetic, not in its decision [mutation-ok] 2026-09-07 00:07:19 +02:00
test_valuereport_loadbearing.py test(loadbearing): close the vacuous-negative class across the whole suite 2026-07-31 21:39:28 +02:00
test_valuereport_seam_loadbearing.py feat(portfolio): K11 — per-run value report, pure projection over the three layers (parity row 25) [skip-docs] 2026-07-25 06:25:02 +02:00