TenantAtlas/specs/123-operations-auto-refresh/quickstart.md
ahmido 4db73e872e Spec 123: operations auto-refresh pass (#149)
## Summary
- add conditional polling support for the tenantless operation run viewer and tenant review pack card
- add focused Pest coverage for active vs terminal polling behavior and related review pack access regressions
- add the full Spec Kit artifacts for Spec 123, including spec, plan, research, data model, contracts, quickstart, tasks, and checklist

## Testing
- `vendor/bin/sail artisan test --compact tests/Feature/OpsUx/RunDetailPollingStopsOnTerminalTest.php tests/Feature/Operations/TenantlessOperationRunViewerTest.php tests/Feature/ReviewPack/ReviewPackWidgetTest.php tests/Feature/ReviewPack/ReviewPackGenerationTest.php tests/Feature/ReviewPack/ReviewPackRbacTest.php`
- `vendor/bin/sail bin pint --dirty --format agent`

## Notes
- Manual QA task `T014` in the Spec Kit checklist remains to be completed outside this automated flow.
- Livewire v4.0+ compliance is unchanged.
- No panel provider changes were made; provider registration remains in `bootstrap/providers.php`.
- No global-search behavior was changed.
- No destructive actions were added or modified.
- No new Filament assets were introduced; existing deployment expectations for `php artisan filament:assets` remain unchanged.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #149
2026-03-08 11:11:26 +00:00

46 lines
2.4 KiB
Markdown

# Quickstart — Operations Auto-Refresh Pass
## Goal
Implement conditional auto-refresh for the tenantless operation run viewer and the tenant review pack card so active work updates without manual refresh and terminal states remain stable.
## Prerequisites
- Laravel Sail services are running.
- A queue worker is available so active states can advance during manual QA.
- Seed or factory data exists for one active and one terminal example of each surface.
## Implementation Steps
1. Reuse the canonical run-detail polling behavior for `TenantlessOperationRunViewer` rather than introducing a second run-detail polling policy.
2. Add review-pack-card polling that emits a `10s` interval only when the latest tenant review pack is `queued` or `generating`.
3. Keep terminal review-pack states (`ready`, `failed`, `expired`) and empty-state rendering non-polling.
4. Add or update Pest coverage for active-versus-terminal polling behavior on both surfaces.
## Automated Verification
Run the smallest relevant test set through Sail:
- `vendor/bin/sail artisan test --compact tests/Feature/OpsUx/RunDetailPollingStopsOnTerminalTest.php`
- `vendor/bin/sail artisan test --compact tests/Feature/Operations/TenantlessOperationRunViewerTest.php`
- `vendor/bin/sail artisan test --compact tests/Feature/ReviewPack/ReviewPackWidgetTest.php`
Then format touched files:
- `vendor/bin/sail bin pint --dirty --format agent`
## Manual QA
### Tenantless operation run viewer
1. Open a queued or running operation at `/admin/operations/{run}`.
2. Keep the page open and confirm the run detail refreshes while the run remains active.
3. Let the run finish and confirm the page settles into a stable terminal state without further refresh behavior.
4. Open an already-completed run and confirm it loads without active polling.
### Tenant review pack card
1. Open the tenant-scoped page that renders `TenantReviewPackCard`.
2. Trigger review-pack generation and confirm the card shows in-progress state without manual refresh.
3. Wait for the pack to finish and confirm the card settles into `Ready` or `Failed` without continuing to poll.
4. Re-open a terminal review pack state and confirm no polling markup is present.
## Rollback
- Remove the new polling condition from the review pack card.
- Revert any tenantless viewer changes so it falls back to the previous non-refreshing behavior.
- Re-run the targeted Pest files to confirm the rollback is clean.