Commit Graph

77 Commits

Author SHA1 Message Date
e110f598db fix: remove Unicode chars from template 2026-04-09 23:03:28 +00:00
e15130d54b fix: remove Unicode chars from template 2026-04-09 23:03:28 +00:00
1d76880b29 fix: remove Unicode chars from template 2026-04-09 23:03:26 +00:00
314bb6565a fix: remove Unicode chars from template 2026-04-09 23:03:25 +00:00
39a14afa75 fix: remove Unicode chars from template 2026-04-09 23:03:23 +00:00
8a288c957c fix: remove Unicode chars from template 2026-04-09 23:03:22 +00:00
David Baity
20112eac6a feat: add debug:true to all templates; add LLM_LOG_DIR config 2026-04-09 14:38:11 -04:00
David Baity
99c4718baf updating 2026-04-06 21:51:34 -04:00
David Baity
4a7318bc53 Sprint 66g: template architecture -- company templates only, starter_pack, rename to lower_case_with_underscores
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 22:43:31 -04:00
David Baity
9c362b92f8 Strengthen chapter review quality gates
- chapter_review.yml: mandatory PROSE EVIDENCE section (3-5 verbatim quotes)
- CHARACTER VOICE AUDIT with per-constraint checks and violation quoting
- Score anchors (95-100/85-94/70-84/<70) to break rubber-stamp clustering
- MUST-FIX items require ORIGINAL quote + PROBLEM + FIX rewrite
- Adjudication: prose_evidence(35) specificity(30) voice_audit(20) coverage(15)
- chapter_roundtable.yml: require quoted evidence, add character_profiles check
2026-04-01 22:33:55 -04:00
David Baity
682454bc7b refactor: remove genre-specific chapter templates; all genres use book_chapter 2026-04-01 17:58:10 -04:00
David Baity
1675b87268 outline: populate bible/outline.md for crimson-vows and binding-thread 2026-04-01 16:53:28 -04:00
David Baity
15d8ac44d2 Reader Knows Rule: truncate outline at chapter N, character state from prev chapter
- book_chapter.yml PASS 0: Reader Knows Rule box, outline truncated at chapter_number_next,
  character state priority chain (RAG first, then prev-chapter traits, not final-book state)
- drafting.yml PASS 0: same rule applied, voice-only character profiles
- chapter_pass0_bible.yml (included by scifi/ya/romance/cozy genre templates): same fix
  All three reference {chapter_number_prev}, {chapter_number_next}, {chapter_ref_prev}
  which are now injected by OutlineSyncService.CreateChapterTaskAsync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-31 17:34:12 -04:00
David Baity
1836ffcd75 Sprint 61k — Template & Pipeline Correctness Audit
- Fix {task.prompt} → {task.message} in all marketing templates (6 files)
- Add author_bio.yml and ad_copy.yml templates for crimson_leaf_marketing
- Add author_bio task_type to marketing_campaign.yml package schema
- Fix book_outline.yml: remove {prose_style} literal, add anti-truncation rule, fix scifi routing
- Fix InputFromUser.yml: echo full operator message in think output
- Fix planning.yml: add agent:Nova top-level field to lock chair
- Fix publishing genesis.yml: fix {task.message} variable and hardcode Nova title
- Add professional_title to AgentContext and build_state_map
- Increase _DEFAULT_MAX_RAG_CHARS from 4000 to 8000
- Fix adj_pass_rate=0.0: thread adjudication criteria through C# and Python

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 10:35:51 -04:00
PAE
9b4ea8f403 Bootstrap: scaffold templates/ 2026-03-30 07:05:01 +00:00
David Baity
b5ddd0506b Cleaned up 2026-03-28 20:36:24 -04:00
David Baity
68d58d3caf Cleaning up 2026-03-28 11:34:36 -04:00
David Baity
8734114885 fix: disable adjudication on roundtable (package step has no staging path, gets stuck at AdjudicationPending) 2026-03-28 03:52:45 -04:00
David Baity
d0305310bc fix: book_chapter spawn context - use {character_profiles|} fallback to handle missing var
Tasks fail at step 7:package when character_profiles is not in context_vars because the
spawn context check incorrectly reports {character_profiles} as an unresolved placeholder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-28 03:20:24 -04:00
David Baity
d042a47856 PASS 3 bucket model: clean dies-in-chapter vs carried-dead 2026-03-25 17:50:55 -04:00
David Baity
efc8402d43 PASS 3 prose-first rule: character in prose = alive 2026-03-25 17:34:39 -04:00
David Baity
c8dfc1e4ee PASS 3: add future-chapter contamination guard to SECRET CARRY-FORWARD RULE
When writing ch-07, PASS 3 was reading character-state-ch-08 deliverables and
carrying 'Known secrets' from future chapters into the current state. Added
explicit FUTURE-CHAPTER CONTAMINATION GUARD: only use secrets from state files
whose chapter number is EARLIER than the current chapter being written.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 17:11:17 -04:00
David Baity
92311e9904 Fix PASS 3: MANDATORY CHECK and DEATH-FORWARD RULE respect author_intent retcon
The MANDATORY CHECK was rigidly applying DECEASED status from previous
character-state deliverables even when author_intent explicitly retconned
the character as alive. Similarly, the DEATH-FORWARD RULE had no exception
for author-directed resurrection/retcon.

Fixes:
- MANDATORY CHECK: add STEP 2 resurrection check -- if AUTHOR'S INTENT
  explicitly states character is ALIVE, skip DECEASED format entirely
- DEATH-FORWARD RULE: add EXCEPTION clause -- author_intent overrides
  previous state DECEASED status; prose is authoritative source of truth

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 17:03:11 -04:00
David Baity
1bc7440d32 Remove PASS 3 hardcoded Kaelen death from system prompt; add general future-death prohibition 2026-03-25 16:29:55 -04:00
David Baity
5987c4646a Remove hardcoded Kaelen Ch04 death — butterfly effect edit: Kaelen now dies in Ch09 2026-03-25 16:21:19 -04:00
42219085ee fix: strengthen DEATH-FORWARD rule — prevent relative/sibling resurrection in PASS 3 2026-03-25 17:47:43 +00:00
2efc2ab787 fix: add DEATH-FORWARD RULE to PASS 3 — prevents deceased chars getting living state 2026-03-25 17:14:27 +00:00
David Baity
89d472f6dc template: PASS 3 carry-forward rule for unresolved chapter secrets 2026-03-25 08:56:20 -04:00
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
5e4be25f51 fix: add chapter_number context var to book_outline.yml spawn schema 2026-03-24 00:24:37 -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
f3d1ac3dc5 Add draft-only chapter template
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-14 09:53:57 -04:00
David Baity
c966146324 chore: restore chapter_polish model to power alias after benchmark
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 13:19:51 -04:00
David Baity
1b462638f0 benchmark: run D — openai/gpt-5.4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 13:15:02 -04:00
David Baity
4ac96b62d7 benchmark: run C — x-ai/grok-4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 13:11:01 -04:00
David Baity
c5ec53c8e0 benchmark: run B — claude-sonnet-4.6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 13:07:47 -04:00