fix: stop chapter_production from dispatching project_index mid-book
- Remove project_index dispatch from chapter_production.yml entirely.
chapter_production should ONLY dispatch book_chapter. The project_index
dispatch belongs to book_editorial (which already handles it correctly).
This was the root cause of the CLM hallucination cascade:
pulse_check -> project_review -> chapter_production -> project_index -> marketing_campaign (infinite loop)
- Add clm_dispatch_gate guard in project_index.yml. project_index now checks
whether its task message is a real book-complete signal or a generic/none
message. If gate is 'skip', clm_dispatch_content is 'none' and the enqueue
call returns gracefully (optional: true). Only fires when triggered by
book_editorial with a legitimate completion message.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -108,25 +108,6 @@ steps:
|
|||||||
task_type: "book_chapter"
|
task_type: "book_chapter"
|
||||||
content: "{chapter_dispatch_message}"
|
content: "{chapter_dispatch_message}"
|
||||||
|
|
||||||
# If COMPLETE, dispatch project_index to compile the manuscript and signal book done
|
|
||||||
- type: think
|
|
||||||
max_tokens: 50
|
|
||||||
output_key: index_dispatch_message
|
|
||||||
hint: |
|
|
||||||
Read production_status above.
|
|
||||||
If production_status is COMPLETE, output exactly:
|
|
||||||
Compile the manuscript index for {project.name}. All chapters are polished and complete.
|
|
||||||
If production_status is NEEDS_CHAPTER, output exactly: none
|
|
||||||
|
|
||||||
- type: tool
|
|
||||||
action: enqueue_strategy
|
|
||||||
optional: true
|
|
||||||
params:
|
|
||||||
company_slug: "crimson_leaf_publishing"
|
|
||||||
project_slug: "{project.slug}"
|
|
||||||
task_type: "project_index"
|
|
||||||
content: "{index_dispatch_message}"
|
|
||||||
|
|
||||||
- type: reply
|
- type: reply
|
||||||
target: channel
|
target: channel
|
||||||
channel_name: "crimson_leaf_publishing:live-feed"
|
channel_name: "crimson_leaf_publishing:live-feed"
|
||||||
|
|||||||
@@ -74,8 +74,61 @@ steps:
|
|||||||
- type: document
|
- type: document
|
||||||
filename: "MANUSCRIPT-README"
|
filename: "MANUSCRIPT-README"
|
||||||
|
|
||||||
# Sprint 81 Loop 2: when a book is complete, automatically dispatch a marketing campaign
|
# Guard: only dispatch CLM marketing if this project_index was triggered as a genuine
|
||||||
# to Crimson Leaf Marketing. optional: true so that if dispatch fails, the book is still done.
|
# book-complete event. If the task message is "none", generic, or empty (e.g. from
|
||||||
|
# chapter_production running mid-book), skip the dispatch.
|
||||||
|
- type: think
|
||||||
|
max_tokens: 50
|
||||||
|
output_key: clm_dispatch_gate
|
||||||
|
hint: |
|
||||||
|
Read the task message above (the original message this task was given).
|
||||||
|
If the message is blank, "none", or a generic system message (e.g. "Compile the manuscript
|
||||||
|
index", "Pulse-check", "Project review"), output exactly: skip
|
||||||
|
If the message contains a real book title, author, genre, and/or an explicit marketing
|
||||||
|
request, output exactly: dispatch
|
||||||
|
Output ONLY one word: skip or dispatch
|
||||||
|
|
||||||
|
# Assemble the final CLM dispatch content. If gate is "skip", outputs "none" so the
|
||||||
|
# server-side handler finds no real payload and returns gracefully (optional: true).
|
||||||
|
- type: think
|
||||||
|
max_tokens: 600
|
||||||
|
output_key: clm_dispatch_content
|
||||||
|
hint: |
|
||||||
|
The dispatch gate is: {clm_dispatch_gate}
|
||||||
|
|
||||||
|
If the gate is "skip", output exactly: none
|
||||||
|
|
||||||
|
If the gate is "dispatch", write the full marketing campaign request:
|
||||||
|
|
||||||
|
MARKETING CAMPAIGN REQUEST -- {project.name}
|
||||||
|
|
||||||
|
The manuscript for "{project.name}" is complete and ready for marketing.
|
||||||
|
|
||||||
|
BOOK DETAILS:
|
||||||
|
Title: {project.name}
|
||||||
|
Genre: {genre_name}
|
||||||
|
Audience: {genre_audience}
|
||||||
|
Author: {lead_author}
|
||||||
|
Company: Crimson Leaf Publishing
|
||||||
|
|
||||||
|
The MANUSCRIPT-README is available in the Crimson Leaf Publishing Gitea repository
|
||||||
|
under the {project.name} project deliverables. It contains the full reading order,
|
||||||
|
chapter summaries, continuity chain, and editorial verdict.
|
||||||
|
|
||||||
|
Please launch a full marketing campaign including:
|
||||||
|
- Campaign strategy (target platforms, timeline, budget allocation)
|
||||||
|
- Social media content pack (TikTok, Instagram, Facebook)
|
||||||
|
- Email campaign (reader list announcement)
|
||||||
|
- Press release (book announcement)
|
||||||
|
- Ad copy (platform-specific variations)
|
||||||
|
- Author bio update
|
||||||
|
|
||||||
|
MISSION: Get this book discovered by its audience and generate revenue for Crimson Leaf.
|
||||||
|
|
||||||
|
Output ONLY the content text above (or "none" if gate is skip).
|
||||||
|
|
||||||
|
# Sprint 81 Loop 2: dispatch marketing only when clm_dispatch_content is a real brief.
|
||||||
|
# optional: true -- if content is "none" the handler returns gracefully.
|
||||||
- type: tool
|
- type: tool
|
||||||
action: enqueue_strategy
|
action: enqueue_strategy
|
||||||
optional: true
|
optional: true
|
||||||
@@ -83,31 +136,7 @@ steps:
|
|||||||
company_slug: "crimson_leaf_marketing"
|
company_slug: "crimson_leaf_marketing"
|
||||||
project_slug: "book-marketing-agency"
|
project_slug: "book-marketing-agency"
|
||||||
task_type: "marketing_campaign"
|
task_type: "marketing_campaign"
|
||||||
content: |
|
content: "{clm_dispatch_content}"
|
||||||
MARKETING CAMPAIGN REQUEST -- {project.name}
|
|
||||||
|
|
||||||
The manuscript for "{project.name}" is complete and ready for marketing.
|
|
||||||
|
|
||||||
BOOK DETAILS:
|
|
||||||
Title: {project.name}
|
|
||||||
Genre: {genre_name}
|
|
||||||
Audience: {genre_audience}
|
|
||||||
Author: {lead_author}
|
|
||||||
Company: Crimson Leaf Publishing
|
|
||||||
|
|
||||||
The MANUSCRIPT-README is available in the Crimson Leaf Publishing Gitea repository
|
|
||||||
under the {project.name} project deliverables. It contains the full reading order,
|
|
||||||
chapter summaries, continuity chain, and editorial verdict.
|
|
||||||
|
|
||||||
Please launch a full marketing campaign including:
|
|
||||||
- Campaign strategy (target platforms, timeline, budget allocation)
|
|
||||||
- Social media content pack (TikTok, Instagram, Facebook)
|
|
||||||
- Email campaign (reader list announcement)
|
|
||||||
- Press release (book announcement)
|
|
||||||
- Ad copy (platform-specific variations)
|
|
||||||
- Author bio update
|
|
||||||
|
|
||||||
MISSION: Get this book discovered by its audience and generate revenue for Crimson Leaf.
|
|
||||||
|
|
||||||
- type: close
|
- type: close
|
||||||
rag_update: true
|
rag_update: true
|
||||||
|
|||||||
Reference in New Issue
Block a user