taskplane 0.5.9 → 0.5.11

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.
@@ -327,8 +327,24 @@ export function executeIntegration(
327
327
  const { orchBranch, currentBranch, batchId } = context;
328
328
 
329
329
  if (mode === "ff") {
330
- // Fast-forward merge
330
+ // Fast-forward merge.
331
+ // Stash any dirty working tree files first — workspace mode leaves
332
+ // STATUS.md modifications in the working tree for dashboard visibility.
333
+ // These would block ff if the orch branch has different versions.
334
+ let stashed = false;
335
+ const statusCheck = deps.runGit(["status", "--porcelain"]);
336
+ if (statusCheck.ok && statusCheck.stdout.trim()) {
337
+ deps.runGit(["stash", "push", "--include-untracked", "-m", `orch-integrate-autostash-${batchId}`]);
338
+ stashed = true;
339
+ }
340
+
331
341
  const result = deps.runGit(["merge", "--ff-only", orchBranch]);
342
+
343
+ // Always pop stash if we stashed, regardless of ff result
344
+ if (stashed) {
345
+ deps.runGit(["stash", "pop"]);
346
+ }
347
+
332
348
  if (!result.ok) {
333
349
  return {
334
350
  success: false,
@@ -359,7 +375,20 @@ export function executeIntegration(
359
375
  }
360
376
 
361
377
  if (mode === "merge") {
378
+ // Stash dirty working tree (same as ff mode — workspace STATUS.md artifacts)
379
+ let mergeStashed = false;
380
+ const mergeStatusCheck = deps.runGit(["status", "--porcelain"]);
381
+ if (mergeStatusCheck.ok && mergeStatusCheck.stdout.trim()) {
382
+ deps.runGit(["stash", "push", "--include-untracked", "-m", `orch-integrate-autostash-${batchId}`]);
383
+ mergeStashed = true;
384
+ }
385
+
362
386
  const result = deps.runGit(["merge", orchBranch, "--no-edit"]);
387
+ // Pop stash regardless of merge result
388
+ if (mergeStashed) {
389
+ deps.runGit(["stash", "pop"]);
390
+ }
391
+
363
392
  if (!result.ok) {
364
393
  return {
365
394
  success: false,
@@ -1185,6 +1214,10 @@ export default function (pi: ExtensionAPI) {
1185
1214
  const repoMessages: string[] = [];
1186
1215
 
1187
1216
  for (const repo of reposToIntegrate) {
1217
+ // Count commits BEFORE integration (after ff, HEAD === orch tip so count would be 0)
1218
+ const preCountResult = runGit(["rev-list", "--count", `HEAD..${resolvedOrchBranch}`], repo.root);
1219
+ const repoCommitsBefore = preCountResult.ok ? parseInt(preCountResult.stdout) || 0 : 0;
1220
+
1188
1221
  const integrationResult = executeIntegration(parsed.mode, resolution as IntegrationContext, {
1189
1222
  runGit: (gitArgs: string[]) => runGit(gitArgs, repo.root),
1190
1223
  runCommand: (cmd: string, cmdArgs: string[]) => {
@@ -1214,10 +1247,7 @@ export default function (pi: ExtensionAPI) {
1214
1247
  break;
1215
1248
  }
1216
1249
 
1217
- // Count commits for this repo
1218
- const countResult = runGit(["rev-list", "--count", `HEAD...${resolvedOrchBranch}`], repo.root);
1219
- const repoCommits = countResult.ok ? parseInt(countResult.stdout) || 0 : 0;
1220
- totalCommits += repoCommits;
1250
+ totalCommits += repoCommitsBefore;
1221
1251
  repoMessages.push(` ${repo.id}: ${integrationResult.message}`);
1222
1252
  }
1223
1253
 
@@ -787,12 +787,10 @@ export function mergeWave(
787
787
  spawnSync("git", ["commit", "-m", `checkpoint: wave ${waveIndex} task artifacts (.DONE, STATUS.md)`], { cwd: mergeWorkDir });
788
788
  execLog("merge", `W${waveIndex}`, `committed ${staged} task artifact(s) to merge worktree`);
789
789
 
790
- // Restore the repo's working tree remove the artifacts from develop's working tree
791
- // so they don't cause conflicts on /orch-integrate
792
- for (const file of artifactFiles) {
793
- spawnSync("git", ["checkout", "--", file], { cwd: repoRoot });
794
- }
795
- // Also remove any untracked .DONE files
790
+ // Restore .DONE files onlythese are untracked and would cause
791
+ // "dirty working tree" issues on /orch-integrate.
792
+ // Keep STATUS.md modifications in develop's working tree so the
793
+ // dashboard can read current progress from the canonical path.
796
794
  for (const file of artifactFiles) {
797
795
  if (file.endsWith(".DONE")) {
798
796
  const srcPath = join(repoRoot, file);
@@ -50,14 +50,15 @@ export const ORCH_MESSAGES = {
50
50
  }
51
51
  if (orchBranch && succeeded > 0) {
52
52
  lines.push("");
53
- lines.push(` ℹ Orch branch: ${orchBranch}`);
53
+ lines.push(` ℹ All work is on orch branch: ${orchBranch}`);
54
+ lines.push(` Your ${baseBranch || "working"} branch was not modified.`);
54
55
  if (baseBranch) {
55
- lines.push(` Review changes: git log ${baseBranch}..${orchBranch}`);
56
+ lines.push(` Preview: git log ${baseBranch}..${orchBranch}`);
56
57
  }
57
- lines.push(" Next steps:");
58
- lines.push(" /orch-integrate — fast-forward into your branch");
59
- lines.push(" • /orch-integrate --merge — merge (if branches diverged)");
60
- lines.push(" • /orch-integrate --pr push and open a PR");
58
+ lines.push("");
59
+ lines.push(" To apply the changes:");
60
+ lines.push(" • /orch-integrate Apply now (fast-forward, recommended)");
61
+ lines.push(" • /orch-integrate --pr Push orch branch & open a PR for team review");
61
62
  }
62
63
  return lines.join("\n");
63
64
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",