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([conflict-source-attribution]): drop PLAN entry reintroduced after PR #638 merge

[._.]/ Adam Eivy12620c8487ca
diff --git a/PLAN.md b/PLAN.md
index 86fc058419..6f173be7e6 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -6,7 +6,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
-- [ ] [conflict-source-attribution] **Conflict-journal `source` is `via:'sync'/peerId:null` on the peer-push path.** `applyIncomingPush` calls `mergeUniversesFromSync`/`mergeSeriesFromSync`/`mergeIssuesFromSync` without the `{ source }` arg even though `sourceInstanceId` is in scope, so the Conflicts tab can't attribute which peer collided. The snapshot-loop caller (`dataSync.applyPipelineRemote`) also drops the param, so snapshot-path issue/series conflicts record `{ via:'sync', peerId:null }`. Thread `{ via:'peer-push', peerId: sourceInstanceId }` from `applyIncomingPush` (and `{ via:'snapshot', peerId }` from the syncOrchestrator → `dataSync.applyRemote` path) into all three merge fns together. `mergeIssuesFromSync` already accepts the optional `source` param (added with the issue-journaling work); the universe/series fns mirror it — only the call sites need wiring. Surfaced in /code-review (low, attribution 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.