## 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
3.3 KiB
3.3 KiB
Data Model — Operations Auto-Refresh Pass
Overview
This feature does not add new tables or columns. It reuses existing persisted state to decide whether two UI surfaces should continue polling.
Entities
OperationRun
- Purpose: Canonical record for queued, running, and completed operational work shown in Monitoring → Operations.
- Relevant fields:
idworkspace_idtenant_id(nullable for tenantless/canonical monitoring)typestatusoutcomecontextsummary_countsfailure_summarycreated_atstarted_atcompleted_at
- Relationships:
- Belongs to
Workspace - Belongs to
Tenant(optional) - Belongs to initiating
User(optional)
- Belongs to
- Polling rule:
- Poll while UX-normalized status is
queuedorrunning - Stop polling for normalized terminal states such as
succeeded,partial, orfailed
- Poll while UX-normalized status is
- Derived constraints:
- Polling on run-detail surfaces must continue to respect hidden-tab and mounted-action guards
- No direct lifecycle mutation is added;
OperationRunServiceremains the only lifecycle transition owner
ReviewPack
- Purpose: Persisted output of tenant review pack generation for a tenant-scoped admin surface.
- Relevant fields:
idworkspace_idtenant_idoperation_run_idinitiated_by_user_idstatusoptionssummarygenerated_atexpires_atfile_pathfile_diskfile_sizecreated_atupdated_at
- Relationships:
- Belongs to
Workspace - Belongs to
Tenant - Belongs to
OperationRun - Belongs to initiating
User
- Belongs to
- Polling rule:
- Poll while
statusisqueuedorgenerating - Stop polling when
statusisready,failed, orexpired - Do not poll when no review pack exists for the tenant
- Poll while
Derived View State
Run detail polling state
- Source:
OperationRun+RunDetailPolling::interval() - Output:
1s,5s,10s, ornull - Rules:
nullwhen the run is terminalnullwhen the tab is hiddennullwhen Filament action modals are mounted
Review pack card polling state
- Source: latest
ReviewPackfor the current tenant - Output:
10sornull - Rules:
10swhen the latest pack isqueuedorgeneratingnullotherwise
State Transitions
OperationRun lifecycle relevant to polling
queued→ active polling enabledrunning→ active polling enabledcompleted+ terminal outcome (succeeded,failed,partially_succeeded) → polling disabled- Any unrecognized or missing status normalization → treated as non-active for polling decisions
ReviewPack lifecycle relevant to polling
queued→ polling enabledgenerating→ polling enabledready→ polling disabledfailed→ polling disabledexpired→ polling disabled
Validation Rules
- Polling must never start for unauthorized users; existing page and widget access checks remain authoritative.
- Polling must stop automatically once terminal state is reached.
- Polling decisions must be derived from persisted state only; no external API call is required during render.
- Terminal-state rendering must remain stable and must not trigger repeated refresh loops.