@yemi33/minions 0.1.334 → 0.1.336

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,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.336 (2026-04-03)
4
+
5
+ ### Fixes
6
+ - CC session auto-invalidated when system prompt changes after restart
7
+ - clear stale buildStatus when PRs are merged or abandoned
8
+
3
9
  ## 0.1.334 (2026-04-03)
4
10
 
5
11
  ### Features
package/dashboard.js CHANGED
@@ -277,8 +277,17 @@ let ccInFlight = false;
277
277
  let ccInFlightSince = 0; // timestamp — auto-release stuck guard
278
278
  const CC_INFLIGHT_TIMEOUT_MS = 2 * 60 * 1000; // 2 minutes — auto-release if request hangs
279
279
 
280
+ // Hash the system prompt so we can detect changes and invalidate stale sessions
281
+ const _ccPromptHash = require('crypto').createHash('md5').update(CC_STATIC_SYSTEM_PROMPT).digest('hex').slice(0, 8);
282
+
280
283
  function ccSessionValid() {
281
284
  if (!ccSession.sessionId) return false;
285
+ // Invalidate session if system prompt changed (e.g. after code update + restart)
286
+ if (ccSession._promptHash && ccSession._promptHash !== _ccPromptHash) {
287
+ console.log('[CC] System prompt changed — invalidating stale session');
288
+ ccSession = { sessionId: null, createdAt: null, lastActiveAt: null, turnCount: 0 };
289
+ return false;
290
+ }
282
291
  const age = Date.now() - new Date(ccSession.lastActiveAt || 0).getTime();
283
292
  return age < CC_SESSION_EXPIRY_MS && ccSession.turnCount < CC_SESSION_MAX_TURNS;
284
293
  }
@@ -553,6 +562,7 @@ function updateSession(store, key, sessionId, existing) {
553
562
  createdAt: existing ? ccSession.createdAt : now,
554
563
  lastActiveAt: now,
555
564
  turnCount: (existing ? ccSession.turnCount : 0) + 1,
565
+ _promptHash: _ccPromptHash,
556
566
  };
557
567
  safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
558
568
  } else if (key) {
@@ -3052,7 +3062,7 @@ What would you like to discuss or change? When you're happy, say "approve" and I
3052
3062
  // Update session
3053
3063
  const now = Date.now();
3054
3064
  if (result.sessionId) {
3055
- ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1 };
3065
+ ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1, _promptHash: _ccPromptHash };
3056
3066
  safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
3057
3067
  }
3058
3068
 
package/engine/ado.js CHANGED
@@ -146,6 +146,12 @@ async function pollPrStatus(config) {
146
146
  pr.reviewStatus = newStatus === PR_STATUS.MERGED ? 'approved' : 'pending';
147
147
  log('info', `PR ${pr.id} reviewStatus: waiting → ${pr.reviewStatus} (${newStatus})`);
148
148
  }
149
+ // Clear stale build status — checks won't be polled after close
150
+ if (pr.buildStatus && pr.buildStatus !== 'none') {
151
+ delete pr.buildStatus;
152
+ delete pr.buildFailReason;
153
+ delete pr._buildFailNotified;
154
+ }
149
155
  await engine().handlePostMerge(pr, project, config, newStatus);
150
156
  }
151
157
  }
package/engine/github.js CHANGED
@@ -152,6 +152,12 @@ async function pollPrStatus(config) {
152
152
  pr.reviewStatus = newStatus === PR_STATUS.MERGED ? 'approved' : 'pending';
153
153
  log('info', `PR ${pr.id} reviewStatus: waiting → ${pr.reviewStatus} (${newStatus})`);
154
154
  }
155
+ // Clear stale build status — checks won't be polled after close
156
+ if (pr.buildStatus && pr.buildStatus !== 'none') {
157
+ delete pr.buildStatus;
158
+ delete pr.buildFailReason;
159
+ delete pr._buildFailNotified;
160
+ }
155
161
  await engine().handlePostMerge(pr, project, config, newStatus);
156
162
  }
157
163
  }
@@ -293,6 +293,14 @@ function renderPlaybook(type, vars) {
293
293
  log('warn', `Playbook "${type}": substituted values contain unresolved {{...}} patterns (potential self-reference): ${selfRefVars.join(', ')}`);
294
294
  }
295
295
 
296
+ // Warn when a substituted value itself contains {{...}} patterns (potential self-reference)
297
+ const selfRefVars = Object.entries(allVars)
298
+ .filter(([, val]) => /\{\{\w+\}\}/.test(String(val)))
299
+ .map(([key]) => key);
300
+ if (selfRefVars.length > 0) {
301
+ log('warn', `Playbook "${type}": substituted values contain unresolved {{...}} patterns (potential self-reference): ${selfRefVars.join(', ')}`);
302
+ }
303
+
296
304
  // Warn on variables that resolved to empty string
297
305
  const emptyVars = Object.entries(allVars)
298
306
  .filter(([, val]) => String(val) === '')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.334",
3
+ "version": "0.1.336",
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"
@@ -102,7 +102,7 @@ Structure your report exactly like this:
102
102
 
103
103
  ## Auto-file Work Items on Failure
104
104
 
105
- If the build OR tests fail, you MUST create a work item so another agent can fix it. Write a JSON entry to the project's work queue:
105
+ If the build or tests fail, create a work item so another agent can fix it. Write a JSON entry to the project's work queue:
106
106
 
107
107
  ```bash
108
108
  # Read existing items, append new one, write back
@@ -17,7 +17,7 @@ Implement PRD item **{{item_id}}: {{item_name}}**
17
17
 
18
18
  This is part of a **shared-branch plan**. Other agents may have already committed work to this branch before you. Your job is to build on top of their work.
19
19
 
20
- ## Git Workflow (SHARED BRANCH — CRITICAL)
20
+ ## Git Workflow (Shared Branch)
21
21
 
22
22
  Your worktree is already set up. Pull latest before starting:
23
23
 
@@ -54,7 +54,7 @@ git push origin {{branch_name}}
54
54
 
55
55
  ## Build and Verify
56
56
 
57
- After implementation, you MUST:
57
+ After implementation:
58
58
  1. Build the project using the repo's build system (check CLAUDE.md, package.json, README)
59
59
  2. Verify the build succeeds with your changes AND all prior commits on this branch
60
60
  3. If the build fails:
@@ -58,7 +58,7 @@ Do NOT remove the worktree — the engine handles cleanup automatically.
58
58
 
59
59
  ## Build and Demo Rule
60
60
 
61
- After implementation, you MUST:
61
+ After implementation:
62
62
  1. Build the project using the repo's build system (check CLAUDE.md, package.json, README)
63
63
  2. Start if applicable
64
64
  3. Include the browser URL and run instructions in the PR description
@@ -71,7 +71,7 @@ After building, verify the build succeeded. If the build fails:
71
71
 
72
72
  ## Test Validation (MANDATORY before PR)
73
73
 
74
- Before creating a PR, you MUST run the project's test suite and ensure all existing tests pass:
74
+ Before creating a PR, run the project's test suite and ensure all existing tests pass:
75
75
 
76
76
  1. Find the test command by reading the project's own documentation — check CLAUDE.md, agent.md, README, or package.json scripts in the project root. Every project defines its own conventions.
77
77
  2. Run the full test suite using whatever command the project specifies
@@ -18,7 +18,7 @@ A user has provided a plan. Analyze it against the codebase and produce a struct
18
18
  3. **Break the plan into discrete, implementable items** — each should be a single PR's worth of work
19
19
  4. **Estimate complexity** — `small` (< 1 file), `medium` (2-5 files), `large` (6+ files or cross-cutting)
20
20
  5. **Order by dependency** — items that others depend on come first
21
- 6. **Use unique item IDs** — generate a short uuid for each item (e.g. `P-a3f9b2c1`). NEVER use sequential `P001`/`P002` — IDs must be globally unique across all PRDs to avoid collisions
21
+ 6. **Use unique item IDs** — generate a short uuid for each item (e.g. `P-a3f9b2c1`). Do not use sequential `P001`/`P002` — IDs must be globally unique across all PRDs to avoid collisions
22
22
  7. **Identify open questions** — flag anything ambiguous in the plan that needs user input
23
23
 
24
24
  ## Output
@@ -83,7 +83,7 @@ When using `parallel`:
83
83
 
84
84
  Rules for items:
85
85
  - IDs must be `P-<uuid>` format (e.g. `P-a3f9b2c1`) — globally unique, never sequential
86
- - **`status` MUST always be `"missing"`no exceptions.** Do NOT set `done`, `complete`, `implemented`, or any other value, even if you observe active PRs or completed work in the codebase. Status is exclusively engine-managed after the PRD is written. Pre-setting any other status causes items to be silently skipped by the engine and breaks dependency resolution for all downstream items.
86
+ - **`status` is always `"missing"`**do not set `done`, `complete`, `implemented`, or any other value, even if you observe active PRs or completed work in the codebase. Status is exclusively engine-managed after the PRD is written. Pre-setting any other status causes items to be silently skipped by the engine and breaks dependency resolution for all downstream items.
87
87
  - **`project` field is REQUIRED** — set it to the project name where the code changes go (e.g., `"OfficeAgent"`, `"office-bohemia"`). Cross-repo plans must route each item to the correct project. The engine materializes items into that project's work queue.
88
88
  - `depends_on` lists IDs of items that must be done first
89
89
  - Keep descriptions actionable — an implementing agent should know exactly what to build
@@ -38,7 +38,7 @@ Branch: `{{pr_branch}}`
38
38
 
39
39
  ## Post Review — Comment AND Vote on PR
40
40
 
41
- You MUST do both of the following:
41
+ Do both of the following:
42
42
 
43
43
  ### Step 1: Leave a detailed review comment
44
44
 
@@ -61,7 +61,7 @@ This vote is visible to human reviewers in the PR UI and helps them understand t
61
61
  If you encounter merge conflicts (e.g., the PR shows conflicts):
62
62
  1. Note the conflict in your review comment. Do NOT attempt to resolve — flag it for the author.
63
63
 
64
- ## CRITICAL: Do NOT run git checkout on the main working tree. Use `git diff` and `git show` only.
64
+ ## Do not run git checkout on the main working tree. Use `git diff` and `git show` only.
65
65
 
66
66
  ## Signal Completion
67
67
 
package/playbooks/test.md CHANGED
@@ -37,7 +37,7 @@ This is a **test/build/run task**. Your goal is to build, run, test, or verify s
37
37
 
38
38
  ## Run Command (IMPORTANT)
39
39
 
40
- When the build succeeds and the task involves running a server or app, you MUST output a ready-to-paste run command using **absolute paths** so the user can launch it from any terminal. Format it exactly like this:
40
+ When the build succeeds and the task involves running a server or app, output a ready-to-paste run command using **absolute paths** so the user can launch it from any terminal. Format it exactly like this:
41
41
 
42
42
  ```
43
43
  ## Run Command
@@ -218,7 +218,7 @@ For each project worktree:
218
218
  - If a project doesn't build, still document what SHOULD be testable once fixed
219
219
  - Do NOT fix code — only report issues
220
220
  - Leave all worktrees in place for the user to inspect
221
- - The application MUST be started **detached** so it keeps running after your process exits
221
+ - Start the application **detached** so it keeps running after your process exits
222
222
  - Use absolute paths everywhere so the user can copy-paste commands
223
223
  - E2E PRs are for review only — do NOT auto-complete or merge them
224
224
 
@@ -53,7 +53,7 @@ Write your findings to: `{{team_root}}/notes/inbox/{{agent_id}}-{{item_id}}-{{da
53
53
  **Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
54
54
 
55
55
  ## Rules
56
- - NEVER checkout branches in the main working tree — use worktrees
56
+ - Do not checkout branches in the main working tree — use worktrees
57
57
  - Use the repo host's MCP tools for PR creation — check available MCP tools before starting
58
58
  - Use PowerShell for build commands on Windows if applicable
59
59
  - If you discover a repeatable workflow, output it as a ```skill block (the engine auto-extracts it to ~/.claude/skills/)