Engine-wide knobs: history cap and observer-error handler.
A Graph instance whose lifetime is owned by the caller.
The closure returned here owns every piece of mutable state the engine touches. There is no module-level state and no implicit singleton — each call yields an independent universe with its own GraphTime. This is the smallest example the engine must support: an input, a derivation, a subscription, and a commit that fires exactly one notification when the downstream value actually changes. If this works, the engine is real; everything else is downstream of getting it right.
A WasmEngineUnavailableError (code === 'CAUSL_WASM_ENGINE_UNAVAILABLE') when the @causl/causl-wasm-ts/wasmsubpath was never imported, or when it was and the WasmGC engine cannot instantiate on this host; aCauslWasmNotPreloadedError (code ===
'CAUSL_WASM_NOT_PRELOADED') when the subpath is imported but
preloadCauslWasm() has not resolved. Branch on error.code, not on
instanceof: the never-imported case is thrown by the main bundle's own
leak-free twin, which cannot extend a /wasm class.
Construct a fresh Causl graph at GraphTime t₀ = 0.
Implements the canonical primitive surface —
input,derived,commit,read,subscribe,subscribeCommits,explain— plus the second-tier extensionscommitLog,exportModel,simulate,snapshot,snapshotAt,hydrate,readAt, and thenowaccessor. Each non-canonical row earned its slot by naming a concept the engine cannot otherwise express: the commit log realises the "transaction log is a Behavior" promise; export is the bridge to the bounded model checker;simulateis the §5 dry-run API that lets a caller predict a commit's effect without committing; snapshot/hydrate/readAt are SSR transfer, persistence, and time-travel;nowlets external observers ask "what time is it?" without firing a commit.