@yemi33/minions 0.1.2361 → 0.1.2362

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/dashboard.js CHANGED
@@ -1373,6 +1373,11 @@ function linkPullRequestForTracking({ url, title, project: projectName, contextO
1373
1373
  }, {
1374
1374
  project: targetProject,
1375
1375
  itemId: linkedWorkItemId,
1376
+ // W-mrdutzdr000t22f4 — a POST /api/pull-requests/link call is deliberate
1377
+ // user intent to (re)track this PR. Unlike passive re-enrollment paths
1378
+ // (pollers, enrollPrFromCanonicalId), this call site should clear a
1379
+ // tombstone left by a prior explicit delete rather than silently no-op.
1380
+ allowResurrect: true,
1376
1381
  });
1377
1382
  return { ...result, prPath, targetProject, projectResolution, prNum };
1378
1383
  }
@@ -13844,16 +13849,25 @@ What would you like to discuss or change? When you're happy, say "approve" and I
13844
13849
  } catch (e) {
13845
13850
  return jsonReply(res, e.statusCode || 400, { error: e.message }, req);
13846
13851
  }
13847
- const { id: prId, prPath, prNum, created, linked, targetProject, projectResolution } = linkResult;
13852
+ const { id: prId, prPath, prNum, created, linked, targetProject, projectResolution, skipped, resurrected } = linkResult;
13848
13853
  invalidateStatusCache();
13854
+ // W-mrdutzdr000t22f4 — upsertPullRequestRecord can leave the record
13855
+ // untouched (`skipped: true`) for reasons other than a resurrect, e.g.
13856
+ // a legitimate cross-scope tombstone match it still refuses to touch.
13857
+ // Surface that instead of always claiming success so a caller relying
13858
+ // on "PR linked." isn't misled into thinking the record changed.
13849
13859
  jsonReply(res, 200, {
13850
13860
  ok: true,
13851
13861
  id: prId,
13852
13862
  created,
13853
13863
  linked,
13864
+ skipped: skipped === true,
13865
+ resurrected: resurrected === true,
13854
13866
  project: targetProject?.name || 'central',
13855
13867
  projectResolution,
13856
- message: projectResolution?.message || 'PR linked.',
13868
+ message: skipped
13869
+ ? 'PR was not linked: an existing tracked record blocked the update.'
13870
+ : (projectResolution?.message || 'PR linked.'),
13857
13871
  });
13858
13872
 
13859
13873
  // Async-enrich: fetch title, description, branch, author from GitHub/ADO API
package/engine/shared.js CHANGED
@@ -7873,7 +7873,7 @@ function collapseDuplicatePrRecords(prPath, { project = null } = {}) {
7873
7873
  * manually records a PR for a work item must use this helper so the PR record
7874
7874
  * and the canonical work-item attachment are created together and idempotently.
7875
7875
  */
7876
- function upsertPullRequestRecord(prPath, entry, { project = null, itemId = null, itemIds = null, beforeInsert = null } = {}) {
7876
+ function upsertPullRequestRecord(prPath, entry, { project = null, itemId = null, itemIds = null, beforeInsert = null, allowResurrect = false } = {}) {
7877
7877
  if (!prPath) throw new Error('prPath required');
7878
7878
  if (!entry || typeof entry !== 'object') throw new Error('entry required');
7879
7879
 
@@ -7906,6 +7906,7 @@ function upsertPullRequestRecord(prPath, entry, { project = null, itemId = null,
7906
7906
  let created = false;
7907
7907
  let linked = false;
7908
7908
  let skipped = false;
7909
+ let resurrected = false;
7909
7910
  let record = null;
7910
7911
 
7911
7912
  mutatePullRequests(prPath, (prs) => {
@@ -7914,9 +7915,20 @@ function upsertPullRequestRecord(prPath, entry, { project = null, itemId = null,
7914
7915
  // Issue #384: tombstoned records (userDeleted:true) must not be re-activated
7915
7916
  // by any poller path. Return skipped so reconcilePrs / shared-branch-reconcile
7916
7917
  // cannot resurrect a PR the user explicitly removed.
7918
+ //
7919
+ // W-mrdutzdr000t22f4 — passive re-enrollment (pollers, enrollPrFromCanonicalId)
7920
+ // must keep respecting the tombstone, but a deliberate user-initiated relink
7921
+ // via POST /api/pull-requests/link is explicit intent to bring the PR back.
7922
+ // Callers that want that behavior opt in with `allowResurrect: true`, which
7923
+ // clears the tombstone here and lets the normal field-merge logic below run.
7917
7924
  if (target && target.userDeleted === true) {
7918
- skipped = true;
7919
- return prs;
7925
+ if (!allowResurrect) {
7926
+ skipped = true;
7927
+ return prs;
7928
+ }
7929
+ delete target.userDeleted;
7930
+ delete target.userDeletedAt;
7931
+ resurrected = true;
7920
7932
  }
7921
7933
  // P-e9f0a2b4 — When findPrRecord returns null but multiple records share the
7922
7934
  // same prNumber (e.g. cross-scope contamination or a project-config change
@@ -7980,7 +7992,7 @@ function upsertPullRequestRecord(prPath, entry, { project = null, itemId = null,
7980
7992
  }
7981
7993
  }
7982
7994
 
7983
- return { id: canonicalId, prNumber, created, linked, skipped, record };
7995
+ return { id: canonicalId, prNumber, created, linked, skipped, resurrected, record };
7984
7996
  }
7985
7997
 
7986
7998
  // ─── PR Reference → URL Derivation ───────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2361",
3
+ "version": "0.1.2362",
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"