// book 7
patriola.com

Book 7 · Patriola’s Guide to Claude

Self-Verifying Pipelines


“Claude finished” and “it’s right” are two different sentences.

Buy on Amazon

Patriola's Guide to Claude — Self-Verifying Pipelines: Build Output You Can Actually Trust
What this book is

Quality gates with exit codes, not prompts

A practical guide to building the system that closes the gap between “Claude finished” and “it’s right.” These gates take a concrete measurement and stop the pipeline when it fails — drawn from the production stack used to ship every book in this series, a live website, and a multi-agent system.

None of these are prompts. They are code with exit codes, and the pipeline stops at the first nonzero one.

What you’ll learn

Five layers, one verification system

  • quality-gates — Code with exit codes that stops the pipeline on failure. Convention: 0 = pass, 1 = gate fail, 2 = internal error. The pipeline reads the exit code after each gate and stops before the next step runs. A gate that exits 0 without actually checking is worse than no gate at all.
  • LIKE Engine — Rhetorical tell detection across 17 named patterns: anaphora, tricolon, diacope, epistrophe, epizeuxis, banned X-not-Y constructions, negation pivots, consecutive same-word sentence openers. All pattern-based — zero model calls. Returns JSON with paragraph index, pattern name, and the matching evidence string.
  • ARC Engine — Statistical tell detection running in parallel: elaboration-chain depth (threshold: 3 levels), hedge density (hedging-phrase ratio per sentence), passive-construction ratio, filler-phrase count. All thresholds are config values. Exit nonzero if any threshold is exceeded; output includes the metric name, measured value, and threshold.
  • deploy-verification — Fetches the live URL, asserts HTTP 200, computes SHA-256 of the response body against the expected hash, optionally diffs deployed HTML against source. Configurable timeout (default 10s), retry on transient 5xx, hard fail on 404. One script, no external dependencies beyond requests.
  • gate-pattern — How to wire gates into any pipeline: prose output (LIKE + ARC, both must exit 0), deployed files (checksum + HTTP), generated code (test-runner exit code), structured data (JSON Schema validation). The interface is always the same: exit 0 or the pipeline stops. Install at pre-commit, CI step, or pipeline stage — the gate doesn’t care where it runs.
  • LIKE Engine — Rhetorical device detection: anaphora, tricolon, banned constructions, consecutive same-word openers. Flags before a chapter advances.
  • ARC Engine — Statistical and grammatical tell detection running in parallel. A second pass catching what the LIKE Engine doesn’t cover.
  • deploy-verification — The script that checks the live URL returns 200 and the checksum matches before anything gets marked done. Sign-off requires gate results, not a gut feeling.
  • gate-pattern — How to install verification at the right layer for any output type: prose, deployed files, generated code, or structured data.
From the book

A preview

The gap between “Claude finished” and “it’s right” is where mistakes live. Gates close that gap. Prompts don’t.
You — gating a chapter Run the gate on chapter three and tell me what fails.
Claude Two LIKE flags. Paragraph four: consecutive “The” openers — three sentences in sequence. Paragraph nine: tricolon — “fast, reliable, and reviewable.” One ARC flag: elaboration chain at paragraph six exceeds the threshold. Gate exits nonzero — chapter does not advance until these are cleared.
This book is a specimen of what it teaches. Every chapter passed the LIKE + ARC gate pair before it was committed.
gate-run — chapter 3$ python tools/like_scan.py chapters/ch03.md scanning 2,841 words across 19 paragraphs… HARD-FAIL [LIKE] consecutive-openers — §4: “The…The…The” (3 in sequence, threshold: 2) HARD-FAIL [LIKE] tricolon — §9: “fast, reliable, and reviewable” SOFT-WARN [ARC] elaboration-chain — §6: depth=4 (threshold: 3) LIKE: 2 hard-fail · 0 soft-warn ARC: 0 hard-fail · 1 soft-warn EXIT 1 — chapter does not advance
Who it’s for

Advanced operators who ship on Claude

CLI-fluent Claude users who already run real pipelines and want output verified by measurement rather than inspection. Python, exit codes, and shell scripting assumed.

A longer excerpt is available to newsletter subscribers.

Buy on Amazon

Stay current

New books in this series

One short email per book launch.