valent-pipeline 0.19.47 → 0.19.48

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.47",
3
+ "version": "0.19.48",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -524,6 +524,10 @@ export function startStory({ root, story, targetBranch = '', prefix = 'story/',
524
524
  let refreshedFromTarget = false;
525
525
  let refreshConflict = false;
526
526
  if (basedOnStory && branchExists(root, target) && !isMergedInto(root, target, branch)) {
527
+ // Capture whether the vendored install is present BEFORE the sync, so the hazard guard below fires
528
+ // ONLY when the merge actually REMOVED it — not when a repo simply never had a materialized install
529
+ // (e.g. a bare test fixture), which must refresh normally.
530
+ const hadFrameworkInstall = existsSync(join(root, '.valent-pipeline', 'bin', 'cli.js'));
527
531
  try {
528
532
  git(root, ['merge', '--no-ff', '-m',
529
533
  buildCommitMessage({ storyId: story, phase: 'sync', summary: `sync ${target} into ${branch} (inherit shared state from a behind base)` }), target]);
@@ -532,6 +536,24 @@ export function startStory({ root, story, targetBranch = '', prefix = 'story/',
532
536
  if (mergeInProgress(root)) git(root, ['merge', '--abort']);
533
537
  refreshConflict = true;
534
538
  }
539
+ // M-52 transition hazard: when `target` UNTRACKS the vendored framework (the post-untrack install
540
+ // model) while THIS branch still TRACKS it (a pre-untrack branch), the merge above applied target's
541
+ // index-deletion to the WORKING TREE and removed the on-disk install — `.valent-pipeline/bin/cli.js`
542
+ // is gone, so the next `node .valent-pipeline/bin/cli.js` call would fail mid-sprint. Such a branch
543
+ // cannot be refreshed in place (keeping the merge loses the install; reverting it restores a STALE
544
+ // framework — the very thing untracking fixed), so undo the sync and surface it like a conflict: the
545
+ // caller must recut the branch FRESH off the untracked target. (The worktree create-path self-heals
546
+ // via setupWorktree's re-materialize; this serial path has no such restore.)
547
+ if (refreshedFromTarget && hadFrameworkInstall && !existsSync(join(root, '.valent-pipeline', 'bin', 'cli.js'))) {
548
+ git(root, ['reset', '--hard', 'ORIG_HEAD']);
549
+ refreshedFromTarget = false;
550
+ refreshConflict = true;
551
+ console.error(
552
+ `git-flow: sync of ${target} into ${branch} would DELETE the vendored framework install ` +
553
+ `(${target} untracks .valent-pipeline/ but ${branch} still tracks it — M-52 untrack transition). ` +
554
+ `Skipped the sync; ${branch} left at its base — recut it FRESH off ${target} instead of --from-story.`,
555
+ );
556
+ }
535
557
  }
536
558
  writeFlowRecord(root, story, {
537
559
  schema: 1,