The Codex Loop: a native app dev playbook (exec summary)
A previous build of the same app shipped 8 phases with green ticks, 61 tests passing, screenshots in every chunk report, done markers everywhere. First launch was a black screen. The contract had drifted three phases earlier. The same context that introduced the drift was the one validating the work. Self-audit can't catch this. The degraded session that produced the bug is the same one evaluating it. So I stopped letting one model do all three jobs. The split Brain holds the spec, the plan, the briefs, the verification judgment. One consistent context across the whole project. Hands execute one chunk at a time against a tight contract. No memory between chunks. Cheap to dispatch, ruthless about scope. Eyes approve the visuals. That's me. Refusing to auto-approve based on a commit message. Shipped a Mac app in three days on this loop. Two phases tagged clean. 123 tests green. Atmospherics visually approved on first build. Zero rebuilds. The five artifacts 1. Spec. What the thing is. Architecture, decisions, and two inventories most specs miss: a craft inventory (the prototype details that aren't in the original brief, every glow and curve) and a staleness inventory (paths and tools that drifted since prior work). 2. Plan. How to build it. Every task is two to five minutes of work, lists files-to-touch, steps, tests, and the exact commit message. TDD baked in. 3. Briefs. Dispatchable units of plan. One per chunk, five to eight tasks each, 60 to 95 lines. 4. Prompts. Paste-ready, no fill-in-the-blanks. Continuation prompts and self-contained fresh-session prompts. 5. Handoff. End-of-session continuity doc. Where things are, the next prompt to paste, decisions made, open items. The next day's session reads it like a contract. The dispatch loop Per chunk: paste prompt, executor runs (5 to 30 min), executor reports, planner verifies with fresh context, approve or correct. Verification is non-negotiable. Git log, file system, test count, snapshot record-flag, launch and look. The executor sometimes claims victory prematurely. The verification step catches it.