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
docs([dup-detect-collection-count-undercount]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivy9e00073d5afb
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 9b515d1726..4a3f1d7185 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -34,5 +34,6 @@- **[provider-fallback-model-leak] Falling back to another provider no longer leaks the primary's model id onto it.** When a stage's primary provider was unavailable (e.g. Codex benched after an OpenAI content-safety refusal), the model resolved against the primary — `codex-configured-default` — was carried verbatim onto the fallback provider, so the run logged `LM Studio/codex-configured-default` and then 400'd because LM Studio has no such model (and Claude Code rejected it the same way). `stageRunner` now re-resolves the model against the *fallback* provider (honoring its configured `fallbackModel`, else its own default / args-baked model) instead of forwarding the primary's resolved model, and the toolkit `createRun` run record + log line do the same.- **[ltx2-fflf-skips-last-image-resize-when-both-frames-set] ltx2 FFLF now resizes both anchor frames.** The two-keyframe ltx2 FFLF path passes both `--image` and `--last-image` into `scripts/generate_ltx2.py`, but Video Gen only resized the start image when both anchors were present. The end frame could therefore reach `KeyframeInterpolationPipeline.generate_and_save()` at its original dimensions. `videoGen/local.js` now treats ltx2 true-FFLF as a real last-image consumer and runs the same ffmpeg resize/crop pass used for multi-keyframes, with a regression test asserting the helper receives resized start and end paths.- **[ref-watch-phosphene-teacache-extend-a2v-denoise] TeaCache now accelerates ltx2 Extend and A2V Stage 1.** `scripts/generate_ltx2.py` now patches the LTX-2 `extend` and `a2vid_two_stage` denoise-loop import sites (the modules where `ExtendPipeline`/`AudioToVideoPipeline` actually call `guided_denoise_loop`), activating the existing Stage-1 TeaCache controller only around Extend and A2V calls and clearing the gate afterward. TeaCache stays default-on for those slow paths, with `--no-teacache` to opt out and `--teacache-thresh` to trade fidelity for speed (~1.2× at the 0.5 default, up to ~3× at 1.5).+- **[dup-detect-collection-count-undercount] Duplicate-universe suggestions now count collection items correctly.** On the Sharing → Duplicates tab, a universe that owned more than one media collection had its collection-item total reported as just the last collection's size rather than the sum, which could understate which duplicate held the most content; the count now adds up every linked collection.## Removeddiff --git a/PLAN.md b/PLAN.mdindex 9d2e2fecfb..5e32a85d1d 100644--- a/PLAN.md+++ b/PLAN.md@@ -23,7 +23,6 @@ Claimable, well-specified, no decision needed — `/claim`-able. Unordered.- [ ] [conflict-restore-additive] **"Restore mine" is additive for keyed fields, not a faithful overwrite.** `conflictJournalResolver.resolveConflict` restore-all applies the snapshot via `updateUniverse(id, () => patch)`, which merges `categories` per-key — so a category the user deleted *after* the conflict is resurrected on restore. Acceptable for v1 (resurrect-not-lose), but the UI says "restore your whole version." Consider a true-replace path for restore-all. Surfaced in /code-review (medium).- [ ] [merge-cascade-no-rollback] **`recordMerge.mergeUniverses`/`mergeSeries` cascade has no rollback.** Union-write survivor → re-point each child → tombstone loser runs as separate awaits; a mid-loop throw leaves the survivor merged but the loser un-tombstoned, and a retry trips `ERR_HAS_LIVE_SERIES` on the remaining children. Single-user/low-concurrency so low-probability, but a half-merge has no cleanup. Consider catching per-child and reporting, or finishing the loser tombstone best-effort. Surfaced in /code-review (medium).- [ ] [conflict-source-attribution] **Conflict-journal `source` is `via:'sync'/peerId:null` on the peer-push path.** `applyIncomingPush` calls `mergeUniversesFromSync`/`mergeSeriesFromSync` without the `{ source }` arg even though `sourceInstanceId` is in scope, so the Conflicts tab can't attribute which peer collided. Thread `{ via:'peer-push', peerId: sourceInstanceId }` from `applyIncomingPush`. Surfaced in /code-review (low, attribution only).-- [ ] [dup-detect-collection-count-undercount] **`duplicateDetection.collectionItemsByUniverse` last-wins instead of summing.** Uses `.set(universeId, length)` while `seriesByUniverse` accumulates with `+`; if two live collections share a `universeId`, `linkedCollectionItemCount` undercounts the survivor-suggestion heuristic. Sum like the series count. Surfaced in /code-review (low, display only).- [ ] [conflict-journal-push-flush-coalesce] **Coalesce per-push base-hash flushes.** `pushRecordToPeer` (`server/services/sharing/peerSync.js` ~947) stamps a base hash and calls `flushBaseHashes()` per pushed universe/series, so a large push loop rewrites `sync_base_hashes.json` once per record. A `setTimeout`-based debounce was tried and reverted (the unref'd timer leaked into `peerSync.test.js`'s settle-waits and made the suite flaky). A safe coalescing approach (microtask/`queueMicrotask` batch within a single push burst, or a test-injectable scheduler) could land the optimization without the timer-leak flake. Low priority.- [ ] [conflict-journal-base-hash-prune] **`sync_base_hashes.json` grows unbounded.** `server/lib/conflictJournal.js` seeds a base hash per synced universe/series and never prunes entries for deleted/tombstoned records. Tiny per-entry, but a long-lived install accumulates dead keys. Add a sweep (drop keys whose record no longer resolves) to the tombstone GC path.- [ ] [makesplitmigration-shared-factory] **Extract a shared `makeSplitMigration` factory into `scripts/migrations/_lib.js`.** The monolithic→per-record split scaffolding (`fileExists` / `readJsonStrict` / `readJsonTolerant` / `writeJson` + the `withFileTypes` already-split scan + the gate1/gate2/recovery/split/stamp/backup body) is now copied verbatim across **four** migrations: `034-split-universe-builder`, `035-split-pipeline-issues`, `036-split-pipeline-series`, `059-split-media-collections`. They differ only in `{ typeDirName, legacyFilename, backupSuffix, typeSchemaVersion, typeLabel, recordsKey, idPattern, buildConfig }` (e.g. `config: { runs }` for universes vs `config: {}` for collections). `_lib.js` already houses cross-migration families (`makePromptReplaceMigration`, layout helpers) — add a split family there and collapse the four to ~15-line config blocks. Pre-existing duplication; 059 was the 4th copy. Own change + test surface, so deferred out of the migration PR.