@yemi33/minions 0.1.1766 → 0.1.1768

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,16 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1766 (2026-05-07)
3
+ ## 0.1.1768 (2026-05-07)
4
+
5
+ ### Fixes
6
+ - stamp dispatchItem.started_at locally so updateMetrics sees it (#2158)
7
+ - stop test fixtures leaking into live engine/log.json (#2154)
8
+
9
+ ### Other
10
+ - test(engine): add unit tests for PR branch/cause resolution helpers (#2160)
11
+ - test(dispatch): add unit tests for dedup/lock-key + retry-classification helpers (#2159)
12
+
13
+ ## 0.1.1765 (2026-05-07)
4
14
 
5
15
  ### Features
6
16
  - suppress duplicate browser tabs on restart/update
@@ -8,7 +18,6 @@
8
18
  - probe every registered runtime adapter, not just claude
9
19
 
10
20
  ### Fixes
11
- - silence 'couldn't find remote ref' warnings on worktree reuse for never-pushed branches (#2155)
12
21
  - close remaining test isolation leaks + add end-of-run regression guard (#2152)
13
22
  - surface legacy .minions dir removal in logs
14
23
  - clear session.json when conversation jsonl missing (W-mouugzow00068741) (#2153)
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-07T03:30:56.716Z"
4
+ "cachedAt": "2026-05-07T15:03:20.055Z"
5
5
  }
@@ -658,4 +658,11 @@ module.exports = {
658
658
  cancelPendingDispatchesForPr,
659
659
  cleanDispatchEntries,
660
660
  cancelPendingWorkItems,
661
+ // exported for testing
662
+ getDispatchProjectKey,
663
+ getPrDispatchTargetKey,
664
+ getBranchDispatchLockKey,
665
+ findActivePrOrBranchLock,
666
+ normalizeRetryableDecision,
667
+ isCompletedWorkItemForFailure,
661
668
  };
package/engine/shared.js CHANGED
@@ -168,12 +168,26 @@ function log(level, msg, meta = {}) {
168
168
  * That leaked test pollution into the live engine log (e.g. `_test/backoff-*`,
169
169
  * `this-playbook-does-not-exist-xyz`, `TEST-EXT-*` meeting IDs).
170
170
  *
171
- * Lazy resolution honors the *current* `MINIONS_TEST_DIR` at flush time, so
172
- * even unbussed dependents write to the test dir while the test owns it.
171
+ * Resolution order:
172
+ * 1. `MINIONS_TEST_DIR` per-test isolation root (regression tests rely
173
+ * on this — log goes to `<tmpdir>/engine/log.json`).
174
+ * 2. `MINIONS_LOG_PATH` — default test log target. Set at the top of
175
+ * `test/unit.test.js` so tests that exercise log() without explicit
176
+ * isolation (e.g. github backoff helpers, cooldown helpers) still land
177
+ * in a benign tmp file instead of the live `D:/squad/engine/log.json`.
178
+ * 3. `MINIONS_HOME` / repo root fallback — production behavior.
179
+ *
180
+ * Lazy resolution honors the *current* env at flush time, so even unbussed
181
+ * dependents write to the test dir while the test owns it.
173
182
  */
174
183
  function _currentLogPath() {
175
- const root = process.env.MINIONS_TEST_DIR
176
- || (process.env.MINIONS_HOME ? path.resolve(process.env.MINIONS_HOME) : path.resolve(__dirname, '..'));
184
+ if (process.env.MINIONS_TEST_DIR) {
185
+ return path.join(path.resolve(process.env.MINIONS_TEST_DIR), 'engine', 'log.json');
186
+ }
187
+ if (process.env.MINIONS_LOG_PATH) {
188
+ return path.resolve(process.env.MINIONS_LOG_PATH);
189
+ }
190
+ const root = process.env.MINIONS_HOME ? path.resolve(process.env.MINIONS_HOME) : path.resolve(__dirname, '..');
177
191
  return path.join(root, 'engine', 'log.json');
178
192
  }
179
193
 
package/engine.js CHANGED
@@ -1692,6 +1692,10 @@ async function spawnAgent(dispatchItem, config) {
1692
1692
  }
1693
1693
  return dispatch;
1694
1694
  });
1695
+ // Also stamp the local ref — mutateDispatch re-reads from disk, so `item`
1696
+ // above is a different object than the `dispatchItem` parameter. updateMetrics
1697
+ // reads dispatchItem.started_at for runtimeMs. (W-moux9nwn0008f923)
1698
+ dispatchItem.started_at = startedAt;
1695
1699
 
1696
1700
  // Atomically stamp dispatched_to/dispatched_at on the originating work item (#402)
1697
1701
  // The discover phase sets these via safeWrite which can race with concurrent writes;
@@ -4709,6 +4713,7 @@ module.exports = {
4709
4713
  parseConflictFiles, pruneAncestorDeps, preflightMergeSimulation, // exported for testing
4710
4714
  isWorktreeRetryableError, removeStaleIndexLock, syncReusedWorktree, // exported for testing
4711
4715
  _maxTurnsForType, buildProjectContext, normalizeAc, _buildAgentSpawnFlags, _classifyAgentFailure, // exported for testing
4716
+ normalizePrBranch, resolvePrBranch, prCausePart, getPrCauseHead, getPrCauseBase, getPrAutomationCauseKey, getPrAutomationDispatchKey, // exported for testing
4712
4717
 
4713
4718
  // Playbooks
4714
4719
  renderPlaybook, validatePlaybookVars, PLAYBOOK_REQUIRED_VARS, buildWorkItemDispatchVars,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1766",
3
+ "version": "0.1.1768",
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"