## Summary - align the Baseline Compare landing page with the shared Product Process Flow contract introduced by Spec 332 - add the horizontal flow rendering primitive and update the landing view/state presentation for readiness, proof, evidence, and next action - add Spec 336 artifacts, screenshots, focused feature coverage, and browser smoke coverage for the aligned states ## Testing - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/BaselineCompareEnvironmentRouteContractTest.php tests/Feature/Filament/Spec330EnvironmentDashboardBaselineCompareProductizationTest.php tests/Feature/Filament/Spec336BaselineCompareProductProcessFlowAlignmentTest.php tests/Browser/Spec330EnvironmentDashboardBaselineCompareSmokeTest.php tests/Browser/Spec336BaselineCompareProductProcessFlowAlignmentSmokeTest.php` ## Notes - Filament v5 / Livewire v4 stack remains unchanged - no panel provider registration changes; `bootstrap/providers.php` is unaffected - no global-search resource behavior changes - no new destructive actions and no asset registration/deployment changes Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #406
6.8 KiB
6.8 KiB
Implementation Plan: Spec 336 - Baseline Compare Product Process Flow Alignment
- Branch:
336-baseline-compare-product-process-flow-alignment - Date: 2026-05-29
- Spec:
specs/336-baseline-compare-product-process-flow-alignment/spec.md - Input: User-provided draft + repo inspection (
BaselineCompareLanding,BaselineCompareStats, Spec 332 flow pattern).
Summary
Align the existing Baseline Compare Landing page to the shared Product Process Flow contract introduced in Spec 332, across repo-backed states.
This is runtime UX alignment only:
- no backend compare engine rewrite
- no new persistence
- no new OperationRun semantics
- no new evidence generator backend
Baseline Compare must become decision-first and flow-driven for the full state family, not only the no-assignment state.
Technical Context
- Language/Version: PHP 8.4.15, Laravel 12.x.
- Primary Dependencies: Filament v5 + Livewire v4, Pest v4, Tailwind v4.
- Storage: PostgreSQL; no schema change expected.
- Testing: Pest Feature/Livewire render tests + 1 browser smoke file.
- Validation Lanes: confidence + browser.
- Target Platform: Sail locally; Dokploy/container posture unchanged.
- Project Type: Laravel monolith under
apps/platform. - Performance Goals: DB-only render; no provider/Graph calls during page render; no new query families beyond existing BaselineCompareStats sources.
- Constraints: No migrations, packages, env vars, queue/scheduler/storage changes, route family changes, or legacy query alias reintroduction.
UI / Surface Guardrail Plan
- Guardrail scope: changed existing operator-facing strategic surface.
- Affected route/page/view:
/admin/workspaces/{workspace}/environments/{environment}/baseline-compareapps/platform/app/Filament/Pages/BaselineCompareLanding.phpapps/platform/resources/views/filament/pages/baseline-compare-landing.blade.php
- Native vs custom: keep Filament-native primitives; reuse Spec 332 flow pattern; no new local design system.
- Decision hierarchy: decision card first, readiness flow always visible, proof/evidence panel next, diagnostics collapsed.
- One-primary-action rule: exactly one state-specific primary next action; no competing CTAs.
- Disclosure policy: raw/support/diagnostics remain collapsed and capability-aware; no raw diff by default.
- Coverage artifacts: no change to
docs/ui-ux-enterprise-audit/*expected (route/archetype unchanged); proof is Spec 336 tests + screenshots.
Shared Pattern & System Fit
- Cross-cutting marker: yes (Product Process Flow consumer alignment; OperationRun proof links; decision-first vocabulary).
- Shared systems reused:
- Spec 332 Product Process Flow pattern (Restore consumer)
- Baseline compare truth:
BaselineCompareStats,BaselineSnapshotTruthResolver - Operation deep links:
OperationRunLinks,OperationUxPresenter,OpsUxBrowserEvents
- New abstraction: add a small presenter/view-model only if required to avoid scattering state mapping logic across Blade and the Page class. Avoid a new generic “workflow engine” layer.
- Bounded deviation: if a shared horizontal flow renderer is introduced, it must be justified by 2+ consumers and remain a small UI primitive (not a taxonomy/framework).
OperationRun UX Impact
- This spec must not change:
Compare nowconfirmation requirement (->requiresConfirmation()),- capability gating (
TENANT_SYNCviaUiEnforcement), - queued toast +
Open operationlink semantics (OperationUxPresenter,OperationRunLinks), - run identity/type (
OperationRunType::BaselineCompare).
- Changes are limited to how Baseline Compare surfaces proof/evidence state on the page.
Provider Boundary / Platform Core Check
N/A. No provider/platform seam is changed.
Current Repo Truth Summary (Implementation-Relevant)
- Page state derives from
BaselineCompareStats::forTenant():no_assignment,no_snapshot,invalid_scope,idle,comparing,failed,ready.
- Readiness flow currently renders only for
no_assignment(page-local array + Blade pipeline). - Compare start uses
BaselineCompareService::startCompare()and dispatchesCompareBaselineToTenantJob(OperationRun-backed). - Coverage/evidence gaps are derived from latest compare run context/diagnostics; “no drift” messaging must be caveated when gaps exist.
Implementation Approach
Phase 0 — Repo Truth Gate (No Runtime Edits)
- Finalize
repo-truth-map.mdandbaseline-compare-state-contract.mdfrom actual code sources. - Confirm which step states are repo-real (no “stale” unless a real signal exists).
Phase 1 — Flow State Presenter (Bounded)
- Introduce a small Baseline Compare presenter (or expand an existing one) that computes:
- decision card fields
- readiness flow steps across the full state family
- proof/input panel items (repo-backed only)
- drift summary + evidence/coverage state (separated from OperationRun proof)
- diagnostics disclosure state (collapsed default)
- Ensure presenter uses existing sources only (
BaselineCompareStats,BaselineSnapshotTruthResolver, latest inventory sync/coverage proof, OperationRun).
Phase 2 — UI Alignment
- Replace the page-local readiness pipeline markup with the shared Product Process Flow render primitive (or a bounded extraction consistent with Spec 332).
- Ensure readiness flow is visible across repo-backed states (not just
no_assignment). - Remove any duplicated lower status/summary blocks introduced by state-specific sections.
- Keep raw diagnostics and raw diff behind disclosure by default.
Phase 3 — Truthful Drift/Evidence Messaging
- Replace any broad “tenant matches baseline” claim with scoped wording:
- “no open drift findings for this baseline comparison”
- plus explicit caveat when coverage/evidence gaps exist.
- Ensure evidence path copy never implies customer-safe output unless an actual evidence/report artifact exists and is linked.
Phase 4 — Tests
- Add
apps/platform/tests/Feature/Filament/Spec336BaselineCompareProductProcessFlowAlignmentTest.phpcovering the core state family. - Update existing Baseline Compare tests (e.g., Spec 330 file) only where necessary, keeping equivalent or stronger assertions.
Phase 5 — Browser Smoke + Screenshots
- Add
apps/platform/tests/Browser/Spec336BaselineCompareProductProcessFlowAlignmentSmokeTest.phpcovering:- no baseline, snapshot required, compare required, compare in progress, compare ready, evidence gaps, diagnostics collapsed, dark mode (if practical).
- Capture the required screenshots under
specs/336-baseline-compare-product-process-flow-alignment/artifacts/screenshots/.
Phase 6 — Hygiene + Validation
- Run the spec’s minimal validation commands (Feature + Browser + filter run).
- Run
./vendor/bin/sail pint --dirtyandgit diff --check.