Engineering
Publish skill completion events from a transactional outbox
Avoid splitting the durable result and its notification into unrelated writes.
A skill can save an artifact record and fail before publishing the event that informs users or downstream systems. It can also announce completion and roll back the state that made the announcement true. An outbox gives one transaction responsibility for both commitments.
Write the result and outbox entry together
Save the confirmed application outcome and a pending event in the same transaction where the design permits it. The event should refer to the durable result rather than carrying an unrestricted copy of user input. Only emit completion when the fact the event claims is supported by the application state.
Deliver events with duplicate handling
A separate publisher can retry pending events after interruptions. A delivery may be repeated if the publisher loses its acknowledgement. Consumers should identify events using documented keys and apply their own effects idempotently. Choose ordering guarantees only where downstream behavior needs them.
Observe the gap between saved and delivered
Track outbox age and delivery failures separately from task completion. A user may already have a valid artifact while a notification is delayed. Test worker shutdown after commit and after sending the event to verify both sides can reconcile.