Skip to content
Open the portal
Developer docs

After the decision: outcomes, recall, replay

Engineers14 min read

A record ends when the agent acts. These three families work on records after that point. None of them changes a record; two of them write new signed records of their own.

Family Writes Reads Signed record
Outcomes people with records:write, ingest keys people DEC-OUT-…, one per outcome
Recall nothing people none; it is a query
Replays people with records:write, ingest keys every member; items need records:write DEC-RP-…, one per sealed set

“People with records:write” means owners, admins and engineers. Auditors read all of it and change none of it; an ingest key reports outcomes and runs replays and can read nothing else, except the replay sets themselves. The matrix. What each record proves.

POST /v1/decisions/{decision_id}/outcomes with records:write:

{
"kind": "result",
"verdict": "reversed",
"label": "chargeback",
"note": "Card issuer reversed the refund on 3 Oct.",
"observed_at": "2026-10-03T09:00:00Z"
}
Field Values Notes
kind result, override, dispute, review What sort of event: something happened later, a person overruled the agent, the subject contested it, a person reviewed it
verdict upheld, reversed, inconclusive What it means for the decision. Inconclusive is listed, never scored
label 1 to 64 characters What happened, in a few words. Whitespace is collapsed
note up to 2,000 characters, optional Working detail. Kept in the index, not in the record
observed_at timestamp, optional When it was observed; defaults to now
reported_by up to 256 characters, optional Who is reporting. Defaults to the caller’s email, or key:<key id> for an ingest key

Answers 201 with the index row:

{
"id": "OUT-3F2A9C1D7B0E4A66",
"decision_id": "DEC-OUTT-support-bot-1",
"agent": { "id": "support-bot", "version": "2026.09.1" },
"subject": { "type": "order", "id": "7001" },
"original_adverse": false,
"kind": "result",
"verdict": "reversed",
"label": "chargeback",
"note": "Card issuer reversed the refund on 3 Oct.",
"reported_by": "ada@example.com",
"reporter_kind": "user",
"observed_at": "2026-10-03T09:00:00+00:00",
"record_id": "DEC-OUT-7C1E52B0A3D94F8E6B21",
"created_at": "2026-10-05T10:14:02.117000+00:00"
}

reporter_kind is user or api_key. A decision may have any number of outcomes; a second report adds a second record, it does not replace the first.

Status Code When
404 decision_not_found No such decision in this workspace
422 not_a_decision The id is one of Stratl’s own workflow records (DEC-OUT-…, DEC-RP-…, DEC-WF-…, …). Outcomes attach to agent decisions only
422 validation A kind or verdict outside the lists, or an empty label

Every outcome is a signed record in the workspace stream, DEC-OUT-…, under the agent stratl-outcomes, with the same custody labels as the decision. It links to the decision through provenance.source_record_ids and carries the facts in documented SRF fields:

{
"seq": 2,
"type": "outcome",
"at": "2026-10-03T09:00:00.000Z",
"status": "reversed",
"adverse": false,
"category": "result",
"effect_on_subject": "chargeback"
}

The kind is the event’s category, the verdict its status, the label its effect_on_subject, the observed time its at. The reporter is an actor with role reporter, human for a person and system for a key. The record’s assurance is observed: Stratl observed the report, not the event. The note is not in the record. It also shows in GET /v1/decisions/{id}/related.

People only; an ingest key gets 403.

Call Returns
GET /v1/decisions/{id}/outcomes { items, kinds, verdicts }: this decision’s outcomes, newest observed first, and the allowed values
GET /v1/outcomes { items, limit, offset } across the workspace. Filters: agent_id, kind, verdict, since, until (on observed_at). limit defaults to 50, at most 500
GET /v1/outcomes/scorecard The scorecard below. since and until apply to decisions (when they happened) and outcomes (when they were observed) alike
GET /v1/stats Now also outcomes: { total, upheld, reversed, inconclusive }
{
"window": { "since": null, "until": null },
"totals": { "decisions": 7, "adverse": 2, "with_outcome": 4, "upheld": 2, "reversed": 2,
"inconclusive": 1, "by_kind": { "result": 2, "override": 1, "dispute": 1, "review": 1 },
"upheld_rate": 0.5, "coverage": 0.5714 },
"agents": [
{
"agent_id": "support-bot", "agent_name": "Support-Bot",
"decisions": 6, "adverse": 2, "with_outcome": 4,
"upheld": 2, "reversed": 2, "inconclusive": 1,
"by_kind": { "result": 2, "override": 1, "dispute": 1, "review": 1 },
"upheld_rate": 0.5, "coverage": 0.6667,
"last_decision_at": "…", "last_outcome_at": "…",
"versions": [
{ "version": "2", "decisions": 2, "adverse": 2, "with_outcome": 1, "upheld": 0, "reversed": 1,
"inconclusive": 0, "by_kind": { "…": 0 }, "upheld_rate": 0.0, "coverage": 0.5, "…": "…" },
{ "version": "1", "decisions": 4, "adverse": 0, "with_outcome": 3, "upheld": 2, "reversed": 1,
"inconclusive": 1, "by_kind": { "…": 0 }, "upheld_rate": 0.6667, "coverage": 0.75, "…": "…" }
]
}
]
}

upheld_rate is upheld / (upheld + reversed), rounded to four places, null when there is no decisive outcome. coverage is with_outcome / decisions. upheld, reversed, inconclusive and by_kind count outcomes; with_outcome counts distinct decisions. Agents are sorted by reversed, then decisions; versions by last decision. Stratl’s own workflow records are excluded from decisions. The agent version comes from agent.version in the record, so send it.

Outcome rows are rebuilt from storage like everything else. DEC-OUT-… records describe their own index row: the kind from the outcome event’s category, the verdict from status, the label from effect_on_subject, the reporter from the actors, the decision from provenance.source_record_ids. The note comes back empty. A DEC-OUT-… record whose decision is unknown is reported as a problem and skipped. The rebuild report counts them as outcomes_indexed. Custody and the rebuild.

Python, on the client:

status = client.outcome(
"DEC-01J9…", kind="result", verdict="reversed", label="chargeback",
note="Card issuer reversed the refund.", # optional
observed_at="2026-10-03T09:00:00Z", # optional, defaults to now
reported_by="billing-sync", # optional
)
# "recorded" or "failed"; client.last_error says why. Never raises, never spooled.

TypeScript:

const r = await client.outcome("DEC-01J9…", {
kind: "result", verdict: "reversed", label: "chargeback",
note: "Card issuer reversed the refund.", // optional
observed_at: "2026-10-03T09:00:00Z", // optional
reported_by: "billing-sync", // optional
});
// { status: "recorded", id, record_id } or { status: "failed", error }. Never rejects.

Outcomes are not spooled: a report that fails is returned as failed, and the caller decides whether to retry. A decision is recorded even when the network is down; an outcome is a later fact that the reporting system still holds.

GET /v1/recall, people only, read-only. Name at least one thing the decisions depended on:

Parameter Matches
agent_id, agent_version The record’s agent, and agent.version
provider, model, model_version, config_hash A model_call event. The fields combine inside one event: model=gpt-5&model_version=0611 means that version of that model
tool A tool_call event’s name
policy_id, policy_version A policy_eval event, combined the same way
retrieval_source, doc_ref A retrieval event’s source, and one fingerprint in its doc_refs
source The record’s provenance.source

Fingerprints (config_hash, doc_ref) are accepted with or without the sha256: prefix. since, until and adverse narrow the result but do not count as a criterion; without one the call answers 422 recall_needs_criteria. limit (default 50, at most 200) and offset page the items. Stratl’s own workflow records are never dependents. The query is a JSONB containment query over the record column, answered by a GIN index.

GET /v1/recall?model=gpt-5&model_version=0611
{
"criteria": { "model_call": { "model": "gpt-5", "version": "0611" }, "since": null, "until": null, "adverse": null },
"summary": {
"decisions": 2, "subjects": 1, "adverse": 1, "notices_sent": 1,
"with_outcome": 1, "reversed": 1,
"first_at": "…", "last_at": "…", "truncated": false,
"agents": [{ "agent_id": "support-bot", "agent_name": "Support Agent", "decisions": 2 }],
"by_category": [{ "category": "refund", "decisions": 1 }, { "category": "refund_denied", "decisions": 1 }]
},
"subjects": [
{ "type": "order", "id": "5001", "display": null, "decisions": 2, "adverse": 1,
"notified": true, "reversed": 1, "first_at": "…", "last_at": "…",
"decision_ids": ["DEC-RCL-2", "DEC-RCL-1"] }
],
"items": [ { "decision_id": "DEC-RCL-2", "subject": { "…": "…" }, "agent": { "…": "…" }, "outcome": { "…": "…" },
"notice_sent": true, "reversed": false, "…": "…" } ],
"limit": 50, "offset": 0
}

summary covers every matching decision up to 5,000 (truncated says when there were more); items is one page of decision summaries, as in the decision list, plus notice_sent (a notice with status sent exists) and reversed (an outcome with verdict reversed exists). subjects is grouped and sorted adverse first, then most recent.

format=csv returns the subject list as a download, stratl-recall-<date>.csv, with the columns subject_type, subject_id, display, decisions, adverse, notice_sent, reversed, first_at, last_at, decision_ids.

GET /v1/recall/facets (with optional since, until) lists what the workspace’s records depended on, with counts, to fill a form: agents (with versions), models (provider, model, version), configs (model, config_hash; at most 200), tools, policies (policy_id, version), retrieval_sources, sources.

Neither SDK wraps recall. Call it with any HTTP client as a signed-in person; an ingest key gets 403.

Stratl never runs a model. It freezes a sample of real decisions, hands your script what it needs to re-run each one, takes the candidate’s conclusion back per decision, and reports what would change. Closing the set writes a signed record of the comparison.

POST /v1/replays with records:write:

{
"name": "gpt-5 1001 candidate",
"selector": { "agent_id": "support-bot", "limit": 5 },
"candidate": { "provider": "openai", "model": "gpt-5", "version": "1001", "note": "October model" }
}
Selector field Meaning
agent_id Required. One agent per set
agent_version, model Only decisions by that agent version, or whose record has a model_call with that model
since, until, adverse Only decisions in that window, or with that adverse flag
limit Default 500, at most 2,000
order latest (default) or random

candidate (provider, model, version, config_hash, note) names what is being tried; all optional. The answer is 201 with the set, status: "open", item_count, and counts: { items, replayed, pending, unchanged, changed, flipped }. The selector is stored as asked. A selector that matches nothing makes an empty set. Workflow records are never sampled.

GET /v1/replays/{id}/items?change=unchanged|changed|flipped|pending&limit=100&offset=0 with records:write. Each item is what you need to re-run the decision, never content:

{
"decision_id": "DEC-RPT-5",
"subject": { "type": "order", "id": "6005" },
"original": {
"occurred_at": "…", "agent_version": "2026.09.1",
"input_hashes": ["sha256:…"],
"model": { "provider": "openai", "model": "gpt-5", "version": "0611",
"config_hash": "sha256:…", "input_hash": "sha256:…", "output_hash": "sha256:…" },
"model_calls": 1,
"doc_refs": [],
"action": { "name": "refunds.issue", "target": "order:6005" },
"outcome": { "status": "completed", "adverse": true, "category": "refund_denied" }
},
"result": null, "change": null, "diff": [], "reported_at": null
}

input_hashes are the record’s input events in order; model is the last model_call; doc_refs holds up to 50 retrieval fingerprints. The originals are in custody: GET /v1/artifacts/{sha256} returns the bytes when the source uploaded them. total in the answer is the set’s item count.

POST /v1/replays/{id}/results with records:write, up to 500 items per call:

{
"items": [
{ "decision_id": "DEC-RPT-1", "outcome": { "adverse": false, "category": "refund" } },
{ "decision_id": "DEC-RPT-3", "outcome": { "adverse": true, "category": "refund_denied" }, "note": "stricter" },
{ "decision_id": "DEC-RPT-2", "outcome": { "adverse": false, "status": "escalated" } },
{ "decision_id": "DEC-RPT-9", "outcome": { "adverse": false } }
]
}

Each item: decision_id; outcome with adverse (required), status (default completed) and category; optional action (name, target), model (provider, model, version), output_hash and note. The answer reports what was taken and the running counts:

{ "accepted": 3, "unknown": ["DEC-RPT-9"], "items": 5, "replayed": 3, "pending": 2, "unchanged": 1, "changed": 1, "flipped": 1 }

Reporting is idempotent per decision: a repeat replaces the earlier result. Ids not in the set are listed in unknown, not accepted. Each result is classified against the original:

change When diff lists
flipped The adverse flag differs adverse, plus any of the others
changed The status, the category (when both are set) or the action name (when both are set) differs the fields that differ
unchanged None of the above nothing

A closed set answers 409 replay_closed.

POST /v1/replays/{id}/close with records:write computes the summary, writes the record and sets status: "closed":

"summary": {
"items": 5, "replayed": 4, "pending": 1, "unchanged": 2, "changed": 1, "flipped": 1,
"flipped_to_adverse": 0, "flipped_to_not_adverse": 1,
"flip_rate": 0.25, "change_rate": 0.5, "subjects_flipped": 1,
"by_category": [ { "category": "refund_denied", "items": 2, "replayed": 1, "changed": 0, "flipped": 1 },
{ "category": "refund", "items": 3, "replayed": 3, "changed": 1, "flipped": 0 } ],
"flipped_decision_ids": ["DEC-RPT-5"]
}

flip_rate is flipped / replayed, change_rate is (flipped + changed) / replayed; both are null when nothing was replayed. by_category groups by the agent’s original outcome category. The record is DEC-RP-… under the agent stratl-replays: subject type agent, id the agent tested, display the set’s name; provenance.source_record_ids is the set id followed by up to 500 flipped decision ids; the input event’s hash fingerprints the full statement (selector, candidate, summary, flipped ids, who closed it, when); the outcome event’s effect_on_subject reads 1 of 4 replayed decisions would flip; 1 would change in another way; 1 not replayed. Its assurance is enforced: the comparison is computed by the service from the reported results. Closing an already closed set answers 409 replay_closed.

GET /v1/replays and GET /v1/replays/{id} are open to every member, auditors included, and return the set with counts and, once closed, summary and record_id. A set from another workspace answers 404 replay_not_found.

import stratl
from stratl.replay import Result
client = stratl.Client() # STRATL_API_URL, STRATL_API_KEY: an ingest key is enough
rp = client.create_replay(
"gpt-5 1001 candidate", agent_id="support-bot", limit=500,
agent_version=None, model=None, since=None, until=None, adverse=None, order="latest",
candidate={"provider": "openai", "model": "gpt-5", "version": "1001"},
)
def decide(item):
# item.decision_id, item.subject, item.original (as in the API)
# item.inputs: the original input bytes, in order, fetched from custody by fingerprint
# item.input_text: the first input decoded as UTF-8, or None when it is not in custody
if item.input_text is None:
return None # skip: the item stays pending
answer = my_agent.decide(item.input_text, model="gpt-5", version="1001")
return Result(adverse=answer.denied, category=answer.category,
status="completed", action=None, target=None, output_hash=None, note=None)
report = stratl.replay.run(client, rp["id"], decide, fetch_inputs=True, close=True)
print(report.summary["flipped"], "of", report.summary["replayed"], "would flip")

run walks the pending items 200 at a time, fetches each original input with client.fetch_artifact(fingerprint) (returns bytes or None) unless fetch_inputs=False, calls fn, batches results 100 per request, then closes the set unless close=False. It returns Report(replay_id, replayed, skipped, summary, record_id); with close=False, summary holds the running counts and record_id is None. It raises httpx.HTTPError when the API cannot be reached or refuses: a replay is a deliberate job, so it fails loudly and does not spool. create_replay raises the same way.

stratl.replay.Replay(client, replay_id) is the loop underneath: items(fetch_inputs=True, change=None) iterates ReplayItems, report(decision_id, result) queues a result and flushes every 100, flush() posts the queue, close() flushes and seals.

Not yet. There is no replay helper in @stratl.ai/sdk; call the three endpoints with fetch as above, or run the Python SDK. The command-line tool does not run replays.

Recall results and replay records are not in evidence bundles or period packs; a replay record has a bundle of its own like any record. Neither SDK wraps recall. There is no TypeScript replay helper and no CLI support for any of the three.