← Back to Pull requests

feat(desktop): signed Windows NSIS updates on the main channel #6854

Closed
unknown closed this pull request without merging on Oct 22, 2026 15:15 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 03:58 UTC
Author

Goal And Delivered Outcome

  • Outcome basis / optional anchor: #5204 (Desktop execution frontend journeys). Its restart/update/rollback items require independent evidence on each operating system; Windows currently has none.
  • Goal/source and gap: on main, the signed desktop-update pipeline builds macOS only (desktop-updater.yml has a single macos-15 matrix entry; scripts/desktop_update_feed.py publishes only darwin-aarch64), and the App's update surface is gated to macOS. A Windows install therefore has no signed-update journey at all, only manual installers and a separately installed CLI.
  • Observable before -> after, with the validation row that proves it: a Windows NSIS install now checks on launch, verifies the minisign signature, installs the update passively and restarts automatically; the update panel offers manual check / install / restart. Proven by the feed and workflow tests, the panel browser smoke, and an author-side installed-NSIS receipt at 823008357 (loopback feed + test key; the channel/platform copy logic is unchanged at 27c3d26f9, details in the receipt comment). The receipt covers successful replacement/restart and a verified-but-unlaunchable failure with service recovery; the official-feed/key and policy-blocked-installer variants remain for the canary.
  • Issue/task and intended base: Related to #5204 (does not close it; per-OS release evidence and the stable rollout stay with the maintainer). Intended base main: rebased onto c97f921e2f18fbd7e155495b7eb5029031c97fe3 for this revision (see Validation).
  • Included Fix

  • Windows webview boot surface: while running the real-machine journey, the packaged Windows App stayed on about:blank because the navigation fence accepted only the tauri:// scheme and the workspace origin, while Windows serves the bundled boot page over the WebView2 transport alias http://tauri.localhost. workspace_navigation in lib.rs now also accepts that exact boot origin, covered by the extended navigation_keeps_the_workspace_fence_and_hands_external_web_links_off_once unit test: both boot variants stay inside the fence, lookalike hosts (http://tauri.localhost.evil.example/, http://elsewhere.localhost/) are handed off to the browser exactly once, and file:// / javascript: / mailto: remain unreachable. This repairs pre-existing Windows behavior that the delivered update journey depends on; without it the update surface cannot render on Windows at all.
  • Channel-scoped panel copy (re-review finding, 823008357): desktop_update_status now exposes the host platform, and the update panel chooses its idle copy from that platform plus the selected channel. Windows stable/MSI names the manual signed-installer path, Windows main keeps the launch-time NSIS promise, macOS keeps the prepared-update wording, and a legacy payload without platform falls back to neutral channel wording. The browser smoke asserts macOS, Windows stable, Windows main and English stable, and rejects the old unconditional Windows sentence. The re-review confirmed the fix on the current production bundle.
  • Author-side installed-NSIS receipt (test key/loopback feed): installed A 0.0.0-main.1.0, updated to B 0.0.0-main.2.0 through the real panel; the old App and both owned services exited, B restarted, new owned services connected, and an independent CLI process survived. A signed invalid-PE payload stopped the owned services, Windows refused launch, and after dismissing the OS error dialog the same window returned to app_install_failed with services restored and retry available. Details, PIDs and hashes are in the receipt comment.
  • Stable release isolation (re-review finding): Windows NSIS now builds in a main-only build-windows job. build-macos remains the stable/main leg, and publish uses explicit result checks: a stable release publishes the Darwin feed when build-windows is skipped, while a main release still rejects a skipped or failed Windows build. tests/desktop/test_update_feed.py evaluates the publish condition for both channels and pins the dependency edges.
  • Stable upload consumer (re-review finding, dcbc04589): the upload step enables nullglob before enumerating .gz/.sig/.exe, so a Darwin-only stable release reaches the immutable feed and desktop-stable pointer instead of passing the unmatched glob to gh. Main still builds Windows and the feed still rejects a missing Windows artifact. The regression executes the exact production shell block for stable Darwin-only and main complete, checking the gh call log and publication order. Main with missing Windows fails in the preceding feed builder before the upload step.
  • Rebase integration (2026-10-22, 0603b49f): preserved main's service-lifetime and startup-state additions while keeping both service_lifetime and service_lifecycle; combined startup_state and platform in the native status payload; and retained main's 59-line transfer-failure/boot smoke coverage alongside the Windows stable/main cases. No conflict resolution selected one side wholesale.
  • Late-handoff restore debt (P2 re-review): a service group that finishes starting after the update handoff parked the supervisor is rejected by adopt and stopped by its caller; the rejection now records reclaimed so a failed installer launch still produces restore_pending. Release is serialized with adopt so a late set is either counted by the release or adopted after the handoff ends. Two new lifecycle tests cover both orderings.
  • Shared smoke coverage restoration (re-review finding): the rebase had dropped main's general/transfer-failure and boot-readback blocks from examples/desktop-update-browser-smoke.mjs. Restored those blocks from main while keeping the Windows stable/main channel cases, and kept main's "open the local version first" macOS copy with the manual-update sentence. The production-bundle smoke passes with the restored failure, no-install, check-only-retry and boot-diagnostics assertions.
  • Review-hardening round (owner review of the delivered journey): the feed now rejects a .sig that is not a decodable minisign signature instead of only checking for non-empty content, and the workflow tests pin the signed Windows build step, its embedded-version assertion and the pointer upload staying inside the advance branch, while the artifact rename becomes idempotent. Rust-side, a failed install no longer folds the macOS continuation journal into a Windows-safe restart (install_failure_state takes an explicit journal-applies input), the platform/action gate is a pure two-column table so both host columns are covered from any test process, and the navigation-fence test pins transport-alias port and scheme lookalikes, the published .sig must match the four-line minisign structure the client parses (74-byte and 64-byte payloads) with tests for comment-only, wrong-length and embedded-newline inputs, and finalize_install_failure no longer attempts the journal effect where no such journal can exist. Both update surfaces stop naming repair or rollback in states where this release disables them (boot.js unrepairedFallback, desktop-update.tsx phaseMessage), the desktop update browser smoke asserts that wording, and the smoke's static-file guard now also serves Windows paths so the smoke runs on Windows.
  • Author Declaration

  • Written by: model_agent (Codex CLI, OpenAI), implementing a request from the repository owner (@JasonBuildAI), who directed opening this PR so review happens on a concrete head.
  • Implemented against

  • Specification and revision: issue #5204's accepted per-OS restart/update evidence requirement, plus the claim comment https://github.com/loopx-project/loopx/issues/5204#issuecomment-6258416249 on main@dc9fdbb51. That comment said "no PR before direction agreement"; the repository owner then directed proceeding, with these decisions: minisign only (no Authenticode in this phase), NSIS only (MSI stays manual), main channel first and the stable rollout as a separate maintainer decision.
  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |

    | --- | --- | --- | --- |

    | #5204: independent per-OS update evidence | implemented (main channel) | .github/workflows/desktop-updater.yml, scripts/desktop_update_feed.py | python -m unittest discover -s tests/desktop -p 'test_update_feed.py' |

    | Feed advertises a Windows NSIS updater on main | implemented | QUALIFIED_PLATFORMS["main"] | test_immutable_source_and_qualified_platform |

    | Feed fails closed on missing, empty, duplicate or unsigned Windows artifacts | implemented | build() in scripts/desktop_update_feed.py | test_windows_artifact_fails_closed_on_the_main_channel |

    | Stable channel keeps manual Windows installs | implemented | QUALIFIED_PLATFORMS["stable"] | test_stable_channel_excludes_windows_until_that_rollout_is_approved |

    | Windows App check / install / restart journey | implemented | app_update_action_supported in maintenance.rs | Rust windows_keeps_the_signed_app_update_journey_without_macos_recovery_actions (CI validate, macOS) |

    | Windows repair / align / rollback report explicit unavailable | implemented | update_action_platform_unavailable + boot.js / desktop-update.tsx copy | same Rust test |

    | Automatic launch-time update on Windows | implemented | automatic_app_update in maintenance.rs | windows-desktop-tests native regression; author-side installed receipt at 823008357 |

    | Rollback / repair mechanism on Windows | out_of_scope | - | explicit unavailable state only |

    | Authenticode signing | out_of_scope | - | minisign only, unchanged from macOS |

    | Stable-channel Windows enablement | deferred (maintainer) | - | post-merge canary and stable decision |

  • Self-check before submission: ran the desktop Python tests, tests/test_ci_resource_policy.py, cargo fmt --check (reports a pre-existing services.rs diff also present on upstream/main; not claimed clean), cargo clippy --all-targets --locked, examples/desktop-release-workflow-smoke.py and scripts/check_rfc_bilingual.py locally. Deliberately left out: no MSI feed entry, no Authenticode, no Windows rollback mechanism, no stable-channel change. An author-side installed-NSIS receipt was produced on this head with a loopback feed and test key; it covers the success and launch-failure journeys. The official-feed/public-key and policy-blocked-installer variants are not claimed.
  • Scope And Continuation

  • Completed scope and remaining work: main-channel signed Windows NSIS updates end to end - pipeline, feed, App gate, panel copy, docs. Remaining, not in this slice: stable-channel Windows enablement, MSI signed updates, Authenticode, the Windows rollback/repair mechanism.
  • Slice boundary / successor: the slice is internally complete and independently revertible (one workflow, one script + tests, one Rust gate, two copy additions, README updates). Successor work - the post-merge main-channel canary on a real machine and the stable decision - stays with the maintainer's release process.
  • Validation

  • Tested revision: 27c3d26f9d8dfc3eef405a5e9a1b7b29bdcecc58 (merge base 0603b49f332c90828b08807e055505bfe1522312). The installed-NSIS screenshots were captured at 823008357; service_lifecycle_windows_update_tests.rs is byte-identical at 27c3d26f9; service_lifecycle.rs additionally carries the late-handoff restore-debt fix, and lib.rs also carries main's service_lifetime and startup-state changes, and desktop-update.tsx keeps the channel/platform idleMessage with main's "open the local version first" macOS copy.
  • Run state: finished (acceptance adequacy is not claimed; see rows)
  • Input classes: synthetic | public_fixture
  • | Check kind | Result | Public-safe evidence / limitation |

    | --- | --- | --- |

    | static | mixed (pre-existing) | cargo fmt --check reports a pre-existing services.rs formatting diff identical on upstream/main; no Rust file is changed by this round, so formatting is not claimed clean. |

    | unit | passed | python -m unittest discover -s tests/desktop: 28 passed at 27c3d26f9, including the exact production upload-loop regression for stable Darwin-only, main with Windows complete, and main missing Windows. |

    | unit | passed | cargo test --locked --lib -- service_lifecycle --test-threads=1 at 27c3d26f9: 8 passed, including the new late-adoption debt cases and the Windows update handoff/failed-launch recovery paths. |

    | unit | passed | cargo test --locked --lib on Windows at 823008357: 134 passed, 1 failed, 2 ignored. The single failure is the pre-existing services::tests::timed_output_large_output_does_not_deadlock in the untouched services.rs; this host resolves python3 to the Microsoft Store stub. |

    | unit | passed | Dashboard npx tsc --noEmit and npm run build:chat at 823008357. |

    | integration | passed | examples/desktop-update-browser-smoke.mjs at 823008357, including the macOS, Windows stable, Windows main and English stable idle-copy assertions and the repair-free wording. |

    | workflow | passed | tests/desktop/test_update_feed.py evaluates the publish condition (stable with a skipped/failed Windows leg publishes Darwin; main rejects it), pins the build/publish dependencies, and executes the exact upload shell block with a fake gh log. Stable Darwin-only uploads the feed and pointer without an .exe or literal glob; main uploads its Windows installer; feed upload precedes pointer upload; main without Windows fails closed in the feed builder. |

    | source_premerge | mixed (18/19) | loopx canary premerge --from-git-diff --git-diff-base upstream/main at dcbc04589: diff hygiene, changed-Python compile, all 8 risk-profile smokes, public/private boundary and 9/10 catalog canaries passed. The remaining hot-path-interface-budget-smoke fails in the pre-existing Windows extension-doctor executable-bit check; readiness.py is outside this diff. |

    | visual | passed | Installed-NSIS and production-bundle screenshots at 1280×900 and 390×844 are embedded in the Frontend / Visual Evidence section. |

    | integration | mixed on the previous approved head dcbc045 | Signed Desktop Updates validate and windows-desktop-tests passed at dcbc045 (including the previously flaky loopback test). The unrelated chat-bundle-browser, windows-powershell and Release Artifacts build jobs still fail outside this diff; some Python shards were still running. The new head 27c3d26f9 reruns the checks; release build jobs are skipped on PR as expected. |

    | real_entrypoint | passed (author-side installed NSIS) | Installed A 0.0.0-main.1.0 -> panel update B 0.0.0-main.2.0: old App PID 41724 and owned services 43428/31044 exited, B PID 52560 restarted, new owned services 43608/28136 connected, independent CLI PID 37672 stayed alive (HTTP 200). Failure: signed invalid-PE ZIP stopped the owned services via the pre-exit hook, Windows refused launch, and after the OS error dialog was dismissed the same App/window returned to error/app_install_failed with services restored (40576/44664), retry available and the independent CLI alive. Bounded: loopback feed + test key, repository CLI via LOOPX_BIN, invalid-PE payload rather than a policy-blocked installer. |

    | real_entrypoint | not_run (official canary) | The official feed/key and policy-blocked-installer variants are main-only; the first live production proof is the post-merge main-channel canary. |

    Frontend / Visual Evidence

  • UI impact: changed
  • Before: on Windows the packaged App never left the about:blank transport page (see Included Fix), so the update panel did not render at all, and desktop_update returned the generic platform_update_not_supported fallback. The "this channel has no update package for this platform" copy is the post-change behavior when a channel has no Windows entry, not the pre-PR state.
  • After: on Windows, repair / align_runtime / rollback return the explicit update_action_platform_unavailable state with dedicated Chinese and English copy, and states without a dedicated code switch to repair-free wording instead of naming the disabled repair or hidden rollback controls; the check / install / restart journey renders as on macOS. The idle copy is channel- and platform-scoped: Windows stable/MSI points at the manual signed installer, Windows main names the launch-time NSIS path, macOS keeps the prepared-update wording, and a legacy status without platform uses neutral channel wording. Buttons remain hidden or disabled through the existing bundled_repair_available / rollback_available state fields - no layout or control change.
  • First viewport and preview: the update entry is in the sidebar footer rather than the page hero; the affected panel was captured in the installed windows at 1280×900 and in the production web bundle at 1280×900 and 390×844. The installed-NSIS images are from the 823008357 run (loopback feed + test key); the browser images use synthetic native status from the same tree. The channel/platform copy is unchanged; service_lifecycle.rs now includes the late-handoff restore-debt fix, and lib.rs also carries main's current service-lifetime/startup changes, and desktop-update.tsx carries main's macOS idle copy. No private data.
  • States and viewports shown: installed A with an available update, the restarted B workspace, the recovered failure panel, and the Windows-stable idle copy at 1280×900 and 390×844.
  • <img src="https://github.com/JasonBuildAI/loopx/releases/download/pr-6854-native-evidence-20261019/panel-available-a.png" width="720" alt="Installed A with an available update">

    Installed A, real panel: 0.0.0-main.2.0 is available after the signed check.

    <img src="https://github.com/JasonBuildAI/loopx/releases/download/pr-6854-native-evidence-20261019/app-b-after-update.png" width="720" alt="Restarted B workspace">

    After the passive NSIS install and automatic restart: the B workspace is interactive.

    <img src="https://github.com/JasonBuildAI/loopx/releases/download/pr-6854-native-evidence-20261019/failure-restored-window.png" width="720" alt="Recovered failure window">

    After the refused launch and dismissing the Windows error dialog: app_install_failed, services restored, check/retry still available.

    <img src="https://github.com/JasonBuildAI/loopx/releases/download/pr-6854-native-evidence-20261019/update-idle-windows-stable.png" width="720" alt="Windows stable idle copy at 1280x900">

    Windows-stable idle copy in the production bundle at 1280×900: manual signed installer path, main/NSIS scope.

    <img src="https://github.com/JasonBuildAI/loopx/releases/download/pr-6854-native-evidence-20261019/update-idle-windows-stable-mobile.png" width="360" alt="Windows stable idle copy at 390x844">

    The same copy at 390×844; the panel wraps without horizontal overflow.

  • Source data: none
  • Attention review: no new control or surface; the added copy replaces a generic failure with the platform's actual capability boundary while the one-step check / install / restart control stays available.
  • Craft review: N/A - no visual layout change, no new tokens, colors or components.
  • Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update
  • LoopX Area

  • Build, packaging, installer, or CI
  • Host or runtime integration
  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Technical Direction

  • Direction / acceptance reference, when applicable: #5204 (Desktop execution frontend journeys) - per-OS restart / update evidence.
  • Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A - no shared-authority RFC progress is claimed.
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A.
  • Provider conformance arms run: N/A.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A.
  • Coordination And Merge

  • The claim comment said "no PR before direction agreement"; the repository owner directed this submission, so this PR is that concrete head for review rather than a new direction claim.
  • PR #6835 was merged on 2026-10-19; this branch is rebased after it.
  • This PR does not self-merge. apps/** behavior changes require maintainer authorization; merge readiness is left to the maintainer after validation.
  • Boundary: this change extends the App-driven signed-update journey to Windows. The CLI-driven desktop upgrade path (loopx update / --loopx-upgrade-request) remains macOS-only, and a Windows desktop keeps using the separately installed CLI.
  • Windows NSIS now builds in a main-only build-windows job. A stable release publishes the Darwin-only feed without depending on that leg, while a main release still requires it; stable release pages keep the unsigned installers for manual installation.
  • The stable publish condition is explicit (always() plus per-job result checks), not a prose convention: the workflow regression in tests/desktop/test_update_feed.py models stable-Darwin success with a skipped/failed Windows leg and main rejection of a missing Windows leg.
  • Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work.
  • I kept the change scoped to the linked issue/task.
  • Existing English/Chinese RFC pairs both have a diff, and python3 scripts/check_rfc_bilingual.py --base main --head HEAD passes, or no paired RFC changed (no paired RFC changed; the check passes).
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: JasonBuildAI Review duration: 4996m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6854"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%