system-prompts-and-models-o.../dealix/auto_client_acquisition/agent_observability/trace_events.py
Sami Assiri b13cb389cc feat(dealix): sync full Dealix package to repo
- API routers, ACA modules, integrations (draft operators)
- Docs, landing pages, scripts (launch readiness, scorecard)
- Tests and CI workflow updates for Dealix

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-01 21:01:17 +03:00

36 lines
958 B
Python

"""Structured trace event for dashboards (PII-redacted strings)."""
from __future__ import annotations
import time
import uuid
from typing import Any
from auto_client_acquisition.security_curator.trace_redactor import redact_trace_payload
def build_trace_event(
*,
workflow_name: str,
agent_name: str,
action_type: str,
policy_result: str,
tool_called: str | None = None,
outcome: str | None = None,
metadata: dict[str, Any] | None = None,
) -> dict[str, Any]:
meta = metadata or {}
safe_meta = redact_trace_payload(meta)
return {
"trace_id": str(uuid.uuid4()),
"ts": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"workflow_name": workflow_name,
"agent_name": agent_name,
"action_type": action_type,
"policy_result": policy_result,
"tool_called": tool_called,
"outcome": outcome,
"metadata": safe_meta,
"demo": True,
}