portfolio-optimiser/src/portfolio_optimiser
Kjell Tore Guttormsen 38df79126f
feat(toolbox): the first four doors out of the toolbox, without a chat client on the way
B-gate row 1's premise, made callable. Every path through the framework CLI constructs a chat
client, so an outside caller -- a human at a terminal, or an agent that is NOT po -- could not
reach a single run-path step without paying for a model. These four steps need no model at all.

One CLI, four subcommands, one core call each:

  navigate-bundle  --bundle-dir                         -> okf.navigate_bundle
  cost-baseline    --bundle-dir --project-id            -> okf.derive_cost_baseline
  retrieve-chunks  --query --docs-dir [--top-k]         -> datasource.retrieve_chunks
  prepass-admit    --payload --bundle-dir [--dimension] -> prepass.admit_payload

Each handler is a thin adapter: strings in, the SAME function the run path calls, JSON on stdout,
and an exit code that says what happened (0 ran, 2 malformed call, 3 the step refused, named).
A handler that computed anything of its own would be a second implementation of a run-path step,
and the outside caller would stop getting what the debate gets.

Dispatch is an explicit branch per command, not argparse's `set_defaults(handler=...)`: the table
hides the one thing a reader wants to see, and B-gate row 1 asks the same question of the source
(it walks the call graph from `main` down to the step's symbol), where a callable in a Namespace
is a hop neither can follow.

Probes (`tests/test_toolbox_doors.py`, 10 arms): each starts the door as a SUBPROCESS with the
subcommand in argv and asserts on what it wrote -- never by importing the core function, which is
the whole difference the gate exists to measure. The yardstick is outside the door in every arm:
the filesystem (navigate-bundle, including the one deliberate outside-bundle link), a table
transcribed from the priced fixture (cost-baseline), the in-process seam it must equal byte for
byte (retrieve-chunks), and the producer's own checked-in payload (prepass-admit). Every refusal
arm has an rc-0 control beside it.

`portfolio-optimiser-toolbox` is the THIRD console script, and the pin test now says why: it is
the door the other two cannot be used for. README and CLAUDE.md updated with the command and the
reason it exists; every documented invocation was run.

Row 1: 1 -> 5 of 17 (four subcommands + `gate`, which the class fix in e47be68 stopped rejecting
on a name technicality). No other row moved; exit 1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 08:11:58 +02:00
..
data feat(validator): anchor the deterministic gate to the project's real cost baseline (S4.0) 2026-08-03 17:19:31 +02:00
evals feat(toolbox): the first four doors out of the toolbox, without a chat client on the way 2026-09-20 08:11:58 +02:00
__init__.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
backends.py feat(4b): AZURE-profilen leser miljøet sitt, ikke operatørens laptop 2026-08-13 22:27:21 +02:00
budget.py feat(budget): enforce a global portfolio token cap before the call, not after it (S3.4/F10) 2026-07-31 21:34:48 +02:00
contracts.py feat(hitl): ekspertdommen kan ikke oppstaa av stillhet (F2, ORDRE 20260825T214801Z) 2026-08-27 01:22:07 +02:00
costsim.py docs(s54): --report CLI surface + truthful costsim kost_mot_verdi seam note 2026-07-24 01:38:10 +02:00
datasource.py feat(prepass): the debate is handed the declared cut and the navigator tools are withdrawn [skip-docs] 2026-09-07 11:10:54 +02:00
dimension.py feat(s53): load_dimension fail-fast loader (MAF-free, mirrors load_goal_config) 2026-07-23 21:31:32 +02:00
explore.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
frozen_bundles.json test(frozen-pin): an added or removed file, and listing order, pinned by tests; drift named apart from missing 2026-09-18 18:49:54 +02:00
frozen_bundles.py feat(frozen-bundles): the measurements read a pinned copy, not another repo's build dir 2026-09-18 03:22:22 +02:00
generate.py feat(p20): the requirement that is RIGHT, and a clause number that is not a price 2026-09-15 06:02:46 +02:00
hitl.py feat(explore): plan-reviewen kan besvares over DAGER (U12 + asynkron U13, rad 3) 2026-08-26 12:26:04 +02:00
hosting.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
ingest.py feat(ingest): P2/S1.b — innholdsgaten står, rundt materialize og ikke i den 2026-08-09 22:58:00 +02:00
ingest_mcp.py fix(okf): close the inert ingest-stamp guard, then land okf 0.8.5 -- and read the block sources form all four bases actually write 2026-09-12 23:02:38 +02:00
ir.py feat(okf): derive a cost baseline from a priced schedule, or refuse 2026-09-03 03:15:39 +02:00
ledger.py fix(money): quantize NOK to øre in one order, from one source (kø-p) 2026-08-03 20:08:59 +02:00
mandate.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
mcp_tools.py feat(provenance): a run records which external service it actually called 2026-08-05 21:37:29 +02:00
notify.py fix(s52): resolve ConsoleNotifier default stream at call time 2026-07-17 03:18:00 +02:00
okf.py feat(p22): a refusal names the DOCUMENTS when the ancestor has no subdirectories 2026-09-16 01:17:39 +02:00
outbox.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
persona.py feat(persona): load the falsification skill from commons at call time 2026-09-02 21:31:32 +02:00
preflight.py fix(5): preflight kjenner samme endepunkt-variabler som kjørestien [skip-docs] 2026-08-14 10:48:45 +02:00
prepass.py feat(prepass): name the delivered excerpt nobody named, never refuse it [skip-docs] 2026-09-10 08:03:38 +02:00
proposal_review.py feat(major2): terminal proposal reviewer - text never repr, closed vocabulary, EOF is never a sign-off [skip-docs] 2026-09-05 06:59:54 +02:00
provenance.py feat(p19): a cost code must have a FORM where the input offers forms 2026-09-15 02:11:29 +02:00
reference_domain.py feat(hitl): ekspertdommen kan ikke oppstaa av stillhet (F2, ORDRE 20260825T214801Z) 2026-08-27 01:22:07 +02:00
retrieval.py fix(retrieval): fail-closed on uncanonicalisable paths (embedded null byte) 2026-07-21 08:00:11 +02:00
run.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
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
shared_root.py feat(4a): wheelen bærer shared/ som pakkede data — arbeidstreet er overstyringen 2026-08-13 21:13:08 +02:00
simulation.py feat(p19): a direction must NAME the requirement that binds it, and have READ it 2026-09-15 01:21:47 +02:00
stress.py feat(frozen-bundles): the measurements read a pinned copy, not another repo's build dir 2026-09-18 03:22:22 +02:00
toolbox.py feat(toolbox): the first four doors out of the toolbox, without a chat client on the way 2026-09-20 08:11:58 +02:00
tools.py feat(okf): adjudication_for names the unknown state and a tool carries it 2026-09-02 20:36:54 +02:00
tracing.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
validator.py feat(row6): a proposal whose approach declared no requirement is unsupported 2026-09-17 16:40:54 +02:00
value_report.py feat(s54): value_report text + deterministic JSON formatters 2026-07-24 01:29:31 +02:00
verdicts.py fix(v1-gate): row 2 binds a round to the run's own artefact family, and says out loud what it still cannot prove 2026-09-18 15:32:14 +02:00
workflow.py feat(fase3): make the maker-checker checker actually gate the reasoning 2026-06-30 07:24:30 +02:00