feat: Le Guin prose-craft doctrine into prose generation (CWQE Phase 10) (#2175)#2246
Merged
Conversation
Completes CWQE Phase 10 (#2175) — the style-doctrine pillar after the worldbuilding (#2219) and character/structure (#2245) slices. Adds PROSE_CRAFT_DOCTRINE to styleGuide.js: always-on generation-side craft guidance (strong nouns/verbs over adjective-noun cliches; style is not ornament; concrete sensory detail; varied rhythm). composeStyleNotes gains an opt-in { proseCraft } flag; textStages wires it only for the prose-writing stages (prose/comicScript/teleplay), not the structural idea/arc/episode-seed passes. Folds into the existing styleNotes render, so no new template variable and no migration.
… style guide + doctrine (#2175) codex review finding: pipeline-pov-rewrite is a prose-generating stage that renders {{series.styleNotes}} but passed raw series.styleNotes, bypassing composeStyleNotes — so the structured style guide, #2179 voice exemplars, AND the new #2175 prose-craft doctrine never reached alternate-POV rewrites. Route it through composeStyleNotes({ proseCraft: true }), matching the prose/comicScript/teleplay stages. The token-budget overheadText already references seriesVars.styleNotes, so it now accounts for the composed block automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2175
Summary
Completes the final pillar of CWQE Phase 10 (generation-side craft doctrine) — the Le Guin style doctrine — after the worldbuilding-doctrine slice (#2219) and the character-framework + structure-rules slice (#2245). Per the design record (
docs/plans/2026-07-04-creative-writing-quality-engine.md): "style is not ornament — it IS the fantasy; prefer strong nouns/verbs over adjective-noun clichés."This is the curriculum, not the editor: craft doctrine injected into the prose prompt before the writer model drafts, the prose sibling of the Sanderson's-Laws worldbuilding doctrine already baked into
buildExpansionPrompt.What changed
server/lib/styleGuide.js— newPROSE_CRAFT_DOCTRINEconst: short, imperative, always-on prose-craft rules (style is the reader's experience of the world; strong specific nouns/verbs over adjective/adverb padding; cut dead clichés like "ancient wisdom"/"piercing gaze"/"heavy silence"; concrete sensory detail over summarized emotion; deliberate rhythm/sentence-length variation).composeStyleNotes(series, { proseCraft })gains an opt-in flag that appends it.server/services/pipeline/textStages.js— the prose-writing stages (prose,comicScript,teleplay— the existingROSTER_BACKED_STAGESset) passproseCraft: true; the structuralideabeat-sheet stage does not. The shared arc-planner and episode-seed context builders leave it off (default false), since sentence-level craft is noise when outlining beats.{{series.styleNotes}}viacomposeStyleNotes, so there's no new stage-prompt template variable (same pattern as the structured style guide and the CWQE Phase 14: series voice discovery + exemplar/anti-exemplar passages injected into prose prompts #2179 voice exemplars).styleGuide.test.jsgains acomposeStyleNotessuite covering: empty input, guide-leads/notes-trail ordering, doctrine absent by default, doctrine appended whenproseCraftis set, and craft-only output.Test plan
NODE_ENV=test npx vitest run lib/styleGuide.test.js services/pipeline/textStages.test.js→ 86 passed.lib/suite green except a pre-existing worktree-path artifact indataRoot.test.js(its Boot migrations resolve data root from executing-file location — crash when run from a CoS agent worktree #1947 leak-safety ignores an override underdata/cos/worktrees/, so the relative-path assertion diverges when run from a worktree; passes on a normal checkout and in CI).