Contribution: plan_externalize: --no-worktree still writes 'Output branch: main' into the plan header
Scope
bug_fix
Motivation
Under a current-branch profile (create_worktree: false), planning.md Step 6 calls the helper with --no-worktree --profile
. The helper still writes 'Output branch: main' into the externalized plan's metadata header. task-workflow Step 9 and the Re-entry Routing both resolve the merge target from that header ('never from profile.output_branch'), so a resumed or Step-9 session aims at main even though the profile never asked for a worktree and the work is on another branch. In this project dev is the working branch and main is the production branch that gates deploys, so the wrong header points in-flight work at production. Observed with framework 0.32.0 on a fast-profile child task: the header had to be corrected by hand after every externalize. Expected: with --no-worktree the header should carry the current branch (or omit Output branch entirely), since the docs state --no-worktree 'clears any stale Output branch already present in a plan's frontmatter' - it clears, then writes main.
Proposed Merge Approach
In the --no-worktree path, set Output branch to the resolved base/current branch rather than defaulting to main; or omit the field so Step 9's documented two-rung rule falls back explicitly rather than being handed a wrong value.
Framework Version
0.32.0
Changed Files
| File |
Status |
.aitask-scripts/aitask_plan_externalize.sh |
Modified |
Code Changes
Contribution: plan_externalize: --no-worktree still writes 'Output branch: main' into the plan header
Scope
bug_fix
Motivation
Under a current-branch profile (create_worktree: false), planning.md Step 6 calls the helper with --no-worktree --profile
. The helper still writes 'Output branch: main' into the externalized plan's metadata header. task-workflow Step 9 and the Re-entry Routing both resolve the merge target from that header ('never from profile.output_branch'), so a resumed or Step-9 session aims at main even though the profile never asked for a worktree and the work is on another branch. In this project dev is the working branch and main is the production branch that gates deploys, so the wrong header points in-flight work at production. Observed with framework 0.32.0 on a fast-profile child task: the header had to be corrected by hand after every externalize. Expected: with --no-worktree the header should carry the current branch (or omit Output branch entirely), since the docs state --no-worktree 'clears any stale Output branch already present in a plan's frontmatter' - it clears, then writes main.
Proposed Merge Approach
In the --no-worktree path, set Output branch to the resolved base/current branch rather than defaulting to main; or omit the field so Step 9's documented two-rung rule falls back explicitly rather than being handed a wrong value.
Framework Version
0.32.0
Changed Files
.aitask-scripts/aitask_plan_externalize.shCode Changes