@yemi33/minions 0.1.784 → 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,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.784 (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
10
+ - don't overwrite reviewStatus when platform vote hasn't propagated
9
11
  - don't overwrite approval with 'waiting' when platform API lags
10
12
 
11
13
  ## 0.1.782 (2026-04-10)
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
@@ -730,10 +730,9 @@ async function updatePrAfterReview(agentId, pr, project, config, resultSummary)
730
730
  const completedEntry = (dispatch.completed || []).find(d => d.agent === agentId && d.type === 'review');
731
731
 
732
732
  // Check actual review status from the platform (agent may have approved or requested changes)
733
- // Default to 'pending' (not 'waiting') — if platform hasn't propagated the vote yet,
734
- // 'pending' lets the next poll cycle pick it up. 'waiting' would trigger the awaitingReReview
735
- // gate and block the PR until the fix→re-review flow runs.
736
- let postReviewStatus = 'pending';
733
+ // If platform hasn't propagated the vote yet (returns 'pending'), keep current status unchanged.
734
+ // The poller will pick up the real status on the next cycle (~3 min).
735
+ let postReviewStatus = null; // null = don't change
737
736
  try {
738
737
  const projectObj = project || shared.getProjects(config)[0];
739
738
  if (projectObj) {
@@ -752,7 +751,7 @@ async function updatePrAfterReview(agentId, pr, project, config, resultSummary)
752
751
  if (!Array.isArray(prs)) return prs;
753
752
  const target = prs.find(p => p.id === pr.id);
754
753
  if (!target) return prs;
755
- target.reviewStatus = postReviewStatus;
754
+ if (postReviewStatus) target.reviewStatus = postReviewStatus; // only update if live check returned decisive result
756
755
  target.lastReviewedAt = ts();
757
756
  target.minionsReview = {
758
757
  reviewer: reviewerName,
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.784",
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"