How design crushes the failure mode.
ai-desk methodology — Hiroyuki OKINOI · 2026-05
This critique is correct under conventional design.
What happens when conventional design is rejected?
AI breaks because the design wasn't built for AI, not because of inherent AI limits.
Conventional design principles (DRY / abstraction / encapsulation) optimise for humans reading code. AI needs the opposite optimisation:
This is Bible §0.0 "Cognitive Asymmetry". The same code is hard for AI and easy for humans, vice versa.
Conventional best practice is what kills AI.
Complete inside one function. AI reads that one function and knows everything.
Build large feature-scoped functions. Inline data transforms, branches, and side-effect triggers into one scope.
200-500 line functions are fine. They just need to fit AI's spotlight. Splitting smaller increases inter-function dependency jumps.
Counter-intuitive. But 1 function = edit blast radius bounded inside it. Other functions stay safe at scale.
No "common helpers" called from multiple functions. Don't fear duplication.
Don't physically split a giant file. Virtually partition it and let AI read locally.
// [ai_s_emblem:#layer Name]node ai-desk.js file.js skeleton → list all emblems (dozens of lines)node ai-desk.js file.js focus EmblemName → extract just that emblemnode ai-desk.js file.js apply patch.js → atomic apply (pre-flight verify + tag immutability check)Structurally separate data flow and state ownership.
L1 Physical → L2 Intent → L3 Logic → L4 Draw. Direction is fixed → editing X structurally determines what changes.
Only L3 may update REAL_state. Other layers are read-only. State-leak bugs become structurally impossible.
Derived values aren't stored. Compute, use, throw away. "Sync miss" bugs vanish.
Cross-layer calls tagged // [ai_s_bridge:L3toL4]. AI sees "this is a cognitive jump point".
Replace nested if/else with "enumerate all worlds → filter".
Minimal proof: constraint-janken.js — 3-player rock-paper-scissors, 27 worlds, zero if statements.
Real example: fighter-cancel.test.js — 1920 worlds exhaustive, single file.
Guarantee maintainability and verifiability structurally.
A pure CPU function runs alongside the GPU implementation, recomputing the same input. When a bug appears, you can definitively say "this is a logic bug, not a rendering bug".
Don't overwrite state. Append the Command history as a JSON array. Each event includes the previous hash → tampering is mathematically detectable.
→ Reproduce any past state, completely audit "why did the state become this".
Even at scale, you can trace back to the cause.
All of these are independent of total size (file count / line count).
At 100,000 lines, the numbers don't change.
In conventional codebases, all of these grow with size. ai-desk severs that relationship by design.
"AI dev dies at scale" applies
only when you keep writing the conventional way.
Redesigned for AI, there is no remaining cause to die.
Heavy Function · No shared helpers · Emblem local read · 4-Layer + REAL/SHADOW ·
Constraint Folding · Twin + Event Sourcing
── once these line up, scale is no longer a failure mode.
github.com/AoyamaRito/ai-desk
Hiroyuki OKINOI · Aoyama Rito