Workshop · Orbit 02 · PEG Grammars & Technical Writing Craft
Invisible Craft & Measuring Diátaxis Cadence with PEG Grammars
What blind A/B writing evaluation exposed about meta-leakage, why fluent prose hides factual errors, and how a 400-line Titan Relabel PEG analyzer revealed four distinct sentence-length bands emerging automatically from reader intent.
1. The Meta-Leakage Paradox
Codifying writing principles (Zobel's Writing for Computer Science + the Diátaxis documentation quadrants) for an AI writer is not summarizing a textbook. What writers lack at generation time is selection pressure against default habits: throat-clearing openers, passive hedging, mixed-intent pages, and padded baselines.
Blind A/B grading caught a subtle first-round pathology: meta-leakage. First-version guidance lifted overall craft scores by +15 points (66/72 vs. 51/72 control) while inadvertently making writers narrate their own checklist inside the finished document ("We disclose this openly", "without a Questions slide") and patch-paraphrase quotations under time pressure. Two structural fixes — naming the backstage rule explicitly (apply craft silently; never recite methodology on stage) and enforcing closed-book drafting before citation verification — moved Round 2 to 69/72 with 16/16 hard gates, zero shared 3-grams with source excerpts, and 165 fewer words of instruction overhead.
2. Structure Shapes Rhythm Automatically
To measure whether separating a monolithic documentation manual into strict Diátaxis quadrants actually
changed prose rhythm, I wrote prose_pulse.titan using Titan's native titan.peg
Relabel grammars. A single line-oriented grammar strips YAML frontmatter, fenced code blocks, headings,
and GFM tables while collapsing inline code spans (like mk.App) into single neutral tokens
so dotted identifiers never trigger false sentence breaks. It also hunts unescaped | characters
inside Markdown table code spans — a real failure class in Titan docs where generic syntax
<|T|> and PEG captures {| p |} quietly split GFM table rows.
| Diátaxis Quadrant | Chapters | Median (w/sent) | Mean (w/sent) | SD | Fluff / Pipes |
|---|---|---|---|---|---|
| Part III — Reference | 4 | 11.0–13.0 | 12.6–15.3 | 6.8–11.5 | 0 / 0 |
| Part I — Tutorials | 1 | 13.0 | 14.1 | 8.4 | 0 / 0 |
| Part II — How-to Guides | 6 | 14.0–17.0 | 15.3–17.1 | 5.2–8.4 | 0 / 0 |
| Part IV — Explanation | 3 | 20.0–23.0 | 21.9–23.0 | 8.0–10.4 | 0 / 0 |
3. Prose Craft and Factual Truth Are Orthogonal
Fluent prose has a dangerous side effect: it makes subtle technical errors harder to spot. After the
rewritten chapters passed every structural and cadence metric with zero fluff and zero broken links, an
independent source-code audit still caught nine subtle factual blockers — private synthesized constructors,
wire status reason-phrase omissions (HTTP/1.1 422 Status), build-directory collisions, and
nominal union identity rules. Keep two distinct gates with distinct incentives: an editor optimizing clarity
and reader intent, and a source auditor verifying every symbol, wire byte, and invariant against live code.