taskplane 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/taskplane.mjs +35 -37
- package/extensions/taskplane/engine.ts +771 -758
- package/extensions/taskplane/execution.ts +4 -2
- package/extensions/taskplane/git.ts +25 -7
- package/extensions/taskplane/merge.ts +18 -16
- package/extensions/taskplane/persistence.ts +1136 -1121
- package/extensions/taskplane/resume.ts +1096 -1092
- package/extensions/taskplane/types.ts +5 -2
- package/extensions/taskplane/waves.ts +894 -900
- package/extensions/taskplane/worktree.ts +6 -5
- package/package.json +1 -1
- package/templates/config/task-orchestrator.yaml +86 -89
- package/templates/config/task-runner.yaml +95 -99
|
@@ -1103,8 +1103,9 @@ export function escapeRegex(str: string): string {
|
|
|
1103
1103
|
*
|
|
1104
1104
|
* @param count - Number of worktrees to create (1-indexed: lane 1..count)
|
|
1105
1105
|
* @param batchId - Batch ID timestamp for branch naming
|
|
1106
|
-
* @param config - Orchestrator config (prefix
|
|
1106
|
+
* @param config - Orchestrator config (prefix extracted from it)
|
|
1107
1107
|
* @param repoRoot - Absolute path to the main repository root
|
|
1108
|
+
* @param baseBranch - Branch to base worktrees on (captured at batch start)
|
|
1108
1109
|
* @returns - CreateLaneWorktreesResult with success flag and details
|
|
1109
1110
|
*/
|
|
1110
1111
|
export function createLaneWorktrees(
|
|
@@ -1112,9 +1113,9 @@ export function createLaneWorktrees(
|
|
|
1112
1113
|
batchId: string,
|
|
1113
1114
|
config: OrchestratorConfig,
|
|
1114
1115
|
repoRoot: string,
|
|
1116
|
+
baseBranch: string,
|
|
1115
1117
|
): CreateLaneWorktreesResult {
|
|
1116
1118
|
const prefix = config.orchestrator.worktree_prefix;
|
|
1117
|
-
const baseBranch = config.orchestrator.integration_branch;
|
|
1118
1119
|
const created: WorktreeInfo[] = [];
|
|
1119
1120
|
const errors: BulkWorktreeError[] = [];
|
|
1120
1121
|
|
|
@@ -1175,7 +1176,7 @@ export function createLaneWorktrees(
|
|
|
1175
1176
|
* Ensure required lane worktrees exist for the current wave.
|
|
1176
1177
|
*
|
|
1177
1178
|
* Reuses existing worktrees when present (multi-wave behavior), resetting
|
|
1178
|
-
* them to
|
|
1179
|
+
* them to the base branch HEAD before use, and only creates missing lanes.
|
|
1179
1180
|
* If creation of a missing lane fails, newly-created lanes in this call are
|
|
1180
1181
|
* rolled back.
|
|
1181
1182
|
*
|
|
@@ -1187,9 +1188,9 @@ export function ensureLaneWorktrees(
|
|
|
1187
1188
|
batchId: string,
|
|
1188
1189
|
config: OrchestratorConfig,
|
|
1189
1190
|
repoRoot: string,
|
|
1191
|
+
baseBranch: string,
|
|
1190
1192
|
): CreateLaneWorktreesResult {
|
|
1191
1193
|
const prefix = config.orchestrator.worktree_prefix;
|
|
1192
|
-
const baseBranch = config.orchestrator.integration_branch;
|
|
1193
1194
|
|
|
1194
1195
|
const existing = listWorktrees(prefix, repoRoot);
|
|
1195
1196
|
const existingByLane = new Map<number, WorktreeInfo>();
|
|
@@ -1205,7 +1206,7 @@ export function ensureLaneWorktrees(
|
|
|
1205
1206
|
for (const lane of needed) {
|
|
1206
1207
|
const reused = existingByLane.get(lane);
|
|
1207
1208
|
if (reused) {
|
|
1208
|
-
// Reused worktrees must be reset to
|
|
1209
|
+
// Reused worktrees must be reset to base branch HEAD before use.
|
|
1209
1210
|
// This covers normal multi-wave reuse and stale leftovers from prior batches.
|
|
1210
1211
|
const resetResult = safeResetWorktree(reused, baseBranch, repoRoot);
|
|
1211
1212
|
if (resetResult.success) {
|
package/package.json
CHANGED
|
@@ -1,89 +1,86 @@
|
|
|
1
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
2
|
-
# Parallel Task Orchestrator Configuration
|
|
3
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
4
|
-
#
|
|
5
|
-
# Copy this file to `.pi/task-orchestrator.yaml` in your project and
|
|
6
|
-
# customize it. The orchestrator reads BOTH this file and task-runner.yaml.
|
|
7
|
-
#
|
|
8
|
-
# - task-runner.yaml → task areas, reference docs, worker/reviewer
|
|
9
|
-
# - task-orchestrator.yaml → lane count, worktrees, merge, failure policy
|
|
10
|
-
#
|
|
11
|
-
# This template is intentionally conservative so it is safe to adapt to a
|
|
12
|
-
# wide range of repositories.
|
|
13
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
14
|
-
|
|
15
|
-
# ── Orchestrator Core ─────────────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
orchestrator:
|
|
18
|
-
# Maximum parallel lanes (worktrees)
|
|
19
|
-
max_lanes: 3
|
|
20
|
-
|
|
21
|
-
# Where to create worktree directories.
|
|
22
|
-
# "sibling" = ../{prefix}-{N} (e.g. ../project-wt-1)
|
|
23
|
-
# "subdirectory" = .worktrees/{prefix}-{N} (e.g. .worktrees/project-wt-1)
|
|
24
|
-
worktree_location: "subdirectory"
|
|
25
|
-
worktree_prefix: "project-wt"
|
|
26
|
-
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
monitoring:
|
|
89
|
-
poll_interval: 5
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
2
|
+
# Parallel Task Orchestrator Configuration
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
4
|
+
#
|
|
5
|
+
# Copy this file to `.pi/task-orchestrator.yaml` in your project and
|
|
6
|
+
# customize it. The orchestrator reads BOTH this file and task-runner.yaml.
|
|
7
|
+
#
|
|
8
|
+
# - task-runner.yaml → task areas, reference docs, worker/reviewer
|
|
9
|
+
# - task-orchestrator.yaml → lane count, worktrees, merge, failure policy
|
|
10
|
+
#
|
|
11
|
+
# This template is intentionally conservative so it is safe to adapt to a
|
|
12
|
+
# wide range of repositories.
|
|
13
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
14
|
+
|
|
15
|
+
# ── Orchestrator Core ─────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
orchestrator:
|
|
18
|
+
# Maximum parallel lanes (worktrees)
|
|
19
|
+
max_lanes: 3
|
|
20
|
+
|
|
21
|
+
# Where to create worktree directories.
|
|
22
|
+
# "sibling" = ../{prefix}-{N} (e.g. ../project-wt-1)
|
|
23
|
+
# "subdirectory" = .worktrees/{prefix}-{N} (e.g. .worktrees/project-wt-1)
|
|
24
|
+
worktree_location: "subdirectory"
|
|
25
|
+
worktree_prefix: "project-wt"
|
|
26
|
+
|
|
27
|
+
# Batch ID format used in branch names and logs.
|
|
28
|
+
batch_id_format: "timestamp"
|
|
29
|
+
|
|
30
|
+
# "tmux" = named sessions you can attach to
|
|
31
|
+
# "subprocess" = headless execution without tmux dependency
|
|
32
|
+
spawn_mode: "subprocess"
|
|
33
|
+
|
|
34
|
+
# Prefix for TMUX session names when tmux mode is enabled.
|
|
35
|
+
tmux_prefix: "orch"
|
|
36
|
+
|
|
37
|
+
# ── Dependency Analysis ───────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
dependencies:
|
|
40
|
+
# "prompt" = parse dependencies from PROMPT.md
|
|
41
|
+
# "agent" = use an agent to analyze tasks
|
|
42
|
+
source: "prompt"
|
|
43
|
+
cache: true
|
|
44
|
+
|
|
45
|
+
# ── Lane Assignment ───────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
assignment:
|
|
48
|
+
strategy: "affinity-first"
|
|
49
|
+
size_weights:
|
|
50
|
+
S: 1
|
|
51
|
+
M: 2
|
|
52
|
+
L: 4
|
|
53
|
+
|
|
54
|
+
# ── Pre-warming ───────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
# Disabled by default. Add commands that fit your stack if you want to use it.
|
|
57
|
+
pre_warm:
|
|
58
|
+
auto_detect: false
|
|
59
|
+
commands: {}
|
|
60
|
+
always: []
|
|
61
|
+
|
|
62
|
+
# ── Merge ─────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
merge:
|
|
65
|
+
model: "" # empty = inherit from parent pi session
|
|
66
|
+
tools: "read,write,edit,bash,grep,find,ls"
|
|
67
|
+
|
|
68
|
+
# Verification commands to run after each merge.
|
|
69
|
+
# Add only the commands that are safe and relevant for your project.
|
|
70
|
+
verify: []
|
|
71
|
+
|
|
72
|
+
order: "fewest-files-first"
|
|
73
|
+
|
|
74
|
+
# ── Failure Handling ──────────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
failure:
|
|
77
|
+
on_task_failure: "skip-dependents"
|
|
78
|
+
on_merge_failure: "pause"
|
|
79
|
+
stall_timeout: 30
|
|
80
|
+
max_worker_minutes: 30
|
|
81
|
+
abort_grace_period: 60
|
|
82
|
+
|
|
83
|
+
# ── Monitoring ────────────────────────────────────────────────────────
|
|
84
|
+
|
|
85
|
+
monitoring:
|
|
86
|
+
poll_interval: 5
|
|
@@ -1,99 +1,95 @@
|
|
|
1
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
2
|
-
# Task Runner Configuration
|
|
3
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
4
|
-
#
|
|
5
|
-
# Copy this file to `.pi/task-runner.yaml` in your project and customize it.
|
|
6
|
-
# This template is intentionally generic — replace the example paths, test
|
|
7
|
-
# commands, and task areas with ones that fit your repository.
|
|
8
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
9
|
-
|
|
10
|
-
# ── Project ───────────────────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
project:
|
|
13
|
-
name: "Your Project"
|
|
14
|
-
description: "Short description of your project"
|
|
15
|
-
|
|
16
|
-
paths:
|
|
17
|
-
tasks: "tasks"
|
|
18
|
-
architecture: "docs/architecture.md"
|
|
19
|
-
|
|
20
|
-
# ── Verification Commands ─────────────────────────────────────────────
|
|
21
|
-
|
|
22
|
-
# Add the commands your project uses for validation. Keep only the ones
|
|
23
|
-
# that are relevant to your stack.
|
|
24
|
-
testing:
|
|
25
|
-
commands:
|
|
26
|
-
test: "npm test"
|
|
27
|
-
build: "npm run build"
|
|
28
|
-
lint: "npm run lint"
|
|
29
|
-
|
|
30
|
-
# ── Standards ─────────────────────────────────────────────────────────
|
|
31
|
-
|
|
32
|
-
standards:
|
|
33
|
-
docs:
|
|
34
|
-
- "README.md"
|
|
35
|
-
- "CONTRIBUTING.md"
|
|
36
|
-
rules:
|
|
37
|
-
- "Keep changes scoped to the task"
|
|
38
|
-
- "Update documentation when behavior changes"
|
|
39
|
-
- "Prefer typed interfaces over unstructured data"
|
|
40
|
-
- "Avoid destructive changes unless explicitly requested"
|
|
41
|
-
|
|
42
|
-
# Per-area standards overrides. Omit or delete if you do not need them.
|
|
43
|
-
standards_overrides: {}
|
|
44
|
-
|
|
45
|
-
# ── Runner Settings ───────────────────────────────────────────────────
|
|
46
|
-
|
|
47
|
-
worker:
|
|
48
|
-
model: "" # empty = inherit from parent pi session
|
|
49
|
-
tools: "read,write,edit,bash,grep,find,ls"
|
|
50
|
-
thinking: "off"
|
|
51
|
-
# spawn_mode: "subprocess" # "subprocess" (default) or "tmux"
|
|
52
|
-
# tmux_prefix: "task" # used only in tmux mode
|
|
53
|
-
|
|
54
|
-
reviewer:
|
|
55
|
-
model: ""
|
|
56
|
-
tools: "read,write,bash,grep,find,ls"
|
|
57
|
-
thinking: "off"
|
|
58
|
-
|
|
59
|
-
context:
|
|
60
|
-
worker_context_window: 200000
|
|
61
|
-
warn_percent: 70
|
|
62
|
-
kill_percent: 85
|
|
63
|
-
max_worker_iterations: 20
|
|
64
|
-
max_review_cycles: 2
|
|
65
|
-
no_progress_limit: 3
|
|
66
|
-
# max_worker_minutes: 30 # used only in tmux mode
|
|
67
|
-
|
|
68
|
-
# ── Task Creation / Discovery ─────────────────────────────────────────
|
|
69
|
-
|
|
70
|
-
# Define the task areas that exist in your project.
|
|
71
|
-
task_areas:
|
|
72
|
-
|
|
73
|
-
path: "tasks
|
|
74
|
-
prefix: "
|
|
75
|
-
context: "tasks/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# Docs requiring explicit user approval to modify.
|
|
97
|
-
protected_docs:
|
|
98
|
-
- "docs/"
|
|
99
|
-
- "templates/"
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
2
|
+
# Task Runner Configuration
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
4
|
+
#
|
|
5
|
+
# Copy this file to `.pi/task-runner.yaml` in your project and customize it.
|
|
6
|
+
# This template is intentionally generic — replace the example paths, test
|
|
7
|
+
# commands, and task areas with ones that fit your repository.
|
|
8
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
9
|
+
|
|
10
|
+
# ── Project ───────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
project:
|
|
13
|
+
name: "Your Project"
|
|
14
|
+
description: "Short description of your project"
|
|
15
|
+
|
|
16
|
+
paths:
|
|
17
|
+
tasks: "tasks"
|
|
18
|
+
architecture: "docs/architecture.md"
|
|
19
|
+
|
|
20
|
+
# ── Verification Commands ─────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
# Add the commands your project uses for validation. Keep only the ones
|
|
23
|
+
# that are relevant to your stack.
|
|
24
|
+
testing:
|
|
25
|
+
commands:
|
|
26
|
+
test: "npm test"
|
|
27
|
+
build: "npm run build"
|
|
28
|
+
lint: "npm run lint"
|
|
29
|
+
|
|
30
|
+
# ── Standards ─────────────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
standards:
|
|
33
|
+
docs:
|
|
34
|
+
- "README.md"
|
|
35
|
+
- "CONTRIBUTING.md"
|
|
36
|
+
rules:
|
|
37
|
+
- "Keep changes scoped to the task"
|
|
38
|
+
- "Update documentation when behavior changes"
|
|
39
|
+
- "Prefer typed interfaces over unstructured data"
|
|
40
|
+
- "Avoid destructive changes unless explicitly requested"
|
|
41
|
+
|
|
42
|
+
# Per-area standards overrides. Omit or delete if you do not need them.
|
|
43
|
+
standards_overrides: {}
|
|
44
|
+
|
|
45
|
+
# ── Runner Settings ───────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
worker:
|
|
48
|
+
model: "" # empty = inherit from parent pi session
|
|
49
|
+
tools: "read,write,edit,bash,grep,find,ls"
|
|
50
|
+
thinking: "off"
|
|
51
|
+
# spawn_mode: "subprocess" # "subprocess" (default) or "tmux"
|
|
52
|
+
# tmux_prefix: "task" # used only in tmux mode
|
|
53
|
+
|
|
54
|
+
reviewer:
|
|
55
|
+
model: ""
|
|
56
|
+
tools: "read,write,bash,grep,find,ls"
|
|
57
|
+
thinking: "off"
|
|
58
|
+
|
|
59
|
+
context:
|
|
60
|
+
worker_context_window: 200000
|
|
61
|
+
warn_percent: 70
|
|
62
|
+
kill_percent: 85
|
|
63
|
+
max_worker_iterations: 20
|
|
64
|
+
max_review_cycles: 2
|
|
65
|
+
no_progress_limit: 3
|
|
66
|
+
# max_worker_minutes: 30 # used only in tmux mode
|
|
67
|
+
|
|
68
|
+
# ── Task Creation / Discovery ─────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
# Define the task areas that exist in your project.
|
|
71
|
+
task_areas:
|
|
72
|
+
general:
|
|
73
|
+
path: "taskplane-tasks"
|
|
74
|
+
prefix: "TP"
|
|
75
|
+
context: "taskplane-tasks/CONTEXT.md"
|
|
76
|
+
|
|
77
|
+
# Reference docs available for higher-context task prompts.
|
|
78
|
+
reference_docs:
|
|
79
|
+
overview: "README.md"
|
|
80
|
+
architecture: "docs/architecture.md"
|
|
81
|
+
contributing: "CONTRIBUTING.md"
|
|
82
|
+
|
|
83
|
+
# Docs that should never be loaded during task execution.
|
|
84
|
+
never_load:
|
|
85
|
+
- "PROGRESS.md"
|
|
86
|
+
- "HANDOFF-LOG.md"
|
|
87
|
+
|
|
88
|
+
# Self-documentation targets (where agents should log useful discoveries).
|
|
89
|
+
self_doc_targets:
|
|
90
|
+
tech_debt: "CONTEXT.md ## Technical Debt / Future Work"
|
|
91
|
+
|
|
92
|
+
# Docs requiring explicit user approval to modify.
|
|
93
|
+
protected_docs:
|
|
94
|
+
- "docs/"
|
|
95
|
+
- "templates/"
|