TenantAtlas/specs/336-baseline-compare-product-process-flow-alignment/tasks.md
ahmido 4c661f18f0 feat: align baseline compare product process flow (#406)
## 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
2026-05-29 22:22:53 +00:00

6.3 KiB

Tasks: Spec 336 - Baseline Compare Product Process Flow Alignment

  • Input: specs/336-baseline-compare-product-process-flow-alignment/spec.md, specs/336-baseline-compare-product-process-flow-alignment/plan.md
  • Prerequisites: spec.md, plan.md, repo-truth-map.md, baseline-compare-state-contract.md

Tests: Required. This changes a strategic operator surface and must be validated with Feature tests plus a Browser smoke file.

Test Governance Checklist

  • Lane assignment is explicit and is the narrowest sufficient proof (Feature + Browser).
  • Browser coverage stays single-file and scenario-scoped (no silent heavy-family expansion).
  • No new default-heavy helpers/factories/seeds are introduced; reuse existing fixture helpers.
  • Validation commands are minimal and directly prove the changed contract.
  • Any deviation resolves as document-in-feature, follow-up-spec, or reject-or-split.

Phase 1: Preparation And Repo Truth

Purpose: Confirm repo truth and lock the state contract before runtime edits.

  • T001 Re-read spec.md, plan.md, and this tasks.md.
  • T002 Confirm working tree intent and record baseline commit (git status, git log -1).
  • T003 Re-verify repo truth sources and step semantics:
    • apps/platform/app/Filament/Pages/BaselineCompareLanding.php
    • apps/platform/resources/views/filament/pages/baseline-compare-landing.blade.php
    • apps/platform/app/Support/Baselines/BaselineCompareStats.php
    • apps/platform/app/Services/Baselines/BaselineSnapshotTruthResolver.php
    • apps/platform/app/Services/Baselines/BaselineCompareService.php
    • apps/platform/app/Jobs/CompareBaselineToTenantJob.php
  • T004 Finalize/update repo-truth-map.md and baseline-compare-state-contract.md if runtime sources differ from the prepared truth map.
  • T005 Confirm Spec 332 Product Process Flow rendering conventions and decide the reuse strategy:
    • reuse existing shared flow render primitive if present
    • otherwise introduce the narrowest shared primitive only if justified by 2+ consumers (Restore + Baseline Compare)

Phase 2: State Presenter / Flow Model

Purpose: Centralize “what is complete/missing/blocked/available” mapping in one place to avoid Blade drift.

  • T006 Implement a small Baseline Compare presenter/view-model (or expand an existing one) that computes:
    • decision card (Status/Reason/Impact/Primary next action)
    • readiness flow steps across repo-backed states
    • available inputs/proof items (repo-backed only)
    • drift summary and evidence/coverage state (separated from OperationRun proof)
    • diagnostics disclosure state (collapsed default)
  • T007 Ensure presenter uses existing truth only (no new persistence, no new enum family, no new compare logic).
  • T008 Ensure primary next action is exactly one per state and is capability-aware (hide/disable per existing conventions).

Phase 3: UI Alignment (Baseline Compare Landing)

Purpose: Render the shared Product Process Flow contract consistently on the page.

  • T009 Replace the current page-local readiness pipeline (currently limited to no_assignment) with the shared Product Process Flow horizontal flow renderer.
  • T010 Ensure the readiness flow is visible across the full repo-backed state family (no_assignment, no_snapshot, invalid_scope, idle, comparing, failed, ready).
  • T011 Keep diagnostics collapsed by default; ensure raw diff/payload is not default-visible.
  • T012 Remove any duplicated visible status/summary blocks introduced by state-specific sections.
  • T013 Keep “Compare now” semantics unchanged: confirmation, capability gate, OperationRun start UX, queued toast + “Open operation” link.

Phase 4: Drift / Evidence / Copy Hardening

Purpose: Prevent false “all clear” outcomes and keep evidence claims truthful.

  • T014 Ensure “no drift” copy is scoped and caveated when coverage/evidence gaps exist (no “healthy/compliant/customer-safe” claim).
  • T015 Ensure evidence/coverage gap state is visible separately from OperationRun proof.
  • T016 Ensure state-specific copy aligns to the state contract and does not leak raw reason codes into primary UI.

Phase 5: Feature Tests (Pest)

  • T017 Add apps/platform/tests/Feature/Filament/Spec336BaselineCompareProductProcessFlowAlignmentTest.php covering:
    • no baseline assignment (decision card + readiness flow + primary action + diagnostics collapsed)
    • baseline assigned but snapshot missing/blocked
    • compare run required (idle) with Compare now enabled only when authorized
    • compare in progress (comparing)
    • compare failed (failed)
    • compare ready with findings + compare ready with zero findings (with truthful caveats)
    • evidence/coverage gap messaging + proof separation
    • workspace/environment isolation and unauthorized action hiding
  • T018 Update existing Baseline Compare tests (including Spec 330) only where necessary, keeping equivalent or stronger assertions.

Phase 6: Browser Smoke + Screenshots

  • T019 Add apps/platform/tests/Browser/Spec336BaselineCompareProductProcessFlowAlignmentSmokeTest.php covering the declared core states and disclosure guarantees.
  • T020 Capture screenshots into specs/336-baseline-compare-product-process-flow-alignment/artifacts/screenshots/:
    • 01-no-baseline-assigned.png
    • 02-baseline-snapshot-required.png
    • 03-compare-run-required.png
    • 04-compare-result-available.png
    • 05-evidence-unavailable.png
    • 06-diagnostics-collapsed.png
    • 07-dark-mode.png
  • T021 If a state is unreachable, document the repo-truth reason in implementation close-out (do not fake screenshots).

Phase 7: Validation

  • T022 Run narrow tests first:
    • cd apps/platform && ./vendor/bin/sail artisan test tests/Feature/Filament/Spec336BaselineCompareProductProcessFlowAlignmentTest.php --compact
    • cd apps/platform && ./vendor/bin/sail artisan test tests/Browser/Spec336BaselineCompareProductProcessFlowAlignmentSmokeTest.php --compact
  • T023 Run overlapping guard filters:
    • cd apps/platform && ./vendor/bin/sail artisan test --filter='BaselineCompare|ProductProcessFlow|EnvironmentOwned|Spec332|Spec330' --compact
  • T024 Run cd apps/platform && ./vendor/bin/sail pint --dirty and git diff --check.
  • T025 Report full-suite status honestly if not run.