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([insights-callprovider-nonjson-test]): remove from PLAN.md and log to changelog

[._.]/ Adam Eivy81f49f90cc80
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 2237caad21..d0582adaa0 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -36,6 +36,7 @@
- **[cos-on-demand-mark-app-review-started-dedupe]** When several on-demand improvement requests for the same app are processed in one CoS dispatch cycle, the app's activity record is now marked review-started once instead of once per request (no user-facing change).
- **[shared-tolerant-fetch-json-helper]** Hardened the HTTP clients that talk to local model backends, the managed browser, and the background agent runner: a non-JSON/HTML error response now surfaces the real error instead of crashing with "Unexpected token <", via one shared tolerant JSON-body reader (no user-facing change).
- **[tolerant-fetch-json-additional-clients]** Extended that same tolerant JSON-body reader to the remaining fetch clients (calendar/message sync, the memory and insights LLM calls, the local-LLM playground, Civitai, Telegram, and the code-review runner), so a non-JSON/HTML error body surfaces the real error instead of crashing — and the code-review runner now reports the server's actual error text instead of a misleading "no content" (no user-facing change).
+- **[insights-callprovider-nonjson-test]** Added regression-test coverage pinning the insights LLM client's non-JSON-error guard so a malformed provider response can't silently overwrite the cached cross-domain narrative or theme analysis (no user-facing change).
- **[cos-agent-output-write-amplification] Streamed CoS agent output no longer rewrites the entire agent-state file once per line.** A shared ~250ms output batcher now coalesces the runner's per-line output events and direct-CLI stdout/stderr into single state writes (draining before an agent is marked complete), cutting agent-state write churn on chatty agents from dozens of writes/sec to a few — with no change to the live output tail (no user-facing change).
- **[subagent-spawner-top-level-side-effects]** The CoS agent spawner now initializes explicitly at server startup instead of as a side effect of being imported, so importing it (in tests or elsewhere) no longer re-arms its event listeners and timers (no user-facing change).
diff --git a/PLAN.md b/PLAN.md
index 5527f54ff9..cd3c073c47 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -6,7 +6,7 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changel
Claimable, well-specified, no decision needed — `/claim`-able. Unordered.
-- [ ] [insights-callprovider-nonjson-test] **Add a regression test for `insightsService.callProviderAISimple`'s non-JSON-body guard.** The `[tolerant-fetch-json-additional-clients]` PR fixed a masquerade-as-empty-success bug where a non-JSON/blank 200 body returned `{ text: '' }`, and `refreshCrossDomainNarrative`/`generateInsightThemes` then overwrote `narrative.json`/`themes.json` with nothing. The fix (`{ fallback: null, emptyValue: null }` + null guard → `{ error }`) got dedicated tests for the sibling calendar/message paths (`calendarApiSync.test.js`, `messageApiSync.test.js`) but NOT for insights, because `callProviderAISimple` is unexported and the only public entry (`refreshCrossDomainNarrative`) needs genome+taste+health context mocked to reach the LLM call. Either export `callProviderAISimple` for a focused unit test, or stand up the context mock and assert: a 200-with-HTML body returns `{ error }` (no `narrative.json` write), while a valid `{ choices:[{message:{content:''}}] }` still returns `{ text: '' }`. Deferred from the review loop on PR #616 (claude flagged the coverage gap, rated non-blocking). **Conflict journal does not cover media-collection scalar overwrites.** `mergeMediaCollectionsFromSync` (`server/services/mediaCollections.js`) LWW-overwrites scalars (name/description/coverKey/universeId/seriesId) when `remoteWins`; items are union-merged (never lost). v1 hooks only universe + series merges because the whole-record content hash used by `conflictJournal.detectConflict` would false-positive on collections whenever items differ. Doing it right needs scalar-subset hashing that stays consistent with the sender-side base hash. Low value (scalar loss is minor), deferred.
+- [ ] [conflict-journal-media-collections] **Conflict journal does not cover media-collection scalar overwrites.** `mergeMediaCollectionsFromSync` (`server/services/mediaCollections.js`) LWW-overwrites scalars (name/description/coverKey/universeId/seriesId) when `remoteWins`; items are union-merged (never lost). v1 hooks only universe + series merges because the whole-record content hash used by `conflictJournal.detectConflict` would false-positive on collections whenever items differ. Doing it right needs scalar-subset hashing that stays consistent with the sender-side base hash. Low value (scalar loss is minor), deferred.
- [ ] [conflict-journal-issues] **Issue-level conflict journaling.** The share-bucket importer hook (`server/services/sharing/importer.js` `applyAutoMerge`→`mergeOne`) is gated to `universe`/`series`; child issues ride LWW silently. Extend the journal to issues (needs the issue merge path to thread a `source` + call `maybeJournalBeforeOverwrite`).
- [ ] [conflict-journal-deep-diff] **`diffSummary` is top-level shallow only.** `conflictJournal.diffSummary` compares top-level fields via canonicalStringify, so the UI shows "categories differ" rather than which variation/canon entry changed. Add per-field deep diffing for richer InlineDiff rendering in the Conflicts tab.
- [ ] [series-merge-season-rehoming] **Series merge re-homes issues un-grouped.** `recordMerge.mergeSeries` re-points the loser series' issues to the survivor via `issues.reassignIssuesToSeries`, which sets `seasonId: null` (seasons are series-scoped). The moved issues land un-grouped and the user must re-assign them to a survivor season. A smarter merge could map loser seasons → survivor seasons by number and preserve issue→season grouping.