@agentium/harness/testing entrypoint to verify the runtime contract of a custom driver. Prefer deterministic fixtures before testing a real provider or external effect.
Run the driver contract fixture
Save asdriver-contract.ts and run npx tsx driver-contract.ts after the quickstart installation.
{ result, eventCount } and checks ordered event sequences, run identity, schema version, exactly one terminal event, terminal/result agreement, final cursor, observer completion, and stable results after late cancellation. It rejects a failed result and closes fixture session resources.
Its optional second argument is Omit<HarnessRuntimeConfig, "driver">; the default grants no tools and the main model role. The helper executes the supplied driver with a conformance input. A real driver may call a provider or perform effects, so choose its test configuration deliberately. Passing the fixture does not prove that custom code never bypasses controlled services.
Troubleshoot common failures
Handle synchronous configuration errors separately from a run’s
result.reason. Do not import internal validation classes from private package paths; HarnessValidationError is not a root package export. Inspect thrown errors and their diagnostics where present.