Admission
The executor sorts candidates by descendingpriority, then probability, then request order. It
prepares them in that order and asks:
- the configured ordinary and high-cost probability gates;
capabilities.limits.max_candidates_per_batch;capabilities.limits.max_horizon_ms;- registry availability; and
- resource parameter validation.
below_quality_gate, budget_exhausted, unavailable, or
invalid_parameters before resolution. The protocol also reserves queue_full and
unsupported_representation.
createPredictionExecutor() defaults to a 0.8 ordinary gate, a 0.9 high-cost gate, and four
concurrent resolvers. Configure these values through executor when using
createCogniResourceServer():
maxConcurrent must be positive.
Capacity
prediction.accepted is emitted only when a resolver starts, so telemetry does not count queued
work as active work.
Resolution emits prediction.resolved; cancellation, expiry, or errors emit prediction.failed.
One final batch.completed event reconciles every terminal count.
Deadlines
horizon_ms becomes the execution deadline. Deadline or request cancellation aborts the resolver
signal and emits deadline_exceeded or cancelled. Downstream I/O must honor the signal to release
host capacity.
Completion order
Priority controls start order; completion controls delivery order. A fast later resolver can populate the cache without waiting for the batch’s slowest read.NDJSON streaming
WithAccept: application/x-ndjson, each validated event is streamed as one JSON line.
The protocol client requests NDJSON by default and invokes onEvent after validating each event:
onEvent receives results as they arrive.
JSON transport
Settransport: "json" to request application/json:
Sequence validation
The client and server reject unknown IDs, invalid event order, duplicate terminal events, inconsistent summaries, and missing or non-finalbatch.completed. A stream may fail after valid
resources arrived, so cache each validated resource independently and retain foreground fallback.
Continue
- Backend contract defines the exact wire messages and error behavior.
- Registered resources defines the validation and authorization boundary.