Coding and Software-Engineering Agents › Summary
Language AI HandbookAll chapters A coding and software-engineering agent is a language model operating a disciplined read-evaluate-edit loop over a real repository, using execution as a verifier. The domain rewards agentic treatment because code is executable (crisp feedback), composable (navigable structure), discrete (small changes), and auditable (inspectable patches).
- Navigation is a funnel. Use grep, glob, and symbol search to narrow, then read to examine. Build a cheap repository map so the first search is informed. The test name itself is a locator.
- Test-driven flow is what makes the loop reliable. Establish a failing test (red), make the smallest change that turns it green, then verify the whole suite (regress). Insist the target test fails for the right reason before editing.
- Test evidence has a scope. Keep the evaluator independent from the edit. Earlier passes and independent cases check selected behaviors. Inspect the complete diff for collateral changes and the untested branches.
- Hand off the complete diff. Include the observed test results and scope checks so the reviewer can decide whether to accept the change.
- Evaluate like SWE-bench. F2P (target goes red-to-green), P2P (the designated previously passing tests still pass), and held-out checks. Be suspicious of any single benchmark score: subset, harness, retries, and test visibility all change it.
- Bound the work. Save the current state and test results. Limit iterations and time, then hand the candidate over when the declared acceptance checks pass or the budget expires.
- Test execution needs an isolation boundary. Use restricted permissions, bounded resources, fresh state and reviewed dependencies. In the fixture, the mechanical check enforces the changed path and edit size. Review capabilities introduced by the diff separately and run independent behavior checks before accepting the patch.
The persistent lesson across all of it is that the model is the proposal engine and the environment is the judge. You never trust the proposal; you trust the verifier, the diff, and the review. Everything else is engineering discipline around that loop.
As we head into Part XLIX, Ch 3: Deep-Research Agents, you will see the same shape of problem, many navigation tools and a long-horizon verification loop, applied to web research rather than source code, with the additional twist that the "test" for a research answer is far fuzzier than a unit test. The contrast is instructive: what makes coding agents tractable is not that they are smarter, but that software gives them a verifier they can trust.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!