Recursive Drafting Pipelines That Treat Editing Passes as Typed Pipeline Stages
Typed editing stages make AI revision testable and routable, not just repeated.
November 25, 2026

Recursive AI writing pipelines refine text automatically by routing drafts through editing stages with defined inputs, one quality criterion, and a contract for downstream output. Their advantage over repeated prompting is not more revision, but revision that can be tested and routed. Treating editing passes as typed stages gives an open-ended loop a set of acceptance criteria it must meet.
Why a write-review-revise loop is not a pipeline
A drafting workflow can run three passes and still produce text that feels no better than it did after one. Single-prompt iterative prompting remains useful for generating alternatives and responding to direct editorial feedback. It is simple to start and leaves room for exploration. The gap appears when the workflow must decide whether a revision is acceptable without a person comparing every version. Another fluent answer is not evidence of improvement.
When every pass accepts arbitrary prose and returns arbitrary prose, nothing binds the next revision to what the previous pass resolved. A request to make the text clearer can change the voice, while a later request to bring back the voice can undo the clearer phrasing. Repeated prompting can also pull text toward the model’s baseline training distribution and away from the editorial target. Without an acceptance contract, the loop cannot distinguish a productive correction from a lateral substitution.
What typed stages actually mean in a drafting pipeline
A typed stage has a defined input schema, exactly one quality criterion, and a downstream contract that its output must satisfy. The schema declares what the stage accepts. The criterion identifies what it judges, such as clarity, claim accuracy, voice fidelity, or sentence rhythm. The contract requires a structured verdict of pass, flag, or rewrite, with the specific violation attached.
A small example makes the distinction concrete. A casing check could emit a three-field JSON object whose fields are criterion, verdict, and violation. Their values could identify casing, request a rewrite, and name the heading that violates the style specification. A passing result would use the same schema. The next stage therefore receives a predictable object, and the orchestrator can route the result according to its verdict.
This is a software interface. Schema-validated JSON and stdin/stdout composability let stages exchange defined objects rather than depend on an agent’s interpretation of free-form feedback. A stage asked to “make this better” across several dimensions remains a generalist pass, even if its response is JSON. Typing requires a narrow editorial responsibility as well as a valid output shape.
How to decompose the drafting cycle into discrete, composable stages
The drafting cycle has stages for generation, structural checks, style enforcement, and claim validation. These are functional parts of the graph rather than permission to combine every related check into one judgment. Within structural checking, required section presence, placeholder detection, and frontmatter dependency consistency can each have a distinct criterion. Style enforcement can also check casing and sentence rhythm on their own.
Deterministic checks belong at the first gate because they are fast, cheap, and require no model call. A missing section is a structural failure. Auto-rewriteable violations, including casing, whitespace, and minor stylistic deviations, route to an inline LLM rewrite path. Violations that need judgment go to adversarial review instead. The revised output must meet its contract before it moves on.
Fixed interfaces also make model replacement practical. Generation can use a faster model, judgment a stronger model, and validation a model that checks closely, while the stages on either side still get what they expect. For teams using Letterwrite, its CLI and API provide access to multi-model writing infrastructure in which an adversarial kernel can occupy the judgment stage while other models generate or validate. The contract, rather than the vendor interface, defines the boundary. That separation allows a model change without requiring the rest of the graph to interpret a new output format.
Why specialization is what makes recursion converge rather than churn
Specialization gives recursion a direction by narrowing the search along one dimension at a time. A casing correction has a defined target. A general improvement pass does not, because it can reopen structure, wording, voice, and claims simultaneously. The next attempt may repair a recent defect while reintroducing one that an earlier pass removed. Structured verdicts preserve a record of what satisfied a criterion, giving later checks something explicit to test.
This does not prove that each added agent makes the writing better. Ning et al.’s 2026 decomposition study from Carnegie Mellon raises a more demanding explanation for gains in staged systems. What appears to be a critic’s error correction may instead be the benefit of sending the task to a stronger model. Naming one agent “editor” and another “critic” does not establish that their interaction caused the improvement.
If stronger-model routing explains much of the gain, judgment passes should use the strongest model instead of counting on role prompts to give a model expertise. Typed stages make that assignment explicit and testable. Their contribution is a controlled place to apply stronger judgment and a criterion against which to assess it. Convergence remains conditional on useful criteria and capable models.
Where adversarial review fits as a typed stage in the graph
Adversarial review belongs where a violation needs judgment and cannot be fixed by a mechanical correction. Its input contract supplies the text and the criterion under review, while its output identifies a specific objection and a structured verdict. It is not another unrestricted rewrite request. Keeping the critic’s responsibility narrow lets the orchestrator distinguish an unresolved objection from a defect that the inline rewrite path can handle.
A critic from a different vendor offers a way to challenge what the drafter has normalized. Different model families leave different distributional fingerprints, while shared training lineage can correlate blind spots. Vendor diversity is therefore a structural choice. It does not establish that every cross-vendor objection is correct. The critic still needs the stage’s criterion, and an arbiter’s resolution still depends on the quality of the upstream specification.
The same boundary has a security role. Intermediate text passed between agents can contain adversarial content that redirects a later agent if it is accepted as trusted input. Explicit boundary verification must therefore validate what crosses the interface. Schema validation defines the expected input, but does not by itself establish that its contents are safe instructions. Typed contracts make that verification a stage obligation rather than an optional check after the graph is built.
What pipeline output looks like when watermarking is a mandatory layer
Where watermarking is mandatory, the output contract must account for embedded provenance signals as well as text and verdicts. Watermarking nudges word choices into a pattern that a detector with the right key can recognize. The reader need not see the mark. For pipeline design, the important distinction is between detecting such a pattern and establishing which stage produced a particular revision.
A watermark supplies non-exclusive, probabilistic evidence that text was processed by a model. Research on watermark radioactivity shows that a model trained on watermarked output can inherit the pattern and emit another model’s signature without intent. A detector result therefore cannot take the place of the pipeline’s own record of which role each model had and which stages ran.
Structured logs remain the authoritative pipeline provenance record. Each boundary needs schema-validated output and a record of which model ran the pass, so that downstream inspection can distinguish the stage’s declared result from a watermark signal. Mandatory watermarking makes this separation more important. It adds a compliance layer to the output, but does not remove the need for auditable verdicts or justify inferring stage history from word choices alone.
How brand voice fidelity is enforced as a typed constraint rather than a prompt instruction
A prompt can request a voice, but cannot enforce it as a contract. The model weighs that instruction against its training distribution, leaving acceptance to an impressionistic judgment unless the pipeline supplies a specification. Voice fidelity needs a machine-readable target. That target includes numeric tone dimensions, banned phrases with replacements, sentence-length distributions from the team’s highest-performing published pieces, and annotated exemplars showing what on-voice prose looks like.
The specification must draw on content that has been published, even if it also uses a prose style guide. LLM-extracted attributes from a substantial corpus of the team’s best writing can be chunked and clustered into a voice-attribute taxonomy. Post-training then gives the enforcement stage a way to learn the specific voice instead of repeatedly approximating it from instructions. This changes the space in which revision operates.
The five-axis control plane includes version control on the voice spec, structured spec authoring, a forbidden-phrase library, a claims allowlist, and corpus-extraction. These controls feed independently checkable constraints. Claim permissibility still belongs to claim validation, even when the controls share a specification. Letterwrite is a CLI-native writing system built on adversarial model councils whose post-trainable kernels implement this enforcement pattern. Its kernels check drafts against fixed style cases and keep an auditable record of what passed and why.
Building the pipeline as testable infrastructure: eval harnesses, CI gates, and version control
To build this architecture as infrastructure, a team should test the contracts, version the outputs, and run quality gates in CI. The terminal workflow follows the stage graph. A generation invocation sends output through stdin/stdout to structural checks, then to the required style and claim stages. Each stage emits a schema-validated object containing its verdict and violation. The invocation is complete only when the routing logic has resolved the required gates.
An eval harness can score those objects, which have a known shape, over many runs. Deterministic checks for required sections, placeholders, and forbidden phrases run before a model makes a judgment. Non-deterministic style and voice checks then use a rubric-based LLM-as-judge pass that emits a structured grade for comparison with a threshold. In CI, the same schema and grading rules become automated gates instead of conventions followed only during manual review. The workflow tests both the interface and the editorial criterion.
Promptfoo provides a CLI and Node.js tool with configuration driven by a data-serialization format for cross-model comparison and adversarial prompt testing. It addresses two concrete implementation questions, which model fits a stage and how its prompt handles adversarial input. Model-role separation can then follow the evaluation rather than an assumption that one model should handle everything.
Version control makes those choices traceable over time. A regression can be examined against changes to the voice specification or stage contracts. An existing developer workflow can also use Letterwrite’s API and MCP hooks to incorporate the writing kernel without a separate content toolchain. The pipeline remains under the team’s version control.
What the architecture cannot do, and where the remaining work is human
Typed stages enforce decisions that people must first make. A human has to define what on-voice means precisely enough to encode, which claims are allowable, and what structure the content requires. A valid schema cannot repair a poor editorial standard. An adversarial critic may raise an objection, but resolving it still depends on good voice specifications and content strategy set upstream. A faulty specification can produce confidently judged, well-structured output that remains wrong for the task.
The decomposition finding also leaves a human responsibility. If stronger-model routing explains part of the improvement, the team must choose which models do which jobs instead of trusting recursion to fix the text on its own. Contracts make that choice auditable, but do not make it automatically. Nor does refining the text automatically improve the system’s specifications or model assignments. Those still need to be tested and judged by editors.
The operational goal is to automate the verifiable and route the rest to the right person. A developer or content lead should not have to rediscover missing sections, forbidden phrases, and unresolved contract violations in every final version. Those failures belong at their respective gates. Human review can then focus on whether the argument is fit to publish, whether the encoded voice still works for the piece, and whether there is good reason to make an exception.