build(agent): molt-z#db0ec5 iteration

This commit is contained in:
agent-db0ec53c058f1326 2026-04-16 23:54:46 +02:00
parent dda27c74ee
commit 417e39c5a7
3 changed files with 25 additions and 1 deletions

View File

@ -8,6 +8,15 @@ A minimal, testable MVP scaffold for a cross-domain energy optimization platform
This repository is intended as a stepping stone toward a CatOpt-style interoperability bridge and a broader MVP as described in the project brief. This repository is intended as a stepping stone toward a CatOpt-style interoperability bridge and a broader MVP as described in the project brief.
## EnergiBridge MVP
- Canonical interoperability bridge that maps GridVerse primitives (Objects, Morphisms, PlanDelta) to a vendor-agnostic canonical representation consumed by adapters and external runtimes.
- Core primitives exposed: LocalProblems (Objects), SharedVariables/DualVariables (Morphisms), PlanDelta, plus Governance and Audit metadata blocks.
- Lightweight graph-contract registry and conformance tests to ensure adapters stay interoperable.
- Starter adapters included (DER controller, building load controller) and a toy ADMM-lite solver scaffold to validate end-to-end delta-sync and mesh planning semantics.
- DSL sketch and codegen scaffolds to bootstrap cross-domain pilots with minimal integration effort.
- Phase plan mirrors the project brief: quick win core primitives, governance scaffolding, marketplace entry points, and hardware-in-the-loop validation.
Usage Usage
- Run tests: bash test.sh - Run tests: bash test.sh
- Package: python -m build - Package: python -m build

View File

@ -87,7 +87,7 @@ def from_canonical(bundle: CanonicalBundle) -> Dict[str, Any]:
} }
__all__ = ["CanonicalBundle", "to_canonical", "from_canonical"] __all__ = ["CanonicalBundle", "to_canonical", "from_canonical", "bootstrap_contracts"]
def bootstrap_contracts(registry: "GraphContractRegistry") -> None: def bootstrap_contracts(registry: "GraphContractRegistry") -> None:

View File

@ -40,6 +40,21 @@ class GraphContractRegistry:
has_contract = required_contract_keys.issubset(set(contract_schema.keys())) has_contract = required_contract_keys.issubset(set(contract_schema.keys()))
return bool(has_adapter and has_contract) return bool(has_adapter and has_contract)
# --- Convenience helpers for introspection and tooling ---
def list_contracts(self) -> Dict[str, list]:
"""Return a map of contract names to available versions.
Example: { "LocalProblem": ["0.1", "0.2"], ... }
"""
return {name: list(versions.keys()) for name, versions in self._contracts.items()}
def list_adapters(self) -> Dict[str, list]:
"""Return a map of adapter names to available versions.
Example: { "DERController": ["0.1"], ... }
"""
return {name: list(versions.keys()) for name, versions in self._adapters.items()}
# Backwards-compatibility alias for older code/tests # Backwards-compatibility alias for older code/tests
# Some clients import ContractRegistry from gridverse.registry. # Some clients import ContractRegistry from gridverse.registry.
# Expose a stable name that maps to the new GraphContractRegistry implementation. # Expose a stable name that maps to the new GraphContractRegistry implementation.