Testing utilities: an in-memory core, a collecting sink and assertions, so a
host app (or this package’s own suite) can test its audit wiring without a
database, timers or the network.
createTestAudit: an in-memory core, a collectingSink
behind a not-started stream runner (drive it with flush()), an
optional panel, and events() to read back everything recorded.
collectingSink: a sink that keeps every batch it receives — with
programmable failures to exercise the stream retry path.
expectRecorded / expectNotRecorded: framework-agnostic
assertions (they throw a descriptive Error) over what a core recorded.
Assert that core recorded an event matching matcher (deep subset). Resolves to the newest matching event; throws a descriptive Error (listing what was recorded instead) otherwise. Works with any test runner.