只有 worktree
隔離有用,但協調沒做完
- 建立一份獨立的 checkout。
- 任務身分、檢查、rebase 與清理,全都留給周邊工具。
- 事後追查通常止於一個 commit。
給 coding agent 的本地優先儲存庫工作流
AIT 是一套 CLI:每個程式修改需求都有自己的隔離 worktree、通過檢查的 精確版本,以及不隨 agent session 消失的儲存庫紀錄。Codex、Claude 或其他 coding agent 都能使用。
結果示意 · 在互動示範中查看每個步驟
在你的機器上執行 唯一離開這台機器的一步
沒有 telemetry、沒有分析、沒有更新檢查。上面唯一標記為對外的,是你的
coding agent 自己呼叫模型——那是你既有的行為,用不用 AIT 都會發生。
AIT 只跟另一個地方通訊:你自己設定為 remote 的
ait-server,設定方式與 Git remote 相同。沒有設定 remote
時,本地工作流完全不產生網路連線。
ait blame src/LoginForm.tsx --line 84版本 + 當初記錄的意圖 →每張卡一個獨立 worktree 衝突不會被靜默覆蓋
相容的工作會在收尾時乾淨 rebase;不相容的重疊會停在明確的衝突狀態, 等你判斷。機械式 rebase 不證明語意相容,所以儲存庫檢查與人的審查 仍然必要。
ait queue summary哪些卡可以動、哪些在等你 →走完一個 AIT 任務
看 AIT 開啟隔離工作區、驗證一個小修改,再把完成的結果帶回原始專案。
AIT first-task command recording — 2026-09-07
Actual command output. Absolute example roots are shortened to ~/ait-first-task.
The replay is edited for readability; playback is not an execution-time measurement.
Working directory: ~/ait-first-task
$ ait --version
ait 1.1.2
Exit code: 0
Working directory: ~/ait-first-task
$ node --test tests/baseline.test.mjs
✔ task titles preserve the input order and data (1.168458ms)
✔ the existing board title is unchanged (0.063583ms)
✔ the existing priorities are unchanged (0.046333ms)
ℹ tests 3
ℹ suites 0
ℹ pass 3
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 63.568458
Exit code: 0
Working directory: ~/ait-first-task
$ ait init
Initialized empty AIT repository in ~/ait-first-task/.ait (plan=zh-Hant-TW/concise)
Exit code: 0
Working directory: ~/ait-first-task
$ ait config set --user-name 'AIT Demo'
ait config set
user-name: AIT Demo
Exit code: 0
Working directory: ~/ait-first-task
$ cat docs/sprints/open-tasks.md
# Open tasks [plan-ref: example/open-tasks]
## Intent
Add openTasks(tasks) to src/tasks.mjs. Return a new array of tasks whose done property is not true, preserving order and object references without mutating the input. Keep taskTitles unchanged.
## Constraints
Only edit this Task worktree. Do not edit checks/, remove tests, or add packages. The root agent executes this task without subagents.
## Acceptance
Add a focused regression test for done true, false, missing, empty input, preserved order and identity. Run node --test tests/*.test.mjs and node checks/first-task.mjs before Task finish; verify acceptance again in the original directory afterward.
- [ ] Add non-mutating openTasks and focused tests. [ref: open-tasks]
Exit code: 0
Working directory: ~/ait-first-task
$ ait task start --from 'docs/sprints/open-tasks.md#open-tasks' --intent 'Add openTasks without mutating input'
ait task start
task: LT-0001
title: Add non-mutating openTasks and focused tests
next: cd ~/ait-first-task/.ait-worktree-links/lt-0001
Exit code: 0
Working directory: ~/ait-first-task/.ait-worktree-links/lt-0001
$ node --test tests/baseline.test.mjs tests/open-tasks.test.mjs
✔ task titles preserve the input order and data (1.041042ms)
✔ the existing board title is unchanged (0.053041ms)
✔ the existing priorities are unchanged (0.048583ms)
✔ openTasks returns unfinished tasks without changing input or objects (1.224417ms)
ℹ tests 4
ℹ suites 0
ℹ pass 4
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 63.11
Exit code: 0
Working directory: ~/ait-first-task/.ait-worktree-links/lt-0001
$ node checks/first-task.mjs
FIRST_TASK_ACCEPTED
Exit code: 0
Working directory: ~/ait-first-task/.ait-worktree-links/lt-0001
$ ait snapshot create LT-0001 --message 'Add non-mutating openTasks'
ait snapshot create
snapshot_id: SNP-0B558114ECDB
task_id: LT-0001
line_name: feature/lt-0001
parent_snapshot_id: SNP-2B43A5F97E11
message: Add non-mutating openTasks
Exit code: 0
Working directory: ~/ait-first-task/.ait-worktree-links/lt-0001
$ ait task finish LT-0001 --local
finished: LT-0001 -> main @ SNP-0B558114ECDB
closed: task, worktree, line, sprint
title: Add non-mutating openTasks and focused tests
Exit code: 0
Working directory: ~/ait-first-task
$ node --test tests/baseline.test.mjs tests/open-tasks.test.mjs
✔ task titles preserve the input order and data (0.987959ms)
✔ the existing board title is unchanged (0.050417ms)
✔ the existing priorities are unchanged (0.042292ms)
✔ openTasks returns unfinished tasks without changing input or objects (0.963875ms)
ℹ tests 4
ℹ suites 0
ℹ pass 4
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 61.445542
Exit code: 0
Working directory: ~/ait-first-task
$ node checks/first-task.mjs
FIRST_TASK_ACCEPTED
Exit code: 0
Working directory: ~/ait-first-task
$ ait blame src/tasks.mjs --line 7
target: current line main
resolved snapshot: SNP-0B558114ECDB
path: src/tasks.mjs
blame parent: SNP-2B43A5F97E11
range: 7-7
7 SNP-0B558114ECDB task=LT-0001 confidence=durable_snapshot_binding
Exit code: 0
Implementation recorded in the completed Task:
// Small, existing behavior to preserve while adding your first feature.
export function taskTitles(tasks) {
return tasks.map((task) => task.title);
}
export function openTasks(tasks) {
return tasks.filter((task) => task.done !== true);
}
Bound sprint after Task finish:
# Open tasks [plan-ref: example/open-tasks]
## Intent
Add openTasks(tasks) to src/tasks.mjs. Return a new array of tasks whose done property is not true, preserving order and object references without mutating the input. Keep taskTitles unchanged.
## Constraints
Only edit this Task worktree. Do not edit checks/, remove tests, or add packages. The root agent executes this task without subagents.
## Acceptance
Add a focused regression test for done true, false, missing, empty input, preserved order and identity. Run node --test tests/*.test.mjs and node checks/first-task.mjs before Task finish; verify acceptance again in the original directory afterward.
- [x] Add non-mutating openTasks and focused tests. [ref: open-tasks]
兩場各 200-session GPT-5.6 Sol campaign · 每種流程每場皆 100/100 通過驗收 · 查看範圍與證據
為什麼不直接用 worktree 就好?
並行執行早就很普遍了。真正缺的那一層,是一份持久的定義:每個 agent 被要求做什麼、哪個結果通過了、以及它如何併入更新的工作。
只有 worktree
AIT Task
ait blame 把出問題的那一行,連回它的版本與當初記錄的意圖。一個需求,一個受控結果
用自然語言說清楚結果與限制。
Task 取得一個專用的可寫 worktree。
檢查結果綁在真正通過的精確版本。
乾淨修改由 AIT 更新;發生衝突就明確停止。
責任版本與當初記錄的意圖始終相連。
從一個儲存庫開始
ait init,然後照常對你的 agent 下需求。預設工作流全程留在本地,不啟動任何伺服器。
每張任務卡都有自己的意圖、工作區與檢查。相容的修改可以完成,實質衝突則停止並保留工作;日後透過版本紀錄追查問題。