PredictionResourceRegistry maps opaque names to host-owned validation and resolution, preventing
the client from inventing URLs, queries, or functions.
Resource names
A name identifies a reusable representation, not its storage. Names start with a lowercase letter, may use lowercase letters, digits, and single., _, or - separators, and are limited to 128
characters.
Registration requires a resolve function and rejects duplicate names:
Validate parameters
validate runs before prediction.accepted, so invalid work is never recorded as admitted.
CogniResourceRejection carries a protocol reason. Other validation errors become
invalid_parameters. Keep tenant identity in authenticated context, never client parameters.
Authorize reads
Registration declares a read; it does not authorize one. Authenticate the route first, then apply the same domain authorization as the foreground read.Return metadata
A resolver returns a payload plus reuse and cost metadata:
The wire response uses
snake_case. Set materialWork: false for a backend cache hit so warm reads
do not distort material reuse.
Classify failures
ThrowCogniResourceFailure when the host can classify a resolver failure:
code and retryable. Unclassified errors become non-retryable
backend_error; cancellation and expiry become cancelled and deadline_exceeded. Failures remain
isolated per candidate.
Propagate cancellation
Pass the resolver’sAbortSignal into downstream calls. Cogni can stop awaiting ignored work, but it
cannot recover the host capacity that work continues to consume.
Continue
- Bounded execution and streaming follows a batch from admission to completion.
- Architecture and trust boundaries shows the full host security and cache flow.