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

docs: capture deferred review findings from v2.7.0 release PR

Adam Eivy093832983a2f
diff --git a/PLAN.md b/PLAN.md
index 088a3f4133..69b1ad0e71 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -23,6 +23,15 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
- [ ] [ref-watch-phosphene-mlx-post-decode-os-exit] **Bypass MLX post-decode deallocator hang via `os._exit(0)`.** From `reference-watch` review of phosphene (commits `adc1cd25` + `94bd6965`, 2026-05-22). At PortOS's current `LTX2_PIN=f8f20c83` the bug isn't reachable, but the moment a user updates `ltx-2-mlx` or PortOS bumps the pin past the May 9 refactor, every Distilled / Extend / two-stage render stalls 5–15 min after the upstream "Decoding done in X.Xs" log while Metal command-buffer completion handlers hold the GIL through frame teardown. Fix: in `scripts/generate_ltx2.py` `main()`, after `print(json.dumps(...))`, call `os._exit(0)` instead of returning normally — mp4 is on disk, stdout was flushed, skipping deallocator teardown saves up to 15 min. Document why in the file's docstring. Subsumes any in-helper watchdog approach.
- [ ] [ref-watch-phosphene-broaden-negative-prompt-override] **Broaden `DEFAULT_NEGATIVE_PROMPT` override to every module that defines it.** From `reference-watch` review of phosphene (commit `4e6129b7`, 2026-05-22). `scripts/generate_ltx2.py:55-70` `configure_negative_prompt()` only patches `ti2vid_one_stage.DEFAULT_NEGATIVE_PROMPT`. At PortOS's current pin this happens to cover every pipeline (the constant resolves against `ti2vid_one_stage` for the base class), but post-May-9 the constant moves to `ltx_pipelines_mlx._base` and `utils.constants` — and the PortOS override silently no-ops on Q8 / two-stage / HQ paths with no error for the user to chase. Fix: rewrite `configure_negative_prompt()` to probe `ti2vid_one_stage`, `_base`, and `utils.constants`, monkey-patch every module that has the constant. Keep PortOS's *replace* semantics (don't switch to phosphene's append-with-comma). No contextmanager needed — the helper is short-lived.
- [ ] [tombstone-gc-manual-trigger-ui] **Wire a manual "GC tombstones now" button on the Instances page.** Today `sharing/tombstoneGc.js#sweepTombstones` only fires from the 60s `syncOrchestrator` interval and uses a hard-coded `GRACE_MS = 24 * 60 * 60 * 1000`, so a user who just mass-deleted records has to wait 24h for them to disappear from `data/universe-builder.json` / `data/pipeline-series.json` / `data/pipeline-issues.json` (even when every subscribed peer has already acked them). Wiring goals: (1) parameterize `sweepTombstones({ now, graceMs })` so callers can override the 24h buffer — keep the 24h default so the orchestrator path is unchanged. (2) Expose `POST /api/sync/tombstones/sweep` with optional `{ graceMs }` body (Zod-validated; clamp to `[0, 24*60*60*1000]` so the button can only shrink the grace, never bypass the ack horizon). The route still calls `cutoffForKind` for each kind so the existing safety checks (peer-ack horizon, refuse-when-snapshot-peer-uncovered) keep firing. (3) Add a "GC tombstones now" button under the Instances page's Sync Status section that POSTs with `graceMs: 0`. Disabled when any enabled peer has snapshot-mode coverage for a kind it isn't subscribed to (mirror the route's null-cutoff refusal). Surfaces the per-kind prune count in a toast (`pruned N universes / M series / K issues` — quiet when zero). (4) One-shot CLI script in `scripts/gc-tombstones-now.js` for headless cleanups (the inline-Node prune we ran 2026-05-23 for the post-Echoes-cleanup batch is the seed). Use `scripts/cleanup-test-data.js`'s pm2-stop-required wording in the header — the prune helpers serialize through per-file write tails that don't cross processes. Surfaced 2026-05-23 during the media-collections sync PR: peer null had acked 82 universe + 192 series tombstones from a same-day mass-delete and the user wanted them off-disk early.
+- [ ] [peer-sync-video-collection-metadata-sync] **Sync video-history.json rows alongside .mp4 bytes pushed via peer-sync.** Codex review of the v2.7.0 release PR (2026-05-23) flagged that `buildAssetManifestForCollection` ships the `.mp4` bytes for `kind: 'video'` collection items but never pushes the corresponding `video-history.json` row. After the receiver pulls the asset, `MediaCollectionDetail.jsx#hydrate` looks up the item ref in the `videosById` map (`listVideoHistory()`) and silently filters it out as "missing." The collection appears half-empty on the receiver. Fix options: (a) add `videoHistory` to the snapshot-sync category set so the rows ride the 60s loop; (b) bundle the matching `video-history.json` row alongside the collection item in `linkedCollection` and merge on the receiver; (c) on first pull, synthesize a stub history row from the asset metadata. (a) is the simplest and matches the existing `mediaCollections` snapshot category pattern. Also generate thumbnails on the receiver (or push them as a sibling asset kind). Scope: `server/services/dataSync.js` add `videoHistory` getter + merge; `routes/dataSync.js` add to enum; `routes/instances.js` `syncCategoriesSchema` add the key; `client/src/services/apiInstances.js` `SYNC_CATEGORY_META` add the row. Surfaced in v2.7.0 release codex review.
+- [ ] [peer-sync-reverse-subscription-ui-broadcast] **Emit a socket event when applyIncomingPush auto-creates a reverse subscription so the Instances page updates without a refetch.** Today `peerSync:subscription:created` (or similar) doesn't exist; the `PeerCard` in `Instances.jsx` loads `peerSubs` once on mount keyed on `peer.instanceId` only, so a reverse-sub created via `maybeCreateReverseSubscription` is invisible until page reload. Add a socket event (or include a `peerSubsRevision` token on `instances:peers:updated`) and let `PeerCard` re-fetch on bump. Reviewer-3 in v2.7.0 release review.
+- [ ] [peer-sync-disambiguate-two-health-rows-in-palette] **Disambiguate the two `Health` rows the ⌘K palette now renders.** Moving the CoS Health page from `meatspace.health` semantics also added `aliases: ['cos-health', 'health']` to `nav.cos.health` while keeping `nav.meatspace.health` with the label "Health". The palette renders two rows labeled "Health" under different sections; bare "health" voice routes to CoS. Pick one: rename the MeatSpace label to "Body Health" / "Health Metrics" in both `Layout.jsx` and `navManifest.js`, or document the bare-word disambiguation as final. Reviewer-6 in v2.7.0 release review.
+- [ ] [peer-sync-insertxxxwithid-emit-on-resurrection] **`insertXxxWithId` should `emitRecordUpdated` + `autoSubscribeRecordToAllPeers` when it overwrites a tombstone.** Today `insertUniverseWithId` / `insertSeriesWithId` / `insertIssueWithId` warn and overwrite the on-disk tombstone but never notify federated peers. A share-bucket re-import that resurrects a deleted record won't propagate until the next manual edit bumps `updatedAt`. Mirror `createUniverse`'s side effects on the tombstone-overwrite branch. Reviewer-2 in v2.7.0 release review.
+- [ ] [peer-sync-importer-tombstone-deferred-detection] **Share-bucket importer treats local tombstones as "deferred" forever.** `server/services/sharing/importer.js` reads with default `getUniverse(...).catch(() => null)` which 404s tombstoned records, returns `{ missingUniverse: true, itemsDeferred }`. The deferred items never apply because the universe IS on disk — just tombstoned. Fix: read with `includeDeleted: true` and either treat tombstone as "deferred until live" with a UI message, or auto-resurrect via `insertUniverseWithId`. Reviewer-2 in v2.7.0 release review.
+- [ ] [tui-handledata-finish-rejection-not-handled-by-trycatch] **TUI `handleData`'s try/catch covers most awaits but `await finish(...)` on command-not-found can still reject inside the same body.** The v2.7.0 wrap is fine for `updateAgent` rejections but `finish` is `async` and could be extended in the future to surface a rejection on its own write path. Add a defensive `.catch` on the `await finish(...)` invocation OR confirm in a one-line comment that `finish` is idempotent and never rejects. Reviewer-4 in v2.7.0 release review.
+- [ ] [mortalloom-writestore-transient-set-widen] **`mortalLoomStore.writeStoreAtPath`'s `withTransientRetry` accepts a narrower errno set than what real iCloud writes throw.** `isTransientFsError` covers EAGAIN/EDEADLK/-11 but not the EBUSY/EIO that `bird` daemon contention can surface on busy iCloud paths. Either widen the predicate OR document the choice. Reviewer-4 in v2.7.0 release review.
+- [ ] [video-gen-remix-stale-model-toast] **VideoGen `validateModelId` effect silently drops a Remix-supplied model to default when the original is gone.** A user who Remixes a clip generated on a model they later uninstalled gets dropped to default with no toast — they think they're rendering with the same model. Add a single one-shot `toast.info('Original model X no longer available — using default')`. Reviewer-6 in v2.7.0 release review.
+- [ ] [reference-repos-analysis-trigger-toast-cascade] **`ReferenceReposPanel.jsx#snap.analysis.reason === 'analysis-trigger-failed'` fires two toasts back-to-back (success then error).** Single toast `toast.error(\`${commitMsg} — but failed to queue analysis\`)` would be cleaner. Reviewer-6 in v2.7.0 release review.
- [ ] [ref-watch-phosphene-lazy-eval-env-bootstrap] **Lazy-eval env bootstrap for M-series perf.** From `reference-watch` review of phosphene (commit `a6e4573f`, context from `ec1437fe`, 2026-05-22). Phosphene measured ~15–25× perf loss on M4 Max with the upstream default `LTX2_DIT_EVAL_EVERY=8` vs `=0`/`=1`, caused by per-block Metal command-buffer churn. The env vars only exist post-May-9 upstream, so this is a "land it with the pin bump" item. Fix: at the very top of `scripts/generate_ltx2.py` (BEFORE any `ltx_*` import, because `ltx_core_mlx.model.transformer.model` reads `LTX2_DIT_EVAL_EVERY` at import time), add `os.environ.setdefault("LTX2_DIT_EVAL_EVERY", "0")` and `os.environ.setdefault("LTX2_GEMMA_EVAL_EVERY", "0")`. User-supplied env still wins via `setdefault`. Phosphene's matrix suggests `=1` is a slightly safer middle if `=0` produces a post-decode hang; use `=0` and revisit if regressions appear.
## Deferred Architecture (human-led planning)