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([med-pipeline-server-services-pipeline-arcplanner-2]): refresh changelog test count + sanitizer note

[._.]/ Adam Eivyf037112b0d86
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index b5b5de7b81..7f8358bf89 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,7 +2,7 @@
## Changed
-- **[med-pipeline-server-services-pipeline-arcplanner-2] Tighten `buildSeasonRemap` Pass 3 — fire only on forced 1↔1 pairings.** `server/services/pipeline/arcPlanner.js#buildSeasonRemap` previously ran its positional fallback whenever the unmatched-old and unmatched-new counts matched (any positive equal length). With 2+ unmatched on each side that's a guess: the LLM may have reshuffled or renamed everything, and number-sorted positional pairing silently invents wrong `oldSeasonId → newSeasonId` mappings — child issues land under the wrong season instead of the visible "ungrouped" bucket. New guard fires Pass 3 only when exactly one unmatched on each side (a forced 1↔1 pairing with no ambiguity) and logs the pairing it made. When the guard suppresses a 2+×2+ fallback, a warning logs the cardinality and the orphans correctly route to `seasonId: null`. The pre-existing "2-old × 2-new with matching numbers" test still passes (Pass 2 unique-number handles it); two new tests cover the new 1↔1 path and the new suppression path. 67/67 arcPlanner tests pass; 518/518 pipeline tests pass.
+- **[med-pipeline-server-services-pipeline-arcplanner-2] Tighten `buildSeasonRemap` Pass 3 — fire only on forced 1↔1 pairings.** `server/services/pipeline/arcPlanner.js#buildSeasonRemap` previously ran its positional fallback whenever the unmatched-old and unmatched-new counts matched (any positive equal length). With 2+ unmatched on each side that's a guess: the LLM may have reshuffled or renamed everything, and number-sorted positional pairing silently invents wrong `oldSeasonId → newSeasonId` mappings — child issues land under the wrong season instead of the visible "ungrouped" bucket. New guard fires Pass 3 only when exactly one unmatched on each side (a forced 1↔1 pairing with no ambiguity) and logs the pairing it made. When the guard suppresses a 2+×2+ fallback, a warning logs the cardinality and the orphans correctly route to `seasonId: null`. Title labels are sanitized (C0/C1 controls + ANSI escapes stripped, whitespace collapsed, capped at 60 chars) before interpolation to keep logging single-line. The pre-existing "2-old × 2-new with matching numbers" test still passes (Pass 2 unique-number handles it); four new tests cover the 1↔1 firing path, the 2+×2+ suppression path, the newline-collapse sanitizer, and the C0/C1-control-char/ANSI-escape sanitizer. 69/69 arcPlanner tests pass; 518/518 pipeline tests pass.
- **[strip-stray-tryreadfile-from-instances-mocks] Drop dead `tryReadFile: vi.fn().mockResolvedValue(null)` entries from two `instances.js` mock factories.** `server/services/sharing/subscriptions.test.js:25` and `server/services/sharing/integration.test.js:44` were a leftover copy-paste from when these tests used to mock `lib/fileUtils.js`; `instances.js` doesn't export `tryReadFile`, so the keys are no-ops that only confuse the next reader. Removed and reformatted both factories onto the project's standard multi-line `vi.mock(..., () => ({ ... }))` shape. The third site PLAN.md referenced — `server/services/mediaAnnotations.test.js` — turned out to be a false positive: its `tryReadFile` lives inside the legitimate `lib/fileUtils.js` mock, and its `instances.js` mock at line 15 is already clean. The 45 tests across the two edited files pass; nothing else changes.