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-routes-pipeline-js-1416-1452]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivy5eea33f1199f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index dbe085893d..0b1d5bcc89 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,6 +2,8 @@
## Changed
+- **[med-pipeline-server-routes-pipeline-js-1416-1452] Cover render routes no longer overwrite `script` when the body omits it.** The four cover render handlers in `server/routes/pipeline.js` (issue front, issue back, volume front, volume back) previously wrote `script: result.coverScript || ''` (or `result.backCoverScript || ''`) on every render, where `result.<script>` is the *resolved* value from the service (body override OR persisted record fallback). That collapsed two distinct cases — "body omitted the field" and "body explicitly cleared it to empty string" — into the same overwrite, and races against blur-save (PATCH `stages.comicPages.cover.script`) because the render path's resolved value can be stale by the time `updateStageWithLatest` / `updateSeasonOnSeries` writes. Switched all four routes to gate the `script` write on `typeof body.<scriptField> === 'string'` — absent leaves the persisted script untouched, empty string is honored as an intentional clear, present text writes through. Added the missing `enqueueComicBackCover` / `enqueueVolumeCover` / `enqueueVolumeBackCover` mocks to `pipeline.test.js` (only the front-cover mock existed before) and added 5 new tests covering absent-preserves / empty-clears semantics across all four routes. 85/85 pipeline route tests pass; 6089/6089 server 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 via the shared `stripAnsi` helper (`server/lib/ansiStrip.js`) plus a C0/C1-control sweep + whitespace collapse + 60-char cap before interpolation to keep logging single-line. Five new tests cover the 1↔1 firing path, the 2+×2+ suppression path, the newline-collapse sanitizer, the full-CSI-sequence sanitizer, and a pinned regression for the 2-old × 2-new matching-numbers case (Pass 2 unique-number handles it; no warning fires). 70/70 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.
diff --git a/PLAN.md b/PLAN.md
index 27adbcafaf..95a82302be 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -14,7 +14,6 @@ _Nothing currently parked — pick the next item from the Backlog._
### v2.1.0 pre-release review residue (deferred from main→release multi-agent review, 2026-05-16)
-- [ ] [med-pipeline-server-routes-pipeline-js-1416-1452] **[MED][PIPELINE]** `server/routes/pipeline.js:1416, 1452, 470-472, 498-500` — cover render routes always overwrite `script` with the resolved value (treats absent vs empty-string identically). Only update `script` from render when the request body actually carried the field, OR drop script writes from render routes entirely (blur-save owns the field).
- [ ] [med-sharing-server-services-sharing-version-js] **[MED][SHARING]** `server/services/sharing/version.js` — `SHARING_SCHEMA_VERSION` not bumped despite series-schema canon-field removal. Cross-peer share-bucket import from a pre-B.4 install silently loses series-side canon. Either bump the version (force refusal) or mirror migration logic in the importer for legacy canon fields.
- [ ] [med-ai-dispatch-server-services-digital-twin] **[MED][AI-DISPATCH]** `server/services/digital-twin-helpers.js:56-130` — `callProviderAI` still has ad-hoc CLI/API split with TUI falling into the CLI branch (will hang or render banner into pipe). Migrate to `runPromptThroughProvider`.
- [ ] [med-ai-dispatch-server-lib-tuipromptrunner-js-198] **[MED][AI-DISPATCH]** `server/lib/tuiPromptRunner.js:198-200` — `OUTPUT_BUFFER_CAP = 1MB` silently truncates the _head_ of TUI responses >1.25MB mid-token. Persists to disk AND returns truncated. Either stream incrementally to `output.txt` (like agentTuiSpawning does) or raise the cap + log a warning.