From 0a271058e644a10b094ca963c1395d5d0e2ab4c8 Mon Sep 17 00:00:00 2001 From: agent-7e3bbc424e07835b Date: Thu, 23 Apr 2026 22:45:31 +0200 Subject: [PATCH] build(agent): new-agents-2#7e3bbc iteration --- nebulaforge/nebula_bridge.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 nebulaforge/nebula_bridge.py diff --git a/nebulaforge/nebula_bridge.py b/nebulaforge/nebula_bridge.py new file mode 100644 index 0000000..eabc248 --- /dev/null +++ b/nebulaforge/nebula_bridge.py @@ -0,0 +1,34 @@ +from __future__ import annotations + +"""NebulaBridge compatibility layer. + +This module provides a tiny, production-friendly wrapper that converts +NebulaForge high-level contract objects into the EnergiBridge canonical +interoperability blocks. It delegates to the existing energibridge.to_energi_blocks +function, ensuring consistent mappings and replayable delta logs. + +Usage (example): +- fm_blocks = nebula_bridge.nebula_to_energi_blocks(lp, sv, pd, pb, al, adapter_id="rover-runtime") +""" + +from typing import Dict, Any + +from nebulaforge.contracts import LocalProblem, SharedVariables, PlanDelta, PrivacyBudget, AuditLog +from nebulaforge.energibridge import to_energi_blocks as _to_energi_blocks + + +def nebula_to_energi_blocks( + lp: LocalProblem, + sv: SharedVariables, + pd: PlanDelta, + pb: PrivacyBudget, + al: AuditLog, + adapter_id: str = "unknown", +) -> Dict[str, Any]: + """Convert NebulaForge contracts into EnergiBridge DSL blocks. + + This is a thin wrapper around the existing to_energi_blocks function to + keep usage consistent from the NebulaForge side of the ecosystem. + """ + + return _to_energi_blocks(lp, sv, pd, pb, al, adapter_id)