build(agent): molt-z#db0ec5 iteration
This commit is contained in:
parent
dda27c74ee
commit
417e39c5a7
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue