DEV Community

Taylor Zhu
Taylor Zhu

Posted on

AI Code Needs Proof, Not Promises: A Three-Layer Readiness Checklist

AI assistants made code generation cheap. Verification is the only thing that got more expensive.

The pattern shows up in every PR queue: a large diff, one approving review, and a merge that happened because nobody had time to read carefully. You don't fix that with more code-style rules. You fix it with a checklist that demands evidence at three layers and fails closed when that evidence is missing.

Here is the version your team can copy, plus a minimal script that enforces the cheap parts automatically. Conclusion first: no evidence, no merge.

The reviewer is now the weakest link

Developer discussions this month keep circling one observation: the human approving the AI's diff has become the least-tested part of the pipeline. Generated code is rarely rejected for being wrong these days — it is rejected, when it is rejected, because someone finally checked.

Verification is the real job now. A checklist won't catch every bug, but it will catch the failures you can predict: missing tests, secrets in the diff, dependencies nobody reviewed, and rollbacks nobody practiced.

Layer 0: Before the agent edits anything

The cheapest bug is the one the agent never writes. These gates run before a single line changes.

  • Task isolation. One task per session. If the assistant keeps context open across tasks, stale memory becomes a hidden feature. Close the session, start clean.
  • Written scope. Which files may change? Which directories are off-limits? Write it down before the first prompt.
  • Memory hygiene. Do not let the agent trust its own old summaries. If a claim cannot be traced to a file in the repo, it does not exist.

Evidence: a task file with the goal and the allowed file list. Fail-closed: if the task file is missing, the session does not start.

Layer 1: Before the merge button

This is where most teams stop. Only some of these checks are about code quality.

  1. Static checks. Lint, type check, formatting. Run them on the diff, not just on the final tree.
  2. Tests. The targeted suite and the full one. Skipping the full suite to save five minutes is how regressions ship.
  3. Secret scan on the diff. Generated code loves to embed example keys. Scan the actual changed lines.
  4. Dependency review. A new package means a new license and a new supply-chain surface. Agents happily add dependencies to make tests pass.
  5. Human sign-off markers. Files on the manual-review list block the merge until a named human approves.

Evidence: build logs, test reports, and a diff stat that matches the written scope. Fail-closed: if a check cannot run, it counts as failed. A skipped gate is a failed gate.

Layer 2: After deploy

Merging is not the goal. A running and observed system is.

  • Smoke probe on the changed endpoint. Wait for the deploy ID, then hit the route.
  • Error budget check at 15 minutes and again at 24 hours, compared against the baseline recorded before the change.
  • Rollback rehearsal before the merge. If you have not rolled back this service recently, you have not practiced it. The first rehearsal should not happen during an incident.

Evidence: deploy ID, probe response, and two snapshots of error rate. Fail-closed: without observability for this change, the feature flag stays off.

A minimal fail-closed script

You can encode the cheap half of Layer 1 in about thirty lines. This is a template, not a finished pipeline — adapt the commands to your repo and test it before relying on it:

#!/usr/bin/env bash
# readiness.sh — fail-closed gates for AI-assisted changes
# Minimal example: adjust to your repo's tooling.

set -euo pipefail
FAILED=0

run_gate() {
  local name="$1"; shift
  echo "==> gate: $name"
  if "$@" >"/tmp/gate-${name}.log" 2>&1; then
    echo "    pass"
  else
    echo "    FAIL: $name"
    FAILED=1
  fi
}

# Layer 1: pre-merge evidence
run_gate lint      npm run lint
run_gate typecheck npm run typecheck
run_gate tests     npm test -- --runInBand
run_gate secrets   sh -c '! grep -rEn "(AKIA[0-9A-Z]{16}|sk-[A-Za-z0-9]{20,})" src'

if [ "$FAILED" -ne 0 ]; then
  echo "==> READINESS BLOCKED — check /tmp/gate-*.log"
  exit 1
fi

echo "==> ready for human review"
Enter fullscreen mode Exit fullscreen mode

The script demonstrates the fail-closed principle in its simplest form: no evidence, no merge. The secret-scan pattern is a floor, not a ceiling — use a real secret scanner on public repositories.

Why a free tier changes the math

Running all three layers per task multiplies tokens and CI minutes. The usual escape is to batch six tasks into one giant diff — which is exactly what the three layers are designed to prevent.

MonkeyCode is an open-source AI coding project, and as of this writing its offering includes free model access with a 10-million-token allowance plus a free server option. For a small team, that is enough headroom to run per-task verification loops without adding a cloud line item. Allowances like this change often, so check the project's current docs before building a workflow around it.

Disclosure: This article was prepared as part of MonkeyCode's product outreach.

None of the gates depend on the tool. The checklist works with any assistant. Your CI does the verifying; the model only supplies the candidate change.

Who should not use this checklist

  • Solo developers building demos and throwaway apps. A dozen gates is ceremony. Keep Layer 0, apply fail-closed to one or two checks, and move on.
  • Teams without observability. Layer 2 is useless if there is no dashboard to read. Fix that first.
  • Regulated environments. Finance, health, and safety-critical stacks need human sign-off and audit trails no matter what the automated gates say.

The checklist also verifies code, not decisions. It cannot tell you whether the feature should exist in the first place.

The takeaway

AI assistants do not need to be banned. They need to be held to evidence. Three layers, fail-closed, with artifacts a machine can re-read: that is a small price for diffs you can defend at 2 AM.

Copy the script, adapt the gates to your repository, and make the next AI-assisted merge prove itself before it ships.

If you want to run this loop on a free stack, MonkeyCode's open-source project provides the model access and server pieces without a paid plan — and everything above works with whatever assistant you already use.

Top comments (0)