Git for AI Agent Teams: Branching, Review and Provenance When Most Commits Aren't Human
Описание и применение
При работе с ИИ‑агентами Git сталкивается с нарушением своих предположений о людях: авторы, сообщения, скорость и масштабирование обзоров. Решение – изолировать агенты в отдельных worktree, использовать атомарные коммиты с машинно‑читаемыми трейлерами, ограничивать размер diff, применять автоматические проверки и разграничивать ревью по риску.
Задача
When most commits are produced by AI agents, Git’s assumptions about authorship, commit intent, review bandwidth, and human‑paced history break, causing review bottlenecks, large diffs, missing context, shared working‑tree conflicts, and attribution problems.
Результат
Implementing isolated worktrees, atomic commits, structured messages, bot identities, CI gates, diff caps, and risk‑tiered reviews transforms an agent‑heavy workflow into a human‑reviewable, reversible, and provenance‑rich process.
Рабочий процесс
- 1. Human writes a task spec with explicit acceptance checks.
- 2. System creates a worktree and an agent/
<task>branch from a clean main. - 3. Agent works in isolation: small commits, structured messages, bot identity.
- 4. Agent runs the full verification suite; evidence is attached to the PR.
- 5. Automation enforces gates: green CI, diff‑size cap, CODEOWNERS for sensitive paths.
- 6. Human reviews at the risk tier earned by the change—skim auto‑verified, read critical.
- 7. Merge to a protected main; branch and worktree are deleted.
- 8. If misbehaviour occurs, revert first and re‑dispatch with a better spec.
Доказательства
Agents should commit more strictly than humans, not less, because their history will be read during incident response: Small, atomic commits. One logical change per commit, enforced by task design.
The single highest‑leverage practice: every agent works in its own Git worktree on its own branch.
Review throughput. Agents generate plausible‑looking diffs at machine speed. Human review — the actual quality gate — becomes the bottleneck within the first week.
- Дата записи: 2026-10-22T08:26:09.017Z