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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
C
Check Point Blog
V
V2EX
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
A
About on SuperTechFans
D
DataBreaches.Net
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
博客园_首页
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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
Why AI Code Review Keeps Flagging the Wrong Things (and H...
martinlepage · 2026-05-08 · via DEV Community

AI code review has a consistent failure mode: it surfaces generic issues and misses the ones that actually matter for your project.

You paste a function. The AI flags potential null pointer issues, suggests adding error logging, recommends extracting a constant. These are fine observations — for a codebase it knows nothing about. But it misses the actual problem: this function violates the constraint that all auth-path operations must complete under 200ms, which you established three months ago when you separated the auth layer from the API gateway.

The AI didn't miss this because it's bad at code review. It missed it because you never told it the constraint existed.

What AI code review is actually reviewing

When you paste code for review without context, the AI is doing generic static analysis with pattern matching against common issues. It's reviewing your code against:

  • General best practices for the language
  • Common error patterns it's seen in training
  • Standard code quality heuristics

It is not reviewing against:

  • Your architectural decisions
  • Your explicit constraints
  • The alternatives you already ruled out and why
  • The tech debt you're intentionally carrying
  • The SLA requirements that define what "good" looks like for this specific function

The gap between "generic code review" and "project-aware code review" is the difference between a smart stranger looking at your code and a teammate who's been on the project for six months.

The four things AI code review doesn't know without you

1. Architectural decisions that constrain "correct"

Your auth layer is separate from the API gateway. Any suggestion that couples them is wrong — not because coupling is bad in general, but because you've decided it's wrong for this project for specific reasons (independent scaling, latency isolation, deploy cycle separation).

Without knowing this, the AI will periodically suggest approaches that violate your architecture. These suggestions look reasonable in isolation.

2. Intentional tech debt

You have a known N+1 query in the profile endpoint. You know about it. You've decided to fix it in Q3 when you migrate to the new data layer. Until then, don't touch it.

Without knowing this, the AI will flag it every time you paste code that touches the profile endpoint. You'll spend time explaining why you're not fixing it right now.

3. Non-obvious constraints

Your application runs on Cloudflare Workers. There's no filesystem. No long-running processes. Any suggestion that involves either of those is invalid — not occasionally, but categorically, for every function in the codebase.

Without knowing this, the AI will suggest solutions that are architecturally impossible for your deployment target.

4. Rejected alternatives

You evaluated three caching strategies last month. Two were ruled out for specific reasons. The AI doesn't know this. It will suggest one of the rejected approaches as a "potential improvement."

Without knowing this, you'll spend time re-evaluating an approach you already rejected.

The fix: a context file for code review

Before asking for code review, give the AI a context file. Not a full architecture document — a focused summary of what the AI needs to review correctly.

# Code Review Context — [Project Name]

## Architecture Constraints
- Auth layer is separate from API gateway (independent scaling + latency isolation)
  - Do NOT suggest coupling these
- Deployment: Cloudflare Workers (no filesystem, no long-running processes, no Node.js APIs)
  - Any suggestion requiring filesystem or persistent process is invalid

## Performance Requirements
- Auth-path endpoints: < 200ms P95
- Data-path endpoints: < 500ms P95
- Flag anything that adds synchronous operations on the hot path

## Known Tech Debt (Do Not Flag)
- N+1 query in profile endpoint — tracked, fixing in Q3 migration
- Legacy error format in /api/v1/* routes — maintained for backwards compat

## Rejected Approaches
- In-memory caching: rejected — Workers are stateless, cache doesn't persist between requests
- Unified middleware: rejected — couples auth and data deploy cycles
- Session tokens in KV: rejected — doesn't meet compliance requirements

## What to Focus On
- Correctness against the constraints above
- Edge cases specific to the Cloudflare Workers runtime
- Anything that violates the auth/data separation

Enter fullscreen mode Exit fullscreen mode

With this context loaded, the AI reviews against your actual project requirements. It won't suggest unified middleware — it knows that was rejected. It won't suggest filesystem operations — it knows the deployment target. It will flag the 200ms constraint violation you actually need to catch.

Where this lives in a structured knowledge system

If you're using a knowledge vault for project context, the code review constraints belong in your active constraints note — the same one your CLAUDE.md points to for every session.

# Active Constraints — [Project Name]

## Deployment
- Cloudflare Workers only — no filesystem, no persistent processes

## Performance
- Auth path: < 200ms P95
- Data path: < 500ms P95

## Architecture (locked decisions)
- Auth layer separate from API gateway (see [[Decision: Auth Layer Separation]])
- No unified middleware (see [[Decision: API Gateway Architecture]])

## Known Tech Debt (intentional, do not flag)
- N+1 query in profile endpoint — scheduled for Q3 migration

Enter fullscreen mode Exit fullscreen mode

When this note is linked from your project hub and the CLAUDE.md points to the hub, the agent reads the constraints before every session — including code review sessions. You don't have to paste the context file manually each time.

The shift in review quality

Code review without project context: generic, noisy, misses architectural violations, surfaces known tech debt as new findings.

Code review with project context: project-specific, accurate, flags actual violations of your constraints, respects intentional debt decisions.

Same model. Same code. Different context.


The vault structure that maintains this context automatically — active constraints note, decision logs with rejected alternatives, hub template, session-state — is packaged as a $49 Obsidian template.

https://pharosml.gumroad.com/l/kvbhdo

$299 guided setup for teams who want it configured for their specific stack. The code review context pattern above is one of eight note types included in the template.