Build an Autonomous Coding Agent · 40 min · Python · GitPython
Multi-File Coordination
A 3-file plan where step 2 fails after step 1 already succeeded isn't done and isn't safe to leave half-applied -- it has to become a full rollback.
Hiring signal: Coordinating changes across multiple files with real rollback semantics is exactly the difference between a working single-file demo and an agent that's actually safe to run against a real, multi-file task.
What you will learn
- Order multi-file changes so dependencies are modified before dependents
- Roll back ALL modified files if any step in a plan fails, not just the failing one
- Stage successfully-completed changes with git as the plan progresses
Introduction
Lesson 4's fix loop handles one file. Real tasks — "add input validation to all API endpoints" — touch 3, 5, sometimes more. Today the agent coordinates all of them, and handles the case Lesson 4 didn't have to: what happens when file 2 of 4 fails after file 1 already succeeded.
Ordering: dependencies before dependents
Plan order isn't always execution order
If the plan adds a new function to validators.py and then calls it from api/routes.py, validators.py has to be modified first — otherwise the test run after step 1 (modifying routes.py to call a function that doesn't exist yet) fails for a reason that has nothing to do with whether the change itself is correct. A simple heuristic: steps that CREATE new files or functions referenced by other steps go first; this course doesn't build full dependency-graph analysis, but the planning engine's risk_notes field (Lesson 3) is exactly where the model can flag "step 2 depends on step 1" for the executor to respect.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Rollback: all-or-nothing per plan, not per step, Git staging as changes complete, What You're Building — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy