# Scanner Platform Events (Redis Streams) ## Module Platform ## Status VERIFIED ## Description Scanner WebService events are ingested by Platform Analytics from the configured stream. The ingestion path now supports `scanner.event.report.ready` and `scanner.scan.completed`, handles scanner DSSE payload decoding for report-ready content, and resumes from persisted stream checkpoints after restart. ## Implementation Details - **AnalyticsIngestionService**: `src/Platform/StellaOps.Platform.Analytics/Services/AnalyticsIngestionService.cs` -- subscribes to scanner stream; supports both `OrchestratorEventKinds.ScannerReportReady` and `OrchestratorEventKinds.ScannerScanCompleted`; resolves report payloads from direct JSON, wrapped `reportReady`, and DSSE envelopes; persists and restores scanner stream checkpoints. - **ScannerOrchestratorEvents**: `src/Platform/StellaOps.Platform.Analytics/Models/ScannerOrchestratorEvents.cs` -- scanner event models, including `ScanCompletedEventPayload` and scanner event-kind constants. - **AnalyticsIngestionOptions**: `src/Platform/StellaOps.Platform.Analytics/Options/AnalyticsIngestionOptions.cs` -- stream settings include `ResumeFromCheckpoint` and optional `ScannerCheckpointFilePath`. - **IEventStream/IEventStreamFactory**: `src/Router/__Libraries/StellaOps.Messaging/Abstractions/IEventStream.cs` -- stream subscription with `StreamPosition.After(entryId)` checkpoint resume support. - **Tests**: `src/Platform/__Tests/StellaOps.Platform.Analytics.Tests/ScannerPlatformEventsBehaviorTests.cs`. - **Source**: 2025-10-19-scanner-policy.md ## E2E Test Plan - [ ] Verify scanner report-ready events (`scanner.event.report.ready`) are consumed and processed by analytics ingestion. - [ ] Verify scanner scan-completed events (`scanner.scan.completed`) are accepted and mapped into report-ready ingestion payloads. - [ ] Verify DSSE envelope payloads are decoded and parsed into report-ready scanner payloads. - [ ] Verify scanner stream checkpoint normalization and subscription position resolution for restart resume. - [ ] Verify tenant filtering skips events from non-allowed tenants. ## Verification - Verified on 2026-02-11 with `run-003`. - Tier 0 source checks passed with scanner event-kind, DSSE parser, and checkpoint resume declarations present. - Tier 1 build + tests passed (`185/185`) with code-review parity confirming previously missing scanner-event claims are implemented. - Tier 2 behavioral/e2e checks passed (`38/38`) across scanner event behavior tests, Docker-backed analytics schema integration, and tenant normalization checks. - Evidence: - `docs/qa/feature-checks/runs/platform/scanner-platform-events/run-003/tier0-source-check.json` - `docs/qa/feature-checks/runs/platform/scanner-platform-events/run-003/tier1-build-check.json` - `docs/qa/feature-checks/runs/platform/scanner-platform-events/run-003/tier2-integration-check.json` - `docs/qa/feature-checks/runs/platform/scanner-platform-events/run-003/retest-result.json`