@yemi33/minions 0.1.369 → 0.1.371

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,11 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.369 (2026-04-06)
3
+ ## 0.1.371 (2026-04-06)
4
+
5
+ ### Features
6
+ - Fix review re-dispatch infinite loop (#226)
7
+ - Add subagent guidance and health check preamble to playbooks (#225)
8
+ - Fix 2 failing source-pattern test assertions (#224)
4
9
 
5
10
  ### Fixes
6
11
  - copy button preserves markdown formatting
package/engine/github.js CHANGED
@@ -141,6 +141,13 @@ async function pollPrStatus(config) {
141
141
  else if (prData.state === 'closed') newStatus = PR_STATUS.ABANDONED;
142
142
  else if (prData.state === 'open') newStatus = PR_STATUS.ACTIVE;
143
143
 
144
+ // Track head SHA changes to detect new pushes (used for review re-dispatch gating)
145
+ if (prData.head?.sha && pr.headSha !== prData.head.sha) {
146
+ pr.headSha = prData.head.sha;
147
+ pr.lastPushedAt = new Date().toISOString();
148
+ updated = true;
149
+ }
150
+
144
151
  if (pr.status !== newStatus) {
145
152
  log('info', `PR ${pr.id} status: ${pr.status} → ${newStatus}`);
146
153
  pr.status = newStatus;
@@ -191,6 +198,9 @@ async function pollPrStatus(config) {
191
198
  if (states.some(s => s === 'CHANGES_REQUESTED')) newReviewStatus = 'changes-requested';
192
199
  else if (states.some(s => s === 'APPROVED')) newReviewStatus = 'approved';
193
200
  else if (states.length > 0) newReviewStatus = 'pending';
201
+ // If all reviews were COMMENTED (filtered out), states is empty but reviews exist.
202
+ // Set to 'waiting' instead of leaving as 'pending' to prevent infinite review re-dispatch.
203
+ else if (states.length === 0 && reviews.length > 0 && newReviewStatus === 'pending') newReviewStatus = 'waiting';
194
204
 
195
205
  if (pr.reviewStatus !== newReviewStatus) {
196
206
  log('info', `PR ${pr.id} reviewStatus: ${pr.reviewStatus} → ${newReviewStatus}`);
@@ -727,6 +727,9 @@ function updatePrAfterReview(agentId, pr, project) {
727
727
 
728
728
  // Set reviewStatus to 'waiting' (single source of truth — synced from ADO/GitHub votes on next poll)
729
729
  target.reviewStatus = 'waiting';
730
+ // Track when this PR was last reviewed — used by engine.js to prevent re-dispatch
731
+ // until new commits are pushed (lastPushedAt > lastReviewedAt)
732
+ target.lastReviewedAt = ts();
730
733
  target.minionsReview = {
731
734
  reviewer: reviewerName,
732
735
  reviewedAt: ts(),
package/engine.js CHANGED
@@ -1268,9 +1268,11 @@ function discoverFromPrs(config, project) {
1268
1268
  // minionsReview tracks metadata (reviewer, note) but not the authoritative status
1269
1269
  const reviewStatus = pr.reviewStatus || 'pending';
1270
1270
 
1271
- // PRs needing review: pending or waiting (review dispatched but no verdict yet)
1271
+ // PRs needing review: pending review status and not already reviewed without new commits
1272
1272
  const autoReview = config.engine?.autoReview !== false;
1273
- const needsReview = autoReview && reviewStatus === 'pending';
1273
+ // Skip re-dispatch if already reviewed and no new commits pushed since last review
1274
+ const alreadyReviewed = pr.lastReviewedAt && (!pr.lastPushedAt || pr.lastPushedAt <= pr.lastReviewedAt);
1275
+ const needsReview = autoReview && reviewStatus === 'pending' && !alreadyReviewed;
1274
1276
  if (needsReview) {
1275
1277
  const key = `review-${project?.name || 'default'}-${pr.id}`;
1276
1278
  if (isAlreadyDispatched(key) || isOnCooldown(key, cooldownMs)) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.369",
3
+ "version": "0.1.371",
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"
@@ -21,6 +21,10 @@ A work item has been flagged as too large for a single agent dispatch. Analyze t
21
21
  {{acceptance_criteria}}
22
22
  {{/acceptance_criteria}}
23
23
 
24
+ ## Working Style
25
+
26
+ Use subagents only for genuinely parallel, independent tasks. For codebase exploration, reading files, and writing the decomposition output, work directly — do not spawn subagents.
27
+
24
28
  ## Instructions
25
29
 
26
30
  1. **Explore the codebase** at `{{project_path}}` — understand the existing structure, patterns, and dependencies
@@ -52,6 +52,10 @@ If the task is purely exploratory (no deliverable requested), skip this step.
52
52
  ### 6. Status
53
53
  **Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
54
54
 
55
+ ## Working Style
56
+
57
+ Use subagents only for genuinely parallel, independent tasks. For reading files, exploring directories, and writing findings, work directly — do not spawn subagents.
58
+
55
59
  ## Rules
56
60
  - Do NOT modify existing code unless the task explicitly asks for it.
57
61
  - Use the appropriate MCP tools for PR creation — check available tools before starting.
package/playbooks/fix.md CHANGED
@@ -17,6 +17,14 @@ Branch: `{{pr_branch}}`
17
17
 
18
18
  {{review_note}}
19
19
 
20
+ ## Health Check
21
+
22
+ Before starting work, run `git status` and verify the worktree is clean and on the expected branch (`{{pr_branch}}`). If the worktree is dirty or on the wrong branch, report the issue and stop.
23
+
24
+ ## Working Style
25
+
26
+ Use subagents only for genuinely parallel, independent tasks. For sequential work, single-file edits, searches, and file reads, work directly — do not spawn subagents.
27
+
20
28
  ## How to Fix
21
29
 
22
30
  1. You are already in the correct worktree on branch `{{pr_branch}}`. Do NOT create additional worktrees.
@@ -45,6 +45,14 @@ git push origin {{branch_name}}
45
45
  - Remove the worktree — the next plan item needs it
46
46
  - Create a new worktree — one already exists at `{{worktree_path}}`
47
47
 
48
+ ## Health Check
49
+
50
+ Before starting work, run `git status` and verify the worktree is clean and on the expected branch (`{{branch_name}}`). If the worktree is dirty or on the wrong branch, report the issue and stop.
51
+
52
+ ## Working Style
53
+
54
+ Use subagents only for genuinely parallel, independent tasks. For sequential work, single-file edits, searches, and file reads, work directly — do not spawn subagents.
55
+
48
56
  ## Instructions
49
57
 
50
58
  1. Read relevant source code and reference implementations before writing anything
@@ -30,6 +30,14 @@ If this feature spans multiple projects, you may need to:
30
30
  3. If changes are needed in other projects, create separate worktrees and PRs for each
31
31
  4. Note cross-repo dependencies in PR descriptions (e.g., "Requires office-bohemia PR #123")
32
32
 
33
+ ## Health Check
34
+
35
+ Before starting work, run `git status` and verify the worktree is clean and on the expected branch. If the worktree is dirty or on the wrong branch, report the issue and stop.
36
+
37
+ ## Working Style
38
+
39
+ Use subagents only for genuinely parallel, independent tasks (e.g., editing files in unrelated modules simultaneously). For sequential work, single-file edits, searches, and file reads, work directly — do not spawn subagents.
40
+
33
41
  ## Instructions
34
42
 
35
43
  1. Read relevant source code and reference implementations before writing anything
@@ -11,6 +11,10 @@ Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
11
11
  Review **{{pr_id}}**: {{pr_title}}
12
12
  Branch: `{{pr_branch}}`
13
13
 
14
+ ## Working Style
15
+
16
+ Use subagents only for genuinely parallel, independent tasks (e.g., reviewing unrelated files simultaneously). For reading diffs, checking patterns, and writing the review, work directly — do not spawn subagents.
17
+
14
18
  ## How to Review
15
19
 
16
20
  1. Fetch latest and read the diff:
package/playbooks/test.md CHANGED
@@ -26,6 +26,10 @@ This is a **test/build/run task**. Your goal is to build, run, test, or verify s
26
26
  5. **Test** if the task asks for it (e.g., `yarn test`, `pytest`, etc.)
27
27
  6. **Report results** — what worked, what failed, build output, test results, localhost URL if running
28
28
 
29
+ ## Working Style
30
+
31
+ Use subagents only for genuinely parallel, independent tasks. For building, testing, and reporting results, work directly — do not spawn subagents.
32
+
29
33
  ## Rules
30
34
 
31
35
  - **Do NOT create pull requests** — this is a test/verification task only
@@ -209,6 +209,10 @@ For each project worktree:
209
209
 
210
210
  4. Note the E2E PR URLs in the testing guide.
211
211
 
212
+ ## Working Style
213
+
214
+ Use subagents only for genuinely parallel, independent tasks (e.g., building separate project worktrees simultaneously). For sequential steps like reading docs, running tests, and writing the report, work directly — do not spawn subagents.
215
+
212
216
  ## Rules
213
217
 
214
218
  - **Read the project docs first** — never assume a build system, language, or framework