Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(explorer): coerce decision timestamp to str in response

修宴778ff5116252
diff --git a/semantica/explorer/routes/decisions.py b/semantica/explorer/routes/decisions.py
index e9df4493..b942b9e5 100644
--- a/semantica/explorer/routes/decisions.py
+++ b/semantica/explorer/routes/decisions.py
@@ -16,6 +16,7 @@ router = APIRouter(prefix="/api/decisions", tags=["Decisions"])
def _node_to_decision(node: dict) -> DecisionResponse:
properties = node.get("properties", {})
+ ts = properties.get("timestamp")
return DecisionResponse(
decision_id=node.get("id", ""),
category=properties.get("category", ""),
@@ -23,7 +24,7 @@ def _node_to_decision(node: dict) -> DecisionResponse:
reasoning=properties.get("reasoning", ""),
outcome=properties.get("outcome", ""),
confidence=float(properties.get("confidence", 0.0) or 0.0),
- timestamp=properties.get("timestamp"),
+ timestamp=ts if isinstance(ts, str) or ts is None else str(ts),
metadata=properties,
)