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

fix([issue-733]): address codex+claude review

[._.]/ Adam Eivydbda7fa877a9
diff --git a/data.reference/prompts/stages/pipeline-manuscript-fix.md b/data.reference/prompts/stages/pipeline-manuscript-fix.md
index 887f8f18d5..64d26d4992 100644
--- a/data.reference/prompts/stages/pipeline-manuscript-fix.md
+++ b/data.reference/prompts/stages/pipeline-manuscript-fix.md
@@ -92,7 +92,7 @@ Return ONLY valid JSON matching this shape — no prose, no markdown fence, no c
- `edits` may contain one edit or several edits. Use several only when the finding genuinely requires more than one insertion/revision.
- `issueNumber` MUST identify the issue section containing that edit's `find`.
-- `find` MUST be copied **character-for-character** from the matching issue's manuscript text above (including punctuation, line breaks, and formatting markers). Keep it as **small as possible** while still being uniquely locatable — a sentence, page/panel block, or short paragraph, not a whole page. The system locates your edit by an exact substring match on `find`, so any paraphrase will fail.
-- `replace` is `find` rewritten to incorporate the fix. To **insert** new material without deleting anything, set `replace` to the original `find` text followed by the new content.
+- `find` MUST be copied **character-for-character** from the matching issue's manuscript text above (including punctuation, line breaks, and formatting markers). The system locates your edit by an exact substring match on `find`, so any paraphrase will fail. Keep it as **small as possible** while still being uniquely locatable — a sentence, page/panel block, or short paragraph, not a whole page. **Exception (full-page replacement):** when "How to read the suggested fix" above says this is a full-page replacement, `find` IS the entire malformed page block the anchor points at — the whole page is what you are replacing.
+- `replace` is `find` rewritten to incorporate the fix. To **insert** new material without deleting anything, set `replace` to the original `find` text followed by the new content. **Exception (full-page replacement):** `replace` is the suggested fix's complete panel-by-panel breakdown — the page's new content, not the old text lightly revised.
- If the gap is a pure absence at the very end (e.g. a missing ending), set `find` to the manuscript's final sentence and append the new ending in `replace`.
- Keep the edit tight and in-voice. Do not rewrite unrelated passages.
diff --git a/scripts/migrations/060-manuscript-multi-edit-fix-prompt.js b/scripts/migrations/060-manuscript-multi-edit-fix-prompt.js
index eb4b8c399d..fa9b71a673 100644
--- a/scripts/migrations/060-manuscript-multi-edit-fix-prompt.js
+++ b/scripts/migrations/060-manuscript-multi-edit-fix-prompt.js
@@ -24,7 +24,7 @@ export const ACCEPTED_OLD_MD5 = {
// body. The idempotent-rerun and drift-catch tests require it to match the live
// data.reference body, not 060's own output.
export const NEW_SHIPPED_MD5 = {
- 'pipeline-manuscript-fix.md': '87c6e47030df07b37ace44d2a15372cf',
+ 'pipeline-manuscript-fix.md': '88199bf7b5b50155bd2e1624bd920ebd',
};
const { applyMigration, up } = makePromptReplaceMigration({
diff --git a/scripts/migrations/066-manuscript-finding-replacement-strategy-prompts.js b/scripts/migrations/066-manuscript-finding-replacement-strategy-prompts.js
index f4a0f6960e..e165c0e118 100644
--- a/scripts/migrations/066-manuscript-finding-replacement-strategy-prompts.js
+++ b/scripts/migrations/066-manuscript-finding-replacement-strategy-prompts.js
@@ -37,7 +37,7 @@ export const ACCEPTED_OLD_MD5 = {
// (056/057 for completeness, 060 for fix) so their drift-catch tests stay green.
export const NEW_SHIPPED_MD5 = {
'pipeline-manuscript-completeness.md': 'cec8faeb75dfff74e41b8221145c2e92',
- 'pipeline-manuscript-fix.md': '87c6e47030df07b37ace44d2a15372cf',
+ 'pipeline-manuscript-fix.md': '88199bf7b5b50155bd2e1624bd920ebd',
};
const { applyMigration, up } = makePromptReplaceMigration({
diff --git a/scripts/setup-data-drift.test.js b/scripts/setup-data-drift.test.js
index 640864430e..70a967cd26 100644
--- a/scripts/setup-data-drift.test.js
+++ b/scripts/setup-data-drift.test.js
@@ -60,7 +60,7 @@ const EXPECTED_STAGE_NEW = {
'story-builder-idea-expand.md': 'c12d76fefaaded2838023065bfc94bb0',
'pipeline-editorial-analysis.md': 'daeb02bd54b0c099b21af659c6298cfe',
'pipeline-manuscript-completeness.md': 'cec8faeb75dfff74e41b8221145c2e92',
- 'pipeline-manuscript-fix.md': '87c6e47030df07b37ace44d2a15372cf',
+ 'pipeline-manuscript-fix.md': '88199bf7b5b50155bd2e1624bd920ebd',
'pipeline-tv-script.md': '376f779f4687b598f1c92ca4e770fd5a',
};
const EXPECTED_PARTIAL_OLD = {
diff --git a/server/services/pipeline/arcPlanner.js b/server/services/pipeline/arcPlanner.js
index c175de7d42..71be422a59 100644
--- a/server/services/pipeline/arcPlanner.js
+++ b/server/services/pipeline/arcPlanner.js
@@ -685,7 +685,8 @@ const COMPLETENESS_CATEGORIES = new Set([
// comic-structure category instead carries a COMPLETE panel-by-panel rewrite of
// the malformed page in `suggestion` (it's directly substitutable). The strategy
// makes that dual use explicit so the fix prompt and UI don't have to special-case
-// the category. Mirrored in server/services/pipeline/manuscriptReview.js.
+// the category. Consumed by server/services/pipeline/manuscriptReview.js (it
+// imports both from here — single source of truth, no duplicate definition).
export const REPLACEMENT_STRATEGIES = new Set(['delta', 'full-page']);
// Category → default strategy. comic-structure is the only full-page category;
// everything else (including legacy findings with no strategy field) is a delta.