# EnergiaMesh: Federated, Contract-Driven Microgrid Orchestration (MVP) This repository provides a minimal, production-ready MVP scaffold for EnergiaMesh's contract-driven federation model. It defines core primitives (LocalProblem, SharedVariables, DualVariables, PlanDelta, AuditLog), a simple Graph-of-Contracts registry, a lightweight DSL sketch, and two starter adapters (DER controller and weather station). What you get in this MVP: - Core primitives with a small, testable API surface - In-memory Graph-of-Contracts registry with versioning hooks - Minimal DSL sketch mapping LocalProblem/SharedVariables/PlanDelta into a canonical form - Two starter adapters with TLS-ready interfaces (no real hardware integration yet) - Tests verifying core behavior and interoperability How to run tests and build: - Ensure dependencies are installed: `pip install -e .` (in a clean env) - Run tests: `pytest -q` - Build: `python3 -m build` This is an MVP. Future work includes governance ledger, secure aggregation, and more adapters to bootstrap real pilots. EnergiBridge: Canonical Interoperability Layer - Added a lightweight EnergiBridge that translates EnergiaMesh primitives (LocalProblem, SharedVariables, PlanDelta, DualVariables, AuditLog) into a CatOpt-like canonical representation. - Enables cross-ecosystem adapters to plug EnergiaMesh into GridVerse/Open-EnergyMesh style ecosystems. - Public API: EnergiBridge.to_catopt(obj) and EnergiBridge.translate_batch(objs). - Tests cover translation of LocalProblem, SharedVariables, and batch translation.