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
|
||||
model: power
|
||||
system: agent_prompt
|
||||
|
||||
agent_prompt:
|
||||
- "= identity.md"
|
||||
|
||||
sections:
|
||||
- agent
|
||||
- project
|
||||
@@ -14,7 +12,6 @@ sections:
|
||||
- rag
|
||||
- message
|
||||
- instructions
|
||||
|
||||
steps:
|
||||
- type: tool
|
||||
action: git_read_file
|
||||
@@ -29,21 +26,32 @@ steps:
|
||||
hint: |
|
||||
You are {agent.name}, production manager for {project.name}.
|
||||
|
||||
Review the DELIVERABLES section above. Count the final-chapter-*.md files.
|
||||
These are the chapters that have been fully completed (written + polished + approved).
|
||||
Review the DELIVERABLES section above.
|
||||
|
||||
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:
|
||||
- If no chapters exist: ch-01
|
||||
- If ch-01 exists but ch-02 does not: ch-02
|
||||
- Continue this pattern up to the chapter_target_words limit
|
||||
- If all chapters are complete: the book is DONE
|
||||
STEP 2 -- Count in-progress (drafted) chapters:
|
||||
Look for any staging files that suggest a chapter has been drafted but not polished.
|
||||
Examples: review files, roundtable files, or draft files for a given chapter ref.
|
||||
|
||||
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:
|
||||
STATUS: NEEDS_CHAPTER or COMPLETE
|
||||
NEXT_CHAPTER: ch-01 (or ch-02, etc., or N/A if COMPLETE)
|
||||
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
|
||||
max_tokens: 100
|
||||
|
||||
Reference in New Issue
Block a user