## Summary - productize the Restore Run detail surface around post-execution proof, evidence availability, and decision-first outcome framing - add a dedicated restore run detail presenter and update the resource/detail rendering for clearer result and diagnostics states - add Spec 335 feature, unit, and browser coverage plus screenshot artifacts ## Testing - Not run as part of this commit/PR task Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #404
7.0 KiB
7.0 KiB
Tasks: Spec 335 - Restore Run Detail / Post-Execution Proof Productization
Input:
specs/335-restore-run-detail-post-execution-proof-productization/spec.mdspecs/335-restore-run-detail-post-execution-proof-productization/plan.mdspecs/335-restore-run-detail-post-execution-proof-productization/repo-truth-map.mdspecs/335-restore-run-detail-post-execution-proof-productization/restore-result-state-contract.md
Tests: Required. This spec changes an operator-facing dangerous-workflow detail surface and must prove decision-first truth boundaries.
Test Governance Checklist
- Lane assignment is named and is the narrowest sufficient proof for the changed behavior.
- New or changed tests stay in the smallest honest family, and browser additions are explicit.
- Shared helpers, factories, seeds, fixtures, and context defaults stay cheap by default.
- Planned validation commands cover the change without pulling in unrelated lane cost.
- The dangerous-workflow proof/evidence surface profile is explicit.
- Any material budget, baseline, trend, or escalation note is recorded in the active spec or PR.
Phase 1: Repo Truth (blocks runtime changes)
Purpose: Freeze repo truth for RestoreRun results/proof/evidence before changing UI.
- T001 Re-read
spec.md,plan.md, and thistasks.md. - T002 Verify current Restore Run view implementation and state sources:
apps/platform/app/Filament/Resources/RestoreRunResource.php(infolist +detailResultsState)apps/platform/resources/views/filament/infolists/entries/restore-results.blade.phpapps/platform/app/Support/RestoreSafety/RestoreSafetyResolver.php(resultAttentionForRun)
- T003 Update/confirm
repo-truth-map.mdis accurate for:RestoreRunmodel fields +RestoreRunStatusvalues- results shape (
results.foundations,results.items) and summary counts (metadata.total/succeeded/failed/skipped/partial/non_applied) operation_run_idrelationship + current OperationRun outcome/status behavior- Evidence snapshot availability (query path, status/completeness enums)
- T004 Update/confirm
restore-result-state-contract.mdis aligned to repo truth (no invented evidence/proof states).
Phase 2: Restore Run Detail Presenter (derived view-model, optional)
Purpose: Ensure one decision-first UI contract drives the view surface.
- T005 Decide whether a presenter/view-model is needed. If the view becomes a multi-section surface (decision card + proof panel + evidence state + table), prefer a presenter to avoid page-local logic drift.
- T006 If introduced, implement a thin derived presenter that outputs:
status_label,reason,impact,primary_next_actionoperation_proofstate + URL (tenant/workspace-safe, capability-gated)post_run_evidencestate + URL (repo-backed only)result_summarycounts (repo-backed only)diagnostics_state = collapsed
- T007 Prove presenter output determinism with Unit tests (no static memoization).
Phase 3: Detail Page UI (decision-first main/aside)
Purpose: Productize the page layout and hierarchy.
- T008 Refactor Restore Run view page into a main/aside hierarchy:
- Main: decision card + result summary + item outcomes (table) + secondary run details
- Aside: proof panel (source backup, target env, requested by, operation proof, post-run evidence, audit trail) + diagnostics collapsed
- T009 Ensure diagnostics and raw payloads remain collapsed/secondary by default (no stack traces, no raw JSON as primary UI).
- T010 Ensure the page does not display "recovery verified", "healthy", "compliant", or "customer-safe" claims unless repo truth supports that semantics.
Phase 4: Proof/Evidence Links (repo-backed only)
Purpose: Make execution proof and post-run evidence explicit, separate, and truthful.
- T011 Operation proof:
- restore run with
operation_run_idshows proof state + link to OperationRun detail - restore run without operation run shows "unavailable" state
- restore run with
- T012 Post-run evidence:
- when evidence snapshots exist for the linked operation run (tenant-scoped), show state + link to Evidence Snapshot detail
- when absent, show "unavailable" and do not imply recovery proof
Phase 5: Item Outcomes (table-first, no payload dump)
Purpose: Make per-item outcomes reviewable without flooding the page.
- T013 Render item outcomes as a table (not large cards) when
results.itemsexists. - T014 Show compact summary counts from
restore_runs.metadata(only when repo-backed; no fake zeros). - T015 Keep raw per-item payload/diff/diagnostics behind disclosure.
Phase 6: RBAC / Isolation
- T016 Add at least one positive and one negative authorization test for Restore Run view access.
- T017 Prove cross-workspace/tenant proof and evidence links cannot leak (deny-as-not-found semantics preserved).
Phase 7: Tests
- T018 Add Feature test:
apps/platform/tests/Feature/Filament/Spec335RestoreRunDetailProductizationTest.phpcovering:- decision question visible
- "Completed" does not imply recovery verified
- operation proof state visible
- post-run evidence state visible and truthful
- diagnostics collapsed; raw payload hidden by default
- T019 Extend or align with existing coverage:
apps/platform/tests/Feature/Filament/RestoreResultAttentionSurfaceTest.php
- T020 Add Browser smoke/screenshot test:
apps/platform/tests/Browser/Spec335RestoreRunDetailProductizationSmokeTest.php.
Phase 8: Screenshots
- T021 Capture required screenshots under:
specs/335-restore-run-detail-post-execution-proof-productization/artifacts/screenshots/
- T022 Capture at least:
01-restore-run-draft.png02-restore-run-completed-proof-incomplete.png03-restore-run-operation-proof.png04-restore-run-evidence-unavailable.png05-restore-run-item-outcomes.png06-restore-run-failed-if-supported.png07-restore-run-diagnostics-collapsed.png08-restore-run-dark-mode.png
If a state is not reachable via fixtures, document why in the Spec 335 notes (do not fake coverage).
Phase 9: Validation
- T023 Run:
cd apps/platform && ./vendor/bin/sail artisan test tests/Feature/Filament/Spec335RestoreRunDetailProductizationTest.php tests/Feature/Filament/RestoreResultAttentionSurfaceTest.php --compactcd apps/platform && ./vendor/bin/sail php vendor/bin/pest tests/Browser/Spec335RestoreRunDetailProductizationSmokeTest.php --compactcd apps/platform && ./vendor/bin/sail pint --dirtygit diff --check
Explicit Non-Goals
- NT001 Do not change restore execution backend behavior.
- NT002 Do not add new Graph calls or ProviderGateway behavior.
- NT003 Do not change
OperationRunlifecycle semantics (link-only). - NT004 Do not add migrations, packages, env vars, queues, scheduler, or storage changes.
- NT005 Do not redesign Restore Create wizard (Spec 333 owns Create UX).
- NT006 Do not introduce any false recovery-proof claims.