Book 7 · Patriola’s Guide to Claude
Self-Verifying Pipelines
“Claude finished” and “it’s right” are two different sentences.
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 learnFive 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.
A preview
The gap between “Claude finished” and “it’s right” is where mistakes live. Gates close that gap. Prompts don’t.
This book is a specimen of what it teaches. Every chapter passed the LIKE + ARC gate pair before it was committed.
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.
New books in this series
One short email per book launch.