Commit Graph

24 Commits

Author SHA1 Message Date
David Baity
a64fa14f2b fix: strip VALIDATION LOG from chapter deliverables; improve word count expansion instructions 2026-03-25 08:04:53 -04:00
David Baity
2cd3b5f41c fix: PASS 3 anchor to PASS 1 chapter, reject deliverable files as state source
Root cause: PASS 0 loads all project deliverables including Ch1-13 drafts.
Ch 3 'adjoining quarters' scene appeared LAST in deliverables just before
the Write Chapter 8 instruction. PASS 3 was using that as 'the chapter I
just wrote' instead of the actual PASS 1 narrative.

Fix: PASS 3 hint now explicitly identifies the conversation turn structure,
anchors to Turn 2 (PASS 1 response), and adds an ANCHOR TEST that rejects
any Location from a [Chapter_N_draft.md] deliverable file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 07:26:59 -04:00
David Baity
f5d4be7f69 fix: PASS 3 system-override anti-hallucination for deceased Kaelen
Previous rule was hint-only and ignored by LLM deep in long context.
Now uses system: override (added to system prompt) plus hyper-explicit
step-by-step self-check targeting Kaelen by name. Dead = no Location,
no Physical, no Emotional, no Arc. Final self-check before submit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 07:08:03 -04:00
David Baity
4a5a74e649 fix: book_chapter PASS 3 explicit DECEASED rule — no hallucinated living presence
Added DECEASED CHARACTER RULE block at top of PASS 3 hint. Dead characters
get a two-line entry (Established + Legacy), NO Location/Physical/Emotional/Arc.
Prevents the LLM from inventing living Kaelen presence in Ch 6-12 state files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 06:51:00 -04:00
David Baity
009f96b7d4 fix: book_chapter step5 rag_write source_step:4 — character-state extraction
Add source_step: 4 so rag_write explicitly targets PASS 3 output instead of
relying on last_text() which could fall back to the chapter document text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 06:35:25 -04:00
David Baity
8d3f54ac54 Sprint 56h: self-check now expands word count when draft is >10% short of target
- Changed 'STRUCTURAL VALIDATION ONLY' → 'STRUCTURAL VALIDATION AND WORD-COUNT EXPANSION'
- Word floor check now EXPANDS (not just flags) when draft is >10% below chapter_target_words
- Added expansion rules: interiority, sensory grounding, dialogue beats, scene transitions
- Added max_tokens: 32000 and model: power to self-check step for capacity headroom
- Removed 'Expand any description or add sensory detail' from NOT ALLOWED (only applies to existing prose)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 03:49:29 -04:00
David Baity
6bf89c8e8a Fix staging_path: mark Chapter draft as primary_deliverable so character-state doc step does not overwrite adjudication target
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 03:21:34 -04:00
David Baity
c08ace762c Sprint 56h: fix package step - use source_step+{steps[1].text} to pass chapter text to reviewers; remove chapter_text schema; trim meta on rewind 2026-03-25 02:11:26 -04:00
David Baity
ca0e2fad89 Sprint 56h: inject author_intent/closing_hook meta fields as template vars; expand chapter_snapshot; add LOCKED CLOSING HOOK support to PASS 0 and SELF-CHECK 2026-03-25 01:58:34 -04:00
David Baity
40f22fa685 Sprint 56h: butterfly effect + character sheet auto-import
- drafting.yml: add {character_profiles} in PASS 0, PASS 3 character state
  extraction, rag_write for character-state asset (enables butterfly effect
  in draft mode), document for character-state file, conditional_skills
- character_sheet.yml: add rag_write step writing voice-sig-{slug} asset
  so auto-import can pick up completed character sheets from RagMemory
- book_chapter.yml: package hint now detects new characters from PASS 3
  Character State (spawns character_sheet tasks) and detects Permanent:YES
  changes (spawns character_update tasks)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 22:46:24 -04:00
David Baity
4ab09d1c16 Fix book_chapter.yml: write chapter draft before char-state extraction
Chapter_N_draft doc step was placed after PASS 3 think, so last_text()
returned char state (3151 chars) instead of the actual chapter from SELF-CHECK.
Moved doc step to immediately after step 2 (SELF-CHECK).

New step order: 0-think, 1-think, 2-think(selfcheck), 3-doc(draft),
4-think(charstate), 5-rag_write, 6-doc(charstate), 7-package, 8-close

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 00:51:39 -04:00
David Baity
79a2e8ab7c Sprint 56h: fix spawn_list bug + add iris character_sheet support + voice sig auto-import 2026-03-23 23:46:15 -04:00
David Baity
63f60559b0 Sprint 56h: evolving character sheets + reliable injection
- Split project.rag.md into 6 focused RAG files (voice-signatures, magic-system,
  story-premise, factions, character-state, world-state)
- book_chapter.yml: PASS 0 STEP 5 replaced with live RAG character/world state check +
  location continuity validation; PASS 3 added for character+world state extraction after
  each chapter (rag_write -> character-state RAG + deliverable snapshot)
- chapter_polish.yml: PASS state extraction after final document (full-mode canonical state)
- book_outline.yml: added Factions section template with NPC memory model
- NEW character_update.yml: permanent arc change template (updates static char profile)
- chapter_review.yml: Sprint 56g voice authenticity fixes (fire/ice -> Body/Mind duality)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 01:07:24 -04:00
David Baity
177acdfa35 Sprint 56f: Human-readable file naming - Chapter_N_draft/review_a/b/c/final 2026-03-22 18:57:33 -04:00
David Baity
b27229a71f Sprint 56a: PASS 1 + SELF-CHECK locked chapter hook enforcement
- PASS 1: new requirement — FIRST LINE must resolve LOCKED PREVIOUS
  CHAPTER HOOK if present in draft prompt
- SELF-CHECK: item 6 — validate opening paragraph answers locked hook;
  add resolution sentence if missing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-21 23:28:40 -04:00
David Baity
87c01864dc Sprint 56: Upstream draft control and editorial boundary refactor
- book_chapter: Remove PASS 2+3 (internal polish cycle); replace with narrow
  SELF-CHECK step (structural validation only — names/POV/hook/format/word-floor).
  Add anti-overpolish drafting discipline rules to PASS 1.
  Add genre-aware guide-use note (apply only the guide matching {genre_name}).
  Update adjudication prose_quality description to match draft-quality standard.

- chapter_polish: Convert from broad 'Rewrite the chapter' pass to bounded
  editorial control pass. Explicitly forbids expansion, sensory addition,
  global voice upgrades, new content. Instructs verbatim preservation of
  unaffected paragraphs. Adjudication rewritten around correction fidelity
  rather than 'more polished is better'. Threshold lowered from 90 to 80.

- chapter_review: Add explicit output categories — STRENGTHS TO PRESERVE,
  MUST-FIX CONTINUITY, MUST-FIX CLARITY, OPTIONAL, FORBIDDEN, VERDICT.
  Remove 'REWRITE' verdict option (roundtable resolves that). Remove all three
  writing-craft guides (editorial tasks do not need genre writing guidance).

- chapter_roundtable: Update CONSENSUS REACHED block to MUST APPLY / OPTIONAL /
  PRESERVE / VERDICT categories. Require disagreements to be resolved before
  calling consensus. Remove REWRITE verdict option. Remove all writing-craft
  guides. Remove 'skills' from sections. Add package hint to populate key_changes
  from the full structured consensus. Update adjudication to score structured output.

- book_outline: Strengthen Voice & Tone Guide as hard operating constraints
  (not aspirations); include anti-overpolish rules, rhythm rules, and voice
  don'ts. Expand per-chapter outline format to include Opens-at location,
  Character state, and Dominant tension. Enrich chapter task description
  packets with that state data so book_chapter has richer upstream context.

- skills/skills.md: Document writing-vs-editorial guide split established in
  Sprint 56. Update Used-by column. Add boundary rules section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-21 16:34:32 -04:00
David Baity
1e2cb6e875 enforce word count in chapter_polish and book_chapter templates
- chapter_polish: add explicit 'chapter_target_words minimum' warning to think hint
  with instruction to EXPAND scenes to reach target length
- chapter_polish: add word_count criterion (30%) to adjudication, restructure weights
- book_chapter PASS 1: strengthen word count instruction with explicit stop-early warning
- book_chapter: add word_count criterion (30%) to adjudication, restructure weights

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 11:38:16 -04:00
David Baity
ff38fff631 refactor: move all project folders into projects/ subdirectory
This change reorganizes the repository structure to keep the root directory
clean. All 15 project folders are now nested under projects/, alongside
infrastructure directories (agents/, templates/, deliverables/, rag/, skills/).

This allows the repository to grow without polluting the core service directories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 11:09:34 -04:00
David Baity
db06dce05d feat: wire skills guides into templates, deduplicate Iris RAG
Skills guides wired (all were dead code — no templates declared skills:):
- book_chapter.yml: YAFictionGuide + RomanceFictionGuide + SciFiFictionGuide
- chapter_review.yml: same (Devon, Lane, Cora reviewers now have genre context)
- chapter_roundtable.yml: same (debate participants use genre craft knowledge)
- chapter_polish.yml: same (Iris polishes with full genre guide in context)
- short_story.yml: same
- blog_write.yml: BlogWritingGuide
- recipe_develop.yml: RecipeWritingGuide

All templates updated to include 'skills' in sections list so guides
are injected as SKILLS & GUIDES block in the prompt.

Iris RAG deduplication:
- agents/iris/rag/agent.rag.md: 15 near-identical entries -> 2 canonical
  Entry 1: Bible & Continuity Check requirement
  Entry 2: Editorial assignments (Devon/Lane/Cora with their roles)
  13 duplicates removed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 09:39:05 -04:00
David Baity
4c9222960d fix: template prompt bloat and variable substitution failures
- chapter_polish: remove sections:deliverables — chapter text already in
  {chapter_text}; this caused 150KB+ prompts for late chapters (40MB logs)
- chapter_roundtable: require structured CONSENSUS REACHED block so
  key_changes is always formatted as an extractable string; change
  key_changes schema from list to string to match
- book_chapter: remove sections:history to reduce context; restructure
  Pass 0 to plan-only (no prose output) so the chapter is only written
  once in Pass 1 instead of twice; add explicit instruction in package
  hint to copy full chapter_text into spawn context
- short_story: remove sections:history and sections:deliverables (standalone
  task, needs neither); restructure Pass 0 to plan-only, Pass 1 to write;
  add note to handle literal {genre_name} placeholders gracefully
- recipe_develop, ai_article_write, blog_write: remove sections:history
  (these standalone tasks do not need full project conversation history;
  deliverables kept so they can read the research/plan file)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 09:05:45 -04:00
David Baity
f4b7a04a27 fix: roundtable uses all three editors as participants
Replace agent_name: Devon with agents: [Devon, Lane, Cora] so the
chapter_roundtable task has all three editors rotating in the debate.
Addresses user feedback that roundtable should not be a specific
agent - everyone in the editorial team should be drafted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 04:31:04 -04:00
David Baity
6c39789f94 Fix: add agent_name to roundtable and polish spawns
- book_chapter.yml: spawn Roundtable task with agent_name: Devon
  (dispatcher requires at least one agent; Devon chairs the roundtable
  while rotate_participants still drafts all available editors)
- chapter_roundtable.yml: spawn Polish task with agent_name: Iris
  (Iris is the designated chapter polish author)

Previously: dispatch_create_task_skipped reason=no_agent for both tasks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 02:54:12 -04:00
David Baity
1f811e98e1 fix(clp): genericise templates — no hardcoded agents/companies/task-types
- planning.yml: roster-driven task types, no hardcoded agent names or generic types
- chapter_roundtable.yml: removed fixed [Devon,Lane,Cora] participant list, any editor can join
- book_chapter.yml: removed hardcoded agents from roundtable spawn
- book_research.yml: removed agent: Atlas from book_outline spawn (Bouncer routes by type)
- ai_article_research.yml: removed agent_name: Atlas from plan spawn
- book_editorial.yml: removed Shadow Heir/Elara/Kai/Alpha Publishing/Wattpad hardcoding
- project_index.yml: removed Wattpad reference
- ai_article_write.yml: fixed adjudication criteria (article, not fiction chapter)
- chapter_review.yml: reply→document so reviews are committed and accessible

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 01:34:36 -04:00
David Baity
50749f8e2b feat(clp): build full CLP agent roster, templates, and skills library
- 8 company agents: Lyra (intake), Selene (CEO), Atlas (research),
  Nova (publishing ops), Iris (author), Devon (dev editor),
  Lane (line editor), Cora (continuity editor)
- 19 additional templates (20 total): blog, recipe, short_story,
  book pipeline, ai_article, planning, boardroom, quick, project_index
- 5 skill guides: YA, Romance, SciFi, Blog, Recipe writing
- Rewritten charter and business plan

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 01:14:51 -04:00