pi-herdr-agents 1.4.0 → 1.4.2

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/AGENTS.md CHANGED
@@ -84,6 +84,7 @@ For normal changes:
84
84
 
85
85
  ```bash
86
86
  npm test
87
+ npm run format:check
87
88
  npm run lint
88
89
  npm pack --dry-run
89
90
  git diff --check
package/CHANGELOG.md CHANGED
@@ -7,11 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
- ## [v1.4.0](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.3.1...v1.4.0)
10
+ ## [v1.4.2](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.4.1...v1.4.2)
11
+
12
+ ### Commits
13
+
14
+ - style: format source with Biome [`06d67d7`](https://github.com/giuseppecrj/pi-herdr-agents/commit/06d67d7c2fa48be6eb5ae7a11e165208da9a228e)
15
+ - style: format workflow-review integration test [`1215dc5`](https://github.com/giuseppecrj/pi-herdr-agents/commit/1215dc58db7e98abb1a18278ca892432c519f6ac)
16
+ - chore: add Biome formatter [`5b6aef3`](https://github.com/giuseppecrj/pi-herdr-agents/commit/5b6aef316c1183bf094d893c88624972762380d5)
17
+ - fix: neutralize line breaks in launch script comments [`ae3c52f`](https://github.com/giuseppecrj/pi-herdr-agents/commit/ae3c52f4a66c9075a14526c30fe8801ab85b35f4)
18
+ - docs: align README with shipped coordinator and workflow behavior [`cc55c68`](https://github.com/giuseppecrj/pi-herdr-agents/commit/cc55c68fc1cc03a28642797eaf1a19c0317aec6c)
19
+ - fix: correct the adversarial-reviewer worktree warning [`7518567`](https://github.com/giuseppecrj/pi-herdr-agents/commit/75185675d589adc3511f40722420387c2dc647fd)
20
+ - ci: run format:check in the release workflow [`bc5b998`](https://github.com/giuseppecrj/pi-herdr-agents/commit/bc5b99819833158623b115587e75c37ae8ead009)
21
+
22
+ ## [v1.4.1](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.4.0...v1.4.1) - 2026-08-31
23
+
24
+ ### Commits
25
+
26
+ - chore: install anti-slop lint rules [`633766b`](https://github.com/giuseppecrj/pi-herdr-agents/commit/633766b434e9558df67650b458a7d4536ac9ffd6)
27
+ - refactor: satisfy anti-slop lint rules [`d9cbf1d`](https://github.com/giuseppecrj/pi-herdr-agents/commit/d9cbf1dbc9442971260414fd52ff20a49a2cde88)
28
+ - chore: release v1.4.1 [`49d50e2`](https://github.com/giuseppecrj/pi-herdr-agents/commit/49d50e2cd64abed8a74db46c103b22e944a5c614)
29
+ - test: stop asserting a deterministic reviewer start order [`edd848e`](https://github.com/giuseppecrj/pi-herdr-agents/commit/edd848ee8057290a7d47f7260b65ba29d832bec5)
30
+
31
+ ## [v1.4.0](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.3.1...v1.4.0) - 2026-08-31
11
32
 
12
33
  ### Commits
13
34
 
14
35
  - test: disable commit signing in git fixtures [`c87e20d`](https://github.com/giuseppecrj/pi-herdr-agents/commit/c87e20dd3d4d7ff058b555759904de36bf881875)
36
+ - chore: release v1.4.0 [`0480689`](https://github.com/giuseppecrj/pi-herdr-agents/commit/0480689cc6914738406d0dab9c260744c7666df3)
15
37
  - feat: state the coordinator contract in always-visible guidelines [`08b1dc6`](https://github.com/giuseppecrj/pi-herdr-agents/commit/08b1dc6ffdfbb4ef03289b0871cc4fbc48883032)
16
38
  - fix: stop implying every writing subagent needs a worktree [`114c239`](https://github.com/giuseppecrj/pi-herdr-agents/commit/114c239f71666a8a9c9a2c8705197b70c5f4e7a2)
17
39
  - fix: point reviewers of worktree results at the retained worktree path [`4d84718`](https://github.com/giuseppecrj/pi-herdr-agents/commit/4d84718ada823eba830195e865c327155f37a8dd)
package/README.md CHANGED
@@ -76,7 +76,7 @@ subagent({ name: "DB scout", agent: "scout", model: "<provider>/<fast-tier-id>",
76
76
  // Both return immediately; each result comes back independently.
77
77
  ```
78
78
 
79
- Use ordinary panes for read-only agents. A single or sequential writer can work in the parent checkout; give each parallel independent writing agent a unique managed worktree. See [Worktree subagents](docs/worktree-subagents.md).
79
+ Use ordinary panes for read-only agents. A single or sequential writer can work in the parent checkout; give each parallel independent writing agent a unique managed worktree. The parent acts as coordinator: decompose work, give each child one bounded outcome with its goal, allowed files, verification, and commit instruction, and keep dependent writes sequential. Children are leaves by default; the parent owns integration and final verification. See [Worktree subagents](docs/worktree-subagents.md).
80
80
 
81
81
  ## How it works
82
82
 
@@ -162,12 +162,12 @@ The current workflow inventory is:
162
162
 
163
163
  | Workflow | Entry point | Composition, artifacts, and runtime |
164
164
  | -------- | ----------- | ----------------------------------- |
165
- | Planning | `/plan` | Scout → interactive planner → workers → reviewer; writes `.pi/plans/...` artifacts; runs on Pi. |
165
+ | Planning | `/plan` | Autonomous scout → interactive planner → workers → reviewer; writes `.pi/plans/...` artifacts; runs on Pi. |
166
166
  | Iteration | `/iterate` | Opens one interactive full-context Pi fork and returns its completion summary. |
167
167
  | Side question | `/btw`, `/btw-close` | Opens one replaceable interactive Pi side session; its answer stays outside the parent transcript. |
168
168
  | Worktree handoff | `/worktree <name> [task]`, `/worktree list` | Forks the active conversation into a long-lived interactive Pi process in a new worktree created from committed `HEAD`; retains the parent session. |
169
169
  | Approved review runner | `herdr_workflow` (low-level control tool) | Validates and runs exact approved project-local JavaScript with bounded read-only Pi reviewers. The bundled `orchestrate` skill authors this first-flow topology. |
170
- | Adversarial review | `adversarial-reviewer` | Transitional workflow implementation that selects eligible authenticated Pi runtimes for generic reviewer passes, verifies findings, and uses a fresh reviewer synthesis pass. It does not write artifacts in the reviewed checkout. |
170
+ | Adversarial review | `adversarial-reviewer` | Directly runnable coordinator role that selects eligible authenticated Pi runtimes, launches leaf `reviewer` children in ordinary panes for generic review passes, and uses a fresh reviewer synthesis pass. It does not write artifacts in the reviewed checkout. |
171
171
 
172
172
  ### Bundled visible definitions
173
173
 
@@ -179,7 +179,7 @@ The current workflow inventory is:
179
179
  | **reviewer** | Leaf agent role | Config, then parent | Reviews changes for correctness, security, and maintainability. |
180
180
  | **visual-tester** | Leaf agent role | Config, then parent | Performs visual QA through the `chrome-cdp` skill. |
181
181
  | **poteto** | Coordinator agent role | Config, then parent | Autonomously investigates, edits minimally, delegates independent work, and verifies. |
182
- | **adversarial-reviewer** | Transitional workflow implementation | Three distinct eligible authenticated Pi model IDs, preferring provider diversity | Runs evidence-backed Optimizer and Skeptic passes through generic `reviewer` children, then a fresh reviewer synthesis pass. |
182
+ | **adversarial-reviewer** | Coordinator agent role | Three distinct eligible authenticated Pi model IDs, preferring provider diversity | Runs evidence-backed Optimizer and Skeptic passes through leaf `reviewer` children in ordinary panes, then a fresh reviewer synthesis pass. |
183
183
 
184
184
  All subagents execute through Pi. Claude models remain available through normal
185
185
  Pi provider/model routing. Legacy role definitions that contain `cli` fail before
@@ -423,6 +423,8 @@ subagent_interrupt({ name: "Scout" });
423
423
 
424
424
  This sends Escape to the child pane, cancelling the in-progress model turn. The subagent session stays alive — the pane, session file, and background polling all remain intact. After the interrupt, the widget immediately labels the child as `interrupted` (counted as **open**, not active processing). Stale pre-interrupt activity snapshots are ignored so a lagging Herdr/`active` reading cannot overwrite the interrupt. The process elapsed timer keeps running because the pane is still open; only the interrupted-state duration freezes relative to the interrupt request. If the child starts work later, newer observations return it to `active`; completion, failure, and `caller_ping` still flow through normally.
425
425
 
426
+ `id` and `name` are each optional, but execution requires one usable target: an exact running ID or an exact, unambiguous display name. When both are supplied, `id` is used. Duplicate names are rejected.
427
+
426
428
  This is a turn-level interrupt, not a method for forcibly terminating a subagent session.
427
429
 
428
430
  ---
@@ -437,11 +439,17 @@ herdr_workflow({ action: "start", runId: "run-1" }); // after APPROVE <hash pref
437
439
  herdr_workflow({ action: "cancel", runId: "run-1" });
438
440
  ```
439
441
 
442
+ Parameters:
443
+
444
+ - `action` (required): `prepare`, `start`, or `cancel`.
445
+ - `path` (required for `prepare`): Path to the workflow script.
446
+ - `runId` (required for `cancel` and `start`): For `start`, it must match the pending run.
447
+
440
448
  ### Prepare and start contract
441
449
 
442
450
  - The script must be `<project>/.pi/plans/<run>/workflow.js` in a trusted Git repository with no existing adjacent `run.jsonl`.
443
- - Its first comment contains strict version-1 JSON metadata that binds the exact committed base, source provenance, distinct review-node IDs and their roles, authenticated `provider/model` references, thinking levels, and per-run caps that cannot exceed the fixed limits.
444
- - Fixed workflow caps: 256 KiB source, 8 agents, concurrency 4, 30-minute deadline, 100,000-character prompts, 100 logs × 4,000 characters, and 64 KiB serialized task result. Metadata may only lower caps.
451
+ - Its first comment contains strict version-1 JSON metadata that binds the exact committed base, source provenance, distinct review-node IDs and their roles, authenticated `provider/model` references, thinking levels, and the configurable `maxAgents` and `maxConcurrency` caps.
452
+ - Fixed workflow caps: 256 KiB source, 8 agents, concurrency 4, 30-minute deadline, 100,000-character prompts, 100 logs × 4,000 characters, and 64 KiB serialized task result. Metadata may lower only `maxAgents` and `maxConcurrency`.
445
453
  - Preparation validates and compiles without evaluating JavaScript, creating a journal or checkout, or launching a child. It returns the exact approval packet and keeps one pending candidate in process memory.
446
454
  - Start requires the latest real user message in the same parent session to be exactly `APPROVE <8 lowercase hex characters>`. It revalidates the complete candidate, consumes approval once, creates the append-only journal, and runs in the background.
447
455
  - Review children are fresh Pi sessions with derived read-only tools in one detached checkout pinned to the approved base. Parent uncommitted files are absent, intermediate child results stay inside the workflow, and operational failures remain explicit non-retryable evidence for parent-guided recovery.
@@ -514,11 +522,11 @@ The `/plan` command orchestrates a full planning-to-implementation pipeline.
514
522
  ```
515
523
 
516
524
  ```
517
- Phase 1: Investigation → Quick codebase scan
525
+ Phase 1: Investigation → Autonomous scout maps the codebase
518
526
  Phase 2: Planning → Interactive planner subagent (user collaborates)
519
527
  Phase 3: Review Plan → Confirm ordered tasks, adjust if needed
520
- Phase 4: Execute → Sequential workers, or isolated parallel workers for independent tasks
521
- Phase 5: Integrate → Parent reviews and integrates worktree branches one at a time
528
+ Phase 4: Execute → Shared-checkout sequential workers by default; isolated parallel workers for independent tasks
529
+ Phase 5: Integrate → Parent reviews and integrates worktree branches one at a time, only when worktrees are used
522
530
  Phase 6: Review → Reviewer subagent checks the integrated changes
523
531
  ```
524
532
 
@@ -727,7 +735,7 @@ and verify them with `/subagent list` plus a smoke launch.
727
735
  | `session-mode` | string | Default child-session mode: `standalone`, `lineage-only`, or `fork` |
728
736
  | `spawning` | boolean | Set `false` to deny all subagent-spawning tools |
729
737
  | `deny-tools` | string | Comma-separated `pi-herdr-agents` tool names to suppress; this is not a universal cross-extension deny list |
730
- | `auto-exit` | boolean | Auto-shutdown when the agent finishes its turn — no `subagent_done` call needed. If the user sends any input, auto-exit is permanently disabled and the user takes over the session. Recommended for autonomous agents (scout, worker); not for interactive ones (planner). Also determines the default value of `interactive` (see below). |
738
+ | `auto-exit` | boolean | Auto-shutdown when the latest assistant turn does not end with `stopReason: "aborted"` — no `subagent_done` call needed. User input does not permanently disable auto-exit. Recommended for autonomous agents (scout, worker); not for interactive ones (planner). Also determines the default value of `interactive` (see below). |
731
739
  | `interactive` | boolean | Override whether stall/recovery transitions wake the parent session. Defaults to the inverse of `auto-exit`: autonomous agents (`auto-exit: true`) are non-interactive and get stall pings; agents without `auto-exit` are interactive and stay quiet. Explicit values take precedence. |
732
740
  | `cwd` | string | Default working directory. Absolute paths are unambiguous; relative agent-frontmatter paths resolve from Pi's agent config directory (`PI_CODING_AGENT_DIR` or `~/.pi/agent`), not the project root |
733
741
  | `disable-model-invocation` | boolean | Hide a role from discovery surfaces like `subagents_list`. The definition remains directly invocable by exact name via `subagent({ agent: "name", ... })`. |
@@ -757,12 +765,12 @@ session-mode: lineage-only
757
765
 
758
766
  ### `auto-exit`
759
767
 
760
- When set to `true`, the agent session shuts down automatically as soon as the agent finishes its turn — no explicit `subagent_done` call is needed.
768
+ When set to `true`, the agent session shuts down on `agent_end` unless the latest assistant message has `stopReason: "aborted"` — no explicit `subagent_done` call is needed.
761
769
 
762
770
  **Behavior:**
763
771
 
764
- - The session closes after the agent's final message (on the `agent_end` event)
765
- - If the user sends **any input** before the agent finishes, auto-exit is permanently disabled for that session the user takes over interactively
772
+ - The session closes on `agent_end` when the latest assistant turn does not have `stopReason: "aborted"`; a normal or error stop exits, while an aborted stop stays open.
773
+ - User input does not permanently disable auto-exit; the latest assistant stop reason determines whether the session exits.
766
774
  - The modeHint injected into the agent's task is adjusted accordingly: autonomous agents see "Complete your task autonomously." rather than instructions to call `subagent_done`
767
775
 
768
776
  **When to use:**
@@ -833,12 +841,15 @@ deny-tools: subagent
833
841
 
834
842
  ### Recommended Configuration
835
843
 
836
- | Agent | `spawning` | Rationale |
837
- | ---------- | ----------- | -------------------------------------------- |
838
- | planner | *(default)* | Legitimately spawns scouts for investigation |
839
- | worker | `false` | Should implement tasks, not delegate |
840
- | reviewer | `false` | Should review, not spawn |
841
- | scout | `false` | Should gather context, not spawn |
844
+ | Agent | `spawning` | Rationale |
845
+ | --- | --- | --- |
846
+ | planner | *(default)* | Can spawn scouts for investigation. |
847
+ | poteto | `true` | Delegates independent work. |
848
+ | adversarial-reviewer | `true` | Launches leaf reviewer passes and synthesis. |
849
+ | worker | `false` | Implements bounded tasks. |
850
+ | reviewer | `false` | Reviews without delegation. |
851
+ | scout | `false` | Gathers context without delegation. |
852
+ | visual-tester | `false` | Performs visual QA without delegation. |
842
853
 
843
854
  ---
844
855
 
package/RELEASING.md CHANGED
@@ -21,6 +21,7 @@ Automated release gates (run by the workflow and required locally):
21
21
 
22
22
  ```bash
23
23
  npm ci
24
+ npm run format:check
24
25
  npm run lint
25
26
  npm test
26
27
  npm pack --dry-run
@@ -194,7 +194,8 @@ project authors can still add their own namespaced fields.
194
194
  `chrome-cdp` dependency declared through canonical `skills` metadata.
195
195
  - `claude-reviewer` — Removed. Use the generic `reviewer` role with an
196
196
  authenticated Claude model through Pi provider/model routing.
197
- - `adversarial-reviewer` — Transitional workflow implementation. It applies
197
+ - `adversarial-reviewer` — Transitional workflow implementation (now shipped
198
+ and documented as a coordinator agent role). It applies
198
199
  project review constraints, selects three distinct eligible exact
199
200
  authenticated Pi model IDs, and launches generic `reviewer` children followed
200
201
  by fresh reviewer synthesis. Do not clone this pattern for new outcomes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-herdr-agents",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Asynchronous Pi subagents and approved review workflows in Herdr, with optional isolated Git worktrees",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,6 +30,8 @@
30
30
  "type": "module",
31
31
  "scripts": {
32
32
  "changelog": "auto-changelog",
33
+ "format": "biome format --write pi-extension test",
34
+ "format:check": "biome format pi-extension test",
33
35
  "lint": "oxlint pi-extension test",
34
36
  "test": "node --experimental-strip-types --test test/test.ts test/launch.test.ts test/runtime-routing.test.ts test/release-workflow.test.ts test/workflow.test.ts test/package-skill.test.js",
35
37
  "test:integration": "node --experimental-strip-types --test --test-concurrency=1 test/integration/*.test.ts",
@@ -57,11 +59,13 @@
57
59
  "image": "https://raw.githubusercontent.com/giuseppecrj/pi-herdr-agents/main/docs/assets/pi-herdr-agents-gallery.png"
58
60
  },
59
61
  "devDependencies": {
62
+ "@biomejs/biome": "2.5.11",
60
63
  "@earendil-works/pi-ai": "^0.84.0",
61
64
  "@earendil-works/pi-coding-agent": "^0.84.0",
62
65
  "@earendil-works/pi-tui": "^0.84.0",
66
+ "@oxlint/plugins": "^1.80.0",
63
67
  "@sinclair/typebox": "^0.34.52",
64
68
  "auto-changelog": "^2.6.0",
65
- "oxlint": "^1.73.0"
69
+ "oxlint": "^1.80.0"
66
70
  }
67
71
  }