Aller au contenu

BC-065A — EventPlatform / Realtime Legacy Audit

Status: HISTORICAL For the current architecture, see: ./dependances.md, ../runtime/overview.md.

Status

BC-065A audit completed.

No production code changed. No plugin file changed. No runtime mirror file changed. No Composer change. No runtime sync.

Scope

Audited directories:

  • src/Application/EventPlatform/**
  • src/Application/M12/**
  • src/Application/M17/**
  • src/Application/Projection/**
  • src/Application/Realtime/**

Important scope nuance:

Two files under src/Application/Projection/ are already canonical and therefore are explicitly out of the legacy debt slice:

  • src/Application/Projection/BuildProductCreatedEventFromProduct.php
  • src/Application/Projection/CatalogProjectionWriter.php

Executive summary

The remaining EventPlatform / Realtime legacy slice is now a small, internally-contained island made of:

  • compatibility wrappers (M12);
  • legacy orchestration shells (EventPlatform, Projection, Realtime);
  • one persistence-sensitive bridge (M17\EventBridge);
  • no proven plugin or runtime coupling.

What is proven in BC-065A:

  • no WordPress plugin file imports CMonChoix\Application\EventPlatform\...;
  • no WordPress plugin file imports CMonChoix\Application\M12\...;
  • no WordPress plugin file imports CMonChoix\Application\M17\...;
  • no WordPress plugin file imports CMonChoix\Application\Projection\...;
  • no WordPress plugin file imports CMonChoix\Application\Realtime\...;
  • Composer still autoloads only CMonChoix\Platform\ => src/;
  • no new compatibility bootstrap, alias or runtime entrypoint is involved;
  • EventBridge remains the only proven serialization-sensitive legacy surface;
  • no hard cycle is proven in code;
  • the Event -> EventBridge -> EventBus -> ProjectionEngine -> Realtime chain is only partially proven.

1. Inventory

Legacy classes in scope

File Namespace Short role Classif.
src/Application/EventPlatform/Bus/EventBus.php CMonChoix\Application\EventPlatform\Bus in-memory event bus keyed by event::class B, F
src/Application/EventPlatform/Bus/EventDispatcher.php CMonChoix\Application\EventPlatform\Bus thin dispatcher over EventBus B
src/Application/EventPlatform/Contracts/Event.php CMonChoix\Application\EventPlatform\Contracts marker event contract C, G
src/Application/EventPlatform/Contracts/EventHandler.php CMonChoix\Application\EventPlatform\Contracts callable handler contract C, G
src/Application/EventPlatform/Kernel/PlatformKernel.php CMonChoix\Application\EventPlatform\Kernel legacy event-platform wiring shell B, G
src/Application/M12/EventBus/EventBus.php CMonChoix\Application\M12\EventBus compatibility wrapper over EventBus A, G
src/Application/M12/Wiring/PlatformKernel.php CMonChoix\Application\M12\Wiring compatibility wrapper over PlatformKernel A, G
src/Application/M17/EventBridge/EventBridge.php CMonChoix\Application\M17\EventBridge persist-then-dispatch bridge B, F, H
src/Application/Projection/EventSubscriberRegistry.php CMonChoix\Application\Projection in-memory subscriber registry B
src/Application/Projection/ProjectionCatalogWiring.php CMonChoix\Application\Projection projection wiring shell B
src/Application/Projection/ProjectionEngine.php CMonChoix\Application\Projection replay-and-dispatch projection shell B
src/Application/Realtime/Async/AsyncEventQueue.php CMonChoix\Application\Realtime\Async in-memory async queue placeholder B
src/Application/Realtime/Async/AsyncWorker.php CMonChoix\Application\Realtime\Async worker loop over queue + rebuilder B, H
src/Application/Realtime/RealtimeCatalogRebuilder.php CMonChoix\Application\Realtime realtime orchestration shell B, H

Classification legend

  • A: wrapper de compatibilité
  • B: orchestration
  • C: contrat
  • D: adapter
  • E: code mort
  • F: surface de sérialisation
  • G: surface reflection
  • H: surface runtime

No audited class qualified as D.

2. Detailed dependency matrix

FQCN Consumers Producers / direct callers Héritage / interfaces Dépendances internes Dépendances externes Plugin/runtime
EventPlatform\Bus\EventBus PlatformKernel, M12\EventBus, EventBridge EventDispatcher, EventBridge none none none none
EventPlatform\Bus\EventDispatcher none proven none proven none EventBus none none
EventPlatform\Contracts\Event none proven none proven interface none none none
EventPlatform\Contracts\EventHandler none proven none proven interface none none none
EventPlatform\Kernel\PlatformKernel M12\Wiring\PlatformKernel none proven none EventBus none none
M12\EventBus\EventBus M12\Wiring\PlatformKernel none proven extends EventPlatform\Bus\EventBus wrapper only none none
M12\Wiring\PlatformKernel none proven none proven extends EventPlatform\Kernel\PlatformKernel wrapper only none none
M17\EventBridge\EventBridge none proven none proven none EventBus Infrastructure\M16\PersistentEventStore none
Projection\EventSubscriberRegistry RealtimeCatalogRebuilder RealtimeCatalogRebuilder none none Domain\Shared\DomainEvent none
Projection\ProjectionCatalogWiring none proven self (new ProjectionEngine) none ProjectionEngine Infrastructure\Event\EventStoreInterface none
Projection\ProjectionEngine ProjectionCatalogWiring self (dispatch) none none Infrastructure\Event\EventStoreInterface none
Realtime\Async\AsyncEventQueue AsyncWorker AsyncWorker none none none none
Realtime\Async\AsyncWorker none proven none proven none AsyncEventQueue, RealtimeCatalogRebuilder none none
Realtime\RealtimeCatalogRebuilder AsyncWorker AsyncWorker none EventSubscriberRegistry, CatalogRankingEngine, CatalogIntelligenceEngine none none

3. Measured surfaces

Static counts

Metric Count
class_exists(...) in audited legacy files 0
interface_exists(...) in audited legacy files 0
Reflection calls 0
serialize(...) / __serialize / unserialize(...) / __unserialize 1
event::class / ::class event-type uses relevant to flow 2
direct new ... calls 1
static calls 0

Proven serialization surfaces

Only one:

  • src/Application/M17/EventBridge/EventBridge.php
  • persists event::class
  • persists get_object_vars($event) payload arrays

Reflection surfaces

No reflection call exists inside the audited legacy production classes.

The reflection sensitivity is indirect only:

  • wrappers and contracts may matter to external reflection if a later BC migrates them;
  • current sensitivity is documentary/test compatibility, not runtime behavior.

4. Real graph

Proven graph

EventDispatcher
  -> EventBus

EventBridge
  -> PersistentEventStore
  -> EventBus

M12 EventBus
  -> EventPlatform EventBus   (extends)

M12 PlatformKernel
  -> EventPlatform PlatformKernel   (extends)

ProjectionCatalogWiring
  -> ProjectionEngine   (new)

AsyncWorker
  -> AsyncEventQueue
  -> RealtimeCatalogRebuilder

RealtimeCatalogRebuilder
  -> EventSubscriberRegistry
  -> CatalogRankingEngine
  -> CatalogIntelligenceEngine

Theoretical but not proven graph

The requested target chain:

Event
↓
EventBridge
↓
EventBus
↓
ProjectionEngine
↓
Realtime

is not fully proven by active consumers.

What is missing as a proven runtime edge:

  • EventBus -> ProjectionEngine
  • ProjectionEngine -> Realtime

Those links exist only as architectural intent or isolated shells, not as a proven active runtime path.

5. Cycles and quasi-cycles

Hard cycles

None proven.

Quasi-cycles

  1. RealtimeCatalogRebuilder -> EventSubscriberRegistry -> closures -> RealtimeCatalogRebuilder::handleProductEvent()
  2. not a code-level cycle through class dependencies;
  3. but a callback-based feedback shape exists.

  4. ProjectionCatalogWiring -> ProjectionEngine -> dispatch(eventName) and RealtimeCatalogRebuilder -> EventSubscriberRegistry

  5. two parallel event-routing shells;
  6. same conceptual space, but no proven direct coupling.

6. Active / dead / critical

Active components

These still have at least one proven incoming or outgoing dependency in the audited slice:

  • EventPlatform\Bus\EventBus
  • EventPlatform\Kernel\PlatformKernel
  • M12\EventBus\EventBus
  • Projection\EventSubscriberRegistry
  • Realtime\RealtimeCatalogRebuilder

Components with no proven active incoming consumer

These are not removed in BC-065A, but they currently look unreachable from proven active consumers:

  • EventPlatform\Bus\EventDispatcher
  • EventPlatform\Contracts\Event
  • EventPlatform\Contracts\EventHandler
  • M12\Wiring\PlatformKernel
  • M17\EventBridge\EventBridge
  • Projection\ProjectionCatalogWiring
  • Projection\ProjectionEngine
  • Realtime\Async\AsyncWorker
  • Realtime\Async\AsyncEventQueue

This is an audit finding only, not a deletion authorization.

Critical components

  • M17\EventBridge\EventBridge
  • because it is the only serialization-sensitive surface
  • Projection\EventSubscriberRegistry
  • because it is the only proven bridge from legacy projection to legacy realtime
  • Realtime\RealtimeCatalogRebuilder
  • because it is the top orchestration point in the proven realtime subgraph

7. Composer / bootstrap / plugin / runtime

Confirmed:

  • composer.json autoload remains:
  • CMonChoix\Platform\ => src/
  • autoload.files = ['src/Support/LegacyProductNamespaceCompat.php']
  • no class_alias() exists for the audited EventPlatform / Realtime slice
  • no legacy require_once bootstrap exists for this slice
  • no plugin file imports this slice
  • no runtime mirror file imports this slice
  • no runtime sync is required

8. Boundary recap

Rechecked during BC-065A:

  • Infrastructure -> Application : no hit
  • Contracts -> Projection : no hit
  • Projection -> Application : no hit in src/Projection
  • ReadService -> Adapter : no hit
  • plugin -> legacy Application (audited families) : no hit

BC-065B — EventBridge

Focus:

  • persistence semantics
  • event::class
  • payload shape
  • replay / queue / storage sensitivity

BC-065C — EventPlatform

Focus:

  • EventBus / EventDispatcher / PlatformKernel
  • legacy contracts
  • M12 wrapper retirement strategy

BC-065C is now completed with a minimal compatibility fix:

  • EventPlatform\Bus\EventBus and EventPlatform\Kernel\PlatformKernel are retained as the active legacy-canonical types for this slice;
  • M12\EventBus\EventBus and M12\Wiring\PlatformKernel are retained as thin wrappers only;
  • the only production fix was to restore wrapper-safe inheritance by removing the incompatible final declarations on the two EventPlatform classes;
  • no dispatch behavior, handler ordering, payload, EventBridge format, plugin file or runtime file changed.

BC-065D — Projection

Focus:

  • ProjectionCatalogWiring
  • ProjectionEngine
  • EventSubscriberRegistry
  • overlap vs canonical projection pipeline

BC-065D is now completed with only mechanical orchestration fixes:

  • EventSubscriberRegistry now accepts canonical Platform\Domain\Shared\DomainEvent instances;
  • ProjectionCatalogWiring now depends on the canonical Platform\Application\Projection\CatalogProjectionWriter;
  • AsyncWorker now forwards canonical domain events into the realtime rebuilder instead of only calling boot();
  • RealtimeCatalogRebuilder boot is idempotent and accepts canonical product id extraction through aggregateId.

BC-065E — Realtime

Focus:

  • AsyncEventQueue
  • AsyncWorker
  • RealtimeCatalogRebuilder
  • registry callback flow
  • relationship with catalog ranking/intelligence

BC-065E is now completed as the final certification tranche:

  • no new P0/P1 defect was proven in the BC-065 scope;
  • EventBridge remains the only serialization-sensitive surface;
  • EventPlatform / M12 / Projection / Realtime are now explicitly certified as retained legacy orchestration or compatibility debt only;
  • the remaining debt is P2 only and BC-065 can close.

10. Decision

BC-065A is closable and BC-065 is now closed.

No functional change was performed.