@h-rig/runtime 0.0.6-alpha.13 → 0.0.6-alpha.14

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.
@@ -7174,7 +7174,7 @@ function gitOpenPr(options) {
7174
7174
  "",
7175
7175
  "## Review",
7176
7176
  "- Completion verification will run validation, verifier review, and PR policy checks.",
7177
- "- When repository policy allows it, Rig enables GitHub auto-merge after approval."
7177
+ "- When repository policy allows it, Rig attempts an immediate strict-gated, head-locked merge after approval."
7178
7178
  ].join(`
7179
7179
  `);
7180
7180
  const preCheck = runCapture2(withGhRepo([gh, "pr", "list", "--state", "merged", "--head", branch, "--json", "url,mergedAt", "--jq", ".[0]"], repoNameWithOwner), repoRoot);
@@ -464,10 +464,6 @@ function runBelongsToProject(projectRoot, run, runsDir) {
464
464
  if (recordedProjectRoot) {
465
465
  return resolve2(recordedProjectRoot) === normalizedRoot;
466
466
  }
467
- const projectLocalRunsDir = resolve2(normalizedRoot, ".rig", "runs");
468
- if (isPathWithin(projectLocalRunsDir, resolve2(runsDir))) {
469
- return true;
470
- }
471
467
  const pathFields = [
472
468
  run.worktreePath,
473
469
  run.artifactRoot,
@@ -475,10 +471,20 @@ function runBelongsToProject(projectRoot, run, runsDir) {
475
471
  run.sessionPath,
476
472
  run.sessionLogPath
477
473
  ].filter((value) => typeof value === "string" && value.trim().length > 0);
478
- if (pathFields.length === 0) {
474
+ if (pathFields.length > 0) {
475
+ if (pathFields.some((value) => isPathWithin(normalizedRoot, resolve2(value)))) {
476
+ return true;
477
+ }
478
+ const pointsAtManagedWorkspace = pathFields.some((value) => /(?:^|[/\\])\.worktrees(?:[/\\]|$)/.test(value));
479
+ if (pointsAtManagedWorkspace) {
480
+ return false;
481
+ }
482
+ }
483
+ const projectLocalRunsDir = resolve2(normalizedRoot, ".rig", "runs");
484
+ if (isPathWithin(projectLocalRunsDir, resolve2(runsDir))) {
479
485
  return true;
480
486
  }
481
- return pathFields.some((value) => isPathWithin(normalizedRoot, resolve2(value)));
487
+ return pathFields.length === 0;
482
488
  }
483
489
  function isPathWithin(root, candidate) {
484
490
  const relativePath = relative(root, candidate);