valent-pipeline 0.19.42 → 0.19.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valent-pipeline",
3
- "version": "0.19.42",
3
+ "version": "0.19.43",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -460,6 +460,25 @@ export function startStory({ root, story, targetBranch = '', prefix = 'story/',
460
460
  orphanMovedTo = aside;
461
461
  }
462
462
  git(root, ['worktree', 'add', wtPath, branch]);
463
+ // BUG-2 worktree variant (M-36/M-41, 2026-06-19): same fix as the non-worktree create path — a
464
+ // --from-story bug fix based on a source the TARGET has advanced past must inherit those target
465
+ // commits (the disposition's bug entries on the shared backlog), or `backlog ship --story <bug>`
466
+ // errors "not found". Here the branch lives in a WORKTREE, so the sync merge runs in the worktree
467
+ // checkout (wtPath), and BEFORE setupWorktree materializes .valent-pipeline/node_modules — a clean
468
+ // tree so no untracked file can block the merge. Same guards (create + basedOnStory + target-ahead);
469
+ // a conflict aborts cleanly in the worktree, leaving the branch at its base. Needed for parallel:2.
470
+ let refreshedFromTarget = false;
471
+ let refreshConflict = false;
472
+ if (creating && basedOnStory && branchExists(root, target) && !isMergedInto(root, target, branch)) {
473
+ try {
474
+ git(wtPath, ['merge', '--no-ff', '-m',
475
+ buildCommitMessage({ storyId: story, phase: 'sync', summary: `sync ${target} into ${branch} (inherit shared state from a behind base)` }), target]);
476
+ refreshedFromTarget = true;
477
+ } catch {
478
+ if (mergeInProgress(wtPath)) git(wtPath, ['merge', '--abort']);
479
+ refreshConflict = true;
480
+ }
481
+ }
463
482
  const setup = setupWorktree(root, wtPath, setupCommands);
464
483
  if (creating) {
465
484
  writeFlowRecord(wtPath, story, {
@@ -477,6 +496,8 @@ export function startStory({ root, story, targetBranch = '', prefix = 'story/',
477
496
  return {
478
497
  branch, base, target, worktree: wtPath, created: creating, resumed: !creating, snapshotSha,
479
498
  ...(orphanMovedTo ? { orphanMovedTo, warning: `orphaned worktree directory moved aside to ${orphanMovedTo} (crashed run; inspect/delete it manually)` } : {}),
499
+ ...(refreshedFromTarget ? { refreshedFromTarget: true } : {}),
500
+ ...(refreshConflict ? { refreshConflict: true } : {}),
480
501
  ...setup,
481
502
  };
482
503
  }