pi-herdr-agents 2.0.5 → 3.0.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.
Files changed (76) hide show
  1. package/AGENTS.md +20 -14
  2. package/CHANGELOG.md +56 -2
  3. package/CONTEXT.md +86 -32
  4. package/README.md +285 -138
  5. package/RELEASING.md +4 -2
  6. package/config.json.example +0 -3
  7. package/docs/README.md +38 -15
  8. package/docs/adr/0001-btw-ephemeral-side-questions.md +1 -1
  9. package/docs/adr/0002-agent-workflow-skill-runtime-taxonomy.md +1 -1
  10. package/docs/adr/0003-installable-role-packs.md +21 -13
  11. package/docs/adr/0009-remove-workflow-subsystem.md +1 -1
  12. package/docs/adr/0012-adopt-maestro-seams-in-repo.md +45 -0
  13. package/docs/adr/0013-pack-neutral-execution-host.md +63 -0
  14. package/docs/adr/0014-operator-cancel-terminal-intent.md +134 -0
  15. package/docs/worktree-subagents.md +4 -2
  16. package/maestro/adapters/fake/fake-harness-adapter.ts +263 -0
  17. package/{pi-extension/subagents/activity.ts → maestro/adapters/pi/activity-file.ts} +15 -72
  18. package/{pi-extension/subagents → maestro/adapters/pi/child}/subagent-done.ts +30 -3
  19. package/{pi-extension/subagents → maestro/adapters/pi}/completion.ts +4 -4
  20. package/{pi-extension/subagents → maestro/adapters/pi}/launch.ts +386 -328
  21. package/maestro/adapters/pi/model-registry.ts +46 -0
  22. package/maestro/adapters/pi/pi-harness-adapter.ts +701 -0
  23. package/maestro/adapters/pi/process-identity.ts +303 -0
  24. package/{pi-extension/subagents → maestro/adapters/pi}/session.ts +1 -13
  25. package/maestro/adapters/pi/task-model-init.ts +55 -0
  26. package/maestro/core/activity.ts +29 -0
  27. package/maestro/core/config/model-config.ts +473 -0
  28. package/{pi-extension/subagents → maestro/core/config}/pane-config.ts +4 -6
  29. package/{pi-extension/subagents → maestro/core/config}/persistent-config.ts +4 -6
  30. package/{pi-extension/subagents → maestro/core/config}/role-config.ts +15 -10
  31. package/{pi-extension/subagents → maestro/core/config}/supervision-config.ts +4 -6
  32. package/{pi-extension/subagents → maestro/core/config}/task-model-init.ts +45 -58
  33. package/maestro/core/config/task-model-types.ts +22 -0
  34. package/maestro/core/harness-adapter.ts +117 -0
  35. package/maestro/core/index.ts +3 -0
  36. package/{pi-extension/subagents → maestro/core}/lifecycle.ts +27 -126
  37. package/maestro/core/roles/discovery.ts +555 -0
  38. package/{pi-extension/subagents/runtime-routing.ts → maestro/core/routing.ts} +36 -43
  39. package/maestro/core/shell.ts +3 -0
  40. package/{pi-extension/subagents → maestro/core}/status.ts +3 -7
  41. package/{pi-extension/subagents → maestro/core}/supervision.ts +1 -1
  42. package/maestro/core/surface-provider.ts +185 -0
  43. package/maestro/core/types.ts +449 -0
  44. package/maestro/core/worktree-cleanup.ts +374 -0
  45. package/maestro/core/worktree.ts +93 -0
  46. package/maestro/runtime/index.ts +44 -0
  47. package/maestro/runtime/pi-run-session.ts +1210 -0
  48. package/maestro/runtime/run-session.ts +801 -0
  49. package/maestro/runtime/surface-retention.ts +6 -0
  50. package/maestro/runtime/task-model-init.ts +22 -0
  51. package/maestro/runtime/worktree-operations.ts +627 -0
  52. package/maestro/surfaces/fake/fake-surface-provider.ts +311 -0
  53. package/maestro/surfaces/herdr/herdr-surface-provider.ts +200 -0
  54. package/{pi-extension/subagents → maestro/surfaces/herdr}/herdr.ts +65 -14
  55. package/{pi-extension/subagents → maestro/surfaces/herdr}/terminal.ts +7 -5
  56. package/package.json +10 -9
  57. package/pi-extension/subagents/config-path.ts +5 -1
  58. package/pi-extension/subagents/index.ts +837 -1789
  59. package/pi-extension/subagents/model-registry.ts +46 -0
  60. package/skills/pi-herdr-agents/SKILL.md +276 -0
  61. package/agents/adversarial-reviewer.md +0 -153
  62. package/agents/planner.md +0 -87
  63. package/agents/poteto.md +0 -32
  64. package/agents/reviewer.md +0 -132
  65. package/agents/scout.md +0 -105
  66. package/agents/visual-tester.md +0 -234
  67. package/agents/worker.md +0 -121
  68. package/docs/review-evaluation.md +0 -183
  69. package/pi-extension/subagents/model-config.ts +0 -305
  70. package/pi-extension/subagents/plan-skill.md +0 -280
  71. package/pi-extension/subagents/worktree-cleanup.ts +0 -785
  72. package/skills/orchestrate/SKILL.md +0 -91
  73. package/skills/orchestrate/adversarial-review-example.js +0 -400
  74. package/skills/orchestrate/adversarial-review.md +0 -87
  75. /package/{pi-extension/subagents → maestro/core/config}/type-guards.ts +0 -0
  76. /package/{pi-extension/subagents → maestro/core}/wake.ts +0 -0
package/AGENTS.md CHANGED
@@ -6,6 +6,8 @@ These instructions apply to humans and coding agents changing `pi-herdr-agents`.
6
6
 
7
7
  `pi-herdr-agents` (Pi Herdr Agents) is a Pi extension that launches asynchronous Pi child agents exclusively in Herdr. Ordinary runs group child panes in extension-owned `Agents` tabs by default. Writing tasks may opt into one isolated Herdr-managed Git worktree per branch. Legacy role definitions that request an external CLI fail before Herdr creates resources.
8
8
 
9
+ The package is a pack-neutral execution host: it ships no agent roles and no planning or review workflows. Its only skill is `pi-herdr-agents`, a general operating guide for the host; do not add methodology or workflow skills here. Roles come from project or global definitions and separately installed role packs. Do not add bundled roles, a privileged default pack, or name-keyed workflow behavior; see [ADR-0013](docs/adr/0013-pack-neutral-execution-host.md).
10
+
9
11
  The extension is fire-and-forget: `subagent` returns an acknowledgement, and completion is delivered to the parent automatically. Never add polling guidance that tells callers to sleep, tail sessions, or repeatedly check status.
10
12
 
11
13
  ## Read these first
@@ -14,26 +16,30 @@ The extension is fire-and-forget: `subagent` returns an acknowledgement, and com
14
16
  - [`docs/README.md`](docs/README.md) — map of shipped contracts, active design, ADRs, and background research
15
17
  - [`CONTEXT.md`](CONTEXT.md) — workflow-domain glossary; read it before changing orchestration design
16
18
  - [`docs/adr/0003-installable-role-packs.md`](docs/adr/0003-installable-role-packs.md) — installable role-pack discovery, precedence, and collision contract
19
+ - [`docs/adr/0013-pack-neutral-execution-host.md`](docs/adr/0013-pack-neutral-execution-host.md) — role-free host ownership, removed commands, and `roles.bundled` deprecation
17
20
  - [`docs/worktree-subagents.md`](docs/worktree-subagents.md) — canonical worktree operating, review, recovery, and cleanup guide
18
21
  - [`RELEASING.md`](RELEASING.md) — release checks and publishing procedure
19
22
 
20
- Bundled role prompts live in [`agents/`](agents/). The native `/skill:orchestrate` public-review fan-out skill lives at [`skills/orchestrate/SKILL.md`](skills/orchestrate/SKILL.md). The `/plan` orchestration prompt lives at [`pi-extension/subagents/plan-skill.md`](pi-extension/subagents/plan-skill.md).
23
+ Former bundled roles, `/plan`, its plan skill, and `/skill:orchestrate` now belong to the separately maintained `pi-herdr-roles` and `pi-herdr-pstack` packs. `/iterate`, `/btw`, and `/btw-close` were removed. Do not reintroduce them here.
21
24
 
22
25
  ## Code map
23
26
 
24
- - `pi-extension/subagents/index.ts` — public tools/commands, agent discovery, launch/watch lifecycle, completion delivery, worktree manifests and handoffs
25
- - `pi-extension/subagents/herdr.ts` — Herdr CLI calls, response parsing, and ID-based Agents tab placement and capacity
26
- - `pi-extension/subagents/terminal.ts` — terminal adapter used by the lifecycle
27
- - `pi-extension/subagents/lifecycle.ts`, `status.ts`, `activity.ts` — process/turn state and widget projection
28
- - `pi-extension/subagents/wake.ts`, `supervision.ts`, `supervision-config.ts` — file wake-ups, shared pane reconciliation, polling fallback, and supervision configuration
29
- - `pi-extension/subagents/persistent-config.ts` — strict persistent-specialist cap configuration
30
- - `pi-extension/subagents/completion.ts`, `session.ts`, `subagent-done.ts` — child completion, transcript handling, `caller_ping`, and `subagent_done`
27
+ - `pi-extension/subagents/index.ts` — Pi composition root: public tools/commands, role-pack event bridge, host policy, widgets, and parent delivery
28
+ - `pi-extension/subagents/model-registry.ts`, `config-path.ts` — permanent host-local SDK capability glue and configuration-path conventions
29
+ - `maestro/core/` — seam interfaces and types; activity/lifecycle/status projection, routing, wake-ups, and supervision
30
+ - `maestro/core/roles/discovery.ts`, `maestro/core/config/` — role parsing/discovery, injected-directory config loaders, and task-model init prompt construction
31
+ - `maestro/core/worktree.ts`, `worktree-cleanup.ts` — manifest schema/state, handoff types, and cleanup eligibility/formatting
32
+ - `maestro/adapters/pi/` — `PiHarnessAdapter`, launch transactions, completion evidence, session I/O, activity files, SDK model glue, and task-model registry projection
33
+ - `maestro/adapters/pi/child/subagent-done.ts` — child protocol: `caller_ping`, `subagent_done`, and activity recording
34
+ - `maestro/surfaces/herdr/` — `HerdrSurfaceProvider`, Herdr CLI driver, and terminal scripts/placement
35
+ - `maestro/runtime/` — `RunSession`, Pi composition, run ownership, controls/retries, observation, delivery-gated cleanup, worktree operations/handoff, and task-model init composition
36
+ - `maestro/adapters/fake/`, `maestro/surfaces/fake/`, `test/maestro/` — conformance fakes, seam tests, and the dependency-rule test
31
37
  - `CONTEXT.md` — orchestration-domain glossary
32
- - `docs/adr/` — hard-to-reverse architectural decisions
38
+ - `docs/adr/` — hard-to-reverse architectural decisions; [ADR-0012](docs/adr/0012-adopt-maestro-seams-in-repo.md) records the maestro seams decision
33
39
  - `docs/research/` — evidence and alternatives, never the shipped contract
34
40
  - `test/test.ts` — unit tests for public subagent extension seams
35
- - `test/package-skill.test.js` — bundled skill and package manifest contract test
36
- - `test/integration/` — real Herdr and Pi lifecycle tests using the deterministic provider by default
41
+ - `test/package-manifest.test.js` — package manifest and pack-neutral package-content contract test
42
+ - `test/integration/` — real Herdr and Pi lifecycle tests using the deterministic provider by default; `test/integration/agents/` holds test-only role fixtures, including the multi-wave `test-coordinator`
37
43
  - `test/bench/supervision-bench.mjs` — manual isolated-Herdr supervision transport benchmark; raw samples stay in `/tmp/issue29-bench/`
38
44
 
39
45
  ## Worktree contract
@@ -69,8 +75,8 @@ When behavior changes, update every affected surface in the same commit:
69
75
  - public tool parameters, role-pack protocol, or lifecycle → `README.md`
70
76
  - role-pack discovery, precedence, or collision policy → `docs/adr/0003-installable-role-packs.md`
71
77
  - worktree behavior, handoff, recovery, or cleanup → `docs/worktree-subagents.md`
72
- - agent operating expectations → relevant files in `agents/`
73
- - `/plan` orchestration policy → `pi-extension/subagents/plan-skill.md`
78
+ - role prompts, `/plan`, and review-workflow methodology → the owning role pack, not this repository
79
+ - the `PI_SUBAGENT_ID` child-context hint → `README.md` and `CONTEXT.md`
74
80
  - contributor/release verification → this file, `.pi/skills/run-integration-tests/SKILL.md`, or `RELEASING.md`
75
81
  - domain terminology → `CONTEXT.md`
76
82
  - hard-to-reverse orchestration trade-offs → the relevant ADR; do not create an ADR for every design question
@@ -105,7 +111,7 @@ Use `PI_TEST_MODEL="openai-codex/gpt-5.6-luna" PI_TEST_TIMEOUT=180000 npm run te
105
111
  Before committing:
106
112
 
107
113
  - inspect `git status` and the final diff;
108
- - confirm the package preview includes `CHANGELOG.md`, `skills/orchestrate/SKILL.md`, `skills/orchestrate/adversarial-review.md`, and `skills/orchestrate/adversarial-review-example.js`, while excluding `pi-extension/subagents/workflow-worker.js`, plans, journals, sessions, prototypes, generated evidence, local config, and `openspec/`;
114
+ - confirm the package preview includes `CHANGELOG.md`, `README.md`, `config.json.example`, and `pi-extension/subagents/index.ts`, contains no `agents/` resources, no `skills/` resources other than the host-owned `skills/pi-herdr-agents/SKILL.md`, and no `pi-extension/subagents/plan-skill.md`, and excludes `pi-extension/subagents/workflow-worker.js`, plans, journals, sessions, prototypes, generated evidence, local config, and `openspec/`;
109
115
  - run `npm pack --dry-run` when package contents or documentation paths changed; durable configuration is `$PI_CODING_AGENT_DIR/herdr-agents/config.json`, never package-root `config.json` (move old files manually or re-run `/subagents-init`);
110
116
  - confirm that no generated plans, journals, sessions, provider configuration, test scripts, or review artifacts are staged; and
111
117
  - confirm that no accidental empty directory exists at the repository root:
package/CHANGELOG.md CHANGED
@@ -7,7 +7,60 @@ 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
- ## [v2.0.5](https://github.com/giuseppecrj/pi-herdr-agents/compare/v2.0.4...v2.0.5)
10
+ ## [v3.0.1](https://github.com/giuseppecrj/pi-herdr-agents/compare/v3.0.0...v3.0.1)
11
+
12
+ ### Merged
13
+
14
+ - docs: README accuracy and install confidence for 3.0.0 [`#75`](https://github.com/giuseppecrj/pi-herdr-agents/pull/75)
15
+
16
+ ### Commits
17
+
18
+ - docs: README for 3.0.0: pstack ships poteto-mode not a role, safety and uninstall, contents, agent pointer [`7ed9969`](https://github.com/giuseppecrj/pi-herdr-agents/commit/7ed99693b1a2d25137d4ba2430f23255923ce3ea)
19
+ - docs: hero image uses generic agent labels instead of removed role names [`70ad6f0`](https://github.com/giuseppecrj/pi-herdr-agents/commit/70ad6f04d492f58e04062e01c1a529ddd1708431)
20
+ - docs: address review: full write footprint, worktree cleanup before uninstall, skill table delimiter [`ababee3`](https://github.com/giuseppecrj/pi-herdr-agents/commit/ababee3a3f18d2112ec8959303986e1a08e3dc2a)
21
+
22
+ ## [v3.0.0](https://github.com/giuseppecrj/pi-herdr-agents/compare/v2.0.5...v3.0.0) - 2026-10-06
23
+
24
+ ### Merged
25
+
26
+ - Release 3.0.0 [`#74`](https://github.com/giuseppecrj/pi-herdr-agents/pull/74)
27
+ - Add subagent_cancel for ordinary managed subagents [`#73`](https://github.com/giuseppecrj/pi-herdr-agents/pull/73)
28
+ - Add the pi-herdr-agents operating skill [`#72`](https://github.com/giuseppecrj/pi-herdr-agents/pull/72)
29
+ - Conditional task-model writes with expectedConfigRevision [`#71`](https://github.com/giuseppecrj/pi-herdr-agents/pull/71)
30
+ - Pack-neutral execution host: move bundled roles and workflows to optional packs [`#70`](https://github.com/giuseppecrj/pi-herdr-agents/pull/70)
31
+
32
+ ### Commits
33
+
34
+ - refactor: compose Pi runs through owned sessions [`e9f8039`](https://github.com/giuseppecrj/pi-herdr-agents/commit/e9f803992894d304c4eb5b7608ab6cce4464ee16)
35
+ - refactor: complete maestro core and dependency boundaries [`2ae8ba5`](https://github.com/giuseppecrj/pi-herdr-agents/commit/2ae8ba57b07d2f77b01363fe175f3b9084ebf6eb)
36
+ - feat!: ship a pack-neutral execution host [`e262c58`](https://github.com/giuseppecrj/pi-herdr-agents/commit/e262c584f54a7c8d60eb1fa5510f47c1299e3801)
37
+ - refactor: establish maestro seams and route Herdr surfaces [`20e5f2a`](https://github.com/giuseppecrj/pi-herdr-agents/commit/20e5f2aee1bebedf22f3b2e78dbf9b5a11f466ef)
38
+ - refactor: route Pi child protocol through harness adapter [`891a533`](https://github.com/giuseppecrj/pi-herdr-agents/commit/891a533d517b4edc86dda19dc99476198741ea89)
39
+ - chore: target Pi 1.0.0 dev dependencies [`a32e02f`](https://github.com/giuseppecrj/pi-herdr-agents/commit/a32e02ff4fed38f0d02a875ed6769f01266577e3)
40
+ - fix: judge worktree cancel by launch-verified process identity [`37d8c62`](https://github.com/giuseppecrj/pi-herdr-agents/commit/37d8c62496aa7e4a421ca3e13d4dfeb8265a151a)
41
+ - feat: add subagent_cancel for ordinary managed subagents [`05e53b8`](https://github.com/giuseppecrj/pi-herdr-agents/commit/05e53b87d3a7d7724f5d784b9eab5e51a1d33a79)
42
+ - fix: bound worktree cancel by its deadline and judge late-captured identity [`f146db2`](https://github.com/giuseppecrj/pi-herdr-agents/commit/f146db2738a0c7fb557e73eaaff90b2845076553)
43
+ - updates [`2b0a187`](https://github.com/giuseppecrj/pi-herdr-agents/commit/2b0a187aedbe2421c2966989cbff5e9c7adf1cc8)
44
+ - feat: conditional task model config writes [`b04906b`](https://github.com/giuseppecrj/pi-herdr-agents/commit/b04906b6d6d0f81ac23a64753a5aec2b506c6423)
45
+ - fix: require owned-process exit evidence and settle cancel edge cases [`3572b4f`](https://github.com/giuseppecrj/pi-herdr-agents/commit/3572b4f40dc004db83a90708234962ec7c10412b)
46
+ - docs: add maestro seams design spec [`ce886f3`](https://github.com/giuseppecrj/pi-herdr-agents/commit/ce886f3660e9a995546904e625ca66a7ec55b9bb)
47
+ - docs: record completed in-repo maestro seams [`d7291c2`](https://github.com/giuseppecrj/pi-herdr-agents/commit/d7291c26daa1b9aacdf0640fdccc27cab2dd0de8)
48
+ - docs: replace subagent-lifecycle with general pi-herdr-agents operating skill [`7121f33`](https://github.com/giuseppecrj/pi-herdr-agents/commit/7121f33e9abe4a25f075dc1e2f96e10a90bc1004)
49
+ - docs: add subagent-lifecycle host skill [`bfce217`](https://github.com/giuseppecrj/pi-herdr-agents/commit/bfce2177984a7b5fededc2b3a7fe255cc966e46c)
50
+ - fix: keep a failed SIGTERM to a live identity unconfirmed and drop overdue provider answers [`4a3992d`](https://github.com/giuseppecrj/pi-herdr-agents/commit/4a3992d865eeb0a11a23350ff4de92dd892e30c2)
51
+ - docs: fix host operating skill review findings and packaging wording [`bbeb580`](https://github.com/giuseppecrj/pi-herdr-agents/commit/bbeb580a5fb38d780209babcd8b5f7848b8543e2)
52
+ - docs: add 3.0.0 release notes and clarify bare-spawn systemPrompt delivery [`b8b23a0`](https://github.com/giuseppecrj/pi-herdr-agents/commit/b8b23a0893d5d9e6176703305838e24bc91391e8)
53
+ - docs(skill): document subagent_cancel in host operating guide [`7a3508c`](https://github.com/giuseppecrj/pi-herdr-agents/commit/7a3508cfe886b5f7932bdf77d3d3a516d2a7dfcd)
54
+ - chore: release v3.0.0 [`b383574`](https://github.com/giuseppecrj/pi-herdr-agents/commit/b383574778aad1498c12ddeb48af6dd32f383856)
55
+ - test(integration): scope the untouched-pane check to the runner's own workspace [`fa483ea`](https://github.com/giuseppecrj/pi-herdr-agents/commit/fa483ea918f862da35162ca4d73ae6191288fa99)
56
+ - docs: scope the pack-neutral claim to roles and workflows [`e75bea8`](https://github.com/giuseppecrj/pi-herdr-agents/commit/e75bea84a79218c9367ea5a165cbab161e2fb217)
57
+ - fix: declare pi.skills so the lifecycle skill actually loads [`5b45e7f`](https://github.com/giuseppecrj/pi-herdr-agents/commit/5b45e7fb17080fe7b5d1d7e675d234fc140ed144)
58
+ - docs(skill): cancel confirmation on absent pane; split requested vs unconfirmed guidance [`787f633`](https://github.com/giuseppecrj/pi-herdr-agents/commit/787f633f49a540a38665f76300d725037a4aaa45)
59
+ - docs: correct subagent_done applicability in the host guide [`ea4602c`](https://github.com/giuseppecrj/pi-herdr-agents/commit/ea4602ce728348a42a332ac091380cc8552663ea)
60
+ - docs: persistent interactive exception and thinking omission wording [`2692c51`](https://github.com/giuseppecrj/pi-herdr-agents/commit/2692c511696ffde339b235bbd146654ecc29562d)
61
+ - Merge pull request #69: in-repo maestro seams [`c2177df`](https://github.com/giuseppecrj/pi-herdr-agents/commit/c2177dff835da44937e614e8a03d0405d442e848)
62
+
63
+ ## [v2.0.5](https://github.com/giuseppecrj/pi-herdr-agents/compare/v2.0.4...v2.0.5) - 2026-09-28
11
64
 
12
65
  ### Merged
13
66
 
@@ -18,9 +71,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
18
71
 
19
72
  ### Commits
20
73
 
74
+ - perf(startup): skip worktree inventory during session init [`8de2447`](https://github.com/giuseppecrj/pi-herdr-agents/commit/8de24470cb53fd345979cfe501a10645202403e0)
75
+ - chore: release v2.0.5 [`ada6018`](https://github.com/giuseppecrj/pi-herdr-agents/commit/ada60185600383a207bb2a24e43d9b66b9ed8288)
21
76
  - test(worktrees): make quoting expectations independent [`a526824`](https://github.com/giuseppecrj/pi-herdr-agents/commit/a526824dcffd97fa09b158fba5cae05ff75fc100)
22
77
  - Merge commit '5fc2ea04b52a03df35b246cef6cb524516d34350' into maint/pr57-null-render-type [`e6fe747`](https://github.com/giuseppecrj/pi-herdr-agents/commit/e6fe747d5df44789df1e8fd42b585d4dbc36a144)
23
- - perf(startup): skip worktree inventory during session init [`8de2447`](https://github.com/giuseppecrj/pi-herdr-agents/commit/8de24470cb53fd345979cfe501a10645202403e0)
24
78
  - fix(worktrees): keep in-scope inventory rows visible [`41639a7`](https://github.com/giuseppecrj/pi-herdr-agents/commit/41639a7673e7a48c28e34e3f3f079c02f6454264)
25
79
  - refactor(cleanup): remove unused inventory notice [`330cc96`](https://github.com/giuseppecrj/pi-herdr-agents/commit/330cc9669eff14358e9eea8999f024e0ebfe4187)
26
80
  - docs: make worktree inventory on-demand [`e946dba`](https://github.com/giuseppecrj/pi-herdr-agents/commit/e946dba9ca246c15e581f35c098ccf88f003c4f9)
package/CONTEXT.md CHANGED
@@ -3,11 +3,48 @@
3
3
  ## Language
4
4
 
5
5
  **Pi subagent runtime**:
6
- The single execution path for fresh and resumed children. `launchPiSubagent()`
7
- owns the complete Pi and Herdr launch transaction; completion uses Pi sidecar
8
- evidence first and the terminal exit marker as fallback.
6
+ The single real execution path for fresh and resumed children, coordinated by a
7
+ run session through the Pi harness adapter. `launchPiSubagent()` still owns each
8
+ complete launch transaction; completion uses Pi sidecar evidence first and the
9
+ terminal exit marker as fallback.
9
10
  _Avoid_: Runtime dispatch, adapter registry, split launch ownership
10
11
 
12
+ **Harness adapter**:
13
+ An object implementing the core interface for child launch, observation,
14
+ completion evidence, and controls. Pi is the only real implementation; the fake
15
+ is for conformance tests.
16
+ _Avoid_: Runtime selector, adapter registry, external CLI compatibility
17
+
18
+ **Surface provider**:
19
+ An object implementing the core interface for panes, commands, inspection, and
20
+ worktree surfaces. Herdr is the only real implementation; the fake is for
21
+ conformance tests.
22
+ _Avoid_: Supported multiplexer catalog, harness adapter, security sandbox
23
+
24
+ **Run session**:
25
+ The runtime owner coordinating launched attempts, retries, observations,
26
+ settlement, and delivery-gated surface cleanup. Pi composition supplies the
27
+ real adapter, provider, and session I/O.
28
+ _Avoid_: Pi session file, persistent specialist identity, historical run registry
29
+
30
+ **Composition root**:
31
+ The Pi host entry point that registers tools and commands, supplies current
32
+ launch inputs and host policy, renders status, and delivers parent results.
33
+ Runtime composition constructs adapters and providers behind its operations.
34
+ _Avoid_: Direct adapter dispatch, duplicated launch owner, workflow engine
35
+
36
+ **Dependency rule**:
37
+ The test-enforced import boundaries between core, adapters, surfaces, runtime,
38
+ and the Pi host. Core stays harness-neutral; the host consumes core and runtime
39
+ without direct adapter or surface imports.
40
+ _Avoid_: Runtime authorization, package split, hidden compatibility re-export
41
+
42
+ **Conformance suite**:
43
+ Shared seam-contract tests applied to an in-memory fake and the real
44
+ implementation. Fake coverage is local; real Pi and Herdr coverage uses the
45
+ deterministic integration suite.
46
+ _Avoid_: Second supported harness, fake-only behavior proof, release certification
47
+
11
48
  **Child wake-up signal**:
12
49
  An internal indication that prompts fresh inspection of an owned child. It does
13
50
  not itself establish completion, failure, or a help request.
@@ -18,6 +55,22 @@ The parent-facing handoff of a child run's observed outcome and available
18
55
  evidence. Receiving it does not establish that the work is correct or accepted.
19
56
  _Avoid_: Wake-up signal, acceptance
20
57
 
58
+ **Operator cancel**:
59
+ A parent's `subagent_cancel` of one ordinary managed run. Its terminal intent is
60
+ recorded before any abort, kill, or await, so no fallback, retry, or recovery
61
+ follows. The run settles with one cancelled result only after its owned process
62
+ or pane termination is confirmed; unconfirmed termination keeps it live for a
63
+ retry, and shutdown suppression of it is not a cancellation. A natural result
64
+ taken first stays authoritative.
65
+ _Avoid_: Interrupt, suppression, persistent stop, pane-close fallback
66
+
67
+ **Process identity**:
68
+ A managed worktree child's Pi process named by immutable kernel facts (PID,
69
+ start time, boot, and PID namespace), recorded by the child at launch and
70
+ verified by the parent against the Herdr pane. A worktree cancel signals and
71
+ judges exit only by it.
72
+ _Avoid_: argv match, foreground process, shell visibility
73
+
21
74
  **No-progress advisory**:
22
75
  An internal warning that an active child shows no durable progress in its session
23
76
  JSONL or activity snapshot. It is advisory only and never changes the child's
@@ -30,18 +83,34 @@ diagnostic, and launch fails before Herdr creates a pane or worktree. Remove
30
83
  `cli` and `cli-model`, then select the model through Pi provider/model routing.
31
84
  _Avoid_: Silent Pi reinterpretation, compatibility adapter
32
85
 
33
- **Public review fan-out**:
34
- A parent procedure that materializes pinned evidence, launches fresh public
35
- reviewer subagents, receives automatic result delivery, and synthesizes every
36
- outcome. Reviewers use ordinary panes and do not poll for completion.
37
- _Avoid_: Hidden child runner, approval gate, parentless aggregation
38
-
39
- **Pinned review evidence**:
40
- The parent-captured repository identity, base and head SHAs, task/spec text,
41
- provenance, changed-file inventory, complete diff, and deleted or base-only
42
- content supplied to reviewers. Dirty state is included only when explicitly
43
- captured and fingerprinted.
44
- _Avoid_: Moving-checkout inference, head-only deleted-content review
86
+ **Pack-neutral host**:
87
+ This package as an execution host that ships no agent roles and no planning or
88
+ review workflows. Its only skill, `pi-herdr-agents`, is a general operating guide for its own
89
+ control tools. Role packs and project or global definitions supply every
90
+ named role. An empty catalog is valid, and bare launches need no role.
91
+ _Avoid_: Default role set, privileged pack, starter workflow
92
+
93
+ **Role pack**:
94
+ A separately installed Pi package that registers role definitions through the
95
+ `pi-herdr-subagents:roles:discover:v1` event. Registered packs form the whole
96
+ package layer below global and project definitions; duplicate names across
97
+ packs are disabled. A pack owns its roles' workflows, skills, prerequisites, and
98
+ workflow glossary.
99
+ _Avoid_: Bundled layer, protected fallback, load-order winner
100
+
101
+ **Child-context hint**:
102
+ The `PI_SUBAGENT_ID` environment variable set for every fresh or resumed child
103
+ this extension launches, and absent from `/worktree` handoff sessions. It
104
+ distinguishes delegated children from user sessions for tool registration and
105
+ pack state decisions. Nested processes inherit it, so it is not a security
106
+ boundary.
107
+ _Avoid_: Authentication token, permission check, second child protocol
108
+
109
+ **Deprecated role setting**:
110
+ A valid legacy `roles.bundled` boolean, accepted as a no-op and reported once per
111
+ parent extension load. Malformed values remain configuration errors. The
112
+ extension never rewrites user configuration.
113
+ _Avoid_: Bundled-role toggle, automatic migration
45
114
 
46
115
  **Role allowlist**:
47
116
  The `tools:` inline comma-separated role-frontmatter scalar passed to Pi for a
@@ -49,20 +118,6 @@ public child. It is the enforced capability boundary available to a reviewer.
49
118
  `read,bash` is not read-only because Bash can mutate files.
50
119
  _Avoid_: Shell-as-read-only claim, implicit capability grant
51
120
 
52
- **Finding record**:
53
- A bounded review record with a stable ID, claimed P0–P3 severity, nullable
54
- confirmed severity, separate provenance, evidence status (`reproduced`,
55
- `trace-backed`, or `unverified`), preconditions, reproduction or trace, expected
56
- and actual behavior, impact, and minimal fix. An unverified potential P0/P1 is
57
- a candidate for verification, not a certified finding.
58
- _Avoid_: Confidence gate, provenance-as-severity, vote count
59
-
60
- **Incomplete review**:
61
- A review outcome for drift, failure, missing or truncated evidence, malformed
62
- output, coverage gaps, or unresolved serious candidates. A child-reported
63
- `INCOMPLETE` propagates to the parent result.
64
- _Avoid_: Hidden missing coverage, certified uncertainty
65
-
66
121
  **Persistent specialist**:
67
122
  A logical subagent that retains one policy-bound Pi session between sequential
68
123
  tasks until it is stopped or crashes.
@@ -156,9 +211,8 @@ model family than the author. For ordinary review, prefer a different
156
211
  authenticated model family. When no other authenticated model family is
157
212
  available, ordinary review may use a same-family reviewer in a fresh standalone
158
213
  session. Disclose that this review is context-isolated, not cross-family
159
- independent. Cross-family verification, `/skill:orchestrate`, and
160
- `adversarial-reviewer` must not use this fallback. Family is the independence
161
- boundary; project policy may separately require a
214
+ independent. Cross-family verification must not use this fallback. Family is
215
+ the independence boundary; project policy may separately require a
162
216
  different provider.
163
217
  _Avoid_: Generic tier, reviewer-family enforcement, per-step routing
164
218