Beacon/MILESTONES.md

2.1 KiB

Beacon Milestones

Phase 3: Planning

  1. Project Infrastructure & Core Dispatcher

    • Initialize composer.json with getphred/beacon-contracts and PHP 8.2 requirements.
    • Configure PHPUnit and test structure.
    • Implement EventDispatcher (PSR-14 compliant).
    • Implement basic ListenerProvider.
    • Implement CanStopPropagation trait for stoppable events.
    • Test Coverage: Unit tests for core dispatching and stoppable behavior.
  2. Advanced Listener Resolution

    • Implement Priority-based listener sorting.
    • Implement Inheritance Resolution (Event class, Parents, Interfaces).
    • Implement Performance Toggle for Interface scanning.
    • Implement Wildcard pattern support (*) and internal regex caching.
    • Test Coverage: Unit tests for sorting, wildcards, and inheritance edge cases.
  3. Middleware Pipeline (The Onion)

    • Implement MiddlewarePipeline runner.
    • Integrate Middleware with EventDispatcher.
    • Implement basic Telemetry (timing/memory) within the pipeline.
    • Test Coverage: Integration tests for middleware execution order and telemetry accuracy.
  4. Discovery & Registration

    • Implement #[AsEventListener] and #[AsSubscriber] attribute support.
    • Implement ListenerDiscovery service for scanning directories.
    • Integrate PSR-16 cache for discovery results.
    • Implement PSR-11 container integration for lazy loading.
    • Test Coverage: Integration tests for scanning, attribute resolution, and cache persistence.
  5. Resiliency & Advanced State

    • Implement FAIL_FAST and CONTINUE resiliency modes.
    • Implement DispatchFailed internal event for CONTINUE mode.
    • Implement EventEnvelope for carrying immutable context.
    • Test Coverage: Unit tests for error handling and context mapping.
  6. Testing Helpers & Verification

    • Implement EventCollector for assertions.
    • Create EventAssertions trait for PHPUnit.
    • Final Verification: Run full suite; zero failures, zero deprecations.