pi-herdr-agents 0.0.2 → 0.0.4
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/CONTEXT.md +16 -0
- package/README.md +15 -10
- package/RELEASING.md +10 -25
- package/agents/adversarial-reviewer.md +20 -23
- package/agents/planner.md +59 -511
- package/agents/reviewer.md +5 -7
- package/agents/visual-tester.md +11 -1
- package/agents/worker.md +8 -18
- package/docs/adr/0002-agent-workflow-skill-runtime-taxonomy.md +30 -21
- package/package.json +1 -1
- package/pi-extension/subagents/claude.ts +164 -0
- package/pi-extension/subagents/index.ts +36 -159
- package/agents/claude-reviewer.md +0 -23
package/CONTEXT.md
CHANGED
|
@@ -20,6 +20,22 @@ _Avoid_: Evaluated metadata, inferred policy
|
|
|
20
20
|
A mandatory exact `provider/model` reference and thinking level declared in workflow metadata; every execution node must resolve to one of these approved runtimes. Missing values fail preparation rather than inheriting parent or role defaults. The first workflow supports Pi-backed agents only; existing public Claude subagents remain unchanged.
|
|
21
21
|
_Avoid_: Runtime tiers, silent fallback, inherited runtime, v1 Claude workflow adapter
|
|
22
22
|
|
|
23
|
+
**External CLI runtime adapter**:
|
|
24
|
+
A runtime-specific module selected by a known local role `cli` value. The MVP dispatches `cli: claude` to the built-in Claude adapter; a future registry needs a proven second CLI.
|
|
25
|
+
_Avoid_: Raw flag template, plugin system before a second CLI
|
|
26
|
+
|
|
27
|
+
**Adapter permission policy**:
|
|
28
|
+
The runtime adapter owns its fixed vendor flags for the MVP. A local role selects the CLI, not raw flags or a policy profile.
|
|
29
|
+
_Avoid_: Implied permission bypass, raw flag values
|
|
30
|
+
|
|
31
|
+
**Adapter seam**:
|
|
32
|
+
`index.ts` retains pane, worktree, lifecycle, and delivery ownership. The Claude adapter owns Claude command construction, completion/result extraction, transcript copying, and workspace cleanup.
|
|
33
|
+
_Avoid_: Vendor behavior in the shared lifecycle
|
|
34
|
+
|
|
35
|
+
**Runtime dispatch**:
|
|
36
|
+
The core validates a role's `cli` value before pane creation and dispatches each known value to its internal adapter. The MVP recognizes `claude` only; unknown values fail closed.
|
|
37
|
+
_Avoid_: Silent Pi fallback, speculative runtime registry
|
|
38
|
+
|
|
23
39
|
**Run journal**:
|
|
24
40
|
The runner-owned append-only `run.jsonl` that starts with approval binding the workflow-script hash, canonical repository identity, and committed base, then records observed node calls and results. Exactly one terminal event contains the bounded runtime envelope; a following delivery event references it without duplicating the task result.
|
|
25
41
|
_Avoid_: User-authored plan, mutable audit log, duplicated result
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Use `pi install -l npm:pi-herdr-agents` for a project-local installation, or try
|
|
|
65
65
|
pi -e npm:pi-herdr-agents
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Pi packages execute with your user account's full system access. Review the package source before installation. Claude CLI
|
|
68
|
+
Pi packages execute with your user account's full system access. Review the package source before installation. A locally installed Claude CLI adapter launches with `--dangerously-skip-permissions`, so those runs skip Claude's interactive permission prompts.
|
|
69
69
|
|
|
70
70
|
After the one-time first-package bootstrap, changing the `package.json` version on `main` automatically publishes to npm and creates the matching Git tag and GitHub Release. For bootstrap authentication, versioning, verification, and troubleshooting, see [RELEASING.md](RELEASING.md).
|
|
71
71
|
|
|
@@ -144,7 +144,7 @@ This package uses five distinct concepts:
|
|
|
144
144
|
dependencies of roles or workflows, not subagent definitions.
|
|
145
145
|
- A **runtime** is how an invocation executes: Pi or an external CLI, plus its
|
|
146
146
|
model and thinking policy.
|
|
147
|
-
- An **adapter** is a hidden runtime-specific definition used by a workflow.
|
|
147
|
+
- An **adapter** is a hidden runtime-specific definition supplied locally or optionally used by a workflow.
|
|
148
148
|
|
|
149
149
|
See [ADR-0002](docs/adr/0002-agent-workflow-skill-runtime-taxonomy.md) for the
|
|
150
150
|
accepted decision, rationale, migration boundaries, and evidence.
|
|
@@ -157,7 +157,7 @@ The current workflow inventory is:
|
|
|
157
157
|
| Iteration | `/iterate` | Opens one interactive full-context Pi fork and returns its completion summary. |
|
|
158
158
|
| Side question | `/btw`, `/btw-close` | Opens one replaceable interactive Pi side session; its answer stays outside the parent transcript. |
|
|
159
159
|
| 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. |
|
|
160
|
-
| Adversarial review | `adversarial-reviewer` | Transitional workflow implementation that
|
|
160
|
+
| Adversarial review | `adversarial-reviewer` | Transitional workflow implementation that selects three distinct authenticated Pi runtimes for generic reviewer passes, preferring provider diversity; it writes `.reviews/...` artifacts. It remains visible and launchable until a dedicated workflow surface replaces it. |
|
|
161
161
|
|
|
162
162
|
### Bundled visible definitions
|
|
163
163
|
|
|
@@ -169,15 +169,20 @@ The current workflow inventory is:
|
|
|
169
169
|
| **reviewer** | Leaf agent role | Config, then parent | Reviews changes for correctness, security, and maintainability. |
|
|
170
170
|
| **visual-tester** | Leaf agent role | Config, then parent | Performs visual QA through the `chrome-cdp` skill. |
|
|
171
171
|
| **poteto** | Coordinator agent role | Config, then parent | Autonomously investigates, edits minimally, delegates independent work, and verifies. |
|
|
172
|
-
| **adversarial-reviewer** | Transitional workflow implementation |
|
|
172
|
+
| **adversarial-reviewer** | Transitional workflow implementation | Three distinct authenticated Pi model IDs, preferring provider diversity | Runs evidence-backed Optimizer and Skeptic review passes through generic `reviewer` children. |
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
Bundled definitions are portable Pi roles. Vendor-specific external CLI adapters
|
|
175
|
+
are local or optional definitions, not bundled roles. The existing external CLI
|
|
176
|
+
path supports a local hidden Claude adapter (`cli: claude`) and always adds
|
|
177
|
+
`--dangerously-skip-permissions`; it does not provide an adapter registry or
|
|
178
|
+
Cursor/OpenCode support. Put an adapter in
|
|
179
|
+
`$PI_CODING_AGENT_DIR/agents/` or `.pi/agents/` with
|
|
180
|
+
`disable-model-invocation: true` when direct exact-name invocation needs it.
|
|
181
|
+
|
|
182
|
+
Optional prerequisites fail closed and are not bundled:
|
|
179
183
|
|
|
180
184
|
- `visual-tester` needs an external `chrome-cdp` skill that provides `scripts/cdp.mjs`.
|
|
185
|
+
- `adversarial-reviewer` needs three distinct exact authenticated Pi model IDs; it prefers IDs from different providers when available.
|
|
181
186
|
- `/plan` uses the bundled scout and planner roles and records ordered tasks in
|
|
182
187
|
`plan.md`; it does not require a researcher role, todo tool, or `write-todos` skill.
|
|
183
188
|
|
|
@@ -859,7 +864,7 @@ herdr
|
|
|
859
864
|
pi
|
|
860
865
|
```
|
|
861
866
|
|
|
862
|
-
Other multiplexers and terminal backends are not supported. Worktrees provide Git checkout isolation only, not process or security isolation; child agents and installed Pi packages run with your user's filesystem and command permissions. Claude CLI
|
|
867
|
+
Other multiplexers and terminal backends are not supported. Worktrees provide Git checkout isolation only, not process or security isolation; child agents and installed Pi packages run with your user's filesystem and command permissions. Locally configured Claude CLI adapters always launch with `--dangerously-skip-permissions` and therefore skip Claude's interactive permission prompts.
|
|
863
868
|
|
|
864
869
|
---
|
|
865
870
|
|
package/RELEASING.md
CHANGED
|
@@ -4,13 +4,9 @@ GitHub Actions publishes this package when the version in `package.json` changes
|
|
|
4
4
|
|
|
5
5
|
The published version must be unique on npm.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Public versioning
|
|
8
8
|
|
|
9
|
-
`0.
|
|
10
|
-
|
|
11
|
-
- Repository tags `v0.1.0`–`v0.1.5` belong to inherited upstream history and are not present in this clean repository.
|
|
12
|
-
- Product work is already on the 0.2 feature line (async subagents, approved review workflows, bundled orchestration skill).
|
|
13
|
-
- Starting the new package name at `0.1.0` would understate that feature line; reusing `0.1.x` would collide with inherited numbering.
|
|
9
|
+
`0.0.1` was a manual bootstrap publication that established the npm package. `0.0.2` is the first release published through the trusted GitHub Actions workflow and is the current public baseline.
|
|
14
10
|
|
|
15
11
|
Do not design a release that creates a GitHub Release without a successful npm publish for a new version. The workflow publishes first, then tags and creates the GitHub Release.
|
|
16
12
|
|
|
@@ -62,30 +58,19 @@ After the package exists on npm, steady-state releases use npm trusted publishin
|
|
|
62
58
|
4. Confirm the workflow uses the exactly pinned Node `26.3.0`, whose bundled npm supports trusted publishing.
|
|
63
59
|
5. Publish stays tokenless: `npm publish --access public --provenance`.
|
|
64
60
|
|
|
65
|
-
When the repository secret `NPM_TOKEN` is absent, the publish step unsets `NODE_AUTH_TOKEN` and relies on OIDC. Once the package exists, the workflow fails if `NPM_TOKEN` is still configured, so steady-state releases cannot silently keep using the bootstrap credential.
|
|
66
|
-
|
|
67
|
-
### First-package bootstrap
|
|
68
|
-
|
|
69
|
-
Trusted publishers are configured on an existing npm package. The first publish of `pi-herdr-agents` therefore needs a short-lived granular npm token once, and must go through the Actions workflow so provenance is GitHub-backed:
|
|
70
|
-
|
|
71
|
-
1. Create a granular access token on npm with permission to publish a new package (allow automated publishing / bypass 2FA if npm requires it for CI).
|
|
72
|
-
2. Add it temporarily as a GitHub Actions repository secret named `NPM_TOKEN`.
|
|
73
|
-
3. The first push that creates `main` does not release: `github.event.before` is all zeroes, so the workflow sets `release=false` and prints a clear message. After the temporary secret is configured, run **Actions → Release → Run workflow** (`workflow_dispatch`) from the `main` branch to publish `pi-herdr-agents@0.2.0`; other refs are rejected.
|
|
74
|
-
4. When the package does not exist, the publish step requires the temporary `NPM_TOKEN` as `NODE_AUTH_TOKEN`. Once any version exists, the workflow rejects that token and requires OIDC trusted publishing.
|
|
75
|
-
5. Configure the trusted publisher as above (`giuseppecrj` / `pi-herdr-agents` / `publish.yml`).
|
|
76
|
-
6. Immediately revoke or delete the granular token on npm and remove the temporary `NPM_TOKEN` repository secret.
|
|
61
|
+
When the repository secret `NPM_TOKEN` is absent, the publish step unsets `NODE_AUTH_TOKEN` and relies on OIDC. Once the package exists, the workflow fails if `NPM_TOKEN` is still configured, so steady-state releases cannot silently keep using the bootstrap credential. Manual dispatch runs only from `main`; other refs are rejected.
|
|
77
62
|
|
|
78
|
-
|
|
63
|
+
### Bootstrap history
|
|
79
64
|
|
|
80
|
-
Later version bumps use trusted publishing only.
|
|
65
|
+
The initial `0.0.1` publication established the npm package. Trusted publishing is now configured for `giuseppecrj/pi-herdr-agents` and `publish.yml`, so all later releases use OIDC only. Later version bumps use trusted publishing only. Do not add `NPM_TOKEN`: the workflow rejects it once the package exists.
|
|
81
66
|
|
|
82
67
|
## Publish a release
|
|
83
68
|
|
|
84
69
|
Choose the semantic version increment:
|
|
85
70
|
|
|
86
|
-
- `patch`: compatible bug fixes, such as `0.2
|
|
87
|
-
- `minor`: compatible features, such as `0.2
|
|
88
|
-
- `major`: breaking changes, such as `0.2
|
|
71
|
+
- `patch`: compatible bug fixes, such as `0.0.2` to `0.0.3`
|
|
72
|
+
- `minor`: compatible features, such as `0.0.2` to `0.1.0`
|
|
73
|
+
- `major`: breaking changes, such as `0.0.2` to `1.0.0`
|
|
89
74
|
|
|
90
75
|
Create the version commit without a local tag:
|
|
91
76
|
|
|
@@ -124,7 +109,7 @@ The workflow stops if the matching version tag already points to a different com
|
|
|
124
109
|
|
|
125
110
|
### npm rejects authentication
|
|
126
111
|
|
|
127
|
-
Confirm that the trusted publisher matches owner `giuseppecrj`, repository `pi-herdr-agents`, and workflow `publish.yml`, that the job has `id-token: write`, and that the runner is GitHub-hosted.
|
|
112
|
+
Confirm that the trusted publisher matches owner `giuseppecrj`, repository `pi-herdr-agents`, and workflow `publish.yml`, that the job has `id-token: write`, and that the runner is GitHub-hosted. If a release reports that `NPM_TOKEN` is bootstrap-only, remove the secret and use the trusted publisher.
|
|
128
113
|
|
|
129
114
|
### npm reports that the version already exists
|
|
130
115
|
|
|
@@ -132,7 +117,7 @@ If the published `gitHead` does not match this commit, the workflow fails before
|
|
|
132
117
|
|
|
133
118
|
### Initial branch creation did not release
|
|
134
119
|
|
|
135
|
-
A clean repository's first push has `github.event.before` all zeroes. The workflow treats that as `release=false`.
|
|
120
|
+
A clean repository's first push has `github.event.before` all zeroes. The workflow treats that as `release=false`. This package is already established on npm, so use tokenless trusted publishing for later releases.
|
|
136
121
|
|
|
137
122
|
### The package is absent from pi.dev
|
|
138
123
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adversarial-reviewer
|
|
3
|
-
description: Adversarial
|
|
3
|
+
description: Adversarial code review using three independent authenticated models followed by skeptical verification
|
|
4
4
|
thinking: high
|
|
5
5
|
tools: read, bash, write, subagent
|
|
6
6
|
spawning: true
|
|
@@ -23,39 +23,36 @@ All review children are read-only, so spawn them in ordinary panes without `work
|
|
|
23
23
|
relevant project review guidance when present.
|
|
24
24
|
2. Resolve review runtimes before creating artifacts or spawning children:
|
|
25
25
|
- Read the live authenticated model catalog in the `subagent` tool guidance.
|
|
26
|
-
- Select
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
- Select three distinct exact authenticated model IDs. Prefer different
|
|
27
|
+
providers; when fewer than three providers are available, use different
|
|
28
|
+
models from the available providers and report the reduced provider
|
|
29
|
+
diversity. Copy IDs verbatim from the catalog; never guess, normalize, or
|
|
30
|
+
retain model IDs in this agent file.
|
|
31
|
+
- If three distinct authenticated model IDs are unavailable, report the
|
|
32
|
+
missing prerequisite and stop cleanly. Do not issue a subagent call with an
|
|
33
|
+
invented ID.
|
|
32
34
|
3. Run available mechanical checks (lint, typecheck, build, tests). Save the raw
|
|
33
35
|
output to `.reviews/<branch-safe>/mechanical.txt`.
|
|
34
36
|
4. Create `.reviews/<branch-safe>/` and spawn three Optimizer subagents in
|
|
35
|
-
parallel with
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- `agent: "reviewer"`, the resolved OpenAI Codex model ID,
|
|
39
|
-
`tools: "read,bash"`, task name `optimizer-gpt`
|
|
40
|
-
- `agent: "claude-reviewer"`, task name `optimizer-claude`; do not pass Pi
|
|
41
|
-
`model` or `thinking` overrides to the Claude CLI agent
|
|
37
|
+
parallel with `agent: "reviewer"`, each resolved model ID, and
|
|
38
|
+
`tools: "read,bash"`. Name the tasks `optimizer-a`, `optimizer-b`, and
|
|
39
|
+
`optimizer-c` in the same order as the resolved model IDs.
|
|
42
40
|
5. Give all Optimizers the same diff, scope, mechanical output, and review
|
|
43
41
|
rubric. Each child's final assistant message is its complete report.
|
|
44
42
|
6. End the parent turn after spawning the Optimizers. Automatic completion
|
|
45
43
|
delivery resumes the review as results arrive. Write each delivered message
|
|
46
|
-
unchanged to `.reviews/<branch-safe>/optimizer-{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
7. Reuse the
|
|
50
|
-
|
|
51
|
-
`
|
|
52
|
-
thinking overrides for Claude.
|
|
44
|
+
unchanged to `.reviews/<branch-safe>/optimizer-{a,b,c}.md`. After all three
|
|
45
|
+
arrive, merge them into `optimizer-merged.md`, preserving provenance and
|
|
46
|
+
deduplicating only clearly identical findings.
|
|
47
|
+
7. Reuse the same three model IDs for the Skeptic passes. Spawn three Skeptics
|
|
48
|
+
in parallel with `agent: "reviewer"` and `tools: "read,bash"`. Name the
|
|
49
|
+
tasks `skeptic-a`, `skeptic-b`, and `skeptic-c` in the same model order.
|
|
53
50
|
Give all Skeptics the merged Optimizer report and require independent
|
|
54
51
|
verification, targeted command evidence for Critical/Major findings, and
|
|
55
52
|
missed-issue detection. Their final assistant messages are the reports.
|
|
56
53
|
8. As Skeptic results arrive, write each delivered message unchanged to
|
|
57
|
-
`.reviews/<branch-safe>/skeptic-{
|
|
58
|
-
|
|
54
|
+
`.reviews/<branch-safe>/skeptic-{a,b,c}.md`. After all three arrive, write
|
|
55
|
+
`.reviews/<branch-safe>/summary.md`.
|
|
59
56
|
9. Recommend fixes only when a finding is Critical/Major and both the evidence
|
|
60
57
|
and Skeptic confidence support it. Do not apply fixes unless the user
|
|
61
58
|
explicitly requested an auto-fix review.
|