docs(readme): the okf server as a lookup during a run, with a validated example config

README section with a before/after command and the limits stated plainly (link not yet tried in a
real run, agent adherence not measured, --prepass-payload rejects okf-consumption/2). Adds
examples/okf-server.mcp.json, pinned by a test that loads it through load_mcp_config; the
published-surface pin moves 516 -> 518 for the two new files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-21 12:57:48 +02:00
commit fe429912c6
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
4 changed files with 83 additions and 1 deletions

View file

@ -601,7 +601,7 @@ _WRITERS_DEFINED = 10
_WRITERS_IN_RUN_PATH = 7
#: publiserte filer i git-manifestet (uttrekk og arbeidstre gir SAMME tall — det var hele poenget
#: med å slutte å telle filtreet: 435 i arbeidstreet var to gitignorerte .local.md-filer).
_PUBLISHED_TODAY = 516
_PUBLISHED_TODAY = 518
_UNDECODABLE_TODAY = 1

View file

@ -0,0 +1,24 @@
"""The committed example that wires the ``okf`` MCP server into a run must load through the same
fail-fast loader a real run uses -- a config in the README that ``load_mcp_config`` refuses is a
broken instruction, not documentation."""
from __future__ import annotations
from pathlib import Path
from portfolio_optimiser.mcp_tools import load_mcp_config
EXAMPLE = Path(__file__).resolve().parent.parent / "examples" / "okf-server.mcp.json"
def test_okf_server_example_loads_through_the_run_loader() -> None:
(server,) = load_mcp_config(EXAMPLE)
assert server.name == "okf"
assert server.transport == "stdio"
assert set(server.allowed_tools) == {"okf_list", "okf_describe", "okf_ask", "okf_fetch"}
assert server.timeout_seconds > 0
def test_okf_server_example_carries_a_neutral_placeholder_path() -> None:
text = EXAMPLE.read_text(encoding="utf-8")
assert "/Users/" not in text and "/home/" not in text