Skip to content

feat: preview apps and built-in features before an image update - #571

Merged
RentnerKev merged 6 commits into
mainfrom
rentner/feat/upgrade-preview
Nov 25, 2026
Merged

RentnerKev merged 6 commits into
mainfrom
rentner/feat/upgrade-preview

Conversation

@RentnerKev

Copy link
Copy Markdown
Member

Part of #457 (Beta 4). Before an operator changes the image, the update dialog now previews the configured built-in features, the app packages the target release requires for them, their active references, and the combinations the target cannot run.

What changes

New release asset rentnerproxy-app-requirements.json (schema 1, ≤ 16 KiB)

  • Describes the target's app runtime (runtimeProfile, platformApi, appProtocol, uiBridge, engineCapabilities) and what it does with each of the six built-in features (built-in or retired, plus the official app IDs that provide the profile).
  • Bound to the same release identity as rentnerproxy-update.json (release ID, tag, channel, publication time) and to its source revision.
  • rentnerproxy-update.json stays at schema 1 and unchanged. Readers match asset names exactly, so older platforms ignore the new asset.
  • Source of truth: web/src/config/app-requirements.config.ts and the bundled docker/production/apps/catalog/installer.json. Both join POLICY_SOURCE_PATHS, so the release fails if the trusted automation checkout and the tagged source disagree.
  • generate-release-app-requirements.ts validates its output with the reader's own schema. publish-release-readiness.sh runs it in both modes and uploads requirements in a separate gh release upload before readiness, so a reader that sees readiness also finds the requirements. publish-building-release.sh clears it as a stale control asset.
  • A test pins the published environment to RUNTIME_PROFILE / PROTOCOL_VERSION in the Rust core and to the web App API constants.

Loader (releases.service.ts): the readiness download is generalised into one bounded control-asset loader (exact-name match, size cap, redirect host allowlist). Requirements load only after readiness parsed, and a failure there never drops the verified image. ApplicationUpdate gains an appRequirements block (verified | pending | invalid | unavailable). A result is cached for the full hour only when the image and the requirements are both verified; otherwise it is rechecked after five minutes, as for unverified images.

Rust core (all checks stay in the core)

  • check_compatibility is parameterised: check_environment takes any ManifestEnvironment; the current values are the new RUNTIME_PROFILE / PROTOCOL_VERSION consts.
  • Installer::check_target checks each installed release against a supplied TargetEnvironment. Manifests come from the accepted signed catalog checkpoint, matched by archive digest; nothing is downloaded and the staged tree is not trusted. Releases the catalog no longer lists are unknown.
  • New POST /v1/catalog/target-check on the existing app UI socket (web UID peer only, 4 KiB body, bounded and validated environment, blocking work under the existing semaphore). It covers running, disabled and recovery-required installations.
  • CatalogEntry.providers and Installation.providers (nullable when the installed release is unlisted) are exposed in /v1/catalog; the strict web contract requires them.

Preview (getApplicationUpgradePreviewHandler, owner only, no-store)

  • Uses only the verified, server-side requirements; the browser never supplies an environment. It names the tag the dialog shows, and the server answers only if that is still its current target, so a newer release never stands in for the reference on screen.
  • Built-in features come from inspectLegacyFeaturesInTransaction with the same source registry as the App API (read-only transaction). No source is registered yet, so configured and references show as "not inspectable yet" instead of guessing.
  • Installed apps come from the Rust target check. Without the native app runtime no app can be installed, so the list is empty and a retired feature in use blocks.
  • The dialog fetches the preview on open. It shows a new "Apps and built-in features" section with issues, feature rows and installed apps. i18n keys are added in all eight locales.
  • appProviderProfiles moved to lib/AppUi/identifiers.ts because client code may not import server/. server/AppRuntime/contract.ts re-exports it.

Decisions

  • Blocking combinations hide the copyable image reference, as the Alpha → Beta 1 rule already does:
    • an installed app (running, disabled or recovery-required) whose signed manifest the target's environment does not satisfy;
    • a feature the target retires while no installed app that the target can run provides its profile;
    • a feature the target retires while platform may still hold its state: owner platform and not inspected as unconfigured with zero references, or a handoff still in progress.
  • Not blocking: apps the check cannot verify (unknown), an unavailable app runtime, or missing or invalid requirements. These show as incomplete or unavailable with guidance, and the verified reference stays available.
  • Current plan: this release keeps all six features built-in with no app IDs. A later extraction PR flips its feature to retired and lists the official app.
  • Rollout: releases published before this PR have no requirements asset, so their preview reads "not published yet".

Verification

  • Rust (kiri, rust:1.99.1-bookworm): cargo clippy --all-targets --all-features -D warnings is clean. The new tests and existing app_install, app_manager::{catalog,lifecycle,ui} tests pass (45 passed, 3 ignored). rustfmt is left to autofix.ci.
  • Web: bun run typecheck and bun run lint (including type-aware rules) are clean. New and updated unit tests cover:
    • the asset reader and loader;
    • generator, publish order and stale clearing;
    • preview evaluation and service;
    • catalog contract and transport;
    • dialog states.

🤖 Generated with Claude Code

RentnerKev and others added 2 commits November 25, 2026 15:52
Publish rentnerproxy-app-requirements.json with each release: the target's app
runtime environment and what it does with each built-in feature. The update
dialog checks installed apps against that environment in the Rust core, reads
built-in feature ownership from the handoff journal, and hides the verified
image reference while the target cannot run the combination.

Part of #457.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The preview server function now takes the tag the dialog shows and answers
only while it is still the current target. A verified image is cached for an
hour only once its app requirements verify too, the requirements upload
finishes before readiness is uploaded, and a deployment without the native app
runtime reports no installed apps instead of an unknown list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 138cdfb and ca6a9bc.

Files selected for processing: 58

  • .github/scripts/release/generate-release-app-requirements.ts
  • .github/scripts/release/publish-building-release.sh
  • .github/scripts/release/publish-release-readiness.sh
  • .github/scripts/release/verify-compatibility-policy-source.ts
  • core/src/app_install.rs
  • core/src/app_install/browse.rs
  • core/src/app_install/target.rs
  • core/src/app_manager/catalog.rs
  • core/src/app_manager/lifecycle.rs
  • core/src/app_manager/ui.rs
  • core/tests/private/app_install.rs
  • core/tests/private/app_manager/catalog_lifecycle.rs
  • core/tests/private/app_ui.rs
  • scripts/compatibility/source-selection.ts
  • web/src/config/app-requirements.config.ts
  • web/src/features/ApplicationVersion/Components/ApplicationUpdateDialog.tsx
  • web/src/features/ApplicationVersion/Components/UpgradePreviewSection.tsx
  • web/src/features/ApplicationVersion/Hooks/useApplicationUpdateDialogLogic.ts
  • web/src/features/ApplicationVersion/Hooks/useApplicationUpdateQuery.ts
  • web/src/features/ApplicationVersion/Hooks/useApplicationUpgradePreviewQuery.ts
  • web/src/features/ApplicationVersion/Types/application-update-dialog.types.ts
  • web/src/features/ApplicationVersion/Types/application-update.types.ts
  • web/src/features/ApplicationVersion/middleware.ts
  • web/src/layouts/AuthenticatedLayout/Components/ApplicationShell/Hooks/useApplicationShellLogic.ts
  • web/src/layouts/AuthenticatedLayout/Components/ApplicationShell/Types/application-shell-logic.types.ts
  • web/src/layouts/AuthenticatedLayout/Components/ApplicationShell/index.tsx
  • web/src/lib/AppCatalog/contract.ts
  • web/src/lib/AppUi/identifiers.ts
  • web/src/lib/ApplicationVersion/Types/app-requirements.types.ts
  • web/src/lib/ApplicationVersion/upgradePreview.ts
  • web/src/lib/Language/Locales/de.json
  • web/src/lib/Language/Locales/en.json
  • web/src/lib/Language/Locales/es.json
  • web/src/lib/Language/Locales/fr.json
  • web/src/lib/Language/Locales/it.json
  • web/src/lib/Language/Locales/nl.json
  • web/src/lib/Language/Locales/pl.json
  • web/src/lib/Language/Locales/pt.json
  • web/src/server/AppRuntime/catalog/transport.server.ts
  • web/src/server/AppRuntime/contract.ts
  • web/src/server/Updates/Types/releases.types.ts
  • web/src/server/Updates/Types/upgrade-preview.types.ts
  • web/src/server/Updates/app-requirements.ts
  • web/src/server/Updates/releases.service.ts
  • web/src/server/Updates/upgrade-preview.service.ts
  • web/src/tests/features/AppCatalog/catalog-install-ui.test.tsx
  • web/src/tests/features/ApplicationVersion/application-update-dialog.test.tsx
  • web/src/tests/features/UserSettings/navigation-preferences-ui.test.tsx
  • web/src/tests/layouts/AuthenticatedLayout/Components/ApplicationShell/application-shell.test.tsx
  • web/src/tests/layouts/AuthenticatedLayout/Components/ApplicationShell/mobile-navigation.test.tsx
  • web/src/tests/lib/AppCatalog/install-progress.test.ts
  • web/src/tests/lib/ApplicationVersion/upgrade-preview.test.ts
  • web/src/tests/server/AppRuntime/catalog.test.ts
  • web/src/tests/server/Updates/update-checker.test.ts
  • web/src/tests/server/Updates/upgrade-preview.test.ts
  • web/src/tests/tooling/github/exact-revision-ci-publisher.test.ts
  • web/src/tests/tooling/github/release-app-requirements.test.ts
  • web/src/tests/tooling/github/release-lifecycle.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

autofix-ci Bot and others added 4 commits November 25, 2026 15:09
Pass the target check into lifecycle::check_target so it is testable without
an installer, exercise the target-check route on the app UI socket, teach the
readiness publisher test about the requirements generator and its separate
upload, and format the generator, which autofix.ci leaves to contributors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RentnerKev
RentnerKev merged commit 3012d47 into main Nov 25, 2026
66 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/upgrade-preview branch November 25, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant