@yemi33/minions 0.1.1564 → 0.1.1565

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1565 (2026-04-27)
4
+
5
+ ### Other
6
+ - docs(sched-weekly-docs-cleanup-1776960000531): sync stale references with current source (#1750)
7
+
3
8
  ## 0.1.1564 (2026-04-27)
4
9
 
5
10
  ### Other
@@ -11,8 +11,8 @@ tick()
11
11
  1. checkTimeouts() Kill stale/hung agents (>heartbeatTimeout)
12
12
  2. consolidateInbox() Merge learnings into notes.md (Haiku-powered)
13
13
  2.5 runCleanup() Periodic cleanup (every 10 ticks ≈ 10min)
14
- 2.6 pollPrStatus() Poll ADO for build, review, merge status (every 6 ticks ≈ 6min)
15
- 2.7 pollPrHumanComments() Poll PR threads for human @minions comments (every 12 ticks ≈ 12min)
14
+ 2.6 pollPrStatus() Poll ADO + GitHub for build, review, merge status (every prPollStatusEvery ticks, default 12 12min)
15
+ 2.7 pollPrHumanComments() Poll PR threads for human @minions comments (every prPollCommentsEvery ticks, default 12 ≈ 12min)
16
16
  3. discoverWork() Scan ALL linked projects for new tasks
17
17
  4. updateSnapshot() Write identity/now.md
18
18
  5. dispatch Spawn agents for pending items (up to maxConcurrent)
@@ -118,11 +118,11 @@ priority: high
118
118
 
119
119
  Both write to `work-items.json` and are picked up by Source 3 on the same or next tick.
120
120
 
121
- ## ADO PR Status Polling (`pollPrStatus`)
121
+ ## PR Status Polling (`pollPrStatus`)
122
122
 
123
- **Runs:** Every 6 ticks (≈ 6 minutes), independently of work discovery. Replaces the retired agent-based `pr-sync`.
123
+ **Runs:** Every `prPollStatusEvery` ticks (default 12, 12 minutes), independently of work discovery. ADO polling lives in `engine/ado.js`; GitHub polling lives in `engine/github.js` — both run in parallel each cycle (`Promise.allSettled`) and write to the same per-project `pull-requests.json` schema. Replaces the retired agent-based `pr-sync`.
124
124
 
125
- The engine directly polls the Azure DevOps REST API for **all** PR metadata: build/CI status, human review votes, and completion state. Two API calls per PR — no agent dispatch needed.
125
+ The engine directly polls the host REST API for **all** PR metadata: build/CI status, human review votes, and completion state. Two API calls per PR — no agent dispatch needed.
126
126
 
127
127
  **Per PR:**
128
128
  1. `GET pullrequests/{id}` → `status` (active/completed/abandoned), `mergeStatus`, `reviewers[].vote`
@@ -137,7 +137,7 @@ The engine directly polls the Azure DevOps REST API for **all** PR metadata: bui
137
137
  | `buildStatus` | PR statuses (codecoverage/deploy/build/ci contexts) | `passing` / `failing` / `running` / `none` |
138
138
  | `buildFailReason` | Failed status description | Set on failure, cleared otherwise |
139
139
 
140
- **Auth:** Bearer token via `azureauth ado token --output token --timeout 1` (cached 30 minutes). The `--timeout 1` flag is required — without it, azureauth can hang indefinitely in headless sessions.
140
+ **Auth:** Bearer token via `azureauth ado token --mode iwa --mode broker --output token --timeout 1` (cached 30 minutes). The `--timeout 1` flag is required — without it, azureauth can hang indefinitely in headless sessions. (GitHub polling uses the ambient `gh` CLI credentials, not azureauth.)
141
141
 
142
142
  This feeds `discoverFromPrs` — when `buildStatus` flips to `"failing"`, the next discovery tick dispatches a fix agent. When `status` becomes `"merged"`, the PR drops out of active polling.
143
143
 
@@ -244,9 +244,12 @@ Combines:
244
244
 
245
245
  ### 5. Spawn Claude CLI
246
246
  ```bash
247
- claude -p <prompt-file> --system-prompt <sysprompt-file> \
248
- --output-format json --max-turns 100 --verbose \
249
- --allowedTools Edit,Write,Read,Bash,Glob,Grep,Agent,WebFetch,WebSearch
247
+ claude -p --system-prompt-file <sysprompt-file> \
248
+ --output-format stream-json --max-turns 100 --verbose \
249
+ --permission-mode bypassPermissions
250
+ # Prompt text is piped via stdin (not passed as an arg).
251
+ # Agent dispatches route through engine/spawn-agent.js; CC / doc-chat use a direct
252
+ # spawn path in engine/llm.js that bypasses spawn-agent.js entirely.
250
253
  ```
251
254
 
252
255
  - Process runs in the worktree directory (or rootDir for reviews)
@@ -325,8 +328,8 @@ docs/**/*.md (specs)┤ (each tick) ┌──────────┐
325
328
  plans/*.md ─────┘ ▼ │
326
329
  addToDispatch()────────┘
327
330
 
328
- ADO REST API ─── pollPrBuildStatus() ──► pull-requests.json
329
- (every 6min) (buildStatus field)
331
+ ADO + GitHub REST ── pollPrStatus() ──► pull-requests.json
332
+ (every ~12min) (buildStatus field)
330
333
  spawnAgent()
331
334
 
332
335
  ┌────────────┼────────────┐
@@ -13,7 +13,7 @@ CC maintains a true multi-turn session using Claude CLI's `--resume` flag. Unlik
13
13
  **Session lifecycle:**
14
14
  - **Created** on first message (or after the system prompt changes, or when you click **New Session**)
15
15
  - **Resumed** on subsequent messages via `--resume <sessionId>`
16
- - **Invalidated** only when the CC system prompt changes — detected by hashing `CC_STATIC_SYSTEM_PROMPT` into `_ccPromptHash` and comparing on each call. There is no time-based expiry and no turn cap (`CC_SESSION_MAX_TURNS = Infinity`).
16
+ - **Invalidated** when the CC system prompt changes — detected by hashing `CC_STATIC_SYSTEM_PROMPT` into `_ccPromptHash` and comparing on each call. Sessions are also bounded by `ENGINE_DEFAULTS.ccMaxTurns` (default 50 turns) and `ENGINE_DEFAULTS.ccSessionTtlMs` (default 2h — resumed sessions older than this get rotated).
17
17
  - **Persisted** to `engine/cc-session.json` — survives dashboard restarts
18
18
  - **Frontend messages** saved to `localStorage` — survive page refresh
19
19
 
@@ -117,9 +117,10 @@ POST /api/command-center (or /api/doc-chat, /api/steer-document)
117
117
  │ timeout: 600s (CC) or 300s (doc-plan) or 60s (doc-other)
118
118
 
119
119
 
120
- spawn-agent.js
120
+ engine/llm.js callLLM({ direct: true }) (bypasses engine/spawn-agent.js — CC + doc-chat only)
121
121
 
122
- ├── If --resume: skip system prompt file, pass -p --resume <id>
122
+ ├── Resolves claude CLI binary path from engine/claude-caps.json
123
+ ├── If --resume: pass -p --resume <id> (no system prompt file)
123
124
  ├── If new: pass -p --system-prompt-file <file>
124
125
 
125
126
 
@@ -143,8 +144,8 @@ Frontend
143
144
 
144
145
  | File | Role |
145
146
  |------|------|
146
- | `engine/llm.js` | `callLLM()` — single LLM function with optional `sessionId` for resume |
147
- | `engine/spawn-agent.js` | Spawns claude CLI; skips system prompt on `--resume` |
147
+ | `engine/llm.js` | `callLLM()` / `callLLMStreaming()` — single LLM function with optional `sessionId` for resume; `direct: true` spawns claude CLI directly (used by CC + doc-chat) |
148
+ | `engine/spawn-agent.js` | Agent dispatch wrapper — resolves claude CLI path and invokes it. **Not used by CC/doc-chat** (direct spawn path). |
148
149
  | `engine/shared.js` | `parseStreamJsonOutput()` extracts `sessionId` from result |
149
150
  | `engine/cc-session.json` | Persisted session state (sessionId, turnCount, timestamps) |
150
151
  | `dashboard.js` | CC endpoint, `buildCCStatePreamble()`, `ccDocCall()`, `parseCCActions()` |
@@ -22,7 +22,7 @@ Minions persists all runtime state as flat JSON files guarded by file-lock-based
22
22
  | `engine/metrics.json` | 5 KB | Per-agent stats | R/W on PR approval/merge | Low | Low |
23
23
  | `engine/control.json` | 169 B | Single object | R/W on start/stop/heartbeat | Low | Low |
24
24
  | `projects/*/work-items.json` | 370 KB | 180 items | R/W every 1-2 ticks; dashboard reads on-demand | **High** — engine + lifecycle + dashboard | High |
25
- | `projects/*/pull-requests.json` | 241 KB | 128 PRs | R/W every 6 ticks (polling); lifecycle writes | Medium | Medium |
25
+ | `projects/*/pull-requests.json` | 241 KB | 128 PRs | R/W every `prPollStatusEvery` ticks (default 12, polling); lifecycle writes | Medium | Medium |
26
26
  | `engine/pipeline-runs.json` | 36 KB | Pipeline state | R/W on pipeline execution | Low | Low |
27
27
  | `engine/schedule-runs.json` | 115 B | Last-run times | R every 10 ticks; W on schedule execution | Low | Low |
28
28
 
@@ -56,7 +56,7 @@ Key properties:
56
56
  | Engine tick cycle | ~15 | ~3 | Heavy read, selective write |
57
57
  | Dashboard (per page load) | ~8 | 0 | Read-only display |
58
58
  | Dashboard (user action) | ~2 | ~2 | Read-modify-write |
59
- | PR polling (every 6 ticks) | ~4 | ~2 | Batch read-modify-write |
59
+ | PR polling (every `prPollStatusEvery` ticks, default 12) | ~4 | ~2 | Batch read-modify-write |
60
60
  | Consolidation (every 10 ticks) | ~3 | ~2 | Read inbox files, write notes.md |
61
61
 
62
62
  **Read:write ratio is approximately 8:1.** This strongly favors a system that can serve reads without locking (e.g., WAL mode).
@@ -46,7 +46,7 @@ These run continuously without you:
46
46
  - **Work discovery** — engine scans all project queues every tick (~60s)
47
47
  - **Agent dispatch** — engine picks the right agent, builds the prompt, spawns Claude
48
48
  - **Worktree management** — create on dispatch, pull on shared-branch, clean after merge
49
- - **PR status polling** — checks ADO for build status, review votes, merge state every ~6 min
49
+ - **PR status polling** — checks ADO + GitHub for build status, review votes, merge state every ~12 min
50
50
  - **Build failure detection** — auto-files fix tasks when CI fails
51
51
  - **Inbox consolidation** — LLM-powered dedup and categorization when inbox hits threshold
52
52
  - **Knowledge base classification** — auto-assigns category to consolidated notes
@@ -52,7 +52,7 @@ How the engine manages the lifecycle of a PR from creation through review, fix,
52
52
 
53
53
  ## 6. Re-review cycle
54
54
 
55
- - Poller (~3min): detects new commit (`head.sha` changed) → sets `lastPushedAt`
55
+ - Poller (every `prPollStatusEvery` ticks, default ~12min): detects new commit (`head.sha` changed) → sets `lastPushedAt`
56
56
  - Platform review state drives next action:
57
57
  - Reviewer approves → `approved` → done
58
58
  - Reviewer re-requests changes → `changes-requested` → triggers another fix
@@ -158,7 +158,7 @@ Without this, review findings only exist in the inbox file under the reviewer's
158
158
 
159
159
  ## 4. Human Feedback on PRs
160
160
 
161
- Humans can leave comments on ADO PRs containing `@minions` to trigger fix tasks. The engine polls PR threads every ~6 minutes and dispatches fixes to the PR's author agent.
161
+ Humans can leave comments on ADO or GitHub PRs containing `@minions` to trigger fix tasks. The engine polls PR threads every ~12 minutes (see `prPollCommentsEvery` in `engine/shared.js`) and dispatches fixes to the PR's author agent.
162
162
 
163
163
  ### Flow
164
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1564",
3
+ "version": "0.1.1565",
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"
@@ -53,7 +53,7 @@ Your context window may be compacted or summarized mid-task by Claude's automati
53
53
 
54
54
  When asked to check build status, CI results, or review state for a PR:
55
55
 
56
- **Preferred — read cached state (always fresh within ~3 min when engine is running):**
56
+ **Preferred — read cached state (refreshed every `prPollStatusEvery` ticks, default ~12 min when engine is running):**
57
57
  Find the PR in `projects/<project-name>/pull-requests.json` by `prNumber`. Key fields:
58
58
  - `buildStatus` — `passing` | `failing` | `running` | `none`
59
59
  - `buildErrorLog` — compiler/pipeline errors when `buildStatus` is `failing`