Create a judgment, or a new version of an existing name
Posting a name that exists creates version n+1; versions are
immutable. The first version of a name is active on creation; a later
version is inactive until activated, unless activate: true, which
implies force and skips the shadow report.
Freshness settings belong to the judgment, not the version:
freshness sets them with the name’s first version. A later version
keeps the judgment’s settings, and warnings says so when the
freshness sent differs from them. Change them with PATCH, which
asks for confirm before a switch to on_change.
Thresholds are a setting of the judgment, not part of the version. Thresholds given here replace the judgment’s thresholds when
this version becomes active, because they are written for its type; a
version created without them keeps the current thresholds. After that,
change them with PATCH.
Images are written to documents, never sent here. A recipe reads an
image only where it names one, as images.<name>: in
its fields, in previous.fields, and in a relation’s fields and
latest aggregates. A name holding a list is read whole. An image
path cannot have max_chars, last_n or window, cannot be summed
or compared, and cannot be an options.from label. A recipe with no
image paths, and a judgment without a recipe, read no images. Only
an engine whose limits in GET /engines have images (today
gpt-6-luna current) reads them, each counted toward the size
class by its tiles and the row counted at its engine’s multiple.
Any other engine reads each image’s digest, as an OmittedImage,
and warnings names the image paths the definition reads.
Activating the version warns again, with an images_unread warning.
On a prefix path (acme%2Fprod%2F*) this creates a template that every
namespace under the prefix inherits. A namespace cannot create a
judgment with the name of one it inherits (conflict). Templates need
the Team plan or above: on a prefix path, creating a version, PATCH
and activating are plan_required below it, while reading, backfill,
delete and detach work on every plan.
A composite judgment (a bool with parts) is never active on
creation, not even as the first version, and activate: true is
invalid_request for one: it cannot answer until its combiner is
fitted on your labels by the shadow job that activation starts.
An entity judgment has context.related.
Creating a version of one on a judgment whose policy will be
on_change needs confirm: true. Without it, the response is 200
with the replay estimate of its monthly cost, and nothing is created. A confirmed request whose estimate is more than the
namespace’s budget is budget_exceeded. When the version
joins on attributes with no reference index yet, job_ids names the
reference_index job that builds each one, and job_id the first.
A ninth reference index in a namespace is
invalid_request, and details.reference_indexes names the current
ones.
A relation that reads a referenced document joins with
{theirs: "id", mine: "attributes.<name>"}. It needs a reference
index on the judged documents’ mine attribute, built by a
reference_index job like any other and counted toward the same 8.
Its replay estimate cannot count fan-out, so it has
excludes: ["fanout"] and lower_bound: true, and without confirm
the response’s fanout shows the rolling limit the confirm sets. A
join on two different attributes is invalid_request, and
warnings names a relation that renders a referenced document’s
updated_at, which changes on every write to it.
A blocking relation joins on one key attribute
on both sides, and a choice can choose among it with
options.from; context.previous reads the document as the
judgment last saw it. A judgment with a blocking relation needs
confirm like one with a referenced relation, and a key value over
block_cap at create is invalid_request naming it in
details.key.
A definition needs a context recipe. Leaving out
context is invalid_request, and details.suggested_context is a
recipe suggested from up to 100 of the namespace’s documents, with
its cost per answer beside the whole state’s (null when there are
no documents). Send it back as context, or use_context: "suggested" to create with it, or use_context: "whole_state" to
send the whole state.
A starter (GET /starters) is created with
from_starter and paths: the server fills the starter’s
placeholders with your paths and validates the result like any
definition. The 201 carries definition, exactly what was
created, and for a starter with a suggested outcome setting,
outcomes: applied with the name’s first version, its rules only on
a plan with outcome rules.
dry_run: true validates the body as a create would and returns the
definition with its cost per answer and backfill estimate (200);
nothing is created.
A create answers within 20 s. When its estimate takes longer, it
answers 202 with a judgment_create job, which finishes the
create: the job’s result is then the 201, the 200 or the error
this request would have returned. A mistake found before the
estimate, such as an invalid body, is still answered at once.
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
A namespace name, or a template prefix ending in /*, with any
/ sent as %2F: acme%2Fprod%2Ftenant_123 or acme%2Fprod%2F*.
A namespace name, or a template prefix: a namespace path ending in
/*, such as acme/prod/*, which every namespace under acme/prod/
inherits judgments from. Up to 256 bytes. Never exactly
. or .., which a URL path can't carry.
1 - 256^(?!\.\.?$)[A-Za-z0-9._:/-]+(/\*)?$Body
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
A definition, or a starter filled with your paths.
Must be active in the registry. When omitted, Brussle fills it in: the namespace's default_engine, else the default model of your key for a provider Brussle serves when the namespace or your organization has one, else the included engine for the type. The created version records the result, and path says whether it runs on your key or on an included engine. Only an engine with limits.images reads the images the recipe selects.
The judgment judges, answers and bills only documents whose attributes match. A document that does not match
has no answer for it: answers omits it. Without it, the judgment
judges, answers and bills every document in the namespace, and the
create response warns. Part of the definition, so changing it
creates a version.
Composite judgments only: 2 to 8 narrow yes/no questions with
names unique within the judgment. They share the judgment's
context recipe and engine, so they go in one engine request with
its other questions, and each counts toward the 32 questions per
request. question then documents what the combination means and
is not sent to the engine. Parts are part of the version. They
cannot reference other judgments. Each part is billed as a
judgment. With features, one part is enough.
1 - 8 elementsUp to 12 numbers, on any bool judgment: aggregates over related
documents the recipe's related declares, the judged document's
own values, ages, and the engine's previous answer (see
FeatureRef). Each is recorded as a raw number beside every
answer under features, and on its evaluation, as of what that
evaluation read, and never recomputed later. A threshold can
name one, a query or subscription can filter on one, and the
fit on your outcomes reads them beside the engine's answer. A
composite judgment's combiner also takes them as numeric inputs
beside the parts, scaled automatically, a missing value counting
as typical. Features add no questions, so they are never billed:
a change that moves only a feature records a new answer with no
engine call. A judgment with relations created with features
debounces for 10 minutes unless its freshness sets
debounce_ms. Changing the list makes a new version.
1 - 12 elementsOne number the judgment records beside every answer and its fit can read. It is one of:
- An aggregate the recipe declares, as
<relation>.count,<relation>.count_where,<relation>.labelledor<relation>.<sum|avg|min|max|latest>(<path>), such astickets.countorinvoices.sum(state.amount). Aminormaxover an answer'sporscoregives the raw extreme, whatever band the context shows; alatestover an answer's threshold reads 1 or 0. Alatestover an answer'svalueis not a number and isinvalid_request. Asumoravgover an answer's number is a feature only. Alatestover abooloutcome reads 1 or 0, over ascoreoutcome its level; over achoiceoutcome it isinvalid_request. - The judged document's own value,
state.<path>orattributes.<name>: a number as itself, a boolean as 1 or 0, anything else missing. It needs no relation. - An age in fractional days,
age(created_at),age(<state or attributes path>)orage(<relation>.<latest|min|max>(<path>))over an aggregate the recipe declares. It is measured as of the judged document's ownupdated_atat the revision judged, so a write to a related document never moves it, and a new revision of the judged document does. The value must be an RFC 3339 string; a number or any other value reads missing, and a later time reads negative.age(updated_at)isinvalid_request: as of the judged revision it is always 0. previous.p: the engine's ownpthe last time it judged the document with the same engine version, in the same life of the document; on a choice, its1 - escape_p. Missing on the first judgment, after the document is created again, after the engine version changes, and on a composite, which has none. On a score it isinvalid_request.- On a choice among candidates (
options.from) only, a number per candidate,<from>.each(<path>)over theoptions.fromrelation: each candidate'sstate.<path>orattributes.<name>, orage(created_at),age(updated_at)orage(<state or attributes path>)of the candidate, as of the judged document's revision. It is recorded for each candidate the engine read, under the answer'scandidate_features. A candidate's answers areinvalid_request: keep the number on the candidate's state.
A name the recipe declares as an aggregate always reads that
aggregate. A feature that reads a path an outcome rule reads, one
inside the other, is invalid_request.
^([A-Za-z0-9_-]+\.(count|count_where|labelled|(sum|avg|min|max|latest)\((state|attributes)(\.[^.()]+)+\)|(min|max|latest)\((created_at|updated_at)\)|(sum|avg|min|max)\(answers\.[A-Za-z0-9_-]+\.(p|score|dist\.[^()]+)\)|latest\(answers\.[A-Za-z0-9_-]+\.thresholds\.[A-Za-z0-9_-]+\)|latest\(outcomes\.[A-Za-z0-9_-]+\.value\))|(state|attributes)(\.[^.()]+)+|age\((created_at|(state|attributes)(\.[^.()]+)+|[A-Za-z0-9_-]+\.(latest|min|max)\((created_at|updated_at|(state|attributes)(\.[^.()]+)+)\))\)|previous\.p|[A-Za-z0-9_-]+\.each\(((state|attributes)(\.[^.()]+)+|age\((created_at|updated_at|(state|attributes)(\.[^.()]+)+)\))\))$Required to create a version with context.related on a judgment whose policy will be on_change. Without it, the
response is the replay estimate of the monthly cost, and nothing
is created; for a judgment that can fan out it also carries
fanout, the rolling limit the confirm sets. Ignored for other
judgments.
Instead of context: suggested creates with the
recipe suggested from a sample of the namespace's documents, the
one a create without context returns in
details.suggested_context; whole_state sends the whole
state, with a warning. Refused together with context.
suggested, whole_state Response
Nothing was created: a dry run (dry_run: true), or an entity
judgment that needs confirm and was not confirmed, whose replay
estimate this is.
- Option 1
- Option 2
What a create would make, and what it would cost. Nothing was created, written or billed.
Mean judgments per answer over sampled_documents of the
documents the definition applies to, each counted by its size
class as a backfill estimate counts them: 1 when every answer is
standard, 4 when every one is large, 2 for a standard composite of
five parts with short questions (the first in full, each other a
quarter). Null when
there is nothing to sample, and on a template's prefix path.
x >= 0