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

[._.]/ Adam Eivy05f536e10854
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 7923b19320..b5b5de7b81 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,6 +2,8 @@
## 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.
+
- **[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.
- **[hoist-certmeta-to-top-level-lib] `readCertMeta()` hoisted to top-level `lib/certMeta.js` so `scripts/` and managed apps can share it.** The previous `server/lib/certMeta.js` baked `PATHS.data` at module load, so `scripts/print-access-url.js` couldn't reach it without crossing the scripts/server boundary and instead carried its own inline `try { JSON.parse(readFileSync(...)).mode } catch {}` block. Moved the module next to `lib/certPaths.js` (zero-dep, side-effect-free — same constraint set as the existing sibling) and changed the signature to `readCertMeta(metaPath)` so each caller passes the path it already resolved via `certPaths(PATHS.data).meta`. Four callers updated: `server/lib/peerSelfHost.js`, `server/lib/networkExposure.js`, `server/services/certRenewer.js` (two call sites), and `scripts/print-access-url.js` (drops the inline try/catch in favor of `readCertMeta(META_PATH)?.mode || ''`). The test file moved too and gained cases for the `metaPath` argument, `statSync`/`readFileSync` throwing (EACCES/EIO), and primitive JSON (parsed value gated on `typeof === 'object' && !Array.isArray`). The `JSON.parse` + try/catch is inlined rather than reusing `server/lib/fileUtils.js#safeJSONParse` — the JSDoc notes this is the cost of the zero-dep boundary that lets `scripts/` import the helper. `server/lib/{index.js, README.md}` barrel + catalog rows removed per the maintenance rule. All 6133 server tests + 270 client tests pass.
diff --git a/PLAN.md b/PLAN.md
index 724cc247aa..27adbcafaf 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-services-pipeline-arcplanner-2] **[MED][PIPELINE]** `server/services/pipeline/arcPlanner.js:929-942` — `buildSeasonRemap` Pass 3 (positional fallback) silently invents wrong mappings when the LLM structurally reshapes the arc. Log a warning when Pass 3 fires; consider only firing when unmatched count ≤ 1.
- [ ] [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`.