TenantAtlas/specs/332-product-process-flow-system-v1/plan.md
ahmido 3bbea1bd00 feat: productize restore wizard preview safety gates and process flow (#399)
## Summary
- productize the restore wizard preview safety gates and process-flow guidance for Spec 332
- add the restore create presenter plus new process-flow, proof, scope, and safety partials
- extend restore wizard feature, smoke, screenshot, and presenter coverage
- include the Spec 332 artifacts for spec, plan, and tasks

## Notes
- branch head was already pushed before PR creation
- working tree was clean when this PR was opened

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #399
2026-05-26 00:08:25 +00:00

91 lines
4.4 KiB
Markdown

# Implementation Plan: Spec 332 - Product Process Flow System v1
- Branch: `332-product-process-flow-system-v1`
- Date: 2026-05-25
- Spec: `specs/332-product-process-flow-system-v1/spec.md`
## Reconciliation Note
Spec 332 was reconciled from the narrower `restore-run-preview-productization` path into the intended `product-process-flow-system-v1` scope. The previous path underrepresented the actual product/process-flow goal and caused restore safety state to drift too late into Preview.
## Summary
Implement a reusable Product Process Flow pattern and apply it first to Restore Run Create:
- Step 1 shows the full restore safety/product process flow, decision card, backup quality summary, restore proof aside, and collapsed diagnostics.
- Step 2 and later keep step-specific content primary while exposing compact restore safety status.
- Step 2 keeps dependency mapping in an explicit resolver mode with progress copy, shared guidance, and blocked progression until required mappings are resolved.
- The Step 2 dependency-mapping picker uses task-specific cache-empty guidance instead of a generic directory-cache table empty state.
- Preview stays decision-first.
- Confirm stays high-friction before execution.
## Affected Surfaces / Files
- Wizard logic:
- `apps/platform/app/Filament/Resources/RestoreRunResource.php`
- Restore safety copy:
- `apps/platform/app/Support/RestoreSafety/RestoreSafetyCopy.php`
- Product Process Flow views:
- `apps/platform/resources/views/filament/forms/components/restore-run-checks.blade.php`
- `apps/platform/resources/views/filament/forms/components/restore-run-preview.blade.php`
- shared/new restore-run process-flow partials as needed
- Group picker modal + component:
- `apps/platform/resources/views/filament/modals/entra-group-cache-picker.blade.php`
- `apps/platform/resources/views/livewire/entra-group-cache-picker-table.blade.php`
- `apps/platform/app/Livewire/EntraGroupCachePickerTable.php`
- Tests:
- `apps/platform/tests/Feature/Filament/RestoreRunPreviewProductizationTest.php`
- restore-run create wizard feature tests covering step 1 through confirm
- `apps/platform/tests/Browser/Spec332RestoreRunWizardProductProcessFlowSmokeTest.php`
## Technical Approach
1. **Spec reconciliation**
- Keep only `specs/332-product-process-flow-system-v1`.
- Update spec/plan/tasks so Product Process Flow is the primary scope and Restore Preview productization is one slice of that scope.
2. **Shared Product Process Flow state**
- Reuse existing `wizardSafetyState`, restore safety assessment, preview integrity, execution readiness, and backup quality summary helpers.
- Add or extract presentation helpers/partials so Step 1 full flow and Step 2+ compact status read from the same underlying state.
3. **Step 1 contract**
- Restore Safety decision card above the selector.
- Backup set selector and backup quality summary.
- Full vertical `Restore safety gates`.
- Restore Proof aside with diagnostics collapsed.
4. **Later-step contract**
- Keep step-specific content primary.
- Render compact Restore Safety Status plus proof context where useful.
- Productize Step 2 resolver mode around collapsed-by-default mapping details, progress copy, blocked progression, and cache-empty follow-up.
- Preserve gate enforcement with `afterValidation()` and `Halt`.
5. **Preview and confirm**
- Preview remains decision-first and truthfully reflects gate state.
- Confirm preserves high-friction confirmation without implying completed recovery proof.
6. **Tests**
- Feature tests for full Step 1, compact Step 2+, blocked validation, truthful preview copy, proof persistence, collapsed diagnostics, and no false recovery-proof claims.
- Browser smoke through Steps 1-4.
## Validation Commands
Narrow first:
- `cd apps/platform && ./vendor/bin/sail artisan test tests/Feature/Filament --filter=Spec332 --compact`
- `cd apps/platform && ./vendor/bin/sail artisan test tests/Feature/Filament/RestoreRun* --compact`
Browser smoke:
- `cd apps/platform && ./vendor/bin/sail php vendor/bin/pest tests/Browser/Spec332RestoreRunWizardProductProcessFlowSmokeTest.php --compact`
Formatting:
- `cd apps/platform && ./vendor/bin/sail pint --dirty`
- `git diff --check`
## Dependencies
- Existing restore safety / preview / backup quality resolvers remain the source of truth.
- Spec 334 (nested Filament/Livewire context hardening) must remain present so browser smoke can run without tenantless Livewire context failures.