feat(HAI-037): add WorktreePool for recycling idle worktrees

- Add recycleWorktrees setting to control worktree pooling behavior
- Implement WorktreePool class with acquire/release/prepareForTask lifecycle
- Integrate pool into executor: acquire warm worktrees, skip init command for pooled entries
- Integrate pool into merger: release worktrees to pool instead of removing on task completion
- Add comprehensive unit and integration tests for pool, executor, and merger interactions
This commit is contained in:
Dustin Byrne
2026-03-25 23:08:04 -04:00
parent bf37701775
commit 74379bdbce
7 changed files with 572 additions and 280 deletions

View File

@@ -66,6 +66,10 @@ export interface Settings {
testCommand?: string;
/** Custom build command for the project (e.g. "pnpm build") */
buildCommand?: string;
/** When true, completed task worktrees are returned to an idle pool instead
* of being deleted. New tasks acquire a warm worktree from the pool,
* preserving build caches (node_modules, target/, dist/). Default: false. */
recycleWorktrees?: boolean;
}
export const DEFAULT_SETTINGS: Settings = {
@@ -75,6 +79,7 @@ export const DEFAULT_SETTINGS: Settings = {
groupOverlappingFiles: false,
autoMerge: false,
worktreeInitCommand: undefined,
recycleWorktrees: false,
};
export interface BoardConfig {