Repository navigation
Description
Phase: 4 | Priority: P0
Install, activate and update apps independently while making interruptions and data compatibility explicit.
Scope
-
Persist install/update states and operate supervised process groups with bounded readiness/drain/shutdown.
-
Prepare candidates without productive jobs/external effects; use explicit app-scoped migration operations.
-
Fence old runtime writes, DB sessions and workers before promoting one active generation.
-
Implement compatible rollback, recovery-required states, dependency-aware removal and separate explicit data purge.
-
Use local verified packages, local grants and the durable lifecycle journal at startup/cutover/recovery. Marketplace accounts, ratings, statistics and reporting acknowledgements are outside that critical path.
Dependencies
These are implementation prerequisites; app-to-app delivery gates do not create runtime dependencies.
Acceptance criteria
- A candidate can stage while the active app runs, but only one generation can write or execute productive jobs.
- App readiness/protocol/data mismatch cannot promote a candidate or restart the entire platform.
- Process failure and interruption before/after every state transition are recoverable from the durable operation journal.
- Migration failures preserve a safe prior state or report recovery-required; arbitrary privileged install/uninstall scripts are not executed.
- Rollback occurs automatically only when old code can safely read/write current data; incompatible or post-cutover writes are never silently discarded.
- Removal respects certificate/pool/security dependencies; app failure still allows base platform administration and recovery.
- Stopping Marketplace services during install/update completion, app startup, drain/activation or local recovery does not block or undo the local operation; installation reporting is a separate background concern.
Planning baseline: Beta 4.
This issue schedules future work; backlog creation does not implement or deploy it.
Use focused project checks and short integration/recovery tests. Endurance runs belong to release preparation. Normal PRs need no additional documentation files or screenshot commits unless requested.
Activity
test(apps): recover interrupted lifecycle transitions (#587)
RentnerKev commentedon Nov 26, 2026
The acceptance criteria are covered by merged changes and tests. The remaining gaps are listed below the table.
Where the tests run: ARR is the App Runtime Reference workflow, jobs "Native app runtime reference (amd64)" and "(arm64)". Rust is the CI job "Rust". Its step "Run privileged IPC fixtures with coverage" runs the root, PostgreSQL and published Greeting fixtures. Web Tests is the CI job "Web Tests".
staging_services_status_and_publishes_candidate_while_retirement_is_busy. The lifecycle authority inprivileged_signed_lifecycleasserts at registration and at worker stop that no other generation is live (Rust, ARR).privileged_postgres_uid_fencingwithdraws the old database login and kills its sessions. Alsodrain_retires_authority_while_a_writer_is_stopping_and_waits_for_workers, and "runtime authority persists and fences app generations, delegation, secrets and replay" (Web Tests). Inprivileged_published_greeting_distribution_gatesstep 7 (ARR), calls from the replaced generation get 412.privileged_signed_lifecycle(Rust, ARR), a candidate that fails readiness restarts the previous release. #587 adds two cases incheck_interrupted_transitions. A candidate that reports protocol9.9.9times out, and the previous release restarts. A candidate declaring data the installation cannot open is refused before the fence, and a UI rollback to it fails withincompatibleData; the running app's PID stays the same. #574: "a stopped app manager leaves the proxy and administration running, another owned child does not" (Web Tests).interrupted_generation_and_uid_reservations_survive_single_owner_reopen, interrupted first install and claim, and a missing archive or data directory at boot inprivileged_signed_lifecycle. The retirement tests cover shutdown and fencing. #587 boots from more interrupted journal states. An update interrupted after it reserved the next generation fences that generation and restarts the old release. Uncertain grants restart it with an empty grant set. An unconfirmed removal staysremovinguntilstartcancels it. A pending removal and a pending purge both finish at boot. In #586, a committed migration followed by a failed start ends inrecoveryRequired, andrecoverfinishes the migrated release without migrating again. Gaps are listed below.privileged_app_data_migrations(Rust, and ARR step "Verify app database provisioning and data migrations"). A failing step rolls back atomically. The test also coversRESET ROLEescalation, symlinked steps,\!shell escapes,COMMITinjection, a timeout and a cancelled migration. Alsosteps_stay_plain_sql_inside_the_runner_transaction. #586,privileged_published_greeting_data_migrations(Rust, ARR): a failing 1.2.0 migration restarts 1.1.0 with the data version and rows unchanged. A committed 1.4.0 migration followed by a failed start reportsrecoveryRequiredand keeps the data. There is no install or uninstall hook mechanism. The only package code that runs isbin/appand plain SQL steps, both under the app UID (privileged_generation_launches_restricted_child_and_revokes_listener).privileged_signed_lifecycle). A rollback keeps data written after the cutover (privileged_published_greeting_lifecycle, ARR). #586: rolling back from 1.3.0 to 1.1.0 is refused withincompatibleData, and the generation and data stay unchanged. After the committed 1.4.0 migration and the failed start, 1.3.0 is not restarted on version-3 data. #587 adds the refused data-incompatible candidate.privileged_signed_lifecycle. Removal:dependency_block_and_separate_purge_keep_the_uid_reserved, and "app removal returns uncommitted domains to platform and keeps committed ownership" (Web Tests). In #587, "removal and data purge wait while the app owns a proxy host" (Web Tests) and an interrupted removal stays recoverable. #585 reports these refusals asdependencyBlocked(dependency_refusals_are_reported_apart_from_conflicts). Certificate and pool checks are open (see below).privileged_published_greeting_distribution_gates(#569, ARR) keeps the Marketplace and GitHub API hosts blocked through install, update and an offline restart, with zero connection attempts. With the catalog server stopped,privileged_signed_lifecycleboots, rolls back, recovers, falls back after a failed activation, uninstalls and purges.privileged_published_greeting_lifecyclerolls back and restarts offline, and #584 uninstalls and purges the published Greeting offline.offline_management_coalesces_retries_and_serializes_with_catalog_install(Rust). A launch only uses recorded packages throughrecover.Gaps and follow-ups
database_provisioned, before the migration starts, has no dedicated test. The flag is saved beforeruntime::provisionruns, but recovery does not trust it:migration::recorded_versionreads the real database and its version marker, so a missing database or a missing marker plans the activation like a first install. The interruption tests boot from journal states written while the manager was stopped, or use failed activations. No test kills the manager at each journal save.provider_dependencies_unknownmarker also belongs to the remaining feat(apps): add provider registration and validated engine contributions #454 work. It blocks removal of every provider app until someone clears it by hand.Closing as completed.