@yemi33/minions 0.1.916 → 0.1.917

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,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.916 (2026-04-13)
3
+ ## 0.1.917 (2026-04-13)
4
4
 
5
5
  ### Features
6
6
  - CC tab unread dot + reopened badge on work items
@@ -18,6 +18,7 @@
18
18
  - add red dot notification on CC tab when response completes (#934) (#946)
19
19
 
20
20
  ### Fixes
21
+ - PRD item status stuck at dispatched when fix completes (#989)
21
22
  - dep merge ancestor pruning + pre-flight simulation (#958) (#979)
22
23
  - add MAX_TURNS failure class and fix enum count test (#983)
23
24
  - prevent Create Plan from meeting saving doc-chat context bleed (#980)
@@ -617,6 +617,8 @@ function updateWorkItemStatus(meta, status, reason) {
617
617
  }
618
618
 
619
619
  const _VALID_PRD_STATUSES = new Set([...Object.values(WI_STATUS), 'missing']);
620
+ // (#984) PRD statuses that are stale when the work item is actually done
621
+ const _STALE_PRD_STATUSES = new Set([WI_STATUS.DISPATCHED, WI_STATUS.FAILED, WI_STATUS.PENDING]);
620
622
  function syncPrdItemStatus(itemId, status, sourcePlan) {
621
623
  if (!itemId) return;
622
624
  if (!_VALID_PRD_STATUSES.has(status)) return;
@@ -637,11 +639,12 @@ function syncPrdItemStatus(itemId, status, sourcePlan) {
637
639
  } catch (err) { log('warn', `PRD status sync: ${err.message}`); }
638
640
  }
639
641
 
640
- // ─── PRD Backward-Scan Reconciliation (#929) ────────────────────────────────
641
- // Proactive counterpart to syncPrdItemStatus. Scans all active PRDs and promotes
642
- // "missing" items to "updated" when a done work item already exists for that ID.
643
- // This catches cases where a PRD regeneration incorrectly sets items to "missing"
644
- // and no subsequent work item state change triggers the reactive sync.
642
+ // ─── PRD Backward-Scan Reconciliation (#929, #984) ─────────────────────────
643
+ // Proactive counterpart to syncPrdItemStatus. Scans all active PRDs and:
644
+ // 1. Promotes "missing" items to "updated" when a done work item already exists (#929)
645
+ // 2. Promotes stale "dispatched"/"failed"/"pending" items to "done" when the work item
646
+ // is actually done (#984) catches cases where fix work items complete with a
647
+ // different ID than the original PRD feature, leaving the PRD status stale.
645
648
 
646
649
  function reconcilePrdStatuses(config) {
647
650
  if (!fs.existsSync(PRD_DIR)) return;
@@ -674,6 +677,14 @@ function reconcilePrdStatuses(config) {
674
677
  modified = true;
675
678
  log('info', `PRD backward-scan: promoted ${feature.id} from missing→updated in ${file} (done work item exists)`);
676
679
  }
680
+ // (#984) Stale status: PRD item stuck at dispatched/failed/pending while WI is done —
681
+ // happens when fix work items complete with a different ID than the original PRD feature
682
+ else if (_STALE_PRD_STATUSES.has(feature.status) && doneWiById.has(feature.id)) {
683
+ const prev = feature.status;
684
+ feature.status = WI_STATUS.DONE;
685
+ modified = true;
686
+ log('info', `PRD backward-scan: promoted ${feature.id} from ${prev}→done in ${file} (done work item exists)`);
687
+ }
677
688
  }
678
689
 
679
690
  if (modified) {
@@ -1790,7 +1801,23 @@ async function runPostCompletionHooks(dispatchItem, agentId, code, stdout, confi
1790
1801
  }
1791
1802
 
1792
1803
  if (type === WORK_TYPE.REVIEW) await updatePrAfterReview(agentId, meta?.pr, meta?.project, config, resultSummary);
1793
- if (type === WORK_TYPE.FIX) updatePrAfterFix(meta?.pr, meta?.project, meta?.source);
1804
+ if (type === WORK_TYPE.FIX) {
1805
+ updatePrAfterFix(meta?.pr, meta?.project, meta?.source);
1806
+ // (#984) Sync PRD status for PR-linked features: fix work items have a different ID
1807
+ // than the original PRD feature, so syncPrdItemStatus(fixWiId, ...) finds nothing.
1808
+ // Use the PR's prdItems to propagate done status when the original work item is done.
1809
+ if (effectiveSuccess && meta?.pr?.prdItems?.length) {
1810
+ try {
1811
+ const allWis = queries.getWorkItems(config);
1812
+ for (const prdItemId of meta.pr.prdItems) {
1813
+ const wi = allWis.find(w => w.id === prdItemId);
1814
+ if (wi && DONE_STATUSES.has(wi.status) && wi.sourcePlan) {
1815
+ syncPrdItemStatus(prdItemId, WI_STATUS.DONE, wi.sourcePlan);
1816
+ }
1817
+ }
1818
+ } catch (err) { log('warn', `PRD sync after fix: ${err.message}`); }
1819
+ }
1820
+ }
1794
1821
  checkForLearnings(agentId, config.agents[agentId], dispatchItem.task);
1795
1822
  if (effectiveSuccess) {
1796
1823
  extractSkillsFromOutput(stdout, agentId, dispatchItem, config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.916",
3
+ "version": "0.1.917",
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"