fix(platform): expose run correlation in list
This commit is contained in:
@@ -101,6 +101,25 @@ def canonical_work_item_id(project_id: str, run_id: UUID) -> str:
|
||||
return f"platform-run:{project}:{run_id}"
|
||||
|
||||
|
||||
def correlation_readback_for_run(
|
||||
project_id: str,
|
||||
run_id: UUID,
|
||||
trace_id: str | None,
|
||||
) -> dict[str, str | None]:
|
||||
"""Project stored trace truth plus its canonical run-bound work item."""
|
||||
|
||||
stored_trace_id = None if trace_id is None else str(trace_id)
|
||||
return {
|
||||
"trace_id": stored_trace_id,
|
||||
"work_item_id": canonical_work_item_id(project_id, run_id),
|
||||
"correlation_status": (
|
||||
"canonical"
|
||||
if is_canonical_traceparent(stored_trace_id or "", run_id=run_id)
|
||||
else "legacy_or_invalid_trace"
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def correlation_for_run(project_id: str, run_id: UUID) -> RuntimeCorrelation:
|
||||
"""Build the canonical public-safe correlation projection for a run."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user