2.3 KiB
2.3 KiB
Task State Machine
Task Types
scanexecute_cleanexecute_uninstallrestoreinspect_permissionshealth_snapshot
Main States
draftsubmittedvalidatingawaiting_permissionqueuedrunningcancellingcompletedpartial_failedfailedcancelledexpired
Terminal States
completedpartial_failedfailedcancelledexpired
Core Transition Rules
draft -> submittedsubmitted -> validatingvalidating -> awaiting_permission | queued | failedawaiting_permission -> queued | cancelled | failedqueued -> running | cancelledrunning -> cancelling | completed | partial_failed | failedcancelling -> cancelled
Action Item States
pendingrunningsucceededskippedfailedcancelled
Guarantees
- Terminal states are immutable.
- Progress must not move backwards.
- Destructive tasks must be audited.
- Recoverable tasks must leave structured recovery entries until restored or expired.
- Expired recovery entries must no longer remain actionable in active recovery state.
- Repeated write requests must honor idempotency rules when those flows become externally reentrant.
Current MVP Notes
scanemits monotonic progress and finishes with a preview-ready plan when the upstream scan adapter succeeds; otherwise the request should fail rather than silently fabricate findings.execute_cleanmust not report completion in release-facing flows unless real cleanup side effects have been applied. Fresh preview plans now carry structured execution targets, and unsupported or unstructured targets should fail closed.execute_uninstallremoves an app from the current workspace view and creates a recovery entry.restorecan physically restore items when structured recovery mappings are present, and can still rehydrate aFindingor an app payload into Atlas state from the recovery payload.restoremust reject expired recovery items before side effects and must fail closed when the original destination already exists.- When
restorerehydrates an app payload, theAppssurface should refresh inventory before presenting footprint counts or a new uninstall preview. - User-visible task summaries and settings-driven text should reflect the persisted app-language preference when generated.