Fix chapter_production: use correct polished file pattern (staging/polished/chapter-ch-XX.md)
This commit is contained in:
@@ -3,10 +3,8 @@ description: "CLP self-driving chapter dispatch -- checks project pipeline statu
|
|||||||
debug: true
|
debug: true
|
||||||
model: power
|
model: power
|
||||||
system: agent_prompt
|
system: agent_prompt
|
||||||
|
|
||||||
agent_prompt:
|
agent_prompt:
|
||||||
- "= identity.md"
|
- "= identity.md"
|
||||||
|
|
||||||
sections:
|
sections:
|
||||||
- agent
|
- agent
|
||||||
- project
|
- project
|
||||||
@@ -14,7 +12,6 @@ sections:
|
|||||||
- rag
|
- rag
|
||||||
- message
|
- message
|
||||||
- instructions
|
- instructions
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- type: tool
|
- type: tool
|
||||||
action: git_read_file
|
action: git_read_file
|
||||||
@@ -29,21 +26,32 @@ steps:
|
|||||||
hint: |
|
hint: |
|
||||||
You are {agent.name}, production manager for {project.name}.
|
You are {agent.name}, production manager for {project.name}.
|
||||||
|
|
||||||
Review the DELIVERABLES section above. Count the final-chapter-*.md files.
|
Review the DELIVERABLES section above.
|
||||||
These are the chapters that have been fully completed (written + polished + approved).
|
|
||||||
|
|
||||||
Also check the BOOK OUTLINE if available above.
|
STEP 1 -- Count completed (polished) chapters:
|
||||||
|
Look for files matching the pattern: staging/polished/chapter-ch-XX.md
|
||||||
|
Count how many such files exist (ch-01, ch-02, etc.)
|
||||||
|
These are the chapters that have been fully written AND polished.
|
||||||
|
|
||||||
Determine which chapter needs to be written NEXT:
|
STEP 2 -- Count in-progress (drafted) chapters:
|
||||||
- If no chapters exist: ch-01
|
Look for any staging files that suggest a chapter has been drafted but not polished.
|
||||||
- If ch-01 exists but ch-02 does not: ch-02
|
Examples: review files, roundtable files, or draft files for a given chapter ref.
|
||||||
- Continue this pattern up to the chapter_target_words limit
|
|
||||||
- If all chapters are complete: the book is DONE
|
STEP 3 -- Determine next chapter:
|
||||||
|
The next chapter to write is the first chapter that has NO draft files at all.
|
||||||
|
- If polished: ch-01 through ch-04 and draft evidence for ch-05: next is ch-06
|
||||||
|
- If polished: ch-01 and draft evidence for ch-02: next is ch-03
|
||||||
|
- If nothing exists for any chapter: next is ch-01
|
||||||
|
|
||||||
|
Also check the BOOK OUTLINE if available above for chapter titles and total count.
|
||||||
|
If all chapters exist in some form up to the outline limit: the book is DONE.
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
STATUS: NEEDS_CHAPTER or COMPLETE
|
STATUS: NEEDS_CHAPTER or COMPLETE
|
||||||
NEXT_CHAPTER: ch-01 (or ch-02, etc., or N/A if COMPLETE)
|
NEXT_CHAPTER: ch-01 (or ch-02, etc., or N/A if COMPLETE)
|
||||||
CHAPTER_TITLE: <from outline if available, otherwise "Chapter N">
|
CHAPTER_TITLE: <from outline if available, otherwise "Chapter N">
|
||||||
|
POLISHED_COUNT: <number of staging/polished/chapter-ch-*.md files found>
|
||||||
|
DRAFTED_COUNT: <number of chapters with any staging evidence>
|
||||||
|
|
||||||
- type: think
|
- type: think
|
||||||
max_tokens: 100
|
max_tokens: 100
|
||||||
|
|||||||
Reference in New Issue
Block a user