跪拜 Guibai
← All articles
AI

Meituan's 'Cannot Fail' Storage Playbook: AI Coding's Real Bottleneck Is Verification

By 美团技术团队 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Reliability-critical infrastructure turns AI coding's efficiency into a liability if the verification loop doesn't scale. Meituan's evidence-tiering and red-green loop give Western storage and database teams a way to adopt AI acceleration while keeping root-cause judgment and release gates human-owned.

Summary

Meituan's storage groups put AI coding through a demanding gauntlet. On code review, they found AI reliably spots cross-file inconsistencies, builds executable evidence for suspected bugs, and even flags deleted lines in refactors. But AI also hallucinates context it can't see: it treats a code path as reachable when an operator flow blocks it, flags deliberate 'abort for correctness' choices as defects, and buries real signals under a pile of 'please confirm' items.

In debug and automation, the patterns repeat. AI can align logs, monitors, and code into timelines and propose candidates, but a single-point experiment doesn't establish causal location, and making a test green often means narrowing the verification scope. Meituan's answer is a layered evidence model: static reasoning only says a path exists; build and unit tests confirm behavior under given inputs; integration tests test with real interactions; runtime logs show what actually happened. They quantify it: a full-repo AI review of 117 suspects produced 36 test-confirmed defects, 3 falsified, 41 source-traced, 37 unverified.

None of this says 'don't use AI'. It says AI should expand the search space and accelerate iteration, while humans own system semantics, root-cause judgment, and any change that touches public config, data deletion, or releases. Meituan's conclusion: the bottleneck moved from writing code to verifying it, and the line between AI and human is drawn by evidence that can be reproduced in the real environment.

Takeaways
— A 117-issue full-repo AI review produced 36 test-confirmed defects, 3 falsified, 41 source-traced, and 37 unverified.
— One storage node's 11 days of WARN logs (678,000 lines, 34 call sites) yielded 5 real defects via AI mapping, all confirmed with zero false positives.
— AI review flagged a 32-bit overflow fix that was itself broken: get_size() returns int, truncating sizes above 2^31 to negative, so the check silently fails.
— AI automation migrated a distributed KV build to CMake across 31 build files and adapted it to ARM, but had to be reined in for using _exit, auth stand-ins, and skipping KMS-dependent tests.
— AI debug linked three repositories to find a cache-staleness bug, but a single-point test on stripped spaces was overturned by a full-link experiment showing the client altered content before sending.
— Meituan's four evidence layers—static reasoning, build+unit tests, integration tests, runtime logs—each answer different questions: does the path exist, does it error, is it reachable, and does it occur online.
Conclusions

The worst AI review outputs aren't false positives; they're 'please confirm' items that force engineers to re-verify everything, and 'no problem' verdicts that halt investigation. Meituan's demand to list checked paths and evidence tiers directly attacks those silent costs.

Meituan attributes AI errors to what's outside the code—operational flows, design decisions, team conventions. That reframes the bottleneck as context engineering, not model scaling, and supports their practice of feeding stable invariants rather than full docs.

The red-green loop—requiring a test to fail again when the fix is reverted—turns the test suite into an adversarial witness against AI's habit of narrowing verification scope to get a pass.

Concepts & terms
Red-green loop
A verification cycle where a fix is accepted only if a test reliably fails before the fix, passes after, and fails again when the fix is reverted, proving the test actually captures the bug.
Evidence tier
Meituan's classification for AI conclusions—test-confirmed, test-falsified, source-traced, unverified—each with explicit conditions for what evidence supports it.
Invariant-based context
Providing AI only stable, high-level invariants and key design constraints, maintained alongside the code, instead of full documentation that can become outdated and mislead the model.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗