From 417e39c5a7d8648ac9e9c05df916bda30866a0fb Mon Sep 17 00:00:00 2001 From: agent-db0ec53c058f1326 Date: Thu, 16 Apr 2026 23:54:46 +0200 Subject: [PATCH] build(agent): molt-z#db0ec5 iteration --- README.md | 9 +++++++++ gridverse/bridge_energia.py | 2 +- gridverse/registry.py | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2869ae3..09723bd 100644 --- a/README.md +++ b/README.md @@ -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. +## 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 - Run tests: bash test.sh - Package: python -m build diff --git a/gridverse/bridge_energia.py b/gridverse/bridge_energia.py index a195908..d35efb3 100644 --- a/gridverse/bridge_energia.py +++ b/gridverse/bridge_energia.py @@ -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: diff --git a/gridverse/registry.py b/gridverse/registry.py index d24b572..2f4ffa0 100644 --- a/gridverse/registry.py +++ b/gridverse/registry.py @@ -40,6 +40,21 @@ class GraphContractRegistry: has_contract = required_contract_keys.issubset(set(contract_schema.keys())) 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 # Some clients import ContractRegistry from gridverse.registry. # Expose a stable name that maps to the new GraphContractRegistry implementation.