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.
Python ai-filmmakingai-videoai-video-generatorapple-siliconhailuoimage-to-videolip-synclocal-ailora-trainingltx-2ltx-2-5ltx-videomacosminimax-h3mlxmusic-generationoffline-aipinokiotext-to-videovideo-generation
Y1.015 · render duration on gallery cards; dev panel infrastructure
mrbizarro5e1f70b2f9af
diff --git a/.clinerules b/.clinerulesindex c95d4c9..3cf6fb6 100644--- a/.clinerules+++ b/.clinerules@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/.cursorrules b/.cursorrulesindex c95d4c9..3cf6fb6 100644--- a/.cursorrules+++ b/.cursorrules@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/.windsurfrules b/.windsurfrulesindex c95d4c9..3cf6fb6 100644--- a/.windsurfrules+++ b/.windsurfrules@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/AGENTS.md b/AGENTS.mdindex c95d4c9..3cf6fb6 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/CLAUDE.md b/CLAUDE.mdindex c95d4c9..3cf6fb6 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/GEMINI.md b/GEMINI.mdindex c95d4c9..3cf6fb6 100644--- a/GEMINI.md+++ b/GEMINI.md@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/QWEN.md b/QWEN.mdindex c95d4c9..3cf6fb6 100644--- a/QWEN.md+++ b/QWEN.md@@ -165,6 +165,31 @@ new patch versions without a venv rebuild — used when we addedserious project shipped by `mrbizarro`. Co-author trailers showing"Claude" make it look like a vibe-coded toy.+### Branch model — `main` is production, `dev` is staging (Y1.015+)++- **`main`** is what real users get. Pinokio's Discover URL points here;+ every commit pushed to `main` is shipped to every user the next time+ they click Update. Treat it accordingly.+- **`dev`** is the staging branch. Push WIP commits here freely. The+ local "Phosphene Dev" Pinokio panel (set up via+ `scripts/setup_dev_panel.sh`) tracks this branch on port 8199 and+ shows a DEV badge in the header.+- **Workflow**: develop on `dev` → push to `origin/dev` → click Update+ in the Phosphene Dev panel → test what real users will experience →+ once verified, merge `dev` → `main` and push. That's when users get+ the change.+- The panel auto-detects which profile it is from `git rev-parse+ --abbrev-ref HEAD`: branch == `dev` → port 8199 + DEV badge; anything+ else → port 8198 + normal header. No config files to edit per panel.+- `update.js` is also branch-aware as of Y1.015 (`git pull --ff-only+ origin <current branch>`) so the dev panel's Update pulls dev and+ the production panel's Update pulls main, from the same shared code.+- The dev panel symlinks `mlx_models/` from the production install+ (saves ~36 GB of duplicate weights). State / outputs / uploads stay+ separate per panel.+- Don't push experimental commits directly to main. Always go via dev.+ The whole point of the staging panel is to verify before users hit it.+### Git policy — NEVER FORCE-PUSH `origin/main`- A history-rewrite + force-push on 2026-05-01 (to scrub identityleaks from old commits) broke `git pull` for every existing userdiff --git a/VERSION b/VERSIONindex b7bc815..eeebf73 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-Y1.013+Y1.015diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.pyindex 787661a..bebc5f0 100644--- a/mlx_ltx_panel.py+++ b/mlx_ltx_panel.py@@ -86,7 +86,34 @@ HIDDEN_FILE = STATE_DIR / "panel_hidden.json"HELPER_IDLE_TIMEOUT = int(os.environ.get("LTX_HELPER_IDLE_TIMEOUT", "1800"))HELPER_LOW_MEMORY = os.environ.get("LTX_HELPER_LOW_MEMORY", "true")FPS = 24-PORT = int(os.environ.get("LTX_PORT", "8198"))++# ---- Profile (production vs dev) ---------------------------------------------+# Y1.015: support running a local "dev" Pinokio panel side-by-side with the+# production install. The dev panel checks out the `dev` branch of the same+# repo and binds to a different port, so commits can be tested in Pinokio+# before merging to main. Detection is automatic from the git branch — no+# config to maintain. PHOSPHENE_PROFILE env var overrides for testing.+def _detect_profile() -> str:+ forced = os.environ.get("PHOSPHENE_PROFILE", "").strip().lower()+ if forced in ("dev", "production"):+ return forced+ try:+ out = subprocess.check_output(+ ["git", "-C", str(ROOT), "rev-parse", "--abbrev-ref", "HEAD"],+ stderr=subprocess.DEVNULL, timeout=2,+ ).decode("utf-8", "replace").strip()+ if out == "dev":+ return "dev"+ except Exception:+ pass+ return "production"+++PROFILE = _detect_profile()+# Default port: 8198 production, 8199 dev — so both panels can run side by+# side. LTX_PORT env var still overrides if the user wants something else.+DEFAULT_PORT = 8199 if PROFILE == "dev" else 8198+PORT = int(os.environ.get("LTX_PORT", str(DEFAULT_PORT)))HISTORY_LIMIT = 200HISTORY_PERSIST_LIMIT = 100 # how many history entries to write to panel_queue.jsonHISTORY_API_LIMIT = 50 # how many to expose via /status@@ -1954,13 +1981,31 @@ def list_outputs(include_hidden: bool = False) -> list[dict]:is_hidden = path_s in hidden_snapif is_hidden and not include_hidden:continue+ # Pull elapsed_sec from the sidecar so the gallery card can show+ # "how long this took to render" instead of a wall-clock timestamp+ # (the timestamp tells you nothing useful when scanning a list of+ # 60 outputs — duration is what users actually compare). Sidecar+ # read is cheap, but tolerate a missing/corrupt sidecar by leaving+ # elapsed_sec null and letting the UI fall back to the file mtime.+ elapsed_sec = None+ sidecar = p.with_suffix(p.suffix + ".json")+ has_sidecar = sidecar.exists()+ if has_sidecar:+ try:+ meta = json.loads(sidecar.read_text())+ v = meta.get("elapsed_sec")+ if isinstance(v, (int, float)):+ elapsed_sec = float(v)+ except Exception:+ passout.append({"name": p.name,"path": path_s,"mtime": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(p.stat().st_mtime)),"size_mb": p.stat().st_size / 1024 / 1024,+ "elapsed_sec": elapsed_sec,"url": f"/file?path={quote(path_s)}",- "has_sidecar": p.with_suffix(p.suffix + ".json").exists(),+ "has_sidecar": has_sidecar,"hidden": is_hidden,})if len(out) >= 60:@@ -3614,8 +3659,18 @@ def page() -> str:"default_image": str(REFERENCE),"default_audio": str(AUDIO_DEFAULT),"fps": FPS, "model": MODEL_ID,+ "profile": PROFILE,})- return HTML.replace("__BOOTSTRAP__", bootstrap)+ # Profile badge — only visible in the dev panel. Lets Salo tell at a+ # glance which install he's looking at when both panels are open.+ profile_badge = (+ '<span class="profile-badge" title="Dev panel · pulls from `dev` branch · port '+ + str(PORT) + '">DEV</span>'+ if PROFILE == "dev" else ""+ )+ return (HTML+ .replace("__BOOTSTRAP__", bootstrap)+ .replace("__PROFILE_BADGE__", profile_badge))HTML = r"""<!doctype html>@@ -3661,6 +3716,21 @@ HTML = r"""<!doctype html>}.brand { display: inline-flex; align-items: center; flex-shrink: 0; }.brand img { height: 104px; width: auto; display: block; }+ /* DEV badge — visible only on the dev panel (PROFILE == 'dev'). Sits+ next to the Phosphene wordmark so it's the first thing you notice+ when comparing dev vs production tabs. */+ .profile-badge {+ display: inline-flex; align-items: center;+ margin-left: 12px;+ padding: 3px 9px;+ border-radius: 5px;+ background: rgba(240,185,64,0.18);+ color: var(--warning, #f0b940);+ border: 1px solid rgba(240,185,64,0.55);+ font-size: 10px; font-weight: 700;+ letter-spacing: 0.12em;+ cursor: help;+ }.tag { color: var(--muted); font-size: 11px; }.pill {padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500;@@ -4981,6 +5051,7 @@ HTML = r"""<!doctype html><header><a href="/" class="brand"><img src="/assets/logo-header.png" alt="Phosphene"></a>+ __PROFILE_BADGE__<span class="spacer"></span><!-- Hardware tier badge — clickable, opens a dialog explaining whatthis Mac's RAM tier allows. Modes / qualities the tier doesn't@@ -6524,6 +6595,21 @@ function setFilter(mode) {poll();}+// Format render duration for the gallery card sub-line. Falls back to+// the time-of-day when the sidecar is missing (older outputs that+// pre-date the elapsed_sec field, or outputs whose sidecar got+// deleted) so the slot is never empty.+function _outputDurationLabel(o) {+ const s = (o && typeof o.elapsed_sec === 'number') ? o.elapsed_sec : null;+ if (s == null) {+ // Fallback: show time-of-day from mtime so empty cards aren't worse.+ return o.mtime ? o.mtime.slice(11, 16) : '—';+ }+ if (s < 60) return `${Math.round(s)} s`;+ if (s < 3600) return `${Math.floor(s / 60)} m ${Math.round(s % 60)} s`;+ return `${Math.floor(s / 3600)} h ${Math.round((s % 3600) / 60)} m`;+}+function renderCarousel() {const el = document.getElementById('carousel');if (!currentOutputs.length) { el.innerHTML = '<div class="empty-msg">No outputs in this view yet.</div>'; return; }@@ -6539,7 +6625,9 @@ function renderCarousel() {: ''}<div class="info"><div class="name" title="${escapeHtml(o.name)}">${escapeHtml(o.name)}</div>- <div class="sub">${o.mtime.slice(11,16)} · ${o.size_mb.toFixed(1)} MB</div>+ <div class="sub" title="Render time · file size">+ ${_outputDurationLabel(o)} · ${o.size_mb.toFixed(1)} MB+ </div></div><div class="row-btns"><button onclick="event.stopPropagation(); ${o.hidden ? 'unhide' : 'hide'}(${pathAttr})">${o.hidden ? 'Show' : 'Hide'}</button>diff --git a/scripts/setup_dev_panel.sh b/scripts/setup_dev_panel.shnew file mode 100755index 0000000..3c8d1db--- /dev/null+++ b/scripts/setup_dev_panel.sh@@ -0,0 +1,109 @@+#!/usr/bin/env bash+#+# Set up a local Phosphene Dev panel side-by-side with the production+# install. Y1.015+.+#+# What this gives you:+# ~/pinokio/api/phosphene.git/ ← production panel (port 8198, main)+# ~/pinokio/api/phosphene-dev.git/ ← dev panel (port 8199, dev)+#+# The dev panel is auto-detected by the panel script: when its git+# branch is `dev`, the panel binds 8199 instead of 8198 and shows a+# "DEV" badge in the header. No code edits required — both clones run+# the same code, just on different branches.+#+# To save ~36 GB of duplicate model downloads, this script symlinks+# mlx_models/ from the production install into the dev panel. Outputs+# and state stay separate (each panel has its own state/, mlx_outputs/,+# panel_uploads/) so dev experiments don't pollute the production+# gallery.+#+# Run once:+# bash scripts/setup_dev_panel.sh+#+# After that, open Pinokio. The "phosphene-dev.git" folder appears as a+# separate panel — Install (re-runs install.js for the venv + patches)+# then Start. Browse to http://127.0.0.1:8199 to use it.+#+# Workflow from then on:+# 1. Develop on the `dev` branch (push commits to origin/dev).+# 2. In Pinokio's Phosphene Dev panel, click Update → Stop → Start.+# 3. Verify the change works exactly like a user will see it.+# 4. Once happy: merge dev into main (`git checkout main && git merge dev && git push`).+# 5. Real users get the change on their next Pinokio Update.++set -euo pipefail++PROD_DIR="${PHOSPHENE_PROD_DIR:-$HOME/pinokio/api/phosphene.git}"+DEV_DIR="${PHOSPHENE_DEV_DIR:-$HOME/pinokio/api/phosphene-dev.git}"++if [[ ! -d "$PROD_DIR/.git" ]]; then+ echo "✗ no production install found at: $PROD_DIR" >&2+ echo " install Phosphene first via Pinokio Discover, then re-run this script." >&2+ exit 1+fi++# ---- 1. clone (or skip if dev install already exists) ------------------------+if [[ -d "$DEV_DIR/.git" ]]; then+ echo "→ dev panel already exists at $DEV_DIR — skipping clone."+else+ echo "→ cloning phosphene into $DEV_DIR"+ git clone https://github.com/mrbizarro/phosphene.git "$DEV_DIR"+fi++# ---- 2. switch to dev branch -------------------------------------------------+cd "$DEV_DIR"+echo "→ fetching origin..."+git fetch origin+if git show-ref --verify --quiet refs/remotes/origin/dev; then+ # origin/dev exists upstream — track it+ if git show-ref --verify --quiet refs/heads/dev; then+ echo "→ dev branch already exists locally; switching to it"+ git checkout dev+ git pull --ff-only origin dev || true+ else+ echo "→ creating local dev tracking origin/dev"+ git checkout -b dev origin/dev+ fi+else+ echo "→ origin has no dev branch yet; creating one from main"+ git checkout -b dev+ echo " (push it with: git push -u origin dev)"+fi++# ---- 3. share heavy assets via symlink ---------------------------------------+# mlx_models is the big one (~36 GB) — symlink so dev + prod share weights.+# In the production install, mlx_models is itself an fs.link symlink to a+# Pinokio drive folder; the symlink-of-a-symlink resolves fine through both.+# Outputs / state / uploads stay separate per panel by design.+for shared in mlx_models; do+ src="$PROD_DIR/$shared"+ dst="$DEV_DIR/$shared"+ if [[ -e "$src" && ! -L "$dst" ]]; then+ if [[ -d "$dst" && ! -L "$dst" ]]; then+ # If install.js already created it as a real dir on the dev side,+ # remove it before symlinking. Empty / freshly-created dirs only —+ # we never delete a real model collection.+ if [[ -z "$(ls -A "$dst" 2>/dev/null)" ]]; then+ rmdir "$dst"+ else+ echo " (skip $shared: dev side already has content; not overwriting)"+ continue+ fi+ fi+ ln -s "$src" "$dst"+ echo "→ linked $shared → $src"+ fi+done++echo+echo "✓ Phosphene Dev panel ready"+echo " Branch: $(git rev-parse --abbrev-ref HEAD)"+echo " HEAD: $(git rev-parse --short HEAD)"+echo " Path: $DEV_DIR"+echo+echo "Next:"+echo " 1. Open Pinokio. The 'phosphene-dev.git' folder appears as a separate panel."+echo " 2. Click Install — re-runs install.js for the venv + patches (idempotent)."+echo " 3. Click Start. Panel binds http://127.0.0.1:8199 with a DEV badge."+echo " 4. Push to origin/dev → click Update on that panel → test → merge to main."diff --git a/update.js b/update.jsindex 9bbb49c..5f1e57f 100644--- a/update.js+++ b/update.js@@ -9,33 +9,23 @@ module.exports = {// (durability of model assets vs. routine code updates) and adds a// 36 GB merge step to a flow that should be fast.- // Resilient pull for the panel repo (mrbizarro/phosphene). Plain- // `git pull` was breaking for existing users after a history-rewrite- // event on origin (commit identities were scrubbed; force-push- // landed; existing clones could no longer fast-forward because- // their local history didn't match origin's anymore).+ // Resilient + branch-aware pull for the panel repo. Y1.015 made this+ // branch-aware so the same update.js works for both the production+ // panel (tracks `main`) and a local dev panel (tracks `dev`). The+ // currently-checked-out branch is whatever the install was set up+ // with; we pull origin/<that branch> rather than hardcoding `main`.//- // The new sequence:- // 1. git fetch origin- // 2. try a fast-forward pull. Works for everyone whose history- // lines up with origin/main (i.e. fresh installs and most- // users post-recovery).- // 3. if step 2 fails, fall back to `git reset --hard origin/main`.- // A Pinokio-installed panel is not a place users keep local- // commits, so wiping the working tree to match origin is the- // Right Thing — it's what they meant by clicking Update.- //- // The compound shell command runs through Pinokio's shell.run with- // && / || so any path that resolves to "we're now on origin/main- // HEAD" finishes 0; any other state finishes non-zero and the user- // sees the error. We add a final `git rev-parse --short HEAD` so the- // log shows what we ended up on, even on the happy path.+ // Recovery from divergence (Y1.002) is preserved: if --ff-only+ // refuses, we fall back to reset --hard origin/<branch>. A Pinokio+ // panel install is never expected to carry local commits.{method: "shell.run",params: {message: ["git fetch origin",- "git pull --ff-only origin main || (echo 'history diverged from origin (likely a force-push); falling back to reset --hard' && git reset --hard origin/main)",+ "BRANCH=$(git rev-parse --abbrev-ref HEAD)",+ "echo \"updating branch: $BRANCH\"",+ "git pull --ff-only origin $BRANCH || (echo 'history diverged from origin (force-push?); falling back to reset --hard' && git reset --hard origin/$BRANCH)","git rev-parse --short HEAD"]}