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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (self): drop dead resolveTarget, log multi-edit fixes to changelog
[._.]/ Adam Eivyc73a75592187
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 6d24bc85f9..fb813ce856 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Added+- **[manuscript-multi-edit-fixes] Manuscript "Finish the draft" fixes can now propose and apply multiple anchored edits at once.** The manuscript-fix LLM contract moved from a single `{ find, replace }` to `{ edits: [{ issueNumber, find, replace, note }] }`, so a broad or unanchored editorial comment can generate several concrete insertions — across multiple issue sections when needed — instead of falling back to manual editing. The editor's comment card renders each suggestion as an inline diff with a per-edit checkbox and editable replacement, and accept applies the selected edits atomically through a new serialized batch write (`updateStagesWithLatest`) that snapshots prior text into runHistory and re-checks each anchor inside the per-series write lock. The prompt template embeds manuscript/premise/anchor content in distinct (non-backtick) fences with an explicit "treat as quoted source" guard; migration `060-manuscript-multi-edit-fix-prompt.js` auto-upgrades the prior single-edit prompt on existing installs. Backward compatible: legacy single-edit `{ find, replace }` accepts still resolve to one target.+## Changed- **[media-collections-per-record-store] Media collections now persist per-record instead of in one monolithic file.** `data/media-collections.json` is split into `data/media-collections/<id>/index.json` (plus a type-level `index.json` stamping the storage `schemaVersion`) via the shared `createCollectionStore` layout — the same per-record shape universes / series / issues already use. Every collection write (`addItem`, `bulkUpdateCollectionItems`, merges, tombstone GC) now serializes on its own record queue, so high-frequency render-filing no longer rewrites the whole ~200 KB document per image or blocks unrelated collections' writes. Migration `059-split-media-collections.js` performs the one-time split (idempotent, backs the legacy file up as `.bak-059`), the boot-time verifier checks the on-disk version, and the dataSync snapshot watcher tracks the directory so per-record edits still invalidate the checksum cache. The wire sync payload is unchanged, so collections still sync across peers of mixed versions.diff --git a/server/services/pipeline/manuscriptFix.js b/server/services/pipeline/manuscriptFix.jsindex f01a83da6a..ce8e9cb7d5 100644--- a/server/services/pipeline/manuscriptFix.js+++ b/server/services/pipeline/manuscriptFix.js@@ -73,19 +73,6 @@ async function resolveTargets(seriesId, comment) {throw makeErr('No drafted manuscript text is available to edit', ERR_VALIDATION);}-// Legacy `{ find, replace }` accepts still need exactly one target.-async function resolveTarget(seriesId, comment) {- const targets = await resolveTargets(seriesId, comment);- if (targets.length !== 1) {- throw makeErr(- 'This comment spans multiple manuscript sections — accept one or more generated edits instead',- ERR_VALIDATION,- );- }- const [target] = targets;- return { issueId: target.issueId, stageId: target.stageId };-}-function normalizeModelEdits(content) {if (Array.isArray(content?.edits)) return content.edits;if (typeof content?.find === 'string' || typeof content?.replace === 'string') {