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

refactor: drop now-unused mergeChunkFindings after incremental merge (#1383)

[._.]/ Adam Eivycdd0cd671075
diff --git a/server/lib/editorial/README.md b/server/lib/editorial/README.md
index 8a3a8dd085..b12641915c 100644
--- a/server/lib/editorial/README.md
+++ b/server/lib/editorial/README.md
@@ -14,9 +14,8 @@ This directory is **pure** (no side-effecting imports — only `zod` and the pur
manuscript-consuming LLM check plans the corpus into provider-sized chunks
through `ctx.planManuscriptChunks` — all injected by the runner. Per-chunk
findings are merged first-wins (capped at the check's `maxFindings`) via
-`editorialFindingKey` (the pure `mergeChunkFindings` helper exposes the same
-merge for callers that collect-then-merge), so a long series is fully reviewed
-regardless of the provider's context window (#1340).
+`editorialFindingKey`, so a long series is fully reviewed regardless of the
+provider's context window (#1340).
Checks whose problems span chapters can opt into a **cross-chunk continuity
digest** (#1383): pass `crossChunkDigest: true` to `runManuscriptLlmCheck` and
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index d75eec3518..8bc768636e 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -212,20 +212,6 @@ export const editorialFindingKey = (f) => [
(f.problem || '').trim().toLowerCase().slice(0, 120),
].join('|');
-// Merge per-chunk finding lists first-wins, capped at `max`. The cap bounds the
-// WHOLE run (not each chunk) so a long, many-chunk manuscript can't flood the
-// review — preserving `maxFindings`'s original single-call meaning.
-export function mergeChunkFindings(lists, max = Infinity) {
- const merged = new Map();
- for (const list of (Array.isArray(lists) ? lists : [])) {
- for (const f of (Array.isArray(list) ? list : [])) {
- const k = editorialFindingKey(f);
- if (!merged.has(k)) merged.set(k, f);
- }
- }
- return [...merged.values()].slice(0, Math.max(0, max));
-}
-
// Cross-chunk continuity digest (#1383). When a manuscript is too long for the
// provider window it is reviewed chunk-by-chunk; a check whose problems span
// chapters (an object set up early and paid off late; tense/POV established in