Generic, open framework on Microsoft Agent Framework (MAF): multi-agent cost-saving proposals gated by a mandatory deterministic validator, with HITL learning.
Find a file
Kjell Tore Guttormsen d6d83d42b5 feat(fase2): wire Step-1 ExpeL retrieval into the hypothesis prompt
Closes maalbilde §5 gap #1 (the one missing "feedback-into-prompt" dataflow)
for the OKF-bundle path. Before, ExpeL was computed AFTER generation into a
discarded SessionContext, so a prior verdict could not influence any hypothesis
(context_providers=0).

- New okf.py: framework-neutral OKF bundle navigation (index + frontmatter +
  cross-links), pure stdlib, no agent_framework/mcp (D7-portable), enforced by
  test_okf_is_maf_free.
- verdicts.py: seed_store_from_bundle + bundle_candidate_features build the
  ExpeL substrate + the pre-hypothesis query key from a bundle.
- run_project(bundle_dir=...): folds the candidate's prior verdicts into the
  generation context BEFORE generate_via_llm; the road path is unchanged.

Load-bearing (maalbilde §7): test_step1_expel_loadbearing proves a prior verdict
reaches the hypothesis prompt and goes RED when the fold is detached (shown via
TDD red->green). The marker is the minted verdict id (content hash) because
docs_dir==bundle_dir lets keyword chunk-stuffing leak the realization rate;
clean layer separation is Fase 2b.

Suite 121->133 passed; mypy + ruff check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHR8iKxJRxDiDfNw8HZmWE
2026-06-29 10:56:48 +02:00
.claude/projects docs(fase3): remediation plan for the 2 /trekreview MAJOR findings (F1+F2) 2026-06-26 15:07:48 +02:00
docs docs(maalbilde): konsolidert agentisk-loop baseline + OKF-kontekstarkitektur 2026-06-26 20:56:14 +02:00
shared docs(shared): bygg-energi mikro-eksempel — OKF-bundle + golden + load-bearing test 2026-06-29 09:42:13 +02:00
spikes fix(fase1): spike B fan-out measures real conversation bleed, not a counter 2026-06-24 11:09:55 +02:00
src/portfolio_optimiser feat(fase2): wire Step-1 ExpeL retrieval into the hypothesis prompt 2026-06-29 10:56:48 +02:00
tests feat(fase2): wire Step-1 ExpeL retrieval into the hypothesis prompt 2026-06-29 10:56:48 +02:00
.gitignore docs(fase2): /trekbrief — gated MVP vertical-slice brief (6/6) [skip-docs] 2026-06-24 11:56:57 +02:00
.python-version feat: initial scaffold (Python framework on Microsoft Agent Framework) 2026-06-23 22:01:22 +02:00
CHANGELOG.md feat: initial scaffold (Python framework on Microsoft Agent Framework) 2026-06-23 22:01:22 +02:00
CLAUDE.md feat(fase2): wire Step-1 ExpeL retrieval into the hypothesis prompt 2026-06-29 10:56:48 +02:00
env.template docs(fase2): add env.template documenting both profiles + no-egress notes 2026-06-26 00:43:26 +02:00
pyproject.toml docs(fase2): record PEP 735 dependency-groups as intentional Step 1 deviation 2026-06-26 00:43:46 +02:00
README.md feat(fase2): wire Step-1 ExpeL retrieval into the hypothesis prompt 2026-06-29 10:56:48 +02:00
uv.lock build(fase2): promote orchestrations + pulp to core deps 2026-06-24 13:22:04 +02:00

portfolio-optimiser

Generic, open framework on Microsoft Agent Framework (MAF) for finding cost-savings / efficiency proposals within each project of a portfolio of independent projects. Multiple agents collaborate to generate candidate proposals; a mandatory deterministic validator (solver + Monte Carlo) decides the numbers; domain experts review via human-in-the-loop, and the system learns from their verdicts.

Status: Early development. The deterministic backbone is solid; the agentic learning loop is being wired one load-bearing seam at a time — Step 1 (OKF context → hypothesis) is wired (see below). Not yet end-to-end usable.

Disclaimer — technical framework only. This project is a technical framework. Organizations that deploy it are themselves responsible for ensuring a valid processing purpose and for any required assessments (DPIA, risk/ROS, security reviews, etc.). The framework ships technical affordances (local-only mode, provenance/audit logging, no silent data egress) to enable compliant use, but makes no compliance guarantees.

Design philosophy

The result will never fit any single customer 100%. The goal is a ~90% genuinely generic core plus clear extension points, so competent people can configure the last mile per customer. We deliberately do not chase the final 10%.

Agentic loop — wiring status

The mandatory deterministic backbone (validator + budget meter + provenance) is solid and load-bearing. The agentic learning loop (see the target picture §11) is wired one seam at a time:

  • Step 1 — OKF context → hypothesis (wired). run_project(..., bundle_dir=...) navigates a project's OKF bundle and folds the candidate's prior expert verdicts (ExpeL retrieval) into the hypothesis prompt before generation — so a prior verdict provably influences the next hypothesis. Guarded by a load-bearing test that fails when the seam is detached (tests/test_step1_expel_loadbearing.py).
  • Steps 38 (checker gating, informed refinement, async file feedback, gated wiki promotion) — not yet wired.

Docs

Stack

Python ≥3.10 · MAF (agent-framework) · uv. Backend profiles: Azure/Foundry (full) + local (fallback).

Develop

uv sync
uv run pytest
uv run ruff check .