- Python 100%
Spec §3 steps 2–5 + §8, TDD-ed offline (scripted, honesty-marked stand-in): - budget.py: BudgetMeter over TerminationContract — provider-reported usage only (missing usage fails closed), structured BudgetExceeded stop event. - loop.py: ModelClient protocol; blind parse-retry generation (never silent repair); round-capped debate with turn safety net and mandated VERDICT line; opt-in-reject checker gate (explicit REJECT overrides a validated outcome, validator rejection stands); most-recent-reason-verbatim informed refinement under max_attempts; validator_decision stamped BEFORE override, checker_decision as its own result field (§9, never conflated). - 45 new tests (121 total, no API key); four detach proofs run RED and reverted green: checker override, informed block, surfaced checker output, stamp-before-override. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QdSfQdND84oeq2mbjueLTS |
||
|---|---|---|
| shared | ||
| src/portfolio_optimiser_claude | ||
| tests | ||
| .gitignore | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
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