Skip to content

Smart Auto Updater M3 — reliable no-close updates, automatic self-repair & standalone recovery - #501

Merged
masarray merged 63 commits into
mainfrom
feature/smart-auto-updater-safe-20261109
Nov 9, 2026
Merged

masarray merged 63 commits into
mainfrom
feature/smart-auto-updater-safe-20261109

Conversation

@masarray

@masarray masarray commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Product milestone

Turn the merged #443 in-place Inno installer into a user-observable, Windows per-user auto-update path without interrupting a live mixer.

Implemented

  • First-party PowerShell supervisor installed beside the verified native ArSonMix EXE and launched as an independent background child after JUCE GUI construction, never from PCM/audio callback.
  • Exact published-source SHA baseline, strict SemVer (stable never auto-opts into alpha), GitHub API release asset URL/size/digest validation, per-release SHA256SUMS and INSTALLER_PROVENANCE source/digest corroboration, bounded streaming and 200MiB cap.
  • Downloads new and previously published rollback installer before changing the installation; one named updater mutex; throttled 6h checks and atomic state; no retry storm after failed release.
  • Runs a short-lived release checker at startup, immediately exits after staging, and starts a separate on-exit installer worker only after native session save. No resident long-wait PowerShell process while mixing. The on-exit worker revalidates the published candidate to reject revocation or substituted bytes, waits briefly for process exit, runs the existing silent Inno installer and relaunches once.
  • Native JUCE WebView stage-2 GUID-scoped GUI_READY health acknowledgement; updater verifies installed commit and process remains alive, rolls back using previous authenticated Inno installer only if no new GUI is running.
  • Keeps Studio/.smix, existing Inno close/relaunch behavior, /preview/ and PCM unchanged; private logging and stage cleanup; portable and unsupported platforms excluded.
  • Adds offline PowerShell SemVer/origin/duplicate artifact selftest to existing Windows Inno smoke and fast Node installer contract tests. No extra CI workflow, Windows runner or UI.
  • Architecture and explicit trust/limitations: docs/ADR_SMART_AUTO_UPDATER_20261109.md.

Qualification / safety

  • Do not merge / claim public stable success until exact-head Windows MSVC+Inno FAT and real GUI health/rollback are verified.
  • This alpha implementation relies on official GitHub HTTPS releases + SHA/provenance, not currently publisher-pinned Authenticode signing; code-signing policy must precede production stable default-on. Existing released clients lack this worker, and must bootstrap once by installer.
  • Physical ASIO testing remains separate. No updater may automatically stop live audio or remap outputs.
  • Reconcile latest main before merge; other active mixer/FX PRs untouched.

CI selection

  • Fast contracts on draft PR, followed by one exact-SHA FAT (instead of native+fat) once fast checks pass; this is the only installer-qualification lane needed.

November 10 hardening (on current PR HEAD)

  • Safety architecture: Inno /ARSONMIXAUTOUPDATE performs a read-only exact-installed-EXE -ProbeOnly preflight and checks active mixer mutex and exclusive file replacement; it never triggers JUCE InstallShutdown or WM_CLOSE. Manual installer path retains graceful close. This resolves the race where a new live session could be closed between updater's own process scan and Inno's pre-copy check.
  • Reliability: if silent installer exceeds its bounded wait, do not start rollback or a second GUI until that installer has actually exited. If the new EXE cannot be spawned, route to health-failure handling rather than abandoning recovery. Suppress update launch during Windows sign-out; run downloader at BelowNormal CPU priority.
  • Deterministic quality: offline Test-StagedAsset policy fixtures reject changed hashes, short payloads and deleted files. Windows executable-level smoke verifies auto-mode refuses running mixer without WM_CLOSE and installs after normal exit, preserving exact EXE hash and private data. These are real Inno process tests, not only regex contracts.
  • Evidence: fast native and Inno smoke PASS on SHA 5b79af41ba5196163c815ff8f4e3821fcc72f6d5 (smoke run). One exact-head FAT MSVC/CTest/installer package qualification run #42703939778 requested; do not claim PASS until terminal.
  • Outstanding: two genuine consecutive release installers plus WebView GUI-ready/rollback under real desktop, signing/publisher trust before stable default-on, physical ASIO monitoring unaffected. Remains DRAFT; not merged/published.

M2 recovery + fool-proof repair (2026-11-10)

  • Same-version self-repair: a published installed image with verifiable BUILD_PROVENANCE.exeSha256/guiExeBytes mismatch stages a verified same-release Inno installer, runs it after natural exit, and restores only vendor-owned application files. No uninstall, recursive folder deletion or user-session/.smix/VST wipe.
  • Interrupted transactions: after a power interruption, reconcile state to previous-retained, candidate-unverified, or unknown-installation; block repeated bad candidate rather than looping or assuming PCM health. A corrupt updater-owned state.json is uniquely quarantined and recreated; private Studio untouched.
  • Safe staged cache: validate size+SHA of both cached installers on every attempt, re-download damaged cache, reject revoked published release and allow a newer candidate, reuse intact cache across launches, clean up only explicitly named stage files.
  • Bounded networking and installer retry: 6h cache after successful release check, 20min retry cooldown after transient network loss, one retry of a completed nonzero-exit Inno on a later normal close after 30min. No retry of timed-out/unknown installer, invalid source, failed GUI health or revoked release.
  • Windows proof: Inno smoke #42711646193 PASS and logs INNO_AUTO_REPAIR_CORRUPT_EXE_PASS: synthetic EXE corrupted then exact-SHA restored, private Studio/user sentinel retained, no-close live-session and hung-app fail-closed tests remain green. Offline policy tests prove crash recovery and bounded retry.
  • Remaining gates: exact-HEAD MSVC/CTests/FAT packaging; two real release installers' end-to-end GUI health/rollback and ASIO owner listening, plus Authenticode pin/signing for production stable. No automatic public rollout, release or merge while unproven.

M3 standalone repair and safe recovery

  • Installed Repair ArSonMix Start Menu fallback invokes an independent PowerShell recovery supervisor even if the normal EXE is missing or cannot open. It authenticates the installed source against official published GitHub release identity/checksums/asset digest, then performs in-place repair of vendor program resources without deleting Studio, .smix, or custom VST3.
  • Normal automatic updates still refuse to install with a missing EXE; only a user-invoked recovery with both explicit Inno flags can restore it. Exact-image process + mutex checks prevent shutting down a live mixer. Failure displays a plain-language recovery message rather than inventing a “clean install”.
  • Handles abandoned updater mutex after abrupt exit/power loss; a corrupt/absent version manifest fails closed with user-facing recovery guidance. No service, task scheduler, Windows Restart Manager force-close, new UI, or DSP changes.
  • Windows proof: Inno smoke #42716280902 PASS. It deletes isolated test EXE, demonstrates regular auto-update refusing, and demonstrates explicit recovery restoring exact EXE SHA while retaining Studio. Also confirms live-session no-close, corrupt-EXE repair and legacy/hung safety.
  • Exact HEAD FAT: run #42716623798 for SHA 0763a4a. This must be terminal PASS before merge. No 2-version real JUCE GUI-health/rollback audio owner evidence or pinned Authenticode identity yet; do not label this production stable release.

Final exact-PE and authentic two-release FAT

  • Fixed M3 recovery/roll-forward/rollback success so sourceCommit metadata or WebView GUI_READY alone cannot certify a healthy installation: the installed EXE size and SHA256 must agree with BUILD_PROVENANCE.json. Windows PowerShell offline integrity fixture and contract test added.
  • Post-close apply now revalidates the rollback published release (tag, target commit, official installer filename, SHA256 and byte size), not only the candidate. A changed/missing rollback asset fails closed before any installation.
  • Added scripts/test_two_genuine_inno_releases_windows.ps1 to opt-in FAT: download authentic published v0.5.0-alpha.4 and alpha.5 Setup EXEs, verify official release digest, SHA256SUMS and INSTALLER_PROVENANCE, perform silent alpha.4 install -> alpha.5 upgrade -> alpha.4 rollback in a disposable GitHub Windows runner, validate EXE SHA and preserved private .smix plus user sentinel at every hop, uninstall fixture. No use on end-user PC or ordinary PR jobs.
  • Exact-head contracts: native, Inno, UI PASS at c8e9af6c828428f181c10e7f7efec076625f7320. One opt-in full FAT #42721612866 is a prior exact SHA for the genuine release test; if newer code head differs, it cannot qualify the newer code automatically.
  • Do not claim production stable readiness without publisher signing / independent authentication of release control and actual interactive WebView GUI + ASIO listening smoke. An official release API digest is not independent signing. Keep public auto rollout deferred until these gates pass.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: af9bdba
Status: ✅  Deploy successful!
Preview URL: https://3748ecb7.arsonmix.pages.dev
Branch Preview URL: https://feature-smart-auto-updater-s.arsonmix.pages.dev

View logs

masarray commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 88ff4a4

masarray commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 8c0f459

masarray commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 0763a4a

@masarray masarray changed the title Smart Auto Updater M2 — user-safe self-repair, disrupted install recovery & bounded retries Smart Auto Updater M3 — reliable no-close updates, automatic self-repair & standalone recovery Nov 9, 2026
@masarray
masarray marked this pull request as ready for review November 9, 2026 23:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T23:08:17.842789Z 0763a4a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0763a4ac9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread installer/ArSonMixAutoUpdate.ps1 Resolved
Comment thread src/Main.cpp Resolved
Comment thread installer/ArSonMixAutoUpdate.ps1 Resolved

masarray commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat c5f58dd

masarray commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat af9bdba

@masarray
masarray merged commit 0279e34 into main Nov 9, 2026
10 checks passed
masarray added a commit that referenced this pull request Nov 10, 2026
Merge validated main updater #501 while retaining alpha.7 native Harmony/Player/Vocal Throw graph and GUI. The 10 main-changed updater file paths were compared; 7 are byte-for-byte identical, Main.cpp's entire ConsoleApp is identical and release workflow/CI variants preserve the same gates plus integration-specific tests. No release artifact is published by this commit.

Copy link
Copy Markdown
Owner Author

Updater engineering integration complete — MERGED TO MAIN. PR #501 squashed at 0279e34c3cb31d0d54f2611179250a04d73e3813. The three Codex findings (PowerShell 5.1 releases enumeration, stage-3 false GUI_READY, and staging download retry throttle) were fixed and their threads resolved. Latest HEAD native/UI/Inno contract checks succeeded; historical real alpha.4→alpha.5→alpha.4 FAT with verified PE and private .smix retention passed in run #42721612866. Exact-final-SHA MSVC/FAT follow-up run #42724291273 was still active when this comment was written. Public stable auto-update is not claimed signed/ASIO-hardware certified. Release qualification is separately controlled.

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