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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review: per-kind backfill catch + single toast + test cleanup
Adam Eivyc70d12478121
diff --git a/PLAN.md b/PLAN.mdindex 980615ad53..ef02d393b7 100644--- a/PLAN.md+++ b/PLAN.md@@ -36,7 +36,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel- [ ] [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)diff --git a/client/src/components/apps/ReferenceReposPanel.jsx b/client/src/components/apps/ReferenceReposPanel.jsxindex 9c4acb3eb0..89e81784b2 100644--- a/client/src/components/apps/ReferenceReposPanel.jsx+++ b/client/src/components/apps/ReferenceReposPanel.jsx@@ -107,8 +107,9 @@ export default function ReferenceReposPanel({ appId, appName }) {} else if (snap.analysis?.reason === 'duplicate') {toast.success(`${commitMsg} — analysis already queued`);} else if (snap.analysis?.reason === 'analysis-trigger-failed') {- toast.success(commitMsg);- toast.error(`${ref.name}: failed to queue analysis task`);+ // Single combined toast — the prior two-toast pattern (success then+ // error) made the failure easy to miss when both fired together.+ toast.error(`${commitMsg} — but failed to queue analysis task`);} else {toast.success(commitMsg);}diff --git a/server/lib/assetHash.test.js b/server/lib/assetHash.test.jsindex aba0210936..3bcaf8c2df 100644--- a/server/lib/assetHash.test.js+++ b/server/lib/assetHash.test.js@@ -67,61 +67,71 @@ describe('assetHash', () => {const token = `portos-assethash-test-${Date.now()}-${Math.random()}.png`;const imagePath = join(PATHS.images, token);const sidecarPath = sidecarPathForImage(imagePath);- await mkdir(dirname(imagePath), { recursive: true });- await writeFile(imagePath, Buffer.from('hello world'));- const result = await getOrComputeImageSha256(imagePath);- expect(result).not.toBeNull();- // "hello world" sha256:- expect(result.hash).toBe(- 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9',- );- const sidecarJson = JSON.parse(await readFile(sidecarPath, 'utf8'));- expect(sidecarJson.sha256.value).toBe(result.hash);- expect(sidecarJson.sha256.size).toBe(11);- // cleanup- await rm(imagePath, { force: true });- await rm(sidecarPath, { force: true });+ try {+ await mkdir(dirname(imagePath), { recursive: true });+ await writeFile(imagePath, Buffer.from('hello world'));+ const result = await getOrComputeImageSha256(imagePath);+ expect(result).not.toBeNull();+ // "hello world" sha256:+ expect(result.hash).toBe(+ 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9',+ );+ const sidecarJson = JSON.parse(await readFile(sidecarPath, 'utf8'));+ expect(sidecarJson.sha256.value).toBe(result.hash);+ expect(sidecarJson.sha256.size).toBe(11);+ } finally {+ // try/finally so a thrown assertion above doesn't leave the+ // portos-assethash-test-* fixture in PATHS.images.+ await rm(imagePath, { force: true });+ await rm(sidecarPath, { force: true });+ }});it('reuses cached sha256 on second call (no recompute)', async () => {const token = `portos-assethash-test-${Date.now()}-${Math.random()}.png`;const imagePath = join(PATHS.images, token);const sidecarPath = sidecarPathForImage(imagePath);- await mkdir(dirname(imagePath), { recursive: true });- await writeFile(imagePath, Buffer.from('one'));- const first = await getOrComputeImageSha256(imagePath);- // Tamper with the sidecar to a known-wrong value but matching the size/mtime —- // the helper should trust the cached entry (proves it's reading sidecar first).- const tampered = JSON.parse(await readFile(sidecarPath, 'utf8'));- const fakeHash = 'a'.repeat(64);- tampered.sha256.value = fakeHash;- await writeFile(sidecarPath, JSON.stringify(tampered));- const second = await getOrComputeImageSha256(imagePath);- expect(second.hash).toBe(fakeHash);- expect(second.hash).not.toBe(first.hash);- await rm(imagePath, { force: true });- await rm(sidecarPath, { force: true });+ try {+ await mkdir(dirname(imagePath), { recursive: true });+ await writeFile(imagePath, Buffer.from('one'));+ const first = await getOrComputeImageSha256(imagePath);+ // Tamper with the sidecar to a known-wrong value but matching the size/mtime —+ // the helper should trust the cached entry (proves it's reading sidecar first).+ const tampered = JSON.parse(await readFile(sidecarPath, 'utf8'));+ const fakeHash = 'a'.repeat(64);+ tampered.sha256.value = fakeHash;+ await writeFile(sidecarPath, JSON.stringify(tampered));+ const second = await getOrComputeImageSha256(imagePath);+ expect(second.hash).toBe(fakeHash);+ expect(second.hash).not.toBe(first.hash);+ } finally {+ await rm(imagePath, { force: true });+ await rm(sidecarPath, { force: true });+ }});it('recomputes when file changes (mtime+size invalidate cache)', async () => {const token = `portos-assethash-test-${Date.now()}-${Math.random()}.png`;const imagePath = join(PATHS.images, token);const sidecarPath = sidecarPathForImage(imagePath);- await mkdir(dirname(imagePath), { recursive: true });- await writeFile(imagePath, Buffer.from('one'));- const first = await getOrComputeImageSha256(imagePath);- // Ensure mtime advances on slow filesystems where atime granularity- // could match — wait a tick before the rewrite.- await new Promise((r) => setTimeout(r, 20));- await writeFile(imagePath, Buffer.from('two-different-bytes'));- const second = await getOrComputeImageSha256(imagePath);- expect(second.hash).not.toBe(first.hash);- // Sidecar reflects the new hash + size.- const sidecarJson = JSON.parse(await readFile(sidecarPath, 'utf8'));- expect(sidecarJson.sha256.value).toBe(second.hash);- expect(sidecarJson.sha256.size).toBe(19);- await rm(imagePath, { force: true });- await rm(sidecarPath, { force: true });+ try {+ await mkdir(dirname(imagePath), { recursive: true });+ await writeFile(imagePath, Buffer.from('one'));+ const first = await getOrComputeImageSha256(imagePath);+ // Ensure mtime advances on slow filesystems where atime granularity+ // could match — wait a tick before the rewrite.+ await new Promise((r) => setTimeout(r, 20));+ await writeFile(imagePath, Buffer.from('two-different-bytes'));+ const second = await getOrComputeImageSha256(imagePath);+ expect(second.hash).not.toBe(first.hash);+ // Sidecar reflects the new hash + size.+ const sidecarJson = JSON.parse(await readFile(sidecarPath, 'utf8'));+ expect(sidecarJson.sha256.value).toBe(second.hash);+ expect(sidecarJson.sha256.size).toBe(19);+ } finally {+ await rm(imagePath, { force: true });+ await rm(sidecarPath, { force: true });+ }});});});diff --git a/server/services/instances.js b/server/services/instances.jsindex 71fff3223e..23031e8e3a 100644--- a/server/services/instances.js+++ b/server/services/instances.js@@ -271,8 +271,15 @@ export async function updatePeer(id, updates) {// dodges a static cycle (peerSync.js statically imports getPeers from us).if (turnedOnKinds.length > 0 && backfillPeerInstanceId) {import('./sharing/peerSync.js').then(async ({ autoSubscribePeerToAllRecords }) => {+ // Per-kind try/catch so a transient failure in one kind's backfill+ // (e.g. universe) doesn't abort the loop and leave the peer with no+ // series subscriptions either. Each kind is best-effort + logged+ // independently; the next category-toggle PATCH or peer-online+ // event re-fires the backfill for any kind that didn't land.for (const kind of turnedOnKinds) {- await autoSubscribePeerToAllRecords(backfillPeerInstanceId, kind);+ await autoSubscribePeerToAllRecords(backfillPeerInstanceId, kind).catch((err) => {+ console.log(`⚠️ peer: backfill-subscribe ${kind} after category toggle failed: ${err.message}`);+ });}}).catch((err) => {console.log(`⚠️ peer: backfill-subscribe after category toggle failed: ${err.message}`);