Skip to content

Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.

release(v4.4.0): updates have been silently keeping the old code since v4.0.5

mrbizarroa37ddc588bbb
diff --git a/VERSION b/VERSION
index 8089590..fdc6698 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.3.0
+4.4.0
diff --git a/docs/STATE.md b/docs/STATE.md
index dc00dfc..97b9a04 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -1,5 +1,17 @@
# Phosphene — project state, history, open work
+> **🔁 2026-08-15 — v4.4.0: every update since v4.0.5 has silently kept running the old code.** The most important release of the day, and it exists because the owner said "I updated and I still don't see any of the changes."
+>
+> - **The "Restart to finish update" pill has never fired. Not once.** v4.0.5 compared disk HEAD against `_VERSION_STATE["local_sha"]`, described in its own docstring as *the boot snapshot*. It is not one: `_check_remote_once()` calls `_detect_local_install_state()` at the top of **every poll** — deliberately, so a tree that was dirty at boot and is clean now stops being suppressed without a restart — and that same call refreshes `local_sha`. Within one 30-minute interval `local_sha` equals disk again, so `disk_sha != boot_sha` is false forever. The detector could never report the one condition it exists to report.
+> - **What that cost every user.** Pull an update, get no prompt, keep running the old process, conclude the update did nothing. Diagnosed on the owner's own install: panel process started **13:20:48**, code updated **20:09:22**, `/version` cheerfully reporting `stale_process: false` while serving a 4.0.9 UI from a 4.3.0 checkout for seven hours. The public tree was verified correct at `325504d` before anything was changed — the code shipped fine, the process never loaded it.
+> - **Fix:** `_BOOT_HEAD_SHA`, captured once at process start and never refreshed, is what disk is compared against. `test_stale_process.py` (5) pins it, and `test_polled_state_does_not_defeat_it` writes a fresh `local_sha` exactly the way a poll would and asserts staleness survives — the original bug stated as a test. A missing git binary still reads as "not stale" rather than as a permanent restart nag.
+> - **One click to update, not two.** The banner's **Update now** opened a `confirm()` asking whether you meant to press the button that says Update now, and then an `alert()` after the pull whose only content was what to do next. The confirm now guards only the version PILL (a small target that does four other things by state), and the post-pull instruction renders inline in the banner, which is already on screen: *"Updated to 4.4.0 — restart to finish."*
+> - **The star ask has a permanent home.** It rendered only inside the update banner, which is gated on being BEHIND — so anyone who keeps Phosphene current, the population most likely to star it, could never see it, and there was no way to reach it deliberately. Now a static header link beside the bug and X icons: no badge, no pulse, no counter, and it retires the banner ask when used.
+>
+> **Gates:** `check_ltx_pin` PASS (pin unmoved) · `check_pinokio_scripts` PASS · `check_output_codec` PASS · **13 panel suites** green · `node -c` install/update · `py_compile` panel + helper + image engine.
+>
+> **Queued, not in this release:** the Kijai rank-resized Turbo adapter (0.44 GB vs our 1.96 GB, equal-or-better in a locked A/B) needs its asset published and the resolver allowlist moved; and the health-cluster redesign is waiting on the owner's pick between one consolidated chip and icon-first pills.
+
> **🎛️ 2026-08-15 — v4.3.0: the engine picker becomes a dropdown, the header stops fighting for room, and contributing has an address.**
>
> - **The picker is a dropdown.** Two segments plus the health cluster already overflowed a 14" window, and a third engine could not have fitted at any width — which mattered, because `ENGINES` already carries a **Flux Video** row behind `LTX_ENGINE_PREVIEW=1`. A trigger showing only the ACTIVE engine costs one header slot no matter how many engines exist, and it *states* the selection instead of leaving it to a highlight. Each menu row now carries its tagline, because the menu is where someone chooses BETWEEN engines: "every mode, LoRAs, characters" / "joint video + dialogue + sound" / "weights announced, not released yet". Every piece of state logic — install offers, repair, capability, mode gating, `engineSegClick` — is untouched; only the presentation changed.
@@ -54,7 +66,7 @@
> **🔧 2026-08-14 night — v4.0.5 ASSEMBLED on dev/beta (`65880b3` + version `66f0dbd`), HELD for the owner's word.** The two recovered audits' punch-list, closed in one campaign. (1) **H3 Turbo install is LIVE again**: the v1.0 runner-layout repack is a published release asset on `weights-ltx25-v1` (sha256 `d51d626f…`, verified byte-identical against the local repack the selection was graded on); `/h3/turbo/install` streams it partial→verify→atomic-rename, `install_h3.js` fetches the same asset best-effort via `scripts/fetch_h3_turbo.py` (resumable, digest-checked, short Pinokio-safe lines), and the retired **ckpt500-EMA is accepted again as the LAST fallback** — dropping it in 4.0.4 un-Turboed installs that rendered fine on it. Raw v0.1 stays refused by name. Turbo gate 5→11 tests incl. script↔panel pin parity. (2) **The dead HQ Speed control is gone** (skip-step fields were dropped at the engine boundary; both pills ran identical settings under a "~12% faster" claim), and the collapsed summary stops printing "exact speed" from the retired accel input. (3) **The real speed control**: the engine's 2.5-only `fast` schedule preset (F6S2, 5+2 forwards, owner-graded, **a different take**) wired end to end — Speed pills → `schedule_preset` → make_job (lane-gated: dropped with a sentence on 2.3/HQ/H3) → helper → `generate_two_stage`; tier cells carry `fast_eta` (cost-model 5+2/8+2 ratio, so fixed costs aren't discounted), chips re-price while Fast is armed, and Load Params round-trips it from day one (`test_schedule_preset.py`, 8). (4) **Geometry truth**: make_job floors LTX canvases to the two-stage engine's /64 grid and frames to 8k+1 (floored, never raised) and pushes a sentence when it does; dims inputs step by 64; warnings state what WILL render; H3 tier-cell geometry untouched (`test_geometry_grid.py`, 6). (5) **Load Params restores the cast** (owner-reported): the fire-and-forget IIFE is replaced by an awaited restore through `applyCharacterSelection()` — the new non-toggling hydrator — with visible failure when the character left the library; quality chip by the sidecar's own token, explicit `no_voice` with touched provenance, Extend's four fields, STG (absence = Off), and the Length chip repaints after programmatic frame assignment. A hidden checked No-voice can no longer rewrite a plain render (submit gated on a cast; every hide path clears the box). (6) **One health cluster**: the six machine-state pills live in a single bordered container that is the header's only shrinkable region — narrow windows degrade it to colored state dots, then collapse it; the creator avatar is never clipped again. (7) **Stale-process pill**: `/version` compares HEAD-on-disk to HEAD-at-boot each poll; a promote landing under a running panel renders "Restart to finish update" — **validated live**: the dev panel booted at `90b8a6e` reported `stale_process: true` the moment `65880b3` landed. (8) Keyframe sidecars stamp the resolved q8 pack, not the 2.3-defaulting `MODEL_ID_HQ`. **Gates all green at the tree** (pinokio scripts 377/500 worst · ltx pin unmoved at `v0.14.19+ltx25.4` · post_update · registry 169 · schedules 45 · character round-trip 35 · lora_compat · stage_live_preview · spicy · turbo 11 · schedule_preset 8 · geometry 6 · storyboard suites · py_compile · page parse). **Known-remaining / descoped**: the owner's "stray −1 bar" did not reproduce in either live panel's idle state (needs a screenshot the moment it appears); HDR Load-Params restore is moot while the HDR pill ships commented out (roadmap-parked); render validation of the fast preset + Turbo v1.0 timing run deferred until the GPU frees (the eltrumpo retrain holds both locks overnight). **Audit sources**: `~/AI/projects/phosphene/notes/customize_audit_2026-08-14.md` + `journey_audit_2026-08-14.md` (recovered from the sandboxed sessions' stdout; the FIELD REGISTRY campaign spec in the journey audit is the post-4.0.5 systemic fix).
-**Public release: `v4.3.0`** (2026-08-14 — the live preview leaves the postage stamp and plays full-size on the main stage; the Spicy option follows the Settings switch on both engines; H3's Turbo adapter selection moves to LightX2V v1.0 768p and its automatic install is paused until the repack is published. Carries v4.0.3's picker-LoRA crash fix and the v4.0.2 content: the 720p High tier, i2v that animates the image you gave it, characters on the engine's native runtime-LoRA route, and the vendored pin at `v0.14.19+ltx25.4`; see the entries below. The narrative in this paragraph stops at v3.1.1 and is kept as history). **The 2.3/2.5 divergence that ran through the v3.8.x line was closed by v4.0.0** — LTX-2.5 is the registered default and the vendored port is pinned at the tag `v0.14.19+ltx25.4`. v3.8.x registered 2.3 only and pinned `871694d`, because the 2.5 packs were not publicly downloadable at cut time; they are now. See `CLAUDE.md`'s pin table. The entire v3.0 line shipped — v3.0.0 (Characters / Voice / Image Studio / A2V, May 23) → v3.0.1 (FFLF crash fix) → v3.0.2 (Boost/Turbo accel restored after a 2-month silent regression) → v3.0.3 (HiDream hidden, #15) → v3.0.4 (CivitAI SSL) → v3.0.5 (A2V kwarg signature shim, #5) → v3.0.6 (deep-review hardening) → v3.0.7 (GPU-race fix + /status version surfacing) → **v3.0.8 (ltx-2-mlx v0.14.8 catch-up — codec-only patches, I2V "mosaic"/Metal-watchdog fix #17, ASCII version-skew handshake fix)** → **v3.0.9 (custom I2V Width×height inputs restored for power users; Train-tab dev-transformer Download "unknown install key" fix — form-encoding, reported by @cocktailpeanut)** → **v3.0.10 (model-integrity self-heal — boot scan + `/status.model_integrity` + a one-click Repair banner for corrupt/partial weights, the leading *non-Metal* "mosaic" garbage-decode cause; safetensors header+size check)** → **v3.0.11 (latent helper-handshake hang fixed: `_read_until` mixed `select()` on the raw fd with a buffered `readline()`, so any event the helper emitted *right before* `ready` — a version-skew line, the new runtime fingerprint — got stranded in the TextIOWrapper buffer and the panel hung 120 s → "helper failed to start: None". This is the true root cause behind the mislabeled "⚠️-emoji" handshake break. Now reads the raw fd via `os.read()` into a carry buffer and drains every complete line before re-`select()`-ing. PLUS: every render log self-documents its runtime — mlx/mlx-metal version + Apple chip + macOS — surfaced in `/status`, the `helper ready ·` line, and a standalone `runtime |` line, the exact data needed to triangulate the remaining MLX-numerical "mosaic")** → **v3.0.12 (the REAL mosaic fix + 3 more. The mosaic is NOT a code bug or the missing-upscaler theory (both disproved by local repro — the bare 6-file Q4 set renders byte-identical-clean on M4 Max); it's stale/corrupt weight *content* — right size, wrong bytes — that v3.0.10's header+size check can't see (confirmed: ronyeoh/#18 + claude3d/#5 fixed it only by a fresh full re-download). Added **deep checksum verify vs upstream**: Settings → Model files → "Verify model files (checksum)" / `/models/verify-deep` hashes every weight + compares to HuggingFace's published SHA-256 (proven to match local), mismatches feed the existing one-click Repair re-download. Validated: flipped 16 bytes mid-file → header+size passed, deep-verify caught it. ALSO in v3.0.12: character-LoRA-shows-as-"style-only" fix (#5 — `list_user_loras` recovers trigger+kind from the `_v2` filename when the sidecar is missing); `cgi`→`email` multipart migration (Python-3.13-ready, removes the boot DeprecationWarning, adopted from @ssfeather's PR #22); dynamic 3–8 multi-keyframe UI (adopted from @youngbee12's PR #20, ported clean with the integrity feature preserved + a JS ReferenceError fixed). Folds in v3.0.11's handshake fix + runtime fingerprint.)** → **v3.0.13 (character LoRA fixes, #5 @claude3d: a multi-word/spaced character filename no longer mislabels as style-only — the id regex gated out spaces before the sidecar was read; and the Character tab no longer silently falls back to plain T2V — a UI desync left the avatar's selection ring lit after `character_id` was cleared. Plus an `enhancePrompt` element-id fix. Cherry-picked to prod `ce03139`, release `814dc2d`.)** → **v3.1.0 (Ideogram 4 — open-weight 9.3B text-rendering image model + a visual text-placement canvas that places exact text via normalized-bbox captions. mflux 0.18 `mflux-generate-ideogram4`; gated `ideogram-ai/ideogram-4-fp8` ~26 GB, needs a HF Read token + license. Fixed the gated-download 401 that would have hit EVERY user — the panel now exports its configured token to subprocess env via `_sync_hf_token_to_env` so a stale `hf auth login` cache can't shadow it; proven clean-room. Validated end-to-end: 8-text-element field-guide poster rendered clean, every label placed per its bbox.)** → **v3.1.1 (Ideogram output-card buttons hotfix, reported by Mr Bizarro: an Ideogram image's prompt is a caption JSON, which broke every output surface that fed it into a plain box / inline onclick — the Recent-list Animate button was worked-but-dead because apostrophes/&/< in the caption terminated the single-quoted onclick. Display-layer fix: `_displayPromptFor` derives `high_level_description`, `escapeHtml` the onclick args, friendly `_imgEngineLabel`, and `loadParams` restores an Ideogram image into the visual canvas instead of dumping JSON. `params.prompt` stays the caption JSON; renders unaffected. Validated live.)** All validated end-to-end on the dev panel (deep-verify corrupt-detect + repair, /loras, byte-identical upload, multi-keyframe render, FFLF regression). See §4 for the full version history. The May-17 Codex C+ UI restructure (capability tiers, Q4 surface, Character as 5th mode pill, accel kill, HQ-speed move) and the Train-tab / LoRA-chrome work that followed are all baseline now, folded into v3.0.x. There is no `v2.0.6` tag.
+**Public release: `v4.4.0`** (2026-08-14 — the live preview leaves the postage stamp and plays full-size on the main stage; the Spicy option follows the Settings switch on both engines; H3's Turbo adapter selection moves to LightX2V v1.0 768p and its automatic install is paused until the repack is published. Carries v4.0.3's picker-LoRA crash fix and the v4.0.2 content: the 720p High tier, i2v that animates the image you gave it, characters on the engine's native runtime-LoRA route, and the vendored pin at `v0.14.19+ltx25.4`; see the entries below. The narrative in this paragraph stops at v3.1.1 and is kept as history). **The 2.3/2.5 divergence that ran through the v3.8.x line was closed by v4.0.0** — LTX-2.5 is the registered default and the vendored port is pinned at the tag `v0.14.19+ltx25.4`. v3.8.x registered 2.3 only and pinned `871694d`, because the 2.5 packs were not publicly downloadable at cut time; they are now. See `CLAUDE.md`'s pin table. The entire v3.0 line shipped — v3.0.0 (Characters / Voice / Image Studio / A2V, May 23) → v3.0.1 (FFLF crash fix) → v3.0.2 (Boost/Turbo accel restored after a 2-month silent regression) → v3.0.3 (HiDream hidden, #15) → v3.0.4 (CivitAI SSL) → v3.0.5 (A2V kwarg signature shim, #5) → v3.0.6 (deep-review hardening) → v3.0.7 (GPU-race fix + /status version surfacing) → **v3.0.8 (ltx-2-mlx v0.14.8 catch-up — codec-only patches, I2V "mosaic"/Metal-watchdog fix #17, ASCII version-skew handshake fix)** → **v3.0.9 (custom I2V Width×height inputs restored for power users; Train-tab dev-transformer Download "unknown install key" fix — form-encoding, reported by @cocktailpeanut)** → **v3.0.10 (model-integrity self-heal — boot scan + `/status.model_integrity` + a one-click Repair banner for corrupt/partial weights, the leading *non-Metal* "mosaic" garbage-decode cause; safetensors header+size check)** → **v3.0.11 (latent helper-handshake hang fixed: `_read_until` mixed `select()` on the raw fd with a buffered `readline()`, so any event the helper emitted *right before* `ready` — a version-skew line, the new runtime fingerprint — got stranded in the TextIOWrapper buffer and the panel hung 120 s → "helper failed to start: None". This is the true root cause behind the mislabeled "⚠️-emoji" handshake break. Now reads the raw fd via `os.read()` into a carry buffer and drains every complete line before re-`select()`-ing. PLUS: every render log self-documents its runtime — mlx/mlx-metal version + Apple chip + macOS — surfaced in `/status`, the `helper ready ·` line, and a standalone `runtime |` line, the exact data needed to triangulate the remaining MLX-numerical "mosaic")** → **v3.0.12 (the REAL mosaic fix + 3 more. The mosaic is NOT a code bug or the missing-upscaler theory (both disproved by local repro — the bare 6-file Q4 set renders byte-identical-clean on M4 Max); it's stale/corrupt weight *content* — right size, wrong bytes — that v3.0.10's header+size check can't see (confirmed: ronyeoh/#18 + claude3d/#5 fixed it only by a fresh full re-download). Added **deep checksum verify vs upstream**: Settings → Model files → "Verify model files (checksum)" / `/models/verify-deep` hashes every weight + compares to HuggingFace's published SHA-256 (proven to match local), mismatches feed the existing one-click Repair re-download. Validated: flipped 16 bytes mid-file → header+size passed, deep-verify caught it. ALSO in v3.0.12: character-LoRA-shows-as-"style-only" fix (#5 — `list_user_loras` recovers trigger+kind from the `_v2` filename when the sidecar is missing); `cgi`→`email` multipart migration (Python-3.13-ready, removes the boot DeprecationWarning, adopted from @ssfeather's PR #22); dynamic 3–8 multi-keyframe UI (adopted from @youngbee12's PR #20, ported clean with the integrity feature preserved + a JS ReferenceError fixed). Folds in v3.0.11's handshake fix + runtime fingerprint.)** → **v3.0.13 (character LoRA fixes, #5 @claude3d: a multi-word/spaced character filename no longer mislabels as style-only — the id regex gated out spaces before the sidecar was read; and the Character tab no longer silently falls back to plain T2V — a UI desync left the avatar's selection ring lit after `character_id` was cleared. Plus an `enhancePrompt` element-id fix. Cherry-picked to prod `ce03139`, release `814dc2d`.)** → **v3.1.0 (Ideogram 4 — open-weight 9.3B text-rendering image model + a visual text-placement canvas that places exact text via normalized-bbox captions. mflux 0.18 `mflux-generate-ideogram4`; gated `ideogram-ai/ideogram-4-fp8` ~26 GB, needs a HF Read token + license. Fixed the gated-download 401 that would have hit EVERY user — the panel now exports its configured token to subprocess env via `_sync_hf_token_to_env` so a stale `hf auth login` cache can't shadow it; proven clean-room. Validated end-to-end: 8-text-element field-guide poster rendered clean, every label placed per its bbox.)** → **v3.1.1 (Ideogram output-card buttons hotfix, reported by Mr Bizarro: an Ideogram image's prompt is a caption JSON, which broke every output surface that fed it into a plain box / inline onclick — the Recent-list Animate button was worked-but-dead because apostrophes/&/< in the caption terminated the single-quoted onclick. Display-layer fix: `_displayPromptFor` derives `high_level_description`, `escapeHtml` the onclick args, friendly `_imgEngineLabel`, and `loadParams` restores an Ideogram image into the visual canvas instead of dumping JSON. `params.prompt` stays the caption JSON; renders unaffected. Validated live.)** All validated end-to-end on the dev panel (deep-verify corrupt-detect + repair, /loras, byte-identical upload, multi-keyframe render, FFLF regression). See §4 for the full version history. The May-17 Codex C+ UI restructure (capability tiers, Q4 surface, Character as 5th mode pill, accel kill, HQ-speed move) and the Train-tab / LoRA-chrome work that followed are all baseline now, folded into v3.0.x. There is no `v2.0.6` tag.
> **🎬 2026-08-14 — v4.0.4: the forming take plays on the MAIN STAGE.** The live preview existed since v3.7 and lived in a postage stamp next to the queue, which is not where anyone looks while they wait. It now takes the big player.
>
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 30c1cb3..0e7dff6 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -3382,6 +3382,33 @@ def _fetch_raw_text(url: str, timeout: int = 10) -> str | None:
return None
+# The SHA this PROCESS loaded, captured once and never refreshed.
+#
+# v4.0.5 built stale-process detection on `_VERSION_STATE["local_sha"]`,
+# described in its own docstring as "the boot snapshot". It is not one:
+# `_check_remote_once()` calls `_detect_local_install_state()` at the top of
+# every poll — deliberately, so a tree that was dirty at boot and is clean now
+# stops being suppressed without a restart. That re-detect also refreshes
+# local_sha, so within one poll interval local_sha equals disk again and
+# `disk_sha != boot_sha` is false forever.
+#
+# Net effect: the "Restart to finish update" pill could never fire. Every user
+# who pulled an update was told nothing, ran the old code, and concluded the
+# update had done nothing — reported 2026-08-15 by the owner, who pulled 4.3.0
+# and saw a 4.0.9 UI for seven hours.
+#
+# This is deliberately captured at IMPORT, not inside a function that anything
+# else might call again.
+_BOOT_HEAD_SHA: str | None = None
+
+
+def _capture_boot_head() -> None:
+ """Record this process's HEAD exactly once. Idempotent by design."""
+ global _BOOT_HEAD_SHA
+ if _BOOT_HEAD_SHA is None:
+ _BOOT_HEAD_SHA = _git_capture(["rev-parse", "HEAD"])
+
+
def _detect_local_install_state() -> None:
"""Populate _VERSION_STATE.local_* fields. Called once at startup; result
doesn't change while the panel is running (no auto-pull on the user's
@@ -3547,6 +3574,7 @@ def version_check_loop() -> None:
"""Daemon thread entry: detect local state once, then poll the remote
every _VERSION_POLL_INTERVAL_SEC. First poll happens after a 30s
delay so we don't compete with boot-time work."""
+ _capture_boot_head() # BEFORE anything can re-detect local state
_detect_local_install_state()
time.sleep(_VERSION_STARTUP_DELAY_SEC)
while True:
@@ -3572,7 +3600,9 @@ def get_version_state() -> dict:
with _VERSION_LOCK:
snap = dict(_VERSION_STATE)
disk_sha = _git_capture(["rev-parse", "HEAD"])
- boot_sha = snap.get("local_sha")
+ # _BOOT_HEAD_SHA, never snap["local_sha"]: the latter is re-detected on
+ # every remote poll and therefore always agrees with disk.
+ boot_sha = _BOOT_HEAD_SHA
snap["stale_process"] = bool(disk_sha and boot_sha and disk_sha != boot_sha)
if snap["stale_process"]:
snap["disk_short"] = disk_sha[:7]
@@ -25493,6 +25523,8 @@ HTML = r"""<!doctype html>
.ub-star[hidden] { display: none; }
.ub-star a { color: #f0b940; font-weight: 600; }
.ub-sep { opacity: .4; }
+ .star-link { color: var(--ink-500, #98a0b3); }
+ .star-link:hover { color: #f0b940; }
.pill-update {
color: var(--warning, #f0b940);
border-color: rgba(240,185,64,0.55);
@@ -33079,6 +33111,7 @@ HTML = r"""<!doctype html>
<symbol id="ph-device-mobile" viewBox="0 0 256 256"><rect x="64" y="24" width="128" height="208" rx="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="104" y1="56" x2="152" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-user-plus" viewBox="0 0 256 256"><circle cx="108" cy="100" r="60" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="116" x2="248" y2="116" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="224" y1="92" x2="224" y2="140" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M16,208c20.83-36.04,57.06-60,104-60s83.17,23.96,104,60" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-music-notes" viewBox="0 0 256 256"><circle cx="180" cy="184" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="52" cy="200" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="80 200 80 56 208 24 208 184" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="80" y1="88" x2="208" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
+<symbol id="ph-star" viewBox="0 0 256 256"><path d="M132.4,190.7l50.4,32.5a8,8,0,0,0,12.1-8.7l-15.1-57.7a8,8,0,0,1,2.7-8.3l45.6-37.5a8,8,0,0,0-4.6-14.2l-59.5-3.8a8,8,0,0,1-7-5.1L134.6,31.5a8,8,0,0,0-14.9,0L97.3,87.9a8,8,0,0,1-7,5.1L30.8,96.8a8,8,0,0,0-4.6,14.2l45.6,37.5a8,8,0,0,1,2.7,8.3L60.5,209a8,8,0,0,0,12.1,8.7l50.4-32.5A8,8,0,0,1,132.4,190.7Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-x-brand" viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" fill="currentColor"/></symbol>
<!-- ==== ENGINE MARKS ====================================================
One per row of the ENGINES table (`mark`). Original stroked monograms,
@@ -33220,6 +33253,16 @@ HTML = r"""<!doctype html>
single right-corner cluster. Subtle pulsing glow uses the
Phosphene gradient (blue → violet) so it pulls the eye without
being loud. Tooltip on hover; the link itself opens a new tab. -->
+ <!-- The star has a PERMANENT home, not only the one-time row in the update
+ banner. That row is gated on being behind, so a user who keeps Phosphene
+ current — the people most likely to star it — could never see it, and
+ there was no way to find it on purpose. This is a static link, never a
+ prompt: no badge, no pulse, no counter. -->
+ <a class="icon-btn star-link" id="starLink"
+ href="https://github.com/mrbizarro/phosphene" target="_blank" rel="noopener"
+ title="Star Phosphene on GitHub — it is how people find it">
+ <svg class="ph" aria-hidden="true"><use href="#ph-star"/></svg>
+ </a>
<a class="phosphene-x-link" href="https://x.com/PhospheneAI" target="_blank" rel="noopener"
title="Follow @PhospheneAI on X — the official Phosphene account">
<svg class="ph" aria-hidden="true"><use href="#ph-x-brand"/></svg>
@@ -52077,6 +52120,30 @@ function _ubRender(s) {
el.hidden = false;
}
+// After a successful pull the banner stops being an offer and becomes the
+// instruction. Returns true when it handled the message, so the caller can skip
+// its alert fallback (a panel with the banner hidden still gets the modal).
+function _ubRestartState(newVersion, requiresFullUpdate) {
+ const el = document.getElementById('updateBanner');
+ if (!el || el.hidden) return false;
+ const star = document.getElementById('ubStar');
+ if (star) star.hidden = true;
+ const title = document.getElementById('ubTitle');
+ const sub = document.getElementById('ubSub');
+ const go = document.getElementById('ubUpdate');
+ const later = document.getElementById('ubLater');
+ if (title) title.textContent = `Updated to ${newVersion} — restart to finish`;
+ if (sub) {
+ sub.textContent = requiresFullUpdate
+ ? 'This update touched Python dependencies, so use Pinokio\u2019s Update button (not just Stop and Start) so they reinstall.'
+ : 'Click Stop, then Start in Pinokio. Your queue and settings are preserved.';
+ }
+ if (go) { go.hidden = true; }
+ if (later) { later.textContent = 'Dismiss'; }
+ el.classList.add('ub-done');
+ return true;
+}
+
async function _ubSaveSetting(patch) {
Object.assign(window._ubStarSettings || (window._ubStarSettings = {}), patch);
try {
@@ -52097,8 +52164,9 @@ function _ubWire() {
if (go) go.onclick = () => {
go.disabled = true;
go.textContent = 'Updating…';
- // Reuse the pill's existing pull path — one implementation, not two.
- versionPillClick();
+ // Straight to the pull, with no confirm: this button already said what it
+ // does. Reuses the pill's implementation, not a second copy of it.
+ versionDoPull({skipConfirm: true});
};
const later = document.getElementById('ubLater');
if (later) later.onclick = () => {
@@ -52125,6 +52193,12 @@ function _ubWire() {
}
document.addEventListener('DOMContentLoaded', () => {
_ubWire();
+ // Same anonymous count as the banner's link, so the two places agree.
+ const sl = document.getElementById('starLink');
+ if (sl) sl.addEventListener('click', () => {
+ _ubSaveSetting({star_prompt_done: true}); // retire the banner ask too
+ try { fetch('/star-click', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({via: 'link'})}); } catch (e) {}
+ });
// The banner needs two settings before it can decide anything, and the
// Settings modal may never be opened — so read them here rather than
// relying on _settingsCache, which is only populated when that opens.
@@ -52213,17 +52287,23 @@ async function versionDoRefresh() {
renderVersionPill();
}
-async function versionDoPull() {
+async function versionDoPull(opts) {
+ opts = opts || {};
const s = _versionState || {};
const target = _versionRemoteLabel(s);
const local = _versionDisplayLabel(s);
- const ok = confirm(
- `Pull update from ${local} → ${target}?\n\n` +
- `This runs git pull on your phosphene install. After it succeeds, ` +
- `you'll need to click Stop, then Start in Pinokio to load the new code. ` +
- `Your queue and settings are preserved across restarts.`
- );
- if (!ok) return;
+ // A button that says "Update now" does not need to ask whether you meant it.
+ // The confirm stays for the version PILL, which is a small ambiguous target
+ // that also does four other things depending on state.
+ if (!opts.skipConfirm) {
+ const ok = confirm(
+ `Pull update from ${local} → ${target}?\n\n` +
+ `This runs git pull on your phosphene install. After it succeeds, ` +
+ `you'll need to click Stop, then Start in Pinokio to load the new code. ` +
+ `Your queue and settings are preserved across restarts.`
+ );
+ if (!ok) return;
+ }
const pill = document.getElementById('versionPill');
pill.classList.add('pill-busy');
pill.innerHTML = '<svg class="ph" aria-hidden="true" style="margin-right:4px;vertical-align:-2px;animation:phSpin 1.2s linear infinite"><use href="#ph-arrow-clockwise-bold"/></svg>pulling…';
@@ -52253,7 +52333,15 @@ async function versionDoPull() {
? `\n\n⚠ This update touched Python dependencies / patches. Use ` +
`Pinokio's Update button (not just Stop+Start) so deps reinstall.`
: '';
- alert(`Pulled to ${newVersion}.\n\nClick Stop, then Start in Pinokio to apply.${fullUpdateNote}`);
+ // Inline, not a modal: the banner is already on screen and is where the
+ // user is looking. An alert here was the second click in "I had to click
+ // twice" — the first pulled, the second only told you what to do next.
+ if (typeof _ubRestartState === 'function'
+ && _ubRestartState(newVersion, !!(data.state && data.state.pull_requires_full_update))) {
+ // handled inline
+ } else {
+ alert(`Pulled to ${newVersion}.\n\nClick Stop, then Start in Pinokio to apply.${fullUpdateNote}`);
+ }
} catch (e) {
pill.classList.remove('pill-busy');
renderVersionPill();
diff --git a/test_stale_process.py b/test_stale_process.py
new file mode 100644
index 0000000..0de0467
--- /dev/null
+++ b/test_stale_process.py
@@ -0,0 +1,78 @@
+"""The "Restart to finish update" detector, and the reason it never fired.
+
+v4.0.5 compared disk HEAD against `_VERSION_STATE["local_sha"]`, calling that
+"the boot snapshot". It is not one: `_check_remote_once()` re-runs
+`_detect_local_install_state()` at the top of every poll — on purpose, so a
+tree that was dirty at boot and is clean now stops being suppressed without a
+restart. That same call refreshes `local_sha`, so within one poll interval it
+equals disk again and `disk_sha != boot_sha` is false forever.
+
+Consequence, reported 2026-08-15: pull an update, get no prompt to restart, run
+the old code, conclude the update did nothing. Seven hours on a 4.0.9 UI with
+4.3.0 on disk.
+
+The fix is a separate `_BOOT_HEAD_SHA` captured once at process start. These
+tests pin the behaviour AND the trap — `test_polled_state_does_not_defeat_it`
+is the one that would have caught the original bug.
+"""
+
+import unittest
+from unittest import mock
+
+import mlx_ltx_panel as panel
+
+
+class StaleProcessDetection(unittest.TestCase):
+ def setUp(self):
+ self._saved = panel._BOOT_HEAD_SHA
+
+ def tearDown(self):
+ panel._BOOT_HEAD_SHA = self._saved
+
+ def test_capture_is_idempotent(self):
+ """A second call must not re-point the snapshot at whatever is on disk now."""
+ panel._BOOT_HEAD_SHA = None
+ with mock.patch.object(panel, "_git_capture", return_value="aaaa111"):
+ panel._capture_boot_head()
+ with mock.patch.object(panel, "_git_capture", return_value="bbbb222"):
+ panel._capture_boot_head()
+ self.assertEqual(panel._BOOT_HEAD_SHA, "aaaa111")
+
+ def test_stale_when_disk_moved_under_the_process(self):
+ panel._BOOT_HEAD_SHA = "aaaa111"
+ with mock.patch.object(panel, "_git_capture", return_value="bbbb222"):
+ snap = panel.get_version_state()
+ self.assertTrue(snap["stale_process"])
+ self.assertEqual(snap.get("disk_short"), "bbbb222"[:7])
+
+ def test_not_stale_when_disk_matches_boot(self):
+ panel._BOOT_HEAD_SHA = "aaaa111"
+ with mock.patch.object(panel, "_git_capture", return_value="aaaa111"):
+ snap = panel.get_version_state()
+ self.assertFalse(snap["stale_process"])
+
+ def test_polled_state_does_not_defeat_it(self):
+ """THE regression. A poll refreshing local_sha must not clear staleness.
+
+ This is the original bug expressed as a test: local_sha catches up to
+ disk on every remote check, so anything comparing against it reports
+ "not stale" no matter how old the running process is.
+ """
+ panel._BOOT_HEAD_SHA = "aaaa111"
+ with panel._VERSION_LOCK:
+ panel._VERSION_STATE["local_sha"] = "bbbb222" # what a poll would write
+ with mock.patch.object(panel, "_git_capture", return_value="bbbb222"):
+ snap = panel.get_version_state()
+ self.assertTrue(snap["stale_process"],
+ "stale_process must key off the boot SHA, not the polled one")
+
+ def test_missing_git_never_claims_staleness(self):
+ """No git binary must read as 'fine', not as a permanent restart nag."""
+ panel._BOOT_HEAD_SHA = "aaaa111"
+ with mock.patch.object(panel, "_git_capture", return_value=None):
+ snap = panel.get_version_state()
+ self.assertFalse(snap["stale_process"])
+
+
+if __name__ == "__main__":
+ unittest.main()