Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

plan: capture LoRA checkpoint-picker dedupe + hide-untrained-step0 follow-up

[._.]/ Adam Eivy527f5d873795
diff --git a/PLAN.md b/PLAN.md
index 18b02411d4..7d95dddc31 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -20,6 +20,8 @@ independently.
<!-- reference-watch proposals: slug-tagged, picked up by /claim later -->
+- [ ] [lora-checkpoint-picker-dedupe-and-hide-untrained-step0] **LoRA checkpoint picker: dedupe by step and don't offer the untrained step-0 checkpoint as deployable.** Surfaced 2026-06-14 from run `90043893` showing 3 checkpoint cards all at "step 0" with identical previews. Two real bugs in `server/services/loraTraining/checkpoints.js#listRunCheckpoints` (NOT caused by the segmentation PR — pre-existing): (1) mflux saves a `0000000_checkpoint.zip` from its `num_iterations==0` monitoring block (the *untrained* initial adapter, identical base-model preview every time) and `listRunCheckpoints` lists it as a deployable "Use this" option — deploying it is a no-op; filter step 0 out of the deployable list (or clearly mark it non-deployable), since the LoRA has zero training at step 0. (2) `run.artifacts.checkpoints` accumulates duplicate entries across MANUAL resume attempts — each resume is a fresh job/wrapper/watcher with an empty `seen` set, so it re-emits the already-existing checkpoint(s), and `listRunCheckpoints` does no dedup → N identical cards. Dedupe by `step` (keep the entry with a non-null loss / latest). Add field-level tests on `listRunCheckpoints` output (dedup + step-0 exclusion). Note: the new segmented-training path does NOT add duplicates (one watcher with a persistent `seen` set spans all segments), so this is purely a manual-resume + step-0 artifact. Estimated scope: small.
+
- [ ] [ref-watch-phosphene-model-weights-integrity-repair] **Verify downloaded model weights (header/size + optional checksum) and offer one-click Repair.** From `reference-watch` review of Phosphene (commits `173d2fd5` + `80752a70`, 2026-06-12). Upstream proved that corrupt/partial safetensors (right size, *wrong bytes*) silently decode to garbled "mosaic" video output that a clean re-download fixes — a leading non-Metal cause of bad renders that hits some machines and not others, so it's cross-platform-relevant for PortOS (mac and windows). PortOS currently only sums file sizes: `server/lib/hfCache.js#inspectModelCache()` returns `{ cached, sizeBytes }` with no integrity check. Fix: add a `verifyModelCache(repoId)` to `server/lib/hfCache.js` that does a cheap structural check first (read each safetensors header length prefix and confirm the file is at least header+declared-tensor-bytes long — catches truncation without loading tensors), and an optional deep check that hashes each weight and compares against HuggingFace's published LFS sha256 (from the repo's `git lfs` pointer / `/api/models/<repo>` metadata). Surface results on `GET /api/video-gen/status` (and the imageGen status it mirrors) as a `modelIntegrity` field, add `POST /api/video-gen/models/verify` (force re-scan, threaded/on-demand) and `POST /api/video-gen/models/repair` (delete flagged files + re-download via the existing resumable HF fetch path), and show a dismissible "Repair model" banner in `client/src/pages/VideoGen.jsx` when integrity reports bad/missing files. Estimated scope: large.
- [ ] [ref-watch-phosphene-runtime-fingerprint-in-status] **Surface the video runtime fingerprint (ltx-2-mlx version, MLX/Metal version, chip, OS) in video-gen status + render logs.** From `reference-watch` review of Phosphene (commits `b069e2d2` P2 + `093a9f05`, 2026-06-12). Upstream found that garbled/"mosaic" output is often a per-chip/per-runtime numerical bug, not a crash, and healthy bug reports carried no version info — so it now logs a one-line runtime fingerprint and exposes `ltx_version`/`mlx_version`/`chip`/`os` on `/status`. PortOS already resolves BYOV runtimes (`server/services/videoGen/local.js#BYOV_RUNTIME_INFO`) but `GET /api/video-gen/status` (`server/routes/videoGen.js:180`) does not report the resolved interpreter/package versions. Fix: have `generate_ltx2.py` (and the wan22/hunyuan/win helpers) emit a single `runtime | ...` fingerprint line at startup (importlib.metadata version of the runtime package + platform/processor on mac, torch+CUDA on windows), capture it in `local.js`, persist it onto the render job/history record so each render log self-documents its environment, and add a `runtime` block to the `/status` payload for the client to show. Estimated scope: medium.