prometeu-studio/docs/studio/pull-requests/PR-01-studio-event-bus-foundation.md
2026-03-24 13:42:39 +00:00

2.5 KiB

PR-01 - StudioEventBus Foundation

Briefing

The Studio now has a normative event model in spec, but prometeu-studio still relies on direct UI wiring.

This PR introduces the generic StudioEventBus foundation that later Studio code will use for:

  • shell-level observation,
  • workspace-local activity,
  • workspace-to-global propagation,
  • project launcher and shell interactions.

Objective

Implement the typed Studio event infrastructure in application code so future Studio work can publish and observe events without string routing or ad hoc direct coupling.

Dependencies

Scope

  • introduce a generic typed StudioEventBus
  • introduce a workspace-local bus model
  • support automatic workspace-to-global propagation
  • introduce DTO-style event payload contracts
  • add the minimum initial event set needed by the shell wave
  • add tests for propagation and subscription behavior

Non-Goals

  • implementing every future Studio event now
  • integrating the full packer event lane now
  • redesigning the whole shell in this PR
  • moving visual controls into prometeu-studio-components

Execution Method

  1. Introduce a small event contract in prometeu-studio.
  2. Use typed DTO events, preferably immutable.
  3. Make subscription and unsubscription explicit and safe.
  4. Implement one global bus and one workspace bus type.
  5. Ensure every workspace event is automatically republished to the global bus.
  6. Keep propagation one-way: workspace to global.
  7. Add tests for:
    • typed subscription
    • unsubscription
    • workspace-to-global propagation
    • no accidental global-to-workspace rebroadcast

Acceptance Criteria

  • prometeu-studio has a generic typed StudioEventBus
  • workspace buses exist and can be attached to the global bus
  • every workspace-published event is observable on the global bus
  • callers do not need to publish the same event twice manually
  • event payloads are DTO-style and not string-based
  • automated tests cover the propagation baseline

Validation

  • unit tests for bus behavior
  • basic smoke coverage for publish/subscribe and nested propagation

Affected Artifacts

  • prometeu-studio application infrastructure
  • future shell integration points
  • tests for Studio UI foundation code