For Japanese version, see IEventBus-jp.md.
IEventBus (Interface Specification)
1. Responsibility Boundary
IEventBus is the neural communication interface for asynchronous event propagation across kernel components with loose coupling.
- Role:
- Non-role:
Provide event publish, subscription lifecycle, broadcast delivery, and subscriber-count visibility.
Distributed transaction guarantees and durable queue semantics are out of scope.
2. Contract Signature
namespace AIKernel.Abstractions.Events;\n\npublic interface IEventBus : IProvider\n{\n Task PublishAsync(string eventName, object eventData, CancellationToken cancellationToken = default);\n string Subscribe<T>(string eventName, Func<T, Task> handler);\n bool Unsubscribe(string subscriptionId);\n Task BroadcastAsync(string eventName, object eventData, CancellationToken cancellationToken = default);\n int GetSubscriberCount(string eventName);\n}
3. Related Use Cases
UC-20Deterministic replay and audit trail:UC-13Runtime signature verification:UC-25Event bus distribution:
Delivers routing/signature/governance events into audit pipelines.
Broadcasts verification-failure events for immediate containment.
Acts as the common kernel event-delivery substrate.
4. Governance & Determinism
- Side-effect control:
- Ordering:
- Fail-Closed:
Handlers should minimize interference with primary reasoning flow.
If event order is semantically critical, implementation should provide ordering guarantees.
Failures that disable safety monitoring should trigger safe-stop or alternate audit channels.
5. Implementation Notes
- In-memory/distributed portability:
- Type safety:
Preserve contract behavior when switching from local bus to distributed backends.
Since eventData is object, maintain explicit event-name to payload-type mappings in production.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/interfaces/provider/IEventBus.md