@ferris1225/pi-subagents 4.3.0 → 4.3.1

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
@@ -4,6 +4,25 @@ Published versions of `@ferris1225/pi-subagents`. Unpublished numbers
4
4
  (`4.2.3`, `4.2.6`, `4.2.9`–`4.2.11`) never shipped on npm; their changes
5
5
  landed in the next published release.
6
6
 
7
+ ## 4.3.1
8
+
9
+ - Make phase ownership explicit and reject an exact active duplicate by normalized
10
+ task plus resolved working directory, regardless of agent name.
11
+ - Route each result exactly once: `wait: true` owns in-turn delivery, background
12
+ completions use follow-up wakeups, and immediate failures flush earlier successes.
13
+ - Move worktree preparation under the bounded queue, release child-process slots
14
+ before Git finalization, and report repository-lane versus process-slot waits
15
+ accurately.
16
+ - Keep missing restored worktrees failed, retained, and non-resumable; compute RPC
17
+ usage from generation-safe session-stat deltas.
18
+ - Store the worktree recovery manifest under `ferris-pi-subagents/`, relocating
19
+ an existing agent-root manifest without losing retained artifact pointers.
20
+ - Enforce a strict read-only scout tool set and strict declared-tool intersection.
21
+ Unknown custom tools remain conservatively write-capable for isolation.
22
+ - Honor `enabledAgents`, including `[]`, without auto-enabling roles. Remove the
23
+ completed role/config migration bridge and shorten role prompts, tool metadata,
24
+ launch receipts, and handoffs.
25
+
7
26
  ## 4.3.0
8
27
 
9
28
  - Built-in team is `scout`, `artisan`, and `steward`. All three stay enabled.
package/README.md CHANGED
@@ -12,17 +12,11 @@ isolation. You install it once and your main agent delegates on its own.
12
12
 
13
13
  ## What's new
14
14
 
15
- **4.3.0** — the team is `scout`, `artisan`, and `steward`. Existing
16
- `explorer`/`executor` configs migrate. Thinking is a role default you can
17
- change in `/subagents-setup` (no Auto, no per-call flag). All three roles
18
- start on. See [CHANGELOG.md](./CHANGELOG.md).
19
-
20
- **4.2.13** — this page now leads with current changes and keeps the 4.2 line
21
- in the changelog.
22
-
23
- **4.2.12**
24
-
25
- - Confirm-before-fix; honest footer counts; `main` publishes npm + GitHub Release.
15
+ **4.3.1** — phase ownership prevents duplicate paid work, completion delivery
16
+ is exactly once, worktree setup obeys the bounded queue, and final integration
17
+ releases its child-process slot. Scout now has a strict read-only tool boundary;
18
+ `enabledAgents` is authoritative, including `[]`. Role prompts and launch receipts
19
+ are shorter and cost-aware. See [CHANGELOG.md](./CHANGELOG.md).
26
20
 
27
21
  ## Contents
28
22
 
@@ -48,17 +42,19 @@ at "spawn a child with a prompt" and leave the hard parts — when to delegate,
48
42
  wide to fan out, what happens when a model dies, how results come
49
43
  back — with you. This extension owns them:
50
44
 
51
- - The main model delegates without being asked, because a delegation directive is
52
- always in its system prompt.
53
- - Dispatching never blocks or ends the main turn, so it can start several runs and
54
- keep working while they execute.
55
- - Results deliver themselves. There is no status tool to poll and no lookup step.
56
- - Parallel writers get their own Git worktrees, so concurrent edits do not collide
57
- and your index is never touched.
58
- - Threads keep their context across resume, stop, reload, and crash; a dead model
59
- hands its session to the current main model instead of losing progress.
60
- - Crashes, partial starts, and integration failures come back as results with
61
- recovery records never as silent hangs.
45
+ - The main model gets a cost-aware routing contract and delegates only when a leaf
46
+ context saves more work than its handoff costs.
47
+ - One active normalized task and working directory owns its phase, so an exact
48
+ duplicate dispatch is rejected instead of paying twice.
49
+ - Background completions wake the main model; `wait: true` returns the same result
50
+ in-turn instead. A run uses exactly one route.
51
+ - Parallel writers use detached Git worktrees without touching your index.
52
+ Worktree setup obeys the bounded queue; final integration releases its process
53
+ slot.
54
+ - Interrupted threads retain their session for resume after reload or crash; a
55
+ configured child-model failure continues the same session on the main model.
56
+ - Start, restore, and integration failures surface with retained recovery paths
57
+ instead of becoming silent hangs.
62
58
 
63
59
  ## Install
64
60
 
@@ -68,10 +64,10 @@ Requires **pi >= 0.84.4** and **Node.js >= 22.19.0**.
68
64
  pi install npm:@ferris1225/pi-subagents
69
65
  ```
70
66
 
71
- Open pi and run `/subagents-setup`. The first session tells you how: pick a
72
- model for `scout`, `artisan`, and `steward` (all three stay on). Each row in
73
- the wizard names the role and what it owns. Thinking has a role default you
74
- can change there. Then just ask for work:
67
+ Open pi and run `/subagents-setup`. Choose the enabled roles, then pick a model
68
+ and optional thinking override for each. Fresh installs select all three, but
69
+ you can disable any role or use `[]` to disable delegation. Then just ask for
70
+ work:
75
71
 
76
72
  ```text
77
73
  Map how authentication works, fix the refresh race, run the tests, and review the diff.
@@ -82,11 +78,11 @@ directly when you want exact control.
82
78
 
83
79
  ## The team
84
80
 
85
- | Agent | Access | Best for |
86
- | ---------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
- | `scout` | Read-only | Broad search, unfamiliar-area mapping, symbol and dependency tracing. Returns a retrieval index — never proof. A single artifact the main agent must fully absorb (one issue, one spec) stays an inline read. |
88
- | `artisan` | Full | One deliverable that changes the repository: implement, fix, refactor, or test — confirmed on current code, then verified, then a result-only handoff. |
89
- | `steward` | Full | Use only when that work exists: evidence-first cleanup, docs/comment sync, or merging a fan-out's result artifacts into one brief. |
81
+ | Agent | Access | Owns |
82
+ | --------- | --------- | ---- |
83
+ | `scout` | Read-only | Broad or unfamiliar reconnaissance with compact findings and decisive citations. Its output is a retrieval lead, not proof. |
84
+ | `artisan` | Full | A substantial self-contained implementation, including affected tests, docs, comments, targeted checks, and local cleanup. |
85
+ | `steward` | Full | One pre-commit cleanup or cross-cutting docs/comments pass after a broad or multi-writer change is complete. |
90
86
 
91
87
  Custom roles join them with a Markdown file (see [Custom agents](#custom-agents)).
92
88
 
@@ -94,17 +90,6 @@ Every child is an isolated leaf pi process with its own context window and no
94
90
  memory of your conversation, so the brief is its only input. A good brief carries
95
91
  the goal, exact paths, constraints, and expected output — which is what the
96
92
  injected delegation guidance produces when the main agent dispatches for you.
97
- A named defect is not yet a change: confirm it on current code before fixing
98
- or briefing a fix. The artisan re-reads before it edits. Steward is
99
- dispatched only when cleanup, docs sync, or a merge is actually needed.
100
-
101
- ```text
102
- You
103
- └─ pi main agent
104
- ├─ scout ─── parallel recon, retrieval leads only
105
- ├─ artisan ─── implement, fix, refactor, or test → verify → deliver
106
- └─ steward ─── cleanup, docs sync, or merge fan-out results (when needed)
107
- ```
108
93
 
109
94
  ## Dispatching work
110
95
 
@@ -115,12 +100,11 @@ subagent({
115
100
  task: "Fix the cache invalidation bug in src/cache, add regression tests, run the checks.",
116
101
  });
117
102
 
118
- // Parallel: as many genuinely independent units as the work has
103
+ // Parallel only when each scope independently justifies a child
119
104
  subagent({
120
105
  tasks: [
121
- { agent: "scout", task: "Trace model fallback from dispatch to completion." },
122
- { agent: "artisan", task: "Add edge-case tests for config migration." },
123
- { agent: "steward", task: "Merge the result artifacts under results/ into one brief." },
106
+ { agent: "scout", task: "Map model fallback across src/rpc-run.ts and src/spawn.ts." },
107
+ { agent: "artisan", task: "Fix config validation in src/config.ts and its tests." },
124
108
  ],
125
109
  });
126
110
  ```
@@ -131,16 +115,20 @@ paces execution instead, running a pool of child processes that scales with the
131
115
  machine (half its cores, bounded to 4–16) and starting queued runs automatically
132
116
  as slots free.
133
117
 
118
+ An active run leases its normalized task and resolved working directory across
119
+ agent names. Dispatching the same pair again is rejected and names the existing
120
+ run id; it does not use fuzzy matching, and resuming that thread remains allowed.
121
+
134
122
  Because queueing is pacing rather than refusal, it is always reported as such.
135
123
  Dispatch confirmations name each waiting run's real reason — waiting for a free
136
124
  process slot, serialized behind the shared-checkout write lane, or already
137
125
  starting its child — alongside the slot capacity. A run that waits for the write
138
126
  lane releases its slot first, so serialized writers never starve new dispatches.
139
127
 
140
- One child owns one coherent deliverable and its files. Dependent work starts only
141
- after its prerequisite delivers. Verification belongs to whoever did the work:
142
- every child runs the checks it can and reports exactly which ones ran, and the
143
- main agent inspects the actual changes before calling anything done.
128
+ One child owns one coherent phase. Dependent work starts only after its
129
+ prerequisite delivers. Artisan owns the affected tests, docs, comments, targeted
130
+ checks, and local cleanup for its implementation. Scout stays read-only. Main
131
+ inspects the integrated diff and runs the final gate.
144
132
 
145
133
  ## Parallel edits
146
134
 
@@ -162,7 +150,7 @@ main agent inspects the actual changes before calling anything done.
162
150
  one repository lane, so two of them never race. A run waiting there is reported
163
151
  as a lane wait, not as slot queueing, and its process slot is already released.
164
152
  - Setup and integration failures keep the useful patch and worktree, and record
165
- where they are in `~/.pi/agent/pi-subagents-recovery.json`. Every later session
153
+ where they are in `~/.pi/agent/ferris-pi-subagents/pi-subagents-recovery.json`.
166
154
  start repeats that notice until you remove the artifacts. When the changes had
167
155
  already been applied and only the cleanup failed, the next session start
168
156
  removes the retained copy itself and clears the notice.
@@ -180,25 +168,27 @@ Every dispatch returns a stable `#id`, which is the handle for the thread tools:
180
168
  subagent_control({ action: "resume", id: 7, objective: "Finish the tests." });
181
169
  ```
182
170
 
183
- There is deliberately no status, polling, or wait tool. Every result delivers
184
- itself as a completion that wakes the main model, so a turn never blocks on a
185
- running subagent keep working or end the turn, and the completion continues
186
- it. The one in-turn block is `wait: true` on a dispatch, which holds that call
187
- until the runs it started settle: the escape hatch for one-shot `pi -p`
188
- parents, which exit at end of turn and would otherwise never see them. That
189
- wait runs on no timer and no timeout the model picks: it resolves the instant
190
- its run settles, a parked run answers immediately with its resume handle, and
191
- aborting the turn is the escape hatch. Control operations are all bounded, so
192
- they never hang on a generation that is still settling.
171
+ There is no status, polling, or separate wait tool. A background dispatch returns
172
+ a launch receipt, then its completion is delivered as a follow-up that wakes the
173
+ main model. `wait: true` instead holds that tool call until its new runs settle,
174
+ which is useful for one-shot `pi -p` sessions. It claims the delivery route before
175
+ launch, so the same result cannot also arrive as a background completion; if the
176
+ parent turn is aborted, delivery falls back to the completion path.
177
+
178
+ The wait has no timer chosen by the model: it resolves when its run settles, and
179
+ a parked run returns its resume handle. Control operations are bounded so they do
180
+ not hang on a generation that is still settling.
193
181
 
194
182
  A thread stays durable while its work is unfinished. Parked sessions, worktree
195
- checkpoints, and result excerpts are recorded in a manifest beside your config, so
196
- a pi reload, restart, or crash interrupts a run into a resumable checkpoint
197
- instead of losing it, and an isolated thread resumes in the worktree it was
198
- already working in. Restore happens at load, and everything that answers for a run
199
- waits for it `subagent_control`, `subagent_stop`, and a new dispatch before it
200
- takes an id so the first call after a reload can never report parked work as
201
- missing or hand its id to something else.
183
+ checkpoints, and result excerpts are recorded under the per-project storage root,
184
+ so reload, restart, or crash produces a resumable checkpoint. An isolated thread
185
+ continues in its original worktree.
186
+
187
+ Restore runs at session start. `subagent_control`, `subagent_stop`, prompt
188
+ injection, and new dispatches wait for it, so a parked id cannot be reported
189
+ missing or reused. If a recorded worktree is gone, the run is surfaced as failed
190
+ and non-resumable while its retained session and recovery record remain available
191
+ for inspection or destructive stop.
202
192
 
203
193
  Only interrupted work needs a record, so a thread that completes or fails cleanly
204
194
  drops its own. That also means a reload keeps interrupted threads resumable, while
@@ -282,33 +272,27 @@ no `thinking` field in agent Markdown. Precedence: your setup override > the
282
272
  role default, then the model clamp. There is no separate vision mode — assign
283
273
  a multimodal model and name the image paths in the task.
284
274
 
285
- Every dispatch, resume, retry, and fallback snapshots the parent's
286
- currently active tools. A role with no explicit list inherits the full set. An
287
- explicit list keeps its pi built-in boundary and gains active extension tools,
288
- while its shell slot follows the parent: a role file naming `bash` runs
289
- `powershell` when that is the shell you enabled. When you run both, the child gets
290
- the one that fits the host — PowerShell on Windows, Bash elsewhere — rather than
291
- two terminals to choose between. A child never receives a shell you disabled,
292
- since pi's `--tools` allowlist overrides its own `defaultTools`. Read-only roles
293
- never gain `edit` or `write`, and all `subagent*` tools are stripped so children
294
- stay leaves. An empty snapshot starts the child with `--no-tools`.
295
-
296
- Shell guidance in the shipped roles is portable for the same reason: they reach
297
- for pi's own `read`/`grep`/`find`/`ls` tools, which behave identically everywhere,
298
- and keep shell examples to `git` queries instead of POSIX binaries a PowerShell
299
- child cannot run.
275
+ Every dispatch, resume, retry, and fallback snapshots the parent's active tools,
276
+ and all `subagent*` tools are removed so children remain leaves. A role without
277
+ an explicit list inherits that snapshot; an explicit list is a strict
278
+ intersection, so active extension tools are available only when named. A declared
279
+ shell slot follows the parent's active shell on non-scout roles.
280
+
281
+ `scout` is a hard read-only boundary even when a project override omits or
282
+ overstates its tool list. The shipped scout uses only `read`, `grep`, `find`, and
283
+ `ls`; it receives no shell or unknown custom tool. Unknown tools declared by other
284
+ roles are conservatively treated as write-capable when isolation is chosen. An
285
+ empty resolved snapshot starts the child with `--no-tools`.
300
286
 
301
287
  ## Configuration
302
288
 
303
- `/subagents-setup` stays one level deep: the team (all three stay on), plus a
304
- model and optional thinking override per agent. First run explains each role
305
- before you pick models. Everything else is config-file only, stored at
289
+ `/subagents-setup` enables or disables roles and configures a model plus optional
290
+ thinking override for each enabled role. The same settings live in
306
291
  `~/.pi/agent/pi-subagents.json` (following `PI_CODING_AGENT_DIR`):
307
292
 
308
293
  ```json
309
294
  {
310
295
  "enabledAgents": ["scout", "artisan", "steward"],
311
- "knownAgents": ["scout", "artisan", "steward"],
312
296
  "agentModels": { "scout": "anthropic/claude-haiku-4-5" },
313
297
  "agentThinkingLevels": { "artisan": "high" },
314
298
  "maxResultLines": 40,
@@ -320,33 +304,20 @@ before you pick models. Everything else is config-file only, stored at
320
304
  | Field | Meaning |
321
305
  | --------------------- | --------------------------------------------------------------------------------- |
322
306
  | `enabledAgents` | Agents available for discovery and delegation. `[]` disables all. |
323
- | `knownAgents` | Built-ins this config has seen; automatic bookkeeping — never edit it. |
324
307
  | `agentModels` | Optional `provider/model-id` per agent; missing = current main model. |
325
308
  | `agentThinkingLevels` | Optional setup override per agent; missing = the role default. |
326
309
  | `maxResultLines` | Lines kept in a completion message before the artifact takes over. Default `40`. |
327
310
  | `agentScope` | Discover `user`, `project`, or `both` agent directories. Default `user`. |
328
311
  | `idleTimeoutSec` | Seconds without child RPC output before termination; `0` disables. Default `90`. |
329
312
 
330
- The delegation directive is always injected; there is no toggle. Invalid values
331
- fall back safely, and stale keys including the former `proactiveInjection`,
332
- `maxConcurrency`, `maxFixRounds`, and `notifyOnReviewPass` knobs are dropped
333
- automatically. Built-in roles a newer package no longer ships (such as the
334
- retired `worker`/`cleaner`/`documenter`/`synthesizer`/`reviewer` set, and the
335
- renamed `explorer`/`executor` names after they have been mapped) are pruned
336
- from `enabledAgents`, `knownAgents`, and the model/thinking tables at first
337
- load, so the setup wizard never mixes old and new roles; custom agents are
338
- untouched. A 4.2 config that still says `explorer`/`executor` is rewritten to
339
- `scout`/`artisan` and gains `steward`; their model and thinking overrides move
340
- with the names. That rename lives in `src/config.ts` and will be deleted in
341
- the next major. At session
342
- start, model overrides pi no longer reports are removed with a one-time notice. If
343
- pi's own session compaction fails mid-thread, a notice surfaces the error and the
344
- automatic retry instead of failing quietly.
345
-
346
- Agents shipped by a newer package version turn themselves on at the next
347
- session. Scout, artisan, and steward stay enabled even if a stale allow-list
348
- left one off. A one-shot notice then points at `/subagents-setup` so you can
349
- pick a model for each.
313
+ When at least one role is enabled, the cost-aware delegation directive is injected
314
+ automatically. `enabledAgents` is authoritative: the extension neither re-enables
315
+ a disabled role nor adopts or renames roles. Invalid known fields fall back safely,
316
+ and unknown fields are dropped when the canonical config is persisted.
317
+
318
+ At session start, model overrides that pi no longer reports are removed with a
319
+ one-time notice. If pi's own session compaction fails mid-thread, a notice surfaces
320
+ the error and automatic retry instead of failing quietly.
350
321
 
351
322
  ## Custom agents
352
323
 
@@ -361,7 +332,7 @@ Built-ins ship with the package. Add or replace them with Markdown files:
361
332
  name: scout
362
333
  description: Fast read-only codebase reconnaissance
363
334
  isolation: shared
364
- tools: read, bash
335
+ tools: read, grep, find, ls
365
336
  ---
366
337
  …additional system prompt…
367
338
  ```
@@ -369,8 +340,9 @@ tools: read, bash
369
340
  `description` is the routing line the main model reads. `isolation` pins the
370
341
  role's default boundary as described under [Parallel edits](#parallel-edits).
371
342
  Models come only from `/subagents-setup`; an agent file cannot pin one. An
372
- explicit `tools` list is the capability boundary, and omitting it inherits the
373
- parent's complete active set.
343
+ explicit `tools` list is intersected with the parent's active set; omitting it
344
+ inherits the active set. A role named `scout` is always reduced to the fixed
345
+ read-only tool set described above.
374
346
 
375
347
  ## Storage and cleanup
376
348
 
@@ -381,15 +353,15 @@ that removes it, so this directory does not grow without bound:
381
353
  | Path | Holds | Removed |
382
354
  | ------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------- |
383
355
  | `pi-subagents.json` | Your configuration | Never — it is yours |
384
- | `pi-subagents-recovery.json` | Worktree integration and cleanup failures | When the retained patch or worktree it points at is gone |
356
+ | `ferris-pi-subagents/pi-subagents-recovery.json` | Worktree integration and cleanup failures | When the retained patch or worktree it points at is gone |
385
357
  | `ferris-pi-subagents/<project>/pi-subagents-threads.json` | One record per interrupted thread | When the thread settles, or after 30 days |
386
- | `ferris-pi-subagents/<project>/sessions/` | Retained child sessions that a resume continues from | When the pi session that produced it ends, or its owner is gone |
387
- | `ferris-pi-subagents/<project>/worktrees/` | Isolated checkouts for parallel writers | On integration, or when its owning process is gone |
358
+ | `ferris-pi-subagents/<project>/sessions/` | Retained child sessions that a resume continues from | When the thread settles or its retained record is removed |
359
+ | `ferris-pi-subagents/<project>/worktrees/` | Isolated checkouts for parallel writers | On integration, or when no retained record claims them |
388
360
  | `ferris-pi-subagents/<project>/results/` | Full text of truncated results | After 7 days, or beyond 50 per project |
389
361
  | `ferris-pi-subagents/<project>/tmp/` | Child prompt copies and the no-retry policy shim | When its owning process exits |
390
362
  | `ferris-pi-subagents/<project>/` | All of the above for one checkout | When the whole directory has been idle for 3 days |
391
363
 
392
- Cleanup runs at extension load and is deliberately conservative. A directory goes
364
+ Cleanup runs at session start and is deliberately conservative. A directory goes
393
365
  away only when the process that created it is gone and no manifest record still
394
366
  claims it, so a live sibling pi instance never loses state and parked work
395
367
  outlives its own process by design — a reference from the threads manifest always
@@ -409,25 +381,11 @@ transport, worktree integration, completion delivery, tools, and TUI status.
409
381
 
410
382
  ## Changelog
411
383
 
412
- The 4.3 line lives in [CHANGELOG.md](./CHANGELOG.md). Latest published
413
- version is **4.3.0**.
414
-
415
- | Version | What changed |
416
- | ------- | ------------ |
417
- | 4.3.0 | Team is `scout` + `artisan` + `steward`; role thinking defaults; config migrate. |
418
- | 4.2.13 | README navigation, What's new, and this changelog. |
419
- | 4.2.12 | Confirm-before-fix; honest footer counts; `main` publishes npm + GitHub Release. |
420
- | 4.2.8 | Footer roll-up; wait-path token usage; hold completions across compaction. |
421
- | 4.2.7 | Sharper executor routing; per-dispatch `thinking`. |
422
- | 4.2.5 | Per-project threads manifest. |
423
- | 4.2.4 | One-line explorer findings; recovery cleanup retry. |
424
- | 4.2.2 | Single-artifact reads stay inline. |
425
- | 4.2.1 | Prune retired roles from upgraded configs. |
426
- | 4.2.0 | Team is `explorer` + `executor`; two-line live widget. |
384
+ See [CHANGELOG.md](./CHANGELOG.md) for published release notes.
427
385
 
428
386
  ## Release
429
387
 
430
- Merging to `main` publishes `@ferris1225/pi-subagents` when `package.json`
388
+ Pushing to `main` publishes `@ferris1225/pi-subagents` when `package.json`
431
389
  carries a version npm does not have yet, then opens a matching GitHub Release.
432
390
  Do not `npm publish` from a laptop. The workflow is
433
391
  `.github/workflows/publish.yml` (npm trusted publisher or `NPM_TOKEN`).
package/agents/artisan.md CHANGED
@@ -1,47 +1,19 @@
1
1
  ---
2
2
  name: artisan
3
- description: A self-contained unit that changes the repository implement, fix, refactor, or test — carried through verification to a result-only handoff.
4
- # No `tools` field => inherits all tools (full capability).
3
+ description: Owns a substantial implementation scope, including directly affected tests, docs, comments, and verification.
5
4
  ---
6
5
 
7
- You are an artisan with full capabilities in an isolated context window. You own one delegated implementation task end to end so the main conversation stays clean. You have NOT got the caller's conversation history — the task brief is your source of truth.
6
+ You own one implementation phase. The task brief is your only context.
8
7
 
9
- Repository instructions (AGENTS.md) and any skills available in this session apply to you as to any agent: follow their process for the domains they own (language style, tests, debugging, cleanup discipline, verification). Where a skill covers the same ground as this brief, the skill's discipline wins — except for the release boundary below, which always wins.
8
+ ## Rules
10
9
 
11
- Cleanup, documentation sync, and merging fan-out results belong to `steward`. If the brief is only that work, do not improvise it here — say so and stop.
10
+ - Inspect current code and confirm the defect before editing; a disproved issue means zero edits.
11
+ - Make the smallest coherent root-cause change. Preserve unrelated work and existing conventions; avoid speculative abstractions and unrelated cleanup.
12
+ - Own code refactors, directly affected tests, README/docs, comments, and local diff hygiene. Remove debug output, dead code, stale comments, and other debris introduced in your scope.
13
+ - Leave standalone docs and cross-cutting pre-commit cleanup for a completed broad or multi-writer change to `steward`.
14
+ - Run the smallest targeted check, then relevant project gates. Report unrun or pre-existing failures exactly; never imply a check passed when it did not run.
15
+ - You are a leaf: do not dispatch agents, bump versions, commit, push, publish, tag, or release.
12
16
 
13
- ## Procedure
17
+ ## Output
14
18
 
15
- 1. **Context.** Read the brief fully, plus referenced files and images, before acting. If critical context is missing, state what is missing rather than guessing.
16
- 2. **Plan.** Inspect existing code and conventions first; form the smallest coherent root-cause change that satisfies the brief. Prefer the design that deletes complexity over one that rearranges it. No unrelated refactors or standalone docs work unless the brief asks.
17
- 3. **Confirm.** A finding is not a change. Re-read the current code and confirm each defect you are about to fix is real — not a misread, a stale report, or an intended tradeoff — even when the brief said "fix it". A false positive means zero edits and a note.
18
- 4. **Implement.** Preserve the user's work; limit edits to the request plus required validation. Follow the project's error handling, naming, and style. Synchronize README/docs/comments your change directly affects; never defer that drift.
19
- 5. **Verify.** Run the project's format/build/tests when they exist. NEVER report an unrun check as passed — report it as unavailable or a pre-existing failure, with the exact error.
20
-
21
- ## Boundaries
22
-
23
- - Never commit, push, publish, tag, release, or bump a package version — the caller owns every release action, even when repository instructions normally automate release after green checks.
24
- - Children are leaf processes: you cannot dispatch sub-agents.
25
- - Never change runtime behavior to make documentation true; report the defect instead.
26
-
27
- ## Output format
28
-
29
- Return only the concrete outcome. Do not repeat the task brief, the plan, the root-cause investigation, or the tool chronology.
30
-
31
- ## Completed
32
-
33
- What was done, in a few lines.
34
-
35
- ## Files Changed
36
-
37
- - `path/to/file.ts` — what changed.
38
-
39
- ## Verification
40
-
41
- Which checks you ACTUALLY ran and their result (e.g. `tsc --noEmit` clean). State explicitly anything you could not run and why.
42
-
43
- ## Notes (only when material)
44
-
45
- Unresolved blockers, rejected requirements, or decisions the caller must know. Omit when nothing actionable.
46
-
47
- Keep the final response comfortably below the 40-line delivery cap unless the result genuinely requires more.
19
+ Return only the outcome, changed paths, checks run, and material blockers. No task restatement, plan, investigation narrative, or tool chronology.
package/agents/scout.md CHANGED
@@ -1,36 +1,18 @@
1
1
  ---
2
2
  name: scout
3
- description: Fast read-only reconnaissance for broad or multi-file search in unfamiliar areas; returns exact paths and compressed findings as retrieval leads.
4
- tools: read, grep, find, ls, bash
5
- # At launch, this shell slot follows the parent and parent-active plugin tools
6
- # are appended; the listed non-shell Pi built-ins remain the permission boundary.
3
+ description: Read-only reconnaissance for broad or unfamiliar code; returns compact, decisive citations.
4
+ tools: read, grep, find, ls
7
5
  ---
8
6
 
9
- You are a scout: a fast, read-only reconnaissance specialist. You investigate a codebase and return compressed, structured findings so another agent does not repeat the whole search. You have NOT got the caller's conversation history — the task brief is your only input.
7
+ You own one broad reconnaissance phase. Atomic lookups and known locations stay with main. The task brief is your only context.
10
8
 
11
- ## Hard constraints
9
+ ## Rules
12
10
 
13
- - You are READ-ONLY. Never create, edit, or delete files; never run mutating commands. Reach for your `read`/`grep`/`find`/`ls` tools before the shell — they behave the same on every platform, while the shell you were given may be POSIX or PowerShell. Keep shell use to read-only inspection (`git log/show/diff/status` and that shell's own read-only commands); no installs, builds, or state changes. Permissions are not perfectly enforceable — keep every command strictly read-only by intent.
14
- - Every finding is a retrieval lead, never sufficient proof for deletion, security claims, public/API compatibility, persistence, or other load-bearing decisions. The caller must re-read the cited line ranges before acting on your results.
11
+ - Stay read-only: never create, edit, delete, install, build, or run commands. Use `read`/`grep`/`find`/`ls` only.
12
+ - Findings are retrieval leads, not proof for deletion, security, compatibility, or persistence decisions. Cite decisive lines so main can plan without repeating the search; a later actor rechecks only source needed for its own decision or edit.
13
+ - Search broadly once, then read key sections and follow relevant imports, callers, tests, and types. Cluster related questions instead of running a series of small searches.
14
+ - Read requested images when relevant. State real gaps instead of guessing.
15
15
 
16
- ## Workflow
16
+ ## Output
17
17
 
18
- 1. Orient with `grep`/`find` to locate the relevant code fast. Prefer bare identifiers as patterns; scope by path and exclude noisy dirs (node_modules, dist, generated).
19
- 2. Read KEY SECTIONS, not whole files. After 1-2 greps, read the top match instead of running more greps.
20
- 3. Identify the types, interfaces, and key function signatures involved; note how files depend on each other.
21
- 4. Record exact paths and line ranges so the caller can jump straight in.
22
- 5. If the brief asks you to inspect images (screenshots, mockups, designs), `read` them — the model receives them as attachments when it supports vision.
23
-
24
- Thoroughness scales with the task (default medium): quick = targeted lookups in key files; medium = follow imports and callers, read critical sections; thorough = trace dependencies across modules, check tests and types.
25
-
26
- ## Final response
27
-
28
- Return only retrieval results, one bare bullet per finding — a single line: path, the fact, nothing else:
29
-
30
- ```text
31
- - `path/to/file.ts:10-50` — the fact
32
- Start here: `path/to/file.ts` — entry symbol and why (only when the caller could not guess it)
33
- Gaps: unresolved uncertainty (only when real)
34
- ```
35
-
36
- No preamble or closing summary. Do not repeat the task brief, inventory every file opened, paste nonessential code, or narrate the search; every line must carry a path with a fact or name a gap — delete anything else. State uncertainty and missing coverage — a plausible guess is more expensive than an honest gap. Stay under 15 lines by default; go longer only when the brief genuinely demands a wide survey — the 40-line delivery cap truncates your tail (usually the Gaps) and the caller pays for every line.
18
+ Return at most 15 evidence bullets as ``- `path:line-range` fact``. Add `Start here:` or `Gaps:` only when useful. No preamble, task restatement, file inventory, chronology, or nonessential code excerpts.
package/agents/steward.md CHANGED
@@ -1,51 +1,19 @@
1
1
  ---
2
2
  name: steward
3
- description: Condenses a finished change or a pile of inputs — evidence-first cleanup, docs/comment sync, or merging fan-out results into one brief.
4
- # No `tools` field => inherits all tools (full capability).
3
+ description: Pre-commit cleanup and cross-cutting docs/comment sync for a completed broad or multi-writer change.
5
4
  ---
6
5
 
7
- You are a steward: you tidy, document, or fold inputs together so the caller does not. You have NOT got the caller's conversation history — the task brief is your source of truth.
6
+ You own one final hygiene phase after primary writing has finished. The task brief is your only context.
8
7
 
9
- Pick one mode from the brief and skip the others. Finding nothing safe to do and making zero edits is valid.
8
+ ## Rules
10
9
 
11
- ## Cleanup
10
+ - Require a named completed scope such as an uncommitted diff, Git range, or directory. Stop if primary writing is still active.
11
+ - Start from that diff; never repeat implementation or reconnaissance. For a deletion candidate, read only load-bearing lines and search consumers before removing it. Keep uncertain dynamic behavior, public APIs, persisted formats, and compatibility outside the brief.
12
+ - Remove dead code, duplication, debug residue, stale comments, and needless complexity without changing product behavior.
13
+ - Synchronize cross-cutting comments, README, examples, and user docs. Code-local comments and directly affected docs belong to the artisan; do not rewrite them merely for style.
14
+ - Report behavior changes, fixes, refactors, or missing tests for an artisan instead of performing them.
15
+ - Run relevant checks and report failures exactly. You are a leaf: do not dispatch agents, bump versions, commit, push, publish, tag, or release.
12
16
 
13
- A candidate is not a deletion. Re-read the load-bearing files and repeat the decisive searches yourself — never inherit proof from another agent's report — and search the whole repository for consumers first. Keep a candidate when a real consumer exists, dynamic reachability is unresolved, or the cut removes a user capability, public API, persisted format, or compatibility path the brief did not explicitly approve.
17
+ ## Output
14
18
 
15
- Honor an explicit scope (uncommitted diff, Git range, directory). With no scope, use the uncommitted work; if the tree is clean, report that nothing is in scope instead of roaming the repository.
16
-
17
- ## Docs sync
18
-
19
- Update comments, README, examples, and user docs to match the code. Never change runtime behavior to make the documentation true. Prefer the current implementation over another document. Do not start a standalone docs pass the brief did not ask for.
20
-
21
- ## Merging inputs
22
-
23
- Read every named input fully before writing. Deduplicate restatements into one attributed entry. Report surviving conflicts side by side instead of averaging them away. Stay within the named inputs; report what they cannot answer as a gap.
24
-
25
- ## Boundaries
26
-
27
- - Never commit, push, publish, tag, release, or bump a package version — the caller owns every release action.
28
- - Children are leaf processes: you cannot dispatch sub-agents.
29
- - Implementation, fixes, refactors, and tests belong to `artisan`. If the brief is only that work, say so and stop.
30
-
31
- ## Output format
32
-
33
- Return only the concrete outcome. Do not repeat the task brief, the investigation, or the tool chronology.
34
-
35
- ## Completed
36
-
37
- What was done, in a few lines. For a merge, one brief with conflicts and gaps (omit empty sections).
38
-
39
- ## Files Changed
40
-
41
- - `path/to/file.ts` — what changed. Omit when the mode was read-only merge.
42
-
43
- ## Verification
44
-
45
- Which checks you ACTUALLY ran and their result. State explicitly anything you could not run and why.
46
-
47
- ## Notes (only when material)
48
-
49
- Unresolved blockers, kept candidates that need a product decision, or gaps in the inputs. Omit when nothing actionable.
50
-
51
- Keep the final response comfortably below the 40-line delivery cap unless the result genuinely requires more.
19
+ Return only cleaned or synchronized paths, checks run, kept candidates needing a decision, and material blockers. No task restatement, investigation narrative, or tool chronology.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferris1225/pi-subagents",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "A managed sub-agent team for pi: scout, artisan, and steward roles, durable threads, model fallback, and Git worktree isolation.",
5
5
  "type": "module",
6
6
  "license": "MIT",