惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
Recent Announcements
Recent Announcements
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
爱范儿
爱范儿
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
月光博客
月光博客
AI
AI
美团技术团队
SecWiki News
SecWiki News
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cybersecurity and Infrastructure Security Agency CISA
M
MIT News - Artificial intelligence
PCI Perspectives
PCI Perspectives
aimingoo的专栏
aimingoo的专栏
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Visual Studio Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
N
News | PayPal Newsroom
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
Schneier on Security
Schneier on Security
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
D
Docker
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
Intezer
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Tried 3 Layers of AI Code Review So Your Diff Doesn't Have To
Ken Imoto · 2026-05-10 · via DEV Community

I shipped 3 bugs after 'looks good to me' AI code review last quarter

I had one of those quarters where every PR went through an AI reviewer, every PR got a friendly "LGTM with minor suggestions", and three of those PRs still managed to wedge production. One was an N+1 query that only appeared when a customer hit a specific endpoint with more than 50 items. One was a missing await that the AI cheerfully ignored because the code "looked async-ish". One was a permission check we removed and nobody, human or model, flagged it.

After the third one I stopped blaming the model and started blaming my setup. A single AI reviewer running once on a diff is not a code review. It is a vibe check.

What actually fixed it was splitting review into three layers, with three different jobs, and never letting any one of them pretend to be the others. This post is that setup.

Why a single AI reviewer falls over

I once spent a Sunday tagging every comment on our PRs for a month. The split was uncomfortable.

About 70% of human review comments were things like "indentation off", "leftover console.log", "this should be camelCase", "no test for this branch", "type is any". The kind of thing a linter, a formatter, or a half-asleep AI can spot in milliseconds.

Only about 30% touched the things humans are actually good at: is this the right architecture, does this match the business rule, what blast radius does this change have.

If you point one AI at the whole PR and ask it to review, it will mostly do the easy 70% (badly, sometimes), and gesture vaguely at the hard 30%. You end up with a reviewer that is simultaneously too noisy on style and too quiet on the parts that matter.

The fix is not "a smarter model". The fix is splitting the work.

The 3 layers I run now

Here is the shape of it.

Layer Owner What it catches
Layer 1 Hooks + CI Mechanical issues: format, lint, types, missing tests
Layer 2 AI reviewer(s) Pattern issues: N+1, dead code, naming, small refactors
Layer 3 Human reviewer Design, business logic, security weight, blast radius

Each layer assumes the previous one passed. Layer 1 failures never reach Layer 2. Layer 2 blocking comments pause Layer 3 until they are resolved.

The order matters. Do not let humans waste eye-time on what a hook would have caught for free.

Layer 1: hooks and CI

Layer 1 has one job: kill mechanical problems before a human or an AI ever sees them.

I run two stages.

On the laptop, via Lefthook (or husky / pre-commit):

  • Formatter (Biome / Prettier)
  • Linter (Biome / ESLint)
  • Type check (tsc --noEmit)
  • Affected tests only

Heavy stuff at pre-commit makes people hate you, so I keep pre-commit narrow (changed files only) and push the slower checks to pre-push.

In CI, the exact same checks again.

Why both? Because local hooks can be skipped. Someone is always one --no-verify away from shipping a 200-line diff with any everywhere. CI is the part you cannot bargain with.

A small example of the kind of bug Layer 1 actually catches: a teammate once renamed a config key but missed one call site. TypeScript caught it in pre-push. The PR never opened. No reviewer time spent. No AI tokens spent. That is the win.

Layer 2: AI review, with role separation

This is where most teams over-spend or under-spend. The trick is treating different AI reviewers as having different jobs, not running three of them on the same diff and hoping for diversity.

I think about it as three roles. You do not need all three.

Pattern sweeper (e.g. CodeRabbit). Good at scanning the whole diff and surfacing N+1 queries, dead code, mis-shaped error handling, things that match a known pattern. Configurable via a yaml file so you can weight security-related paths heavier than test files.

Local refactor advisor (e.g. GitHub Copilot Code Review). Good at sitting on a specific function and saying "this loop becomes one map, this nested if becomes a guard clause". Concrete suggestions on a small surface area.

Project-rules enforcer (e.g. Claude with AGENTS.md / CLAUDE.md). Good at reading your repo's actual conventions and flagging "we do not use this util in this layer" or "this module is supposed to be pure". The other two cannot do this; they do not know your house rules.

For solo projects I just use the third one. For real team repos I run the pattern sweeper on every PR and let developers opt into the refactor advisor when they want a second opinion. That is roughly how much AI review a normal PR can absorb before the noise starts costing more than it saves.

A bug Layer 2 caught for me recently: a new endpoint was iterating over user sessions and calling the database inside the loop. CodeRabbit flagged the N+1 pattern with a one-line suggestion. A human reviewer might have caught it too, but the human reviewer would then not have had time to look at the actual auth flow change in the same PR. Which is the whole point.

Layer 3: humans, and only on four things

By the time a PR reaches Layer 3, the formatter, the linter, the types, the obvious patterns, and the project-rule violations are all gone. What is left is everything machines are bad at.

I keep human reviewers focused on exactly four questions:

1. Direction. Does this change fit the architecture we agreed on? Module boundaries, layering, who owns what. A model can recite your architecture; it cannot tell whether this PR is quietly drifting away from it.

2. Business logic. Does this match the actual rule the business wants? Edge cases, weird customer states, that one regulator who wants invoices rounded a specific way. This is where domain knowledge lives, and where AI is most confident and most wrong.

3. Security weight. Is this a "small refactor" or is this "we just changed who can see what"? AI can flag a permission check; a human decides whether the change is one that needs a second pair of eyes from the security-minded engineer.

4. Blast radius. What else does this touch that is not in the diff? Which untested area might regress? Long-tenure engineers know which parts of the codebase have a history of revenge.

Four questions. Not "did you forget a semicolon". When I drew the line here, average human review time roughly halved on our team and reviewers stopped resenting the queue.

What each layer misses (and why running all three matters)

Concretely, here is what I have watched leak past each layer.

  • Layer 1 alone: ships a PR that lints clean, types clean, tests pass, and quietly contains an N+1 query that takes down staging for hours under realistic load. Linters do not know about your database.
  • Layer 2 alone: rubber-stamps a refactor that is technically beautiful and strategically wrong. The AI does not know that this module is on the deprecation list and you are not supposed to add features to it.
  • Layer 3 alone: is what most teams had five years ago. Humans drowning in style nits, missing the security change buried on line 184 of the diff because their attention budget was already spent on tab vs spaces.

The 3-layer setup is not "more review". It is the same review, sorted so each reviewer is doing the thing they are actually good at.

How I wire this up in practice

The glue is a single AGENTS.md (or CLAUDE.md, same idea) at the root of the repo. It explicitly writes down which layer owns what.

## Review policy

### Layer 1 — hooks / CI
- format (Biome)
- lint (Biome)
- type check (tsc --noEmit)
- affected tests

### Layer 2 — AI review
- CodeRabbit: auto on every PR. Focus: N+1, dead code, error handling.
- Copilot Code Review: opt-in by author. Focus: local refactors.
- Claude (/review-pr): focus on AGENTS.md rule violations only.
  Do NOT comment on architecture or business logic.

### Layer 3 — human review
Reviewers focus on exactly four things:
- direction (architecture fit)
- business logic correctness
- security weight
- blast radius

### Comment style
We use Conventional Comments:
praise / nit / suggestion / issue / question

Enter fullscreen mode Exit fullscreen mode

Two things I learned to be explicit about:

  • Tell the AI what NOT to comment on. Otherwise the pattern sweeper starts opining on architecture, the human reviewer reads it, defers, and now nobody is checking architecture. Bound the AI's job in writing.
  • Tell humans what IS their job. Otherwise they keep nitpicking format because format-nits are fast dopamine. Make Layer 3 boring on purpose.

Three traps I walked into so you do not have to

Trap 1: Layer 2 starts doing Layer 3's work. The AI writes a confident paragraph about your architecture. Humans read it and think "well, the AI has it covered". Now nobody is doing architecture review. Fix: write down in AGENTS.md that AI reviewers do not comment on design direction. They literally are not allowed to, and you tell them so.

Trap 2: Layer 1 gets bypassed. Local hooks get disabled because someone is "in a hurry". Fix: assume good-faith hooks will fail you about once a month and put the same checks in CI as a hard gate. I learned this the hard way after merging a PR with a leftover console.log that printed customer emails into our logs for a weekend.

Trap 3: Treating "LGTM" from AI as approval. It is not. The AI's "LGTM" means "I did not find a pattern I recognize". That is a useful signal, not a verdict. The human at Layer 3 is still the one who merges.

What I would do differently next time

If I were starting a new repo tomorrow, I would do Layer 1 on day one, Layer 3 (the four-question rubric) on day two, and add Layer 2 only after I had seen what kinds of bugs were actually leaking past humans. I jumped straight to "let us add three AI reviewers" once and ended up with a PR comments page that read like a group chat at 2am.

The 3-layer model is not about removing humans from review. It is about putting humans in the spot where they are obviously, embarrassingly better than any model: judgment about your specific system, your specific business, and your specific tolerance for risk. That is the part the model cannot fake.

Everything else, let the machines do the dishes.

Read more

If you want the full 21-chapter playbook with config examples for AGENTS.md, hook setups, and team rollout patterns, I wrote a Zenn Book on it:

Harness Engineering Practice (Zenn Book)