Intelligence · interface

DeterministicScript

A provider that answers after a stated number of ticks, or never.

Explained in Agents and behaviour.

interface DeterministicScript
import type { DeterministicScript } from '@driftengine/ai';

In depth

This is not a mock capability provider. R1 withdrew mocks standing in for engine capabilities that did not exist, on the reasoning that a mock is a second implementation of a contract with no first implementation to check it against. This stands in for a provider — a thing that is genuinely remote, genuinely slow and genuinely variable — and it exists so that timing can be asserted rather than observed.

Nothing here runs on a real timer. A response is due at an absolute tick, and a tick only happens when a caller says so. Every timing property Track O claims is measured against this, and on a real clock each of those measurements would be a race that passes on a fast machine.

What it costs: a test must remember to call advance, and one that forgets sees an agent that never gets an answer. What would make it wrong: if a provider adapter ever needed wall-clock behaviour to be exercised — a retry backoff, say — this could not exercise it, and that adapter would need its own harness rather than a change here.

Properties

NameTypeDescription
latencyTicksreadonlynumber | 'never'Ticks between the request and its first event. 'never' answers nothing, ever.
eventsreadonlyreadonly AiEvent[]