@yemi33/minions 0.1.785 → 0.1.786

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/CHANGELOG.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.785 (2026-04-10)
3
+ ## 0.1.786 (2026-04-10)
4
4
 
5
5
  ### Features
6
6
  - cap review→fix cycles at evalMaxIterations (default 3)
7
7
 
8
8
  ### Fixes
9
+ - stale ADO build detection + merge conflict auto-fix for both platforms
9
10
  - don't overwrite reviewStatus when platform vote hasn't propagated
10
11
  - don't overwrite approval with 'waiting' when platform API lags
11
12
 
package/engine/ado.js CHANGED
@@ -362,9 +362,8 @@ async function pollPrStatus(config) {
362
362
  // Find builds where sourceVersion matches the PR's merge commit
363
363
  const buildsUrl = `${orgBase}/${project.adoProject}/_apis/build/builds?$top=10&api-version=7.1`;
364
364
  const buildsData = await adoFetch(buildsUrl, token);
365
- const prBuilds = (buildsData?.value || []).filter(b =>
366
- b.sourceVersion === mergeCommitId || b.sourceBranch === prData.sourceRefName
367
- );
365
+ // Only match builds against the current merge commit — sourceBranch match catches stale builds
366
+ const prBuilds = (buildsData?.value || []).filter(b => b.sourceVersion === mergeCommitId);
368
367
 
369
368
  if (prBuilds.length > 0) {
370
369
  // partiallySucceeded = warnings, not failures — counts as passing
@@ -447,6 +446,18 @@ async function pollPrStatus(config) {
447
446
  }
448
447
  }
449
448
 
449
+ // Merge conflict detection
450
+ if (prData.mergeStatus === 'conflicts') {
451
+ if (!pr._mergeConflict) {
452
+ pr._mergeConflict = true;
453
+ log('info', `PR ${pr.id} has merge conflicts — will dispatch fix if not already in progress`);
454
+ updated = true;
455
+ }
456
+ } else if (pr._mergeConflict) {
457
+ delete pr._mergeConflict;
458
+ updated = true;
459
+ }
460
+
450
461
  return updated;
451
462
  } catch (err) {
452
463
  // Auth errors → mark build status stale so dashboard shows uncertainty
package/engine/github.js CHANGED
@@ -423,6 +423,18 @@ async function pollPrStatus(config) {
423
423
  }
424
424
  }
425
425
 
426
+ // Merge conflict detection
427
+ if (prData.state === 'open' && prData.mergeable === false) {
428
+ if (!pr._mergeConflict) {
429
+ pr._mergeConflict = true;
430
+ log('info', `PR ${pr.id} has merge conflicts — will dispatch fix if not already in progress`);
431
+ updated = true;
432
+ }
433
+ } else if (pr._mergeConflict) {
434
+ delete pr._mergeConflict;
435
+ updated = true;
436
+ }
437
+
426
438
  // Auto-complete: merge PR when builds green + review approved
427
439
  if (pr.status === PR_STATUS.ACTIVE && pr.reviewStatus === 'approved' && pr.buildStatus === 'passing' && !pr._autoCompleted) {
428
440
  const autoComplete = config.engine?.autoCompletePrs === true; // opt-in
package/engine.js CHANGED
@@ -1771,6 +1771,21 @@ async function discoverFromPrs(config, project) {
1771
1771
  }
1772
1772
  }
1773
1773
 
1774
+ // PRs with merge conflicts — dispatch fix to resolve
1775
+ if (pr.status === PR_STATUS.ACTIVE && pr._mergeConflict && !fixDispatched) {
1776
+ const key = `conflict-fix-${project?.name || 'default'}-${pr.id}`;
1777
+ if (!isAlreadyDispatched(key) && !isOnCooldown(key, cooldownMs)) {
1778
+ const agentId = resolveAgent('fix', config, pr.agent);
1779
+ if (agentId) {
1780
+ const item = buildPrDispatch(agentId, config, project, pr, 'fix', {
1781
+ pr_id: pr.id, pr_branch: pr.branch || '',
1782
+ review_note: `This PR has merge conflicts with the target branch. Resolve the conflicts:\n\n1. Pull latest from main/master\n2. Resolve all conflicts (prefer PR branch changes unless main has critical fixes)\n3. Build and test after resolving\n4. Push the resolved branch`,
1783
+ }, `Fix merge conflicts on PR ${pr.id}`, { dispatchKey: key, source: 'pr', pr, branch: pr.branch, project: projMeta });
1784
+ if (item) { newWork.push(item); setCooldown(key); }
1785
+ }
1786
+ }
1787
+ }
1788
+
1774
1789
  }
1775
1790
  // Build & test now runs once at PRD completion (via verify task), not per-PR.
1776
1791
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.785",
3
+ "version": "0.1.786",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"