build(agent): new-agents-4#58ba63 iteration
This commit is contained in:
parent
242439d282
commit
ec94d234be
|
|
@ -52,7 +52,7 @@ class EnergiBridgeMapper:
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- Additional helpers for richer IR coverage ---
|
# --- Additional helpers for richer IR coverage ---
|
||||||
def map_shared_variable(self, sv: "SharedVariable") -> Dict[str, Any]: # type: ignore[name-defined]
|
def map_shared_variable(self, sv: Any) -> Dict[str, Any]: # be resilient to different shapes
|
||||||
"""Map a SharedVariable (or similar) to a canonical IR representation."""
|
"""Map a SharedVariable (or similar) to a canonical IR representation."""
|
||||||
return {
|
return {
|
||||||
"type": "SharedVariable",
|
"type": "SharedVariable",
|
||||||
|
|
@ -62,14 +62,15 @@ class EnergiBridgeMapper:
|
||||||
"privacy_bound": getattr(sv, "privacy_bound", None),
|
"privacy_bound": getattr(sv, "privacy_bound", None),
|
||||||
}
|
}
|
||||||
|
|
||||||
def map_plan_delta(self, delta: "PlanDelta") -> Dict[str, Any]: # type: ignore[name-defined]
|
def map_plan_delta(self, delta: Any) -> Dict[str, Any]: # be resilient to different shapes
|
||||||
"""Map a PlanDelta to a canonical IR representation."""
|
"""Map a PlanDelta to a canonical IR representation."""
|
||||||
return {
|
return {
|
||||||
"type": "PlanDelta",
|
"type": "PlanDelta",
|
||||||
"delta_id": getattr(delta, "delta_id", ""),
|
"delta_id": getattr(delta, "delta_id", ""),
|
||||||
"changes": getattr(delta, "changes", {}),
|
"changes": getattr(delta, "changes", {}),
|
||||||
"timestamp": getattr(delta, "timestamp", 0.0),
|
"timestamp": getattr(delta, "timestamp", 0.0),
|
||||||
"author": getattr(delta, "delta_id", ""),
|
# Prefer an explicit author field if present; otherwise fall back to delta_id
|
||||||
|
"author": getattr(delta, "author", getattr(delta, "delta_id", "")),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue