portfolio-optimiser/tests
Kjell Tore Guttormsen d296cffcd5 fix(okf): evidence_for derives a tier only for the key SPEC 5.3 tiers
[skip-docs]

PM addendum 5 to order 20260902T151931Z-250257273, reported at the close of B4
and deliberately left unfixed there as outside that order.

evidence_for(path, key="sources") raised ValueError. The tier was derived
unconditionally through trust_tier, which refuses an entry that names no `by`
actor -- correctly, because a trust level derived from an entry identifying
nobody mints the provenance it claims to read. But `by` is required of a
VERIFICATION entry (SPEC 5.2), not of every provenance key: the agreed
segmented form carries segment_id/source_offset and a sources list carries
id/resource. The guard belonging to one key was being applied to all of them.

trust_tier is UNCHANGED. evidence_for stops applying it to keys it was never
about: _TIERED_KEY names the one key SPEC 5.3 tiers, and every other key comes
back with state / reason / items_seen / entries and tier=None.

admits_falsification moved WITH it, and that is the same fact rather than
scope: it read `tier != "unverified"`, and None != "unverified" is TRUE, so a
present `sources` list would have cleared a threshold about verification. It
now names the tiers that clear it. For every value reachable before this change
both spellings are identical, which is why the existing K5 arms stay green.

Measured, and it corrected the test: an actorless `verified` value never
reaches trust_tier through evidence_for at all -- the decoder refuses that shape
first as unreadable / unsupported-flow. Both guards are now asserted where each
actually lives instead of one asserted where it is not.

Load-bearing measured, four mutations, all red against the WHOLE suite: derive
the tier unconditionally (3 red) - revert the K5 threshold (1, the consequence
arm alone) - "fix" it by never tiering at all (3, including two pre-existing
falsification arms) - loosen trust_tier instead (2, including its own
pre-existing gate). Green control 1208 passed / 5 skipped; golden
demo-transcript.stdout unchanged (ea8c534773acdbe41ae68f2c55724d69aaf8be4f).
2026-09-03 01:28:12 +02:00
..
golden test(okf): capture block-form fixture and collection baseline before any decoder 2026-09-02 19:58:56 +02:00
spikes fix(maf): en vakt som gikk inert i STILLHET, funnet ved aa loefte pinnen (F15, ORDRE 20260829T155150Z) 2026-09-02 19:35:49 +02:00
conftest.py fix(1b): regelen gjelder HVER betalt arm - fan-out-testen var fortsatt ugatet [skip-docs] 2026-08-14 20:12:47 +02:00
test_a5_per_approach_artifacts_loadbearing.py feat(outbox): every evaluated approach becomes something an expert can judge 2026-08-05 21:12:09 +02:00
test_anchored_reserve_loadbearing.py feat(simulation): GO — demoen kjører levert VEGLYS-bundle, forankret på deres tall [skip-docs] 2026-08-09 21:27:43 +02:00
test_assessment_method_loadbearing.py feat(fase1): assessment-method encoding — persisted dimension-scoped example + validator rule (F1) 2026-07-07 08:15:44 +02:00
test_async_plan_review_loadbearing.py fix(hitl): planen et menneske signerer er TEKST, aldri en objekt-repr (BLOCKER-1, ORDRE 20260902T151931Z) 2026-09-02 17:38:25 +02:00
test_b4_mcp_call_trace_loadbearing.py feat(provenance): a run records which external service it actually called 2026-08-05 21:37:29 +02:00
test_backends.py feat(4b): AZURE-profilen leser miljøet sitt, ikke operatørens laptop 2026-08-13 22:27:21 +02:00
test_baseline_visibility_loadbearing.py feat(visibility): en uforankret kjoering sier det - felt + linje (ORDRE 20260821T092039Z) 2026-08-21 12:21:48 +02:00
test_budget.py test(budget): defend the third field of the stop event — observed (kø-y) 2026-08-03 20:46:36 +02:00
test_bundle_id_reconciliation_loadbearing.py feat(explore): read_bundle costs O(documents), never O(bytes of the base) 2026-09-03 00:36:08 +02:00
test_bygg_energi_mikro.py docs(shared): bygg-energi mikro-eksempel — OKF-bundle + golden + load-bearing test 2026-06-29 09:42:13 +02:00
test_catalogue_cost_loadbearing.py feat(explore): katalogkallet koster O(baser), ikke O(korpus) (ORDRE 20260825T213645Z) 2026-08-26 14:45:16 +02:00
test_checker_gate_loadbearing.py feat(fase3): make the maker-checker checker actually gate the reasoning 2026-06-30 07:24:30 +02:00
test_console_entry_points.py feat(cli): console entry points + the demo's stderr damping (P4 pkt. 5 og 2) 2026-08-09 15:13:09 +02:00
test_content_keyed_script_loadbearing.py feat(sim): the demo script is keyed on the project the prompt names, so a new project is data 2026-08-06 16:43:29 +02:00
test_contracts.py feat(fase1): GoalContract + GoalConfig standalone fail-fast loader (F1) 2026-07-07 08:01:53 +02:00
test_costsim.py test(s36): value-level guard for _ore_to_kr_str money formatter 2026-07-15 10:25:05 +02:00
test_costsim_loadbearing.py feat(s36): costsim CLI + no-network + no-hardcoded-price guards 2026-07-15 10:05:29 +02:00
test_datasource.py feat(fase2): expose retriever as citation-bearing data source 2026-06-24 13:34:53 +02:00
test_demo_stderr_quiet_loadbearing.py feat(cli): console entry points + the demo's stderr damping (P4 pkt. 5 og 2) 2026-08-09 15:13:09 +02:00
test_dimension.py feat(s53): load_dimension fail-fast loader (MAF-free, mirrors load_goal_config) 2026-07-23 21:31:32 +02:00
test_dimension_loadbearing.py feat(fase1): dimension in run_project — context scope + candidate constraint (F1) 2026-07-07 07:50:26 +02:00
test_doc_constant_sync_loadbearing.py test(docs): klassifiser den nye kontraktfila som LIVE, ikke arkiv 2026-09-02 20:06:30 +02:00
test_evidence_key_parameter_loadbearing.py fix(okf): evidence_for derives a tier only for the key SPEC 5.3 tiers 2026-09-03 01:28:12 +02:00
test_explore_callsites_loadbearing.py feat(explore): --plan-review gjoer "be om svar, bruke svarene" naabar fra CLI (F4, ORDRE 20260825T133139Z) 2026-08-26 00:27:36 +02:00
test_explore_loadbearing.py feat(explore): read_bundle costs O(documents), never O(bytes of the base) 2026-09-03 00:36:08 +02:00
test_falsification_skill_loadbearing.py feat(persona): load the falsification skill from commons at call time 2026-09-02 21:31:32 +02:00
test_falsification_verdict_loadbearing.py test(okf): navigation stays tolerant while the decoder refuses, proven by bytes 2026-09-02 20:37:46 +02:00
test_foundry_profile_live.py test(fase2): gated live local + Foundry profile checks 2026-06-24 14:02:44 +02:00
test_frontmatter_unquote_loadbearing.py fix(okf): one unquoting rule for frontmatter scalars (kø-(a)/(i)) 2026-08-04 21:23:18 +02:00
test_full_run_live.py feat(1b): skjemaet ER akseptert av det levende endepunktet - malt, ikke resonnert [skip-docs] 2026-08-14 20:02:26 +02:00
test_generate.py feat(step5): the falsification that informed the next hypothesis now leaves the loop 2026-08-06 15:12:06 +02:00
test_go_delivered_bundle_loadbearing.py feat(simulation): GO — demoen kjører levert VEGLYS-bundle, forankret på deres tall [skip-docs] 2026-08-09 21:27:43 +02:00
test_golden_transcript_loadbearing.py fix(maf): en vakt som gikk inert i STILLHET, funnet ved aa loefte pinnen (F15, ORDRE 20260829T155150Z) 2026-09-02 19:35:49 +02:00
test_handover_package_loadbearing.py feat(gate): pakke-gaten leser INNHOLDET, ikke bare filnavn + vurdering av Azure-omdøping 2026-08-18 13:42:02 +02:00
test_hitl.py feat(visibility): en uforankret kjoering sier det - felt + linje (ORDRE 20260821T092039Z) 2026-08-21 12:21:48 +02:00
test_hitl_loadbearing.py feat(visibility): en uforankret kjoering sier det - felt + linje (ORDRE 20260821T092039Z) 2026-08-21 12:21:48 +02:00
test_hosted_backend_loadbearing.py feat(4b): AZURE-profilen leser miljøet sitt, ikke operatørens laptop 2026-08-13 22:27:21 +02:00
test_hosting_loadbearing.py feat(hitl): ekspertdommen kan ikke oppstaa av stillhet (F2, ORDRE 20260825T214801Z) 2026-08-27 01:22:07 +02:00
test_imports_core.py feat(fase1): export domain-model public API + green full suite (F1) 2026-07-07 08:17:10 +02:00
test_ingest_content_gate_loadbearing.py feat(ingest): P2/S1.b — innholdsgaten står, rundt materialize og ikke i den 2026-08-09 22:58:00 +02:00
test_ingest_golden.py test(ingest): golden extraction case examples/ingest-golden-file, byte-frozen (I2) 2026-07-03 18:40:53 +02:00
test_ingest_golden_http.py fix(3): den fremmedes første kjøring skriver ingen SyntaxWarning [skip-docs] 2026-08-14 07:04:08 +02:00
test_ingest_golden_mcp.py fix(ingest): narrow mcp_timeout to our OWN deadline, not the exception type (kø-z follow-up) 2026-08-03 21:22:00 +02:00
test_ingest_golden_sql.py chore(repo): planning artifacts become local-only; fixture builders become code 2026-08-05 10:08:17 +02:00
test_ingest_http.py feat(ingest): http read_http connector + injectable transport seam (I6) 2026-07-04 16:57:29 +02:00
test_ingest_http_loadbearing.py fix(3): den fremmedes første kjøring skriver ingen SyntaxWarning [skip-docs] 2026-08-14 07:04:08 +02:00
test_ingest_http_timeout_loadbearing.py feat(ingest): bound the default http transport in time, in front of the pinned library (S2.4) 2026-08-03 14:54:04 +02:00
test_ingest_library_seam.py chore(deps): move the ingest library pin to v0.3.2 — as far as latest goes today 2026-08-05 12:11:12 +02:00
test_ingest_loadbearing.py fix(tests): the re-ingest fixture modelled two manifests, not one edited manifest 2026-08-05 12:30:08 +02:00
test_ingest_manifest.py refactor(ingest): adopt shared llm-ingestion-okf v0.3.1 behind a thin adapter 2026-07-20 07:47:55 +02:00
test_ingest_materialize.py refactor(ingest): adopt shared llm-ingestion-okf v0.3.1 behind a thin adapter 2026-07-20 07:47:55 +02:00
test_ingest_mcp.py chore(deps): move the ingest library pin to v0.3.2 — as far as latest goes today 2026-08-05 12:11:12 +02:00
test_ingest_mcp_loadbearing.py feat(ingest): add the MCP connector as a transport inside the http family (S2.2) 2026-08-02 21:14:57 +02:00
test_ingest_sql.py test(ingest): SQL connector + load-bearing + golden, detach-proven (I4) 2026-07-04 06:56:02 +02:00
test_ingest_sql_loadbearing.py test(ingest): SQL connector + load-bearing + golden, detach-proven (I4) 2026-07-04 06:56:02 +02:00
test_ingest_stamp_fail_closed_loadbearing.py fix(okf): fail-closed ingest-stempel-sjekk paa YAML-1.1-sannhetsformer [skip-docs] 2026-08-21 19:20:51 +02:00
test_ledger.py fix(s54): reject non-array/non-object ledger JSON in SavingsLedger.load 2026-07-24 19:52:52 +02:00
test_ledger_loadbearing.py feat(fase1): hard/soft goal-stop in run_portfolio on accumulated ledger (F1) 2026-07-07 08:11:43 +02:00
test_live_dry_run.py feat(4b): AZURE-profilen leser miljøet sitt, ikke operatørens laptop 2026-08-13 22:27:21 +02:00
test_live_dry_run_loadbearing.py feat(s42): live_dry_run cut in run_project + DryRunReport 2026-07-15 18:05:16 +02:00
test_live_full_run_contract.py feat(1b): skjemaet ER akseptert av det levende endepunktet - malt, ikke resonnert [skip-docs] 2026-08-14 20:02:26 +02:00
test_local_profile_live.py test(fase2): gated live local + Foundry profile checks 2026-06-24 14:02:44 +02:00
test_maf_version_guard.py fix(maf): en vakt som gikk inert i STILLHET, funnet ved aa loefte pinnen (F15, ORDRE 20260829T155150Z) 2026-09-02 19:35:49 +02:00
test_mandate.py docs(mandate): how a domain expert commissions a run — and one honesty fix the run itself exposed 2026-08-05 16:31:27 +02:00
test_mandate_cli.py feat(mcp): concrete MCP servers become tools the agents can call during a run 2026-08-05 16:53:07 +02:00
test_mandate_generation_loadbearing.py feat(step5): the falsification that informed the next hypothesis now leaves the loop 2026-08-06 15:12:06 +02:00
test_mandate_run_loadbearing.py feat(run): every commissioned approach is evaluated, and every one is reported 2026-08-05 16:05:48 +02:00
test_mcp_run_loadbearing.py feat(mcp): concrete MCP servers become tools the agents can call during a run 2026-08-05 16:53:07 +02:00
test_mcp_tools.py feat(mcp): concrete MCP servers become tools the agents can call during a run 2026-08-05 16:53:07 +02:00
test_method_spec_loadbearing.py feat(persona): load the falsification skill from commons at call time 2026-09-02 21:31:32 +02:00
test_money_quantization_loadbearing.py fix(money): quantize NOK to øre in one order, from one source (kø-p) 2026-08-03 20:08:59 +02:00
test_multibase_loadbearing.py docs: multi-base som invariant + den ende-til-ende-sloeyfa som beviser den (ORDRE 20260825T080753Z) 2026-08-25 13:41:31 +02:00
test_navigation_visibility_loadbearing.py feat(visibility): en lenke som ikke ble fulgt sier det - spor + betinget linje (ORDRE 20260821T142704Z) 2026-08-21 17:18:18 +02:00
test_notify.py test(s52): cover build_notifier console/file dispatch + file-without-path fail-fast 2026-07-17 03:16:25 +02:00
test_notify_loadbearing.py fix(s52): resolve ConsoleNotifier default stream at call time 2026-07-17 03:18:00 +02:00
test_okf.py feat(mandate): a domain expert can commission WHICH approaches a run evaluates 2026-08-05 15:43:02 +02:00
test_outbox_loadbearing.py feat(visibility): en uforankret kjoering sier det - felt + linje (ORDRE 20260821T092039Z) 2026-08-21 12:21:48 +02:00
test_p4_honesty_sentences_loadbearing.py feat(simulation): P4 pkt. 3+4 — demo-transkriptet pinnet, frø-setningen avledet [skip-docs] 2026-08-09 22:12:25 +02:00
test_parse_failure_capture_loadbearing.py feat(1b): fang den råe modell-svarteksten ved parse-feil 2026-08-14 11:41:04 +02:00
test_persona_skill_loadbearing.py feat(persona): build the shared expert-reviewer persona as a framework-neutral Agent Skill 2026-06-30 13:59:42 +02:00
test_plan_review_cli_door_loadbearing.py fix(hitl): planen et menneske signerer er TEKST, aldri en objekt-repr (BLOCKER-1, ORDRE 20260902T151931Z) 2026-09-02 17:38:25 +02:00
test_plan_review_progress_line_loadbearing.py fix(explore): a plan review never shows an expert the word None and calls it progress 2026-09-03 01:06:27 +02:00
test_portfolio.py feat(validator): anchor the deterministic gate to the project's real cost baseline (S4.0) 2026-08-03 17:19:31 +02:00
test_portfolio_budget_loadbearing.py feat(validator): anchor the deterministic gate to the project's real cost baseline (S4.0) 2026-08-03 17:19:31 +02:00
test_portfolio_cli_offline_loadbearing.py fix(tests): blade 2 was testing the wrong defect, and said so out loud 2026-08-05 11:06:41 +02:00
test_portfolio_concurrent_loadbearing.py test(portfolio): gate the wave handler's catch width and the failed-project ledger (v/t/s) 2026-08-03 16:09:12 +02:00
test_portfolio_failure_accounting_loadbearing.py feat(validator): anchor the deterministic gate to the project's real cost baseline (S4.0) 2026-08-03 17:19:31 +02:00
test_portfolio_learning_loadbearing.py feat(fase2a): percent-mål mot baseline 0 reiser ValueError (S2.0) 2026-07-15 07:14:29 +02:00
test_portfolio_live.py fix(1b): regelen gjelder HVER betalt arm - fan-out-testen var fortsatt ugatet [skip-docs] 2026-08-14 20:12:47 +02:00
test_preflight.py fix(5): preflight kjenner samme endepunkt-variabler som kjørestien [skip-docs] 2026-08-14 10:48:45 +02:00
test_preflight_loadbearing.py style(s41): ruff format preflight test files 2026-07-15 11:25:26 +02:00
test_provenance.py feat(visibility): en uforankret kjoering sier det - felt + linje (ORDRE 20260821T092039Z) 2026-08-21 12:21:48 +02:00
test_provenance_decoder_loadbearing.py feat(verdicts): promoted verdicts carry a verified field with the actor verbatim 2026-09-02 20:29:32 +02:00
test_public_surface_claims_loadbearing.py fix(docs): rett README-statusen — to usanne paastander paa offentlig flate (ORDRE 20260825T122454Z) 2026-08-25 15:07:08 +02:00
test_read_bundle_cost_loadbearing.py feat(explore): read_bundle costs O(documents), never O(bytes of the base) 2026-09-03 00:36:08 +02:00
test_reference_domain.py test(fase2a): commit Step 2 optional bundle_dir/verdict_dir tests (S2.0, omitted from 9659045) 2026-07-15 07:29:19 +02:00
test_retrieval.py fix(retrieval): fail-closed on uncanonicalisable paths (embedded null byte) 2026-07-21 08:00:11 +02:00
test_run_cli.py fix(run): --embedder-config is refused, not silently dropped 2026-08-05 11:39:49 +02:00
test_run_cli_loadbearing.py test(s31): close 1 review MAJOR — main()-level load-bearing proof of the --semantic-retrieval wiring 2026-07-25 12:44:03 +02:00
test_run_smoke.py feat(fase2): vertical-slice orchestrator + two-layer HITL wiring 2026-06-24 13:54:54 +02:00
test_s40_cost_baseline_loadbearing.py feat(validator): anchor the deterministic gate to the project's real cost baseline (S4.0) 2026-08-03 17:19:31 +02:00
test_scripted_cli_door_loadbearing.py feat(hitl): ekspertdommen kan ikke oppstaa av stillhet (F2, ORDRE 20260825T214801Z) 2026-08-27 01:22:07 +02:00
test_scripted_client_consolidation.py feat(1b): proposeren får en grammatikk — strict structured output [skip-docs] 2026-08-14 14:00:32 +02:00
test_scripted_explore_door_loadbearing.py feat(explore): den offline generalproeven kan AAPNE en base (MAJOR-1 b, ORDRE 20260902T151931Z) 2026-09-02 18:45:53 +02:00
test_semretrieval.py fix(semretrieval): refuse a non-finite embedding instead of scoring it (kø-(l)/S3.1 MINOR) 2026-08-03 21:48:50 +02:00
test_semretrieval_loadbearing.py fix(semretrieval): refuse a non-finite embedding instead of scoring it (kø-(l)/S3.1 MINOR) 2026-08-03 21:48:50 +02:00
test_shared_packaged_data_loadbearing.py feat(4a): wheelen bærer shared/ som pakkede data — arbeidstreet er overstyringen 2026-08-13 21:13:08 +02:00
test_shared_root_loadbearing.py feat(shared-root): S3 — configurable shared-root resolver with load-bearing override test 2026-07-03 01:10:05 +02:00
test_simulation_loadbearing.py feat(sim): offline end-to-end simulation proving the learning loop closes 2026-06-30 12:55:15 +02:00
test_smoke.py feat(3): flaten sier sant om seg selv, og to gater måler at den fortsetter å gjøre det 2026-08-14 06:57:25 +02:00
test_step1_expel_loadbearing.py feat(fase2b): OKF-navigated bundle context replaces chunk-stuffing 2026-06-30 06:42:19 +02:00
test_step5_history_loadbearing.py feat(step5): the falsification that informed the next hypothesis now leaves the loop 2026-08-06 15:12:06 +02:00
test_step5_refine_loadbearing.py feat(step5): the falsification that informed the next hypothesis now leaves the loop 2026-08-06 15:12:06 +02:00
test_step7_async_loop_loadbearing.py feat(fase5): add the long/async verdict file inbox (Steg 7 resumable feedback) 2026-06-30 09:54:23 +02:00
test_step7_demo_inbox_loadbearing.py feat(simulation): the demo now RUNS the Step-7 file inbox it narrates (P1/S1.a) 2026-08-09 13:13:21 +02:00
test_step8_promotion_loadbearing.py feat(verdicts): key each verdict on its own candidate, not the bundle's one IR projection (S3.2) 2026-08-03 16:44:58 +02:00
test_step32_multicandidate_loadbearing.py feat(verdicts): key each verdict on its own candidate, not the bundle's one IR projection (S3.2) 2026-08-03 16:44:58 +02:00
test_structured_output_loadbearing.py feat(1b): proposeren får en grammatikk — strict structured output [skip-docs] 2026-08-14 14:00:32 +02:00
test_tracing_loadbearing.py fix(maf): en vakt som gikk inert i STILLHET, funnet ved aa loefte pinnen (F15, ORDRE 20260829T155150Z) 2026-09-02 19:35:49 +02:00
test_ungiven_verdict_loadbearing.py feat(hitl): ekspertdommen kan ikke oppstaa av stillhet (F2, ORDRE 20260825T214801Z) 2026-08-27 01:22:07 +02:00
test_validator.py feat(validator): enforce the deterministic stage-2 bound and band enclosure (S2.7) 2026-08-03 16:22:54 +02:00
test_value_report.py feat(s54): value_report text + deterministic JSON formatters 2026-07-24 01:29:31 +02:00
test_value_report_loadbearing.py test(s54): value_report overlap-flag load-bearing seam 2026-07-24 01:30:55 +02:00
test_verdicts.py fix(s51): close 2 review MINORs — non-UTF-8 skip + affected_codes parity 2026-07-15 20:59:01 +02:00
test_vertical_slice_e2e.py fix(fase3): stamp real proposer model into provenance, kill fake-model leak (F1) 2026-06-26 15:03:45 +02:00
test_workflow.py feat(fase2): thread tools + budget middleware through fresh_workflow onto agents 2026-06-26 00:36:06 +02:00