/** * Coordination between the parallel agents sharing one working tree. * * Remote runs snapshot the WHOLE tree, including other agents' * half-finished edits. Rather than isolating agents in worktrees, the * algorithm uses the team's own trunk discipline: if a snapshot fails to * build because of someone else's in-flight work, wait for them to reach * their next stable checkpoint and re-run. Every agent's loop passes * through stable checkpoints constantly — the end of each green cycle, a * completed contract regeneration — so the wait is short and, because * only remote runs ever read the full tree (local suites are * per-package), waiting is one-directional and cannot deadlock. */ export interface TreeCoordination { /** * Resolves once every agent has reached its next stable checkpoint — * no half-written files, no mid-regeneration generated code. */ awaitStableWorkingTree(): Promise; }