New load_dimension(str | Path) in dimension.py: is_file() -> FileNotFoundError, then Dimension.model_validate_json -> pydantic.ValidationError on malformed shape. Fail-fast because dimension config is authoritative startup input (contrast the tolerant verdict-inbox RAW layer). Stdlib + pydantic only — stays MAF-free (test_okf_is_maf_free AST guard green). Exported from __init__.py in both the import block and __all__. RED-first: 3 loader tests failed on the missing import, green after. tests/test_dimension.py + test_okf.py: 29 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNNiJRk1sSwxgVLS5AobT1
59 lines
1.3 KiB
Python
59 lines
1.3 KiB
Python
"""portfolio-optimiser — generic MAF framework for per-project cost-savings optimization."""
|
|
|
|
from portfolio_optimiser.contracts import GoalConfig, GoalContract, load_goal_config
|
|
from portfolio_optimiser.dimension import Dimension, admits, load_dimension
|
|
from portfolio_optimiser.ledger import (
|
|
LedgerEntry,
|
|
RealizationRefused,
|
|
SavingsLedger,
|
|
realize,
|
|
)
|
|
from portfolio_optimiser.notify import (
|
|
ConsoleNotifier,
|
|
FileNotifier,
|
|
Notifier,
|
|
NotifierConfig,
|
|
NotifyError,
|
|
NotifyRefused,
|
|
WebhookNotifier,
|
|
build_notifier,
|
|
)
|
|
from portfolio_optimiser.run import (
|
|
GoalReached,
|
|
PortfolioResult,
|
|
RunResult,
|
|
run_portfolio,
|
|
run_project,
|
|
)
|
|
|
|
__version__ = "0.1.0"
|
|
|
|
__all__ = [
|
|
# Portfolio orchestration
|
|
"PortfolioResult",
|
|
"RunResult",
|
|
"run_portfolio",
|
|
"run_project",
|
|
# Fase 1 domain model
|
|
"Dimension",
|
|
"admits",
|
|
"load_dimension",
|
|
"SavingsLedger",
|
|
"LedgerEntry",
|
|
"realize",
|
|
"RealizationRefused",
|
|
"GoalContract",
|
|
"GoalConfig",
|
|
"load_goal_config",
|
|
"GoalReached",
|
|
# S5.2 varsling (B11): the declared Notifier contract + deliverable implementations
|
|
"Notifier",
|
|
"ConsoleNotifier",
|
|
"FileNotifier",
|
|
"WebhookNotifier",
|
|
"build_notifier",
|
|
"NotifierConfig",
|
|
"NotifyError",
|
|
"NotifyRefused",
|
|
"__version__",
|
|
]
|