Skip to content

test(apps): gate reference app install, updates and recovery on both architectures #458

Done

Description

@RentnerKev

Phase: 5 | Priority: P0

Prove the complete Marketplace-to-appliance path before moving the first production feature.

Scope

  • Consume two independently built reference versions through the real trusted catalog/SDK/package path.

  • Exercise backend/UI, scoped calls, providers/events, lifecycle, data migration, offline operation and package-aware restore together.

  • Add short reproducible interruption and rejection cases using isolated fixtures on native AMD64/ARM64.

  • Keep the reference app internal; this gate adds no public seventh app.

  • Exercise source submission -> isolated candidate build/validation -> exact admin approval -> controlled Release asset publication -> signed catalog promotion -> direct platform verification/install. Test changed/rejected/unapproved candidates without allowing them into the installable catalog.

  • Block Marketplace web/database/accounts/review/ratings/statistics endpoints while independent catalog/package delivery remains reachable, then separately block distribution and all network access. Use native architectures and short isolated fixtures.

Dependencies

These are implementation prerequisites; app-to-app delivery gates do not create runtime dependencies.

Acceptance criteria

  • A fresh platform discovers, installs and activates the signed reference app without a Marketplace account.
  • Updating backend and UI needs no platform rebuild/restart; frontend/generation mixing and duplicate jobs are rejected.
  • Bad signatures/archives, unsupported capabilities and permission/context escalation are rejected without damaging the active app.
  • Interrupted download/staging/migration/cutover, compatible rollback, incompatible-data recovery and event cursor expiry have deterministic outcomes.
  • Restore works from captured packages/data without remote hosting; base proxy and local administration remain operational during optional app failure.
  • Both architectures pass bounded integration/Docker/recovery checks; normal PRs do not start or wait for endurance runs.
  • A fresh platform installs and updates a newly approved reference version while all Marketplace services are stopped; no central login, package proxy, common GitHub token or per-download ticket is used.
  • Cached listing/display assets and installed backend/UI survive full network loss. New uncached downloads require a reachable package source, and expired trust metadata cannot authorize new network installations.
  • Source tag movement, changed bytes/evidence after approval, forged publication results, revoked pending approval and unreviewed next versions cannot become installable; retry/interruption never substitutes or duplicates a release.

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

  1. added this to the v1.0.0-beta.4 milestone on Nov 15, 2026
  2. added
    enhancement
    area: runtime
    area: ci
    on Nov 15, 2026
  3. RentnerKev commented on Nov 26, 2026

    @RentnerKev
    MemberAuthor

    The reference gate runs in the App Runtime Reference workflow, jobs "Native app runtime reference (amd64)" and "(arm64)" (ARR below), on native runners. It uses the published Greeting 1.0.0 and 1.0.1. Rust and Web Tests are the CI jobs of those names; they run on AMD64 only. Deviations and follow-ups are listed below the table.

    Criterion Covered by
    1. A fresh platform discovers, installs and activates the signed reference app without a Marketplace account app-offline-restore.ts (#573) starts a fresh production appliance built from the revision. It reads the live signed catalog with the shipped root and installs the newest Greeting until it reaches running. Gates step 3 (#569) installs with the Marketplace blocked. privileged_published_greeting_lifecycle (#543) installs from an empty store. All of these run in ARR.
    2. Backend and UI update without a platform rebuild or restart; generation mixing and duplicate jobs are rejected In gates step 7 (#569, ARR), the manager keeps running while the app updates to 1.0.1. The new generation serves the newly staged UI, and the old generation's metadata, asset and operation calls get 412. #584 adds three checks. The native presentation metadata switches from none (1.0.0) to the view that 1.0.1 declares. Two identical update posts while the update is pending get the same operation. A deactivate and an install get 409, and the release host serves one archive. Since #583, the generation-scoped UI fixtures (app_manager::ui::tests::, privileged_web_socket_serves_generation_scoped_ui) run natively on both architectures (step "Verify privileged app IPC and UI boundaries natively"). Browser bridge mixing: app-ui-frame.test.tsx (Web Tests).
    3. Bad signatures and archives, unsupported capabilities and permission or context escalation are rejected without damaging the active app Bad archives: interrupted and corrupt downloads leave the app unchanged (privileged_published_greeting_lifecycle, ARR). privileged_signed_greeting_package (ARR) refuses bytes that differ from the signed identity. Malicious archive entries: unsafe_archive_entries_are_refused_before_publication (#588, Rust). Bad signatures: flipped_role_signatures_leave_the_accepted_catalog_unchanged (#588, Rust). Permission escalation: a 1.0.2 release that asks for a new grant is refused with 409, with the active app unchanged and no asset requested (gates, ARR). Unsupported engine capabilities: engine_capability_changes_are_preflighted_for_engine_providers (Rust). Context escalation: app_ipc::tests::privileged_, root_ui_, root_provider_ and app_manager::ui::tests:: run natively on both architectures since #583. Also authority.test.ts and gateway.test.ts (Web Tests).
    4. Interrupted download, staging, migration and cutover, compatible rollback, incompatible-data recovery and event cursor expiry have deterministic outcomes Download: privileged_published_greeting_lifecycle (#544). Staging, claim and cutover: privileged_signed_lifecycle boots from interrupted journal states. #587 adds an update interrupted after the next generation was reserved, and uncertain grants. Migration: #586, privileged_published_greeting_data_migrations, repackages Greeting as four releases and drives them through the real catalog and manager. It checks a fresh migration, a failing migration that restarts 1.1.0 with the data unchanged, a migrated update, a rollback refused with incompatibleData, and a committed migration plus a failed start that ends in recoveryRequired. recover then finishes without migrating again. Migration runner: privileged_app_data_migrations (#568). Compatible rollback: the offline rollback in privileged_published_greeting_lifecycle and privileged_restore_published_greeting. All of these run in ARR. Event cursor expiry: authority.test.ts and authority.db.test.ts (Web Tests only).
    5. Restore works without remote hosting; the proxy and local administration keep working when an app fails privileged_restore_published_greeting (#545) runs on a fresh volume with --network none. It rejects a corrupt bundle, resumes an interrupted replay, repeats idempotently, rolls back offline and replaces in place. app-offline-restore.ts (#573) restores an operator backup into an appliance without network. Both run in ARR. App crash: production-app-runtime.ts checks readiness and the proxy listener (Production Smokes on AMD64, "Native ARM64 appliance" on ARM64). Manager exit: "a stopped app manager leaves the proxy and administration running, another owned child does not" (#574, Web Tests).
    6. Both architectures pass bounded checks; normal PRs do not start or wait for endurance runs ARR passes on AMD64 and ARM64. Since #583, ARR reports on every pull request; when no app runtime input changed, it skips its steps and passes. Pull requests run only the short reliability profile (--profile short). The long profile runs only through a manual Runtime Reliability dispatch. The required-check setting is still open (see below).
    7. A fresh platform installs and updates a newly approved version with all Marketplace services stopped; no central login, proxy, shared token or download ticket Gates steps 3 and 7 (#569, ARR) start from fresh state with --network none. Signed metadata and release assets come from separate direct hosts. market.rentner.dev and api.github.com point at a stand-in that records zero connections. Every request is an anonymous GET without query, authorization, cookie, token, ticket or API key header. The gates re-sign the official Greeting catalog under a test root; the shipped production root is exercised by app-offline-restore.ts.
    8. Cached listing, display assets and the installed app survive network loss; new downloads need their source; expired metadata cannot authorize Gates step 8 (ARR) restarts without network. The cached listing stays (stale), the UI bytes are served and the data is intact. In steps 2, 4 and 5, unreachable assets or metadata now report packageSourceUnavailable or networkUnavailable (#589), and cached marks packages that need their source. In steps 1 and 6, expired metadata cannot authorize, and the checkpoint stays unchanged.
    9. Tag movement, changed bytes or evidence, forged results, revoked approvals and unreviewed versions cannot become installable; retries never substitute or duplicate a release See the list below.

    Criterion 9. The publication side runs in RentnerProxy/marketplace CI: jobs TypeScript, Rust and PostgreSQL, all on AMD64.

    • Tag movement: approvals bind the 40-hex source commit (contract case "approval fails after the source commit changes consistently"), and candidate fetches use --no-tags.
    • Changed bytes or evidence after approval: the contract "approval fails after …" cases (version, architectures, build run, SBOM, provenance), and "publisher verifies the admitted GitHub ZIP and exact unpacked approved bytes".
    • Forged publication results: "rejects anonymous and forged identities" (publisher-auth.test.ts). test(catalog): cover publication guards and run PostgreSQL tests in CI marketplace#92 adds "defers queued work when the Marketplace returns $name".
    • Revoked pending approval: test(catalog): cover publication guards and run PostgreSQL tests in CI marketplace#92. A reviewer who loses the review permission causes approvalRevoked, and the row stays failed.
    • Unreviewed next versions: in test(catalog): cover publication guards and run PostgreSQL tests in CI marketplace#92, submitted and awaitingReview rows are not publication work. On the platform, an unapproved next version never reaches the download (privileged_signed_greeting_package, ARR).
    • Retries and interruptions: "reconciles a lost receipt for the old run without replacing bytes or catalog metadata" and publisher_plan_reconciles_prior_runs_and_refuses_a_conflicting_signed_release. test(catalog): cover publication guards and run PostgreSQL tests in CI marketplace#92 adds "rejects duplicate catalog releases and unexpected or repeated assets without writing". It also runs "persists the app submission lifecycle through concurrent PostgreSQL connections" in the new PostgreSQL job. On the platform, a retried download commits exactly the signed archive (privileged_published_greeting_lifecycle).

    Deviations and follow-ups

    • Greeting 1.0.0 → 1.0.1 changes neither the backend nor the UI entry document; only api/openapi.json and app.config.json differ. test(apps): prove UI updates, coalesced retries and removal of the published reference app #584 therefore asserts the generation switch through the native presentation metadata that 1.0.1 adds, and asserts that uiEntryChanged is false.
    • Event cursor expiry is covered only by the Web Tests (AMD64). Greeting declares no events, so there is no end-to-end cursor test.
    • Some checks run on AMD64 only; they test logic that does not depend on the architecture: bad signatures, malicious archive entries, unsupported engine capabilities, the coalescing unit tests, cursor expiry and the Marketplace pipeline tests.
    • Scope: the issue planned an internal reference app. Greeting is published in the public production catalog instead, so the gate verifies the same signed bytes that operators install. The fixture step downloads the catalog and release assets from GitHub before the tests run without network.
    • Icons (criterion 8): there is no icon pipeline, and no app ships icons yet. The cached display assets are the name, summary and publisher.
    • Making "Native app runtime reference (amd64)" and "Native app runtime reference (arm64)" required status checks is a repository setting the owner still has to change. Until then, a failing ARR does not block a merge.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciarea: runtimeenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions