Candidate fields
PredictionCandidate makes the decision inspectable:
Malformed candidates throw
TypeError before admission.
Admission and deduplication
predict(candidate, loader) returns immediately. Inspect accepted before assuming work entered the
queue:
0.8 for ordinary work, 0.9 for high-cost work, two loaders, and 16 queued items.
Matching keys return the active handle with deduplicated: true. Queued work sorts by priority,
probability, then insertion order.
Lifecycle
waiting_for_reuse separates completion from usefulness. The host must report consumption before
the horizon ends.
The corresponding events are:
acceptedwhen the candidate enters active work;startedimmediately before Cogni calls the loader;loadedwhen the loader resolves;reusedwhen the host reports that committed work consumed the same resource;missed,failed,cancelled, orexpiredat terminal completion;rejectedwhen admission fails; anddeduplicatedwhen an existing active key is reused.
onEvent failures are isolated from the lifecycle.
Mark reuse
Callhandle.markReused() only when the committed action reads the same cached representation.
Reuse reported during loading finalizes after completion. Reuse while still queued becomes
superseded_by_committed_action.
Do not mark reuse for these cases:
- the foreground action fetched a different cache key or payload shape;
- the predicted entry expired or was invalidated first;
- navigation changed to another destination; or
- the application merely observed that the prediction request completed.
Cancellation
Cancel through the handle or stable key:dispose() uses coordinator_disposed; host cancellation
uses cancelled_by_host.
Measure quality
quality(filter?) reads bounded terminal history filtered by cost, destination, policy, or
trigger.
Continue
- Why Cogni explains the production quality target.
- Scheduling and direct intent controls when admitted work reaches the coordinator.