Phase 14: Agent Engineering

Delegate Agent Work with Isolation and Merge Contracts

Parallel agents save wall time only when the work is independent. Otherwise they convert one clear task into a coordination problem with a faster failure rate. Decide whether delegation is justified by real independence. Give each worker exclusive file ownership and explicit proof. Compute execution waves from dependencies. Design a merge contract for combining agent work safely. Do not delegate because more agents are available. Delegate when at least one of these is true: two investigations can answer different unknowns independently;. two implementations own disjoint files and contracts;. a reviewer can inspect a completed artifact without changing it;. a slow external check can run while local work continues. Keep work serial when agents need the same files, the same unresolved decision, or the same mutable environment. Each delegated unit needs: “Handle the backend” is not a work unit. “Implement the duplicate check in app/accounts.py and prove it with the focused account test” is. Filesystem isolation: separate worktrees or sandboxes prevent accidental shared edits. Ownership isolation: contracts prevent two workers from intentionally editing the same path. State isolation: separate logs and outputs prevent one worker from overwriting another worker’s evidence. Filesystem isolation does not solve ownership. Two clean worktrees can still produce conflicting designs. The merge contract must resolve shared interfaces before work begins. The integrator should: confirm each handoff matches…

Delegate Agent Work with Isolation and Merge Contracts: Parallel agents save wall time only when the work is independent. Otherwise they convert one clear…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.