Append observed outcomes or labelled examples
Outcomes are append-only. They are joined when calibration, the report
or a recommendation reads them, never when posted, so an evaluation
or an outcome that arrives late still counts. An outcome that
joins nothing is kept, and the calibration report counts it in
unmatched_outcomes. Outcomes feed the calibration report, the
calibrated answer fields and threshold recommendations; see
calibration. An outcome whose value does not
match the judgment’s type is invalid_request; one for a judgment the
namespace does not have is not_found.
- Labelled examples are outcomes with the default horizon of
0s: write the documents, post their labels, and each label is joined to the document’s evaluation of the revision current atobserved_at. This measures accuracy before going live. - Real-world results use a horizon, such as “churned within 30
days” with
horizon: "30d". An answer predicts the event within the horizon after it was made. A document’s first answer opens the window(t, t + horizon], answers made inside an open window open none, and the first answer after it closes opens the next. An outcome labels the window itsobserved_atfalls in; several in one window count once, atruewinning. Afalsethat falls in no window, posted once the period is over, labels the latest window that closed by itsobserved_at. Once atrueis observed, later windows of the document count for nothing until it is deleted and created again: the event already happened. An outcome observed after the new life’s first answer never labels a window from before the delete.
An outcome observed while its document is deleted joins nothing, whatever the horizon. A document written again remembers its id’s last 8 deletions, so this holds however late the outcome is posted. It needs the deletion to still be recorded when the outcome is posted or read, or when the id is written again.
Post what did not happen as well as what did: calibration needs at
least 20 outcomes of each class. For a bool judgment with a horizon,
the outcomes.implicit_negatives setting counts each closed window
with no outcome as false. When the truth already arrives in your
writes, the outcomes.rules setting derives outcomes from them
instead; a posted outcome beats a derived one in the same window.
A label for a document the labelling queue drew carries its
queue_item_id; it counts as source: queue. An id whose draw is
gone, or that names another document, is invalid_request; one whose
7-day lease has run out is conflict. An answer keeps one queue label,
the latest recorded, so a retry or a correction counts once.
Outcomes belong to a namespace, not a template prefix: post them on each namespace’s own path.
Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Headers
One key per logical request, reused only on its retries. A key
belongs to one request: within your organization, the same method,
path, query and body. For 24 hours after a successful response, a
request with the key and the same body gets that response back
verbatim, with Idempotent-Replayed: true, and runs nothing. Only a
successful response is kept, so the retry of a request that failed
runs again. While the first request runs or its response is kept,
the key with a different request is idempotency_key_reused (422).
A request sent while one with its key is still running is
rate_limited with Retry-After: 1, without running: retry it to
get the first one's response. In the rare case the key can't be
checked, the request runs as if it had none.
1 - 255Path Parameters
The namespace name, with any / sent as %2F.
Up to 256 bytes. / separates levels of the hierarchy, as in acme/prod/tenant_123. Never exactly . or .., which a URL path can't carry.
1 - 256^(?!\.\.?$)[A-Za-z0-9._:/-]+$Body
1Response
The outcomes were appended.