2.2.1 Scenario: sign in and open a demo
The middleware matches/launcher and /demo/:path*. A request without the session cookie value redirects to /login.
2.2.2 Scenario: plugin lifecycle
The kernel’sPluginLifecycleManager allows only these transitions. It serializes operations for each plugin, so hooks cannot race.
Every transition publishes a plugin.lifecycle.changed event with pluginId, previousState, and state. If event delivery fails, the manager raises EVENT_DELIVERY_FAILED after the state has already changed.
2.2.3 Scenario: event publishing
TheInMemoryEventBus runs handlers in subscription order and awaits each one. A failing handler propagates the error to the publisher. emit is a compatibility alias for publish.
The web app’s
PlatformProvider builds its own per-plugin PluginContext and event bus in the browser. It does not run the kernel’s lifecycle manager. See Risks and technical debt.