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.

Parser: titan.peg Relabel Corpus: 14 chapters (~15,000 words) Fluff / Pipe Hazards: 0 / 0

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.

Empirical Sentence-Length Bands by Diátaxis Quadrant (prose_pulse.titan, ~15,000 words) 10 12 14 16 18 20 22 24 Part III · Reference median 11–13 w/s · 4 chapters · lookup Part I · Tutorials median 13 w/s · 1 chapter · guided Part II · How-to Guides median 14–17 w/s · 6 chapters · task recipes Part IV · Explanation median 20–23 w/s · 3 chapters · reasoning Words per sentence (bold = chapter median span; shaded = chapter mean span; 0 fluff hits)
Figure 1 · Empirical Sentence-Length Bands by Diátaxis Quadrant. Measured across 14 rewritten documentation chapters (~15,000 prose words). No target sentence length was ever specified; enforcing one reader intent per page separated the corpus cleanly into four cadence bands.
Diátaxis Quadrant Chapters Median (w/sent) Mean (w/sent) SD Fluff / Pipes
Part III — Reference411.0–13.012.6–15.36.8–11.50 / 0
Part I — Tutorials113.014.18.40 / 0
Part II — How-to Guides614.0–17.015.3–17.15.2–8.40 / 0
Part IV — Explanation320.0–23.021.9–23.08.0–10.40 / 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.