AIKernel.NET
version: 0.0.2 / status: Refactor / edition: Draft / published: 2026-05-16 / updated: 2026-05-16

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:
  • Provide event publish, subscription lifecycle, broadcast delivery, and subscriber-count visibility.

  • Non-role:
  • 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}
  • UC-20 Deterministic replay and audit trail:
  • Delivers routing/signature/governance events into audit pipelines.

  • UC-13 Runtime signature verification:
  • Broadcasts verification-failure events for immediate containment.

  • UC-25 Event bus distribution:
  • Acts as the common kernel event-delivery substrate.

4. Governance & Determinism

  • Side-effect control:
  • Handlers should minimize interference with primary reasoning flow.

  • Ordering:
  • If event order is semantically critical, implementation should provide ordering guarantees.

  • Fail-Closed:
  • Failures that disable safety monitoring should trigger safe-stop or alternate audit channels.

5. Implementation Notes

  • In-memory/distributed portability:
  • Preserve contract behavior when switching from local bus to distributed backends.

  • Type safety:
  • 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
Source: architecture/interfaces/provider/IEventBus.md