import { useState } from "react"; import { Link, useParams } from "react-router"; import { api, ApiError, type ExecutionDetail as ED } from "../api"; import { useFetch, fmtBytes, fmtDate } from "../hooks"; import { Badge, Bool, ErrorBox, JsonTree, KV, Loading, Td } from "../components/ui"; export default function ExecutionDetail() { const { id } = useParams(); const { data, error, loading } = useFetch(`executions/${id}`); const [body, setBody] = useState(null); const [bodyErr, setBodyErr] = useState(null); if (loading) return ; if (error) return ; if (!data) return null; const e = data; const loadBody = async () => { setBodyErr(null); try { const t = await api(`/api/v1/executions/${e.id}/body`, { raw: true }); setBody(t.length > 20000 ? t.slice(0, 20000) + `\n… (${t.length - 20000} more characters)` : t); } catch (ex) { setBodyErr(ex as ApiError); } }; return (

Execution {e.id.slice(0, 8)} {e.provisional && } {e.observed === false && }

Request

{e.url}], ["Project", {e.project_slug}], ["Policy mode", e.policy_mode], ["API", e.api_id ? {e.api_name} : "unregistered"], ["Package", e.package_id ? {e.akp_id} v{e.akp_version} : "—"], ["Operation", e.operation_id ? {e.operation_id} ({e.endpoint_path}) : "—"], ["Purpose", e.purpose || "—"], ["Caller / agent", `${e.caller ?? "—"} / ${e.agent_name ?? "—"}`], ["Credential", e.credential_ref ? {e.credential_ref} v{e.credential_version} : "none"], ["Fingerprint", {e.request_fingerprint}], ["Correlation", {e.correlation_id}]]} />

Sanitized parameters

Outcome

{e.response_hash ?? "—"}], ["Bytes", fmtBytes(e.response_bytes)], ["Media type", e.response_media_type ?? "—"], ["Snapshot", e.artifact ? {e.artifact.sha256.slice(0, 16)} : "none"], ["Error", e.error ? {e.error} : "—"]]} />

Policy decision

{e.policy_decision ? <> mode {e.policy_decision.mode}
    {e.policy_decision.reasons.map((r, i) =>
  • {r}
  • )}
: none}

Response body

{body === null ?
{!e.response_artifact_id && no snapshot retained}
:
{body}
}

Lineage edges

{e.lineage.length ? e.lineage.map((l, i) =>
{l.from_type}:{l.from_id.slice(0, 8)} —{l.relation}→ {l.to_type}:{l.to_id.slice(0, 8)}
) : none}

Egress log

{e.egress.length ? {e.egress.map((g, i) => )}
WhenHostDecisionReason
{fmtDate(g.ts)}{g.host}:{g.port}{g.reason}
: no proxy traffic (direct gateway call)}

Audit trail (hash-chained)

{e.audit.map((a) =>
#{a.seq} {a.action} {fmtDate(a.ts)} · {a.actor_type}:{a.actor_id?.slice(0, 8)}
hash {a.hash.slice(0, 20)}…
)}
); }