Skip to content

emrg: upgrade prompt: enforce GUI sync with self-sufficient toolchain - #959

Merged
argszero merged 1 commit into
masterfrom
feature/upgrade-prompt-gui-sync
Aug 24, 2026
Merged

emrg: upgrade prompt: enforce GUI sync with self-sufficient toolchain#959
argszero merged 1 commit into
masterfrom
feature/upgrade-prompt-gui-sync

Conversation

@argszero

Copy link
Copy Markdown
Owner

What

Makes GUI sync a mandatory step of the auto-upgrade flow. Previously the upgrade prompt treated the GUI (EMRG.app) as "your call — skip if no node/npm", which left GUI packages stuck at 0.2.72 while the daemon moved on.

Root cause of the old skip reasoning: a false premise — node/npm exist on the host (asdf), they are just not on the daemon's PATH.

Changes (emrg/server/prompts/upgrade_prompt.j2)

Replaces the optional "GUI as needed" paragraph with a fixed 5-step GUI must-sync flow:

  1. Version compare — extract package.json from the installed GUI asars ({{ install_dir }}/emrg-gui/... and ~/Applications/EMRG.app) via npx @electron/asar extract-file and compare with the target tag's emrg/gui/package.json version. Identical → skip build but still do the copy/sync check.
  2. Toolchain self-sufficiency — inside {{ upgrade_work }}, never assume node/npm are callable; try in order: asdf shims (~/.asdf/shims), nvm, Homebrew, last-resort node LTS binary tarball download. Verify node --version && npm --version before building.
  3. Build the GUI — mirror CI's build-release.yml order: build-runtime.sh if dist/runtime is missing, then npm install && npm run distdist/mac-arm64/EMRG.app. Host-arch-only build is fine (release installer rebuilds all arches); electron-builder ad-hoc signing is part of the build output, not manual signing/notarization.
  4. Replace — back up both {{ install_dir }}/emrg-gui/EMRG.app and ~/Applications/EMRG.app into {{ backup_dir }}/<current_version>/ (emrg-gui tree was previously excluded from backups — now included), then copy the fresh build to both locations (postinstall semantics: emrg-gui/EMRG.app = install source, ~/Applications/EMRG.app = run copy).
  5. Verify — re-extract the replaced asar's package.json and confirm version == target tag (strip leading v).

Verification

  • Full pytest: 1039 passed, 1 skipped (prompt template change; no daemon logic touched)

Rant: 2026-08-24T17:52:03 (upgrade_prompt.j2 强制 GUI 同步升级 — 工具链自给自足)

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 180730

Re-verified: head 4e135a5 unchanged, MERGEABLE/CLEAN, CI green (test + test-windows). Reviewed upgrade_prompt.j2: GUI 'as needed' → mandatory 5-step sync flow (asar version compare → self-sufficient toolchain asdf/nvm/brew/fallback download → CI-mirroring build → backup+replace both install paths → asar version verify). No jinja/directive changes, prompt-only — local pytest 1039 pass / 1 skip.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 181352

Re-verified: head 4e135a5 unchanged, MERGEABLE/CLEAN, CI green (test + test-windows). Prompt-only change (upgrade_prompt.j2): GUI must-sync 5-step flow with self-sufficient toolchain fallbacks (asdf/nvm/brew/download), backup both app paths, asar version verification. No jinja directives touched — LGTM.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 182004 (3/3)

Re-verified: head 4e135a5 unchanged, MERGEABLE/CLEAN, CI green (test + test-windows). Three consecutive LGTMs from different cycles (180730/181352/182004), no ❌ in between. Merge approved.

@argszero
argszero merged commit a1403b4 into master Aug 24, 2026
2 checks passed
@argszero
argszero deleted the feature/upgrade-prompt-gui-sync branch August 24, 2026 10:21
argszero added a commit that referenced this pull request Aug 24, 2026
…ead-tool vision, bundled-git test fix, promote_state housekeeping, GUI open-session fix, upgrade prompt GUI sync) (#962)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
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