liveBook · Manning

Deterministic check

As explained in Vibe Engineering

A deterministic check is an automated validation whose output is predictably determined by its inputs and explicit rules.

A deterministic check produces the same validation result for the same inputs and explicit rules. Give blocking authority to such tools; let probabilistic models advise when judgment is required. section 5.3.2

Apply the distinction as an engineering guardrail:

  • Block commits with checks that cannot reasonably be argued out of their result, such as secret scanning against known patterns. section 5.3.2
  • Keep model-based review advisory because incorrect blocking trains developers to bypass the gate with --no-verify. section 5.3.2
  • Parse structured verdicts with jq instead of grepping free text, which can mistake a response containing FAIL for PASS. section 5.3.2

Pre-commit gate

A staged diff first runs gitleaks protect --staged --redact and exits on failure. An AI reviewer then assesses conventions and prints concerns without blocking the commit. section 5.3.2

Listing 5.4 Pre-commit hook example
#!/bin/bash
# .git/hooks/pre-commit
set -euo pipefail
 
DIFF=$(git diff --cached)
[ -z "$DIFF" ] && exit 0
 
# Deterministic checks block. This is the real gate.
gitleaks protect --staged --redact || exit 1
 
# The model advises. It cannot block on its own.
VERDICT=$(printf '%s' "$DIFF" | claude -p "Review this diff against our
conventions: error handling, test coverage for new public functions,
naming. Reply with exactly one line of JSON and nothing else:
{\"verdict\":\"clean\"} or {\"verdict\":\"concerns\",\"notes\":\"...\"}")
 
if [ "$(printf '%s' "$VERDICT" | jq -r '.verdict')" = "concerns" ]; then
    echo "AI reviewer raised concerns (advisory, not blocking):"
    printf '%s' "$VERDICT" | jq -r '.notes'
fi
exit 0

Inspect the complete shell hook showing staged-diff handling, deterministic secret blocking, structured model output, and advisory reporting. section 5.3.2

How Vibe Engineering covers it

How deep it goes
Explains blocking authority, failure modes, and structured parsing, then demonstrates a pre-commit implementation.
Examples
Uses gitleaks, jq-parsed JSON verdicts, staged Git diffs, and advisory AI review in a pre-commit hook.
What it assumes
Assumes Git hooks, shell commands, gitleaks, jq, and staged-diff handling.
What you can do after
Apply a layered Git gate that blocks deterministic failures and reports model concerns without creating bypass incentives.
How it connects
Connects deterministic checks with secret scanning, static analysis, Git hooks, model review, and continuous integration.

Also explained in

Compare how 3 books explain deterministic check →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.