Skip to content

The Pipeline

Nick edited this page Jul 28, 2026 · 1 revision

The Pipeline

The Open-Write Pipeline is an autonomous, resumable, phase-by-phase production system that takes a creative brief from concept to a completed, verified manuscript.

Overview

BIBLE -> VOICE -> EDITORIAL LOCK -> (per unit: ARCHITECT -> WRITER -> CRITICS x5 -> EDITORIAL -> VERIFY) -> ASSEMBLE -> ADVERSARIAL READ -> FINALIZE

Each phase:

  1. Builds a system prompt from the canonical rule files
  2. Calls the LLM (via your configured provider)
  3. Writes the artifact to the path the manifest expects
  4. Runs the gate for that phase
  5. Blocks on FAIL — never auto-advances past a failure

Human approval is required between phases. The pipeline pauses after each phase so you can review the output and decide whether to continue.

Phase Sequence

Project Phases

Phase Description Rule File
Bible Concept, outline, and format rules rules-architect.md + bible templates
Voice Voice experiment (candidates + review + locked spec) voice_experiment_protocol.md
Editorial Lock Review and lock the outline editorial_review_protocol.md

Per-Unit Loop (repeated for each chapter)

Phase Description Rule File
Architect Per-unit plan (scenes, beats, character arcs) rules-architect.md
Writer First draft of the chapter rules-prose-writer.md + novel_craft.md
Critics x5 Show, Voice, Palette, Continuity, Naturalism rules-critic-{show,voice,palette,continuity,naturalism}.md
Editorial Full editorial evaluation rules-editorial-eval.md
Verify Deterministic completion gate verify_completion.py

Closing Phases

Phase Description Rule File
Assemble Combine chapters into full manuscript assemble.py
Adversarial Read Two-reader A/B critique (Reader A + Reader B) rules-adversarial-reader.md
Finalize SHA-256-bound completion certificate finalize.py

Deterministic Completion Gate

The gate is the sole authority for PASS/FAIL between phases:

  • Word counting — strips artifacts, counts prose words
  • Manifest building — reads the locked outline, counts chapters
  • Verification — path-traversal guards, critic-substance checks, hash binding
  • Linting — 6 blocking/advisory lints on finalized output
  • Finalize — writes COMPLETION_PASS.json with SHA-256 binding

The agent/caller may NEVER write COMPLETION_PASS.json directly — only the /finalize endpoint produces it.

Post-Critics Revision Loop

After critics evaluate a chapter, if any say REVISE:

  1. All critic findings are collected
  2. The writer automatically rewrites with the feedback
  3. Critics re-evaluate
  4. Max 2 retries per chapter
  5. Proceeds only when critics are satisfied (PASS/ADVANCE verdicts)

User Input Overrides

You can provide your own content for any phase instead of generating via the model:

  • Paste your own bible, voice spec, chapter prose, etc.
  • The override is applied before the phase runs
  • Useful for migrating existing work into the pipeline

Pipeline UI

The Pipeline screen has three tabs:

Run Tab

  • Phase roadmap (done / current / pending)
  • Gate verdict banner (PASS / FAIL)
  • [Run Next Phase] button
  • Auto-run toggle (2s delay between phases)
  • User input override textarea
  • Per-phase model routing dropdowns

Outputs Tab

  • Browsable artifact catalog organized by category:
    • Bible / Voice Experiment / Design Documents / Prose / Reviews / Manifest
  • Markdown and JSON rendering
  • Word count display

Chat Tab

  • Multi-turn chat with the Pipeline Companion
  • Knows the current run state
  • Apply to Brief — proposes creative brief changes
  • Re-run Phase — triggers a phase re-run with new instructions

CLI Tool

For debugging and automation:

cd backend
python tools/ow_cli.py status <project>
python tools/ow_cli.py start <project> -i "creative brief"
python tools/ow_cli.py advance <project>
python tools/ow_cli.py advance-all <project>
python tools/ow_cli.py reset <project>
python tools/ow_cli.py outputs <project>
python tools/ow_cli.py read <project> <relpath>
python tools/ow_cli.py critic-test <project> -t show
python tools/ow_cli.py --direct advance <project>  # bypass sidecar

Run State

Pipeline state persists to <project>/state/pipeline_run.json. This makes the pipeline resumable across sessions — if you close the app and reopen it, the pipeline picks up where it left off.

Profile Integration

Character profiles are automatically routed into pipeline phases by importance level:

Phase Receives
Architect All levels (core + present + background + contextual + hidden)
Writer Core + present + hidden (hidden flagged "NEVER name directly")
Voice critic Core + present + voice registers
Continuity critic Core + present + hidden
Other critics Blinded (per Open-Write critic architecture)

Clone this wiki locally