/trajectory-analysis to inspect runs. The workspace keeps partial evidence visible, but marks it incomplete or malformed until the contract is satisfied. It never creates placeholder model calls, costs, tool evidence, parents, or participants.
What the contract records
The version 2 contract normalizes these event classes:
Participants have stable keys, display names, roles, optional framework identifiers, and metadata. Events have stable keys, source timestamps, optional source sequence numbers, explicit parent keys, and typed evidence references.
Ingest a trajectory
Send batches toPOST /api/trajectory-analysis with runs:write. One batch accepts up to 5,000 events and 10 MiB. Reuse the trajectory key across late batches; use a new idempotency key for each distinct batch.
Idempotency and conflicts
- Replaying the same idempotency key and identical body returns the existing trajectory.
- Reusing an idempotency key with different content returns
409 CONFLICT. - Reusing an event key with different content returns
409 CONFLICT. - A trajectory key cannot switch its source run or hosted/remote variant.
- Evidence IDs from another organization return
403 CROSS_ORG_REFERENCE.
Understand completion states
complete means the run is finalized and every event class, participant, parent, target participant, tool evidence item, Model Gateway call, and cost record is present.
incomplete is a valid persisted state. The response lists exact missing parts such as:
malformed indicates a structural contradiction such as a duplicate participant identity or self-parent event. Malformed runs remain inspectable for diagnosis but cannot be scored or reported.
Inspect the explorer
The Timeline tab separates named agent lanes from the event stream. Events are ordered by source timestamp, then source sequence, then stable event key. Each row exposes its parent and participant so concurrency, handoffs, loops, and premature termination remain visible. The Evidence tab counts exact Model Gateway, cost, and tool-evidence references. A complete run shows zero orphaned parent or participant relationships. Incomplete runs list each unresolved contract part next to the affected workflow. The Quality tab displays versioned trajectory scorer results and evidence reports. The Compare tab compares a selected baseline against another hosted or remote variant without merging their provenance.Use the SDK clients
list, get, score, createReport / create_report, and compare. Structured API failures preserve the HTTP status and EvalGate error code so callers can distinguish incomplete evidence from identity conflicts or authorization failures.
Score a complete trajectory
CallPOST /api/trajectory-analysis/{trajectoryId}/score with runs:write:
409 INCOMPLETE or 409 MALFORMED.
Build an evidence report
After scoring, callPOST /api/trajectory-analysis/{trajectoryId}/reports with reports:write:
- trajectory identity, source variant, source run, and content hash;
- participant identities and roles;
- every event ID, parent ID, and participant ID;
- exact model-call, cost-record, and evidence-item references;
- scorer identity, version, metrics, failures, and score;
- an evidence hash over the complete report payload;
- an empty orphan list, enforced before report creation.
Compare hosted and remote variants
UseGET /api/trajectory-analysis/compare?baselineId={hostedId}&candidateId={remoteId} with runs:read. The comparison returns source variant, completion state, latest score, event count, cost-evidence count, and score/event deltas for each side.
The comparison never treats two variants as interchangeable. Each side preserves its own source run, content hash, participants, events, and durable evidence references.
Retention
Each trajectory sets a retention period from 1 to 3,650 days. Organization administrators can runPOST /api/trajectory-analysis/retention with admin:org to delete expired trajectories. Cascades remove normalized participants, ingestion receipts, events, score results, and reports together; referenced gateway, cost, and platform evidence records remain governed by their own retention policies.
Operational checklist
- Create Model Gateway calls, cost records, and tool evidence before referencing them.
- Use stable participant and event keys from the source system.
- Preserve source timestamps and explicit parents; do not infer order from arrival time.
- Use one idempotency key per distinct batch and retain it through retries.
- Send late participants or parents under the same trajectory key.
- Finalize only after the source believes streaming is terminal.
- Require
completeand zero orphans before scoring or reporting. - Compare hosted and remote variants as separate evidence graphs.
- Review retention periods against organization policy.