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.