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-sharing-server-services-sharing-version-js]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivy00219486f3e8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 0b1d5bcc89..48f1118190 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,6 +2,8 @@
## Changed
+- **[med-sharing-server-services-sharing-version-js] Sharing importer salvages pre-B.4 series-side canon instead of dropping it.** Cross-peer share-bucket imports from a pre-B.4 install previously lost any `series.{characters, settings|places, objects}` arrays silently — `sanitizeSeries` (post-B.4) strips those fields on insert, and the importer fed records straight into `insertSeriesWithId`. The B.4 schema teardown intentionally moved canon onto the linked universe, so the recovery shape was the existing `migrateSeriesCanon` CLI helper; the gap was that nothing ran it for peer-authored records. `server/services/pipeline/migrateSeriesCanon.js` now exposes a per-record helper `applyLegacySeriesCanonToUniverse(series, { dryRun, log })` (extracted from the CLI batch's loop body) that folds legacy canon into the linked or freshly-created universe with the same `SERIES_EXTRACT` + `autoLock` + `sourceSeriesId` provenance the live extract path uses. `server/services/sharing/importer.js` calls this helper for every incoming series record carrying a non-empty `characters / settings / places / objects` array — between the universes merge loop and the series merge loop, so the universe (existing or newly minted for orphan series) holds the canon by the time `sanitizeSeries` runs. The pre-022 `settings[]` wire name is coalesced onto `places[]` inside the helper so peers shipping either rename-era survive. Two new integration tests in `services/sharing/integration.test.js` lock in the linked-universe and orphan-universe paths; 5904 server tests pass. `SHARING_SCHEMA_VERSION` is intentionally NOT bumped — the version bump would only help if paired with a hard refusal, and salvaging the data is the kinder outcome.
+
- **[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.
diff --git a/PLAN.md b/PLAN.md
index 14e2bcd132..0f4a9da94f 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -16,7 +16,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-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.
- [ ] [med-tests-no-direct-tests-for-executetuirun-pty] **[MED][TESTS]** No direct tests for `executeTuiRun` PTY mechanics — idle-complete, hard-timeout, missing-binary early-fail, `emitRunStarted` shape, CLAUDECODE env stripping. The new `tuiPromptRunner.test.js` only covers `cleanTuiResponse`.