Claude Agent SDK sibling implementation of the portfolio-optimiser method: an open Python framework that finds cost savings inside each project in a portfolio.
Find a file
Kjell Tore Guttormsen 22bfc80dda feat(learning): S9 — D7 læringssløyfe: verdict-inbox, fail-closed promoteringsgate, artefakt-sourced persona
- inbox.py (§4.2+§5): VerdictDocument med verbatim-id-regel; write_verdict
  authoring-primitiv (deterministisk JSON); load_inbox tolerant (skip, aldri
  raise; sortert på filnavn); merge_inbox_into_store first-write-wins,
  idempotent, skriver aldri (rolle-splitt §3 steg 7)
- promotion.py (§6): promote fail-closed mot {approved,
  approved_with_adjustment}; eksplisitt påkrevd timestamp; minimal frontmatter
  (rationale → description, aldri strukturerte læringsfelt); path-safe token
  med content-hash-fallback; idempotent index-lenking med fast nøytral label
- persona.py (§4.3): load_persona_example fail-fast (run-path-vokabular,
  marker ⊆ rationale); drop_persona_verdict artefakt-sourced ved kalltid mot
  delt shared/-artefakt
- experience.py (kirurgisk): seeding leser verdict_id VERBATIM fra frontmatter
  — re-minting ville kollidert distinkte promoterte kandidater
- 43 nye load-bearing tester (step7/step8/persona), 164/164 uten API-nøkkel;
  to-runs-bevis med fersk store + tom-inbox-kontroll; fire detach-bevis kjørt
  røde og revertert grønne

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QdSfQdND84oeq2mbjueLTS
2026-07-03 07:36:15 +02:00
shared Merge commit '97a9172311' as 'shared' 2026-07-03 06:00:11 +02:00
src/portfolio_optimiser_claude feat(learning): S9 — D7 læringssløyfe: verdict-inbox, fail-closed promoteringsgate, artefakt-sourced persona 2026-07-03 07:36:15 +02:00
tests feat(learning): S9 — D7 læringssløyfe: verdict-inbox, fail-closed promoteringsgate, artefakt-sourced persona 2026-07-03 07:36:15 +02:00
.gitignore feat: initial commit — repo bootstrap (D7 sibling on Claude Agent SDK) 2026-07-03 06:00:09 +02:00
CHANGELOG.md feat: initial commit — repo bootstrap (D7 sibling on Claude Agent SDK) 2026-07-03 06:00:09 +02:00
CLAUDE.md feat(scaffold): S5 — D7 sibling scaffold: SDK dep, fail-fast startup contracts, CLAUDE.md 2026-07-03 06:06:03 +02:00
pyproject.toml feat(scaffold): S5 — D7 sibling scaffold: SDK dep, fail-fast startup contracts, CLAUDE.md 2026-07-03 06:06:03 +02:00
README.md feat: initial commit — repo bootstrap (D7 sibling on Claude Agent SDK) 2026-07-03 06:00:09 +02:00
uv.lock feat(scaffold): S5 — D7 sibling scaffold: SDK dep, fail-fast startup contracts, CLAUDE.md 2026-07-03 06:06:03 +02:00

portfolio-optimiser-claude

Sibling implementation of the portfolio-optimiser method on the Claude Agent SDK (decision D7). An open, generic Python framework that finds cost savings inside each project in a portfolio of independent projects: agents generate candidate measures, a mandatory deterministic validator gates the numbers, domain experts judge via HITL, and the system learns from the verdicts.

The method itself is framework-neutral and lives in portfolio-optimiser-commons (consumed here as a git subtree under shared/): the method spec, the OKF bundle navigation contract, the golden/conformance suite (the only oracle for the validator), and the shared expert-reviewer persona skill. This repo implements that spec on the Claude Agent SDK — it does not reverse-engineer the MAF sibling.

Disclaimer: this is a purely technical framework. The deployer owns DPIA, risk assessment, and the legal basis for any processing. The framework ships only the technical preconditions (local-only operation, provenance, no silent egress).

Status

Scaffold (S5): repo, contracts, and shared core in place — no agent runs yet.

Development

uv sync          # install dependencies
uv run pytest    # test suite (runs without any API key)
uv run ruff check . && uv run ruff format --check .
uv run mypy src