pi-herdsman 0.7.1 → 0.7.3
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/SKILL.md +17 -4
- package/dist/index.js +62 -49
- package/docs/concepts/delegation.md +22 -8
- package/docs/concepts/lifecycle.md +37 -14
- package/docs/development/smoke-testing.md +26 -9
- package/docs/guides/recovery.md +21 -0
- package/package.json +1 -1
|
@@ -84,21 +84,35 @@ Do not:
|
|
|
84
84
|
|
|
85
85
|
- delegate overlapping writers to one worktree;
|
|
86
86
|
- delegate review before the writer finishes;
|
|
87
|
-
-
|
|
88
|
-
-
|
|
87
|
+
- repeat work already assigned to an active agent;
|
|
88
|
+
- delegate substantially overlapping work to multiple active agents;
|
|
89
|
+
- continue work that depends on an active agent result;
|
|
90
|
+
- inspect, list, or steer active agents merely to check progress or completion.
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
Direct ownership grants lifecycle and control authority. It does not make the
|
|
93
|
+
owner a second executor of an active delegated assignment.
|
|
94
|
+
|
|
95
|
+
A useful parallel pattern is:
|
|
91
96
|
|
|
92
97
|
```text
|
|
93
|
-
|
|
94
|
-
├──
|
|
95
|
-
|
|
98
|
+
controller
|
|
99
|
+
├── agent A: independent reconnaissance
|
|
100
|
+
├── agent B: separate independent analysis
|
|
101
|
+
└── local: bounded independent controller work
|
|
102
|
+
|
|
103
|
+
local work becomes sufficiently complete
|
|
104
|
+
↓
|
|
105
|
+
controller ends its turn
|
|
96
106
|
|
|
97
|
-
agent result
|
|
107
|
+
agent result or attention resumes the controller
|
|
98
108
|
↓
|
|
99
|
-
|
|
109
|
+
controller integrates and reassesses
|
|
100
110
|
```
|
|
101
111
|
|
|
112
|
+
Parallelism is optional. Do not create additional assignments or local side work
|
|
113
|
+
merely to keep the controller active. For the full turn-navigation model, see
|
|
114
|
+
[Asynchronous orchestration](lifecycle.md#asynchronous-orchestration).
|
|
115
|
+
|
|
102
116
|
## Clarification across ownership edges
|
|
103
117
|
|
|
104
118
|
An agent may ask its exact direct owner through `ask_owner`.
|
|
@@ -77,26 +77,49 @@ restart recovery. The agent then runs independently in its managed Pi session
|
|
|
77
77
|
while the owner remains available for other useful work and, for a lead Pi
|
|
78
78
|
session, continued user interaction.
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
Each active delegated assignment has one executor: that agent. The owner retains
|
|
81
|
+
lifecycle and control authority but does not repeat the delegated assignment
|
|
82
|
+
locally or assign substantially overlapping work elsewhere.
|
|
83
|
+
|
|
84
|
+
After starting an agent assignment or receiving an agent result or attention
|
|
85
|
+
event, the owner reassesses the remaining work:
|
|
86
|
+
|
|
87
|
+
1. Handle required agent control when needed.
|
|
88
|
+
2. Delegate another concrete, necessary objective when it is independent of
|
|
89
|
+
active assignments and an authorized agent is the right owner.
|
|
90
|
+
3. Continue concrete, necessary independent work locally when the owner is the
|
|
91
|
+
right owner and doing it now materially advances the task.
|
|
92
|
+
4. Otherwise end the turn.
|
|
93
|
+
|
|
94
|
+
After control, delegation, or local parallel work, the owner reassesses again.
|
|
95
|
+
Once further useful progress depends on active agents, or no other concrete,
|
|
96
|
+
necessary independent work remains, it ends the turn. Agent results,
|
|
97
|
+
clarifications, and recovery attention resume the session automatically.
|
|
98
|
+
|
|
99
|
+
The owner does not invent side work merely because agents are running. It does
|
|
100
|
+
not poll, sleep, inspect merely for progress, send status steering, or use
|
|
101
|
+
another mechanism to keep the turn alive.
|
|
84
102
|
|
|
85
103
|
Conceptually:
|
|
86
104
|
|
|
87
105
|
```text
|
|
88
|
-
assignment
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
106
|
+
assignment or agent event
|
|
107
|
+
↓
|
|
108
|
+
reassess remaining work
|
|
109
|
+
↙ ↓ ↘
|
|
110
|
+
control parallel no useful
|
|
111
|
+
work action
|
|
112
|
+
↙ ↘ ↓
|
|
113
|
+
delegate local end turn
|
|
114
|
+
\ / ↓
|
|
115
|
+
reassess agent event resumes
|
|
95
116
|
```
|
|
96
117
|
|
|
97
|
-
This is asynchronous but not fire-and-forget. The owner retains
|
|
98
|
-
|
|
99
|
-
requests, and remains responsible for
|
|
118
|
+
This is asynchronous but not fire-and-forget. The owner retains lifecycle and
|
|
119
|
+
control authority: it can steer eligible active work when the assignment
|
|
120
|
+
actually changes, receives clarification requests, and remains responsible for
|
|
121
|
+
result delivery and cleanup. The delegated agent remains the executor of its
|
|
122
|
+
active assignment.
|
|
100
123
|
|
|
101
124
|
## Exactly-once assignment result
|
|
102
125
|
|
|
@@ -155,25 +155,42 @@ Verify:
|
|
|
155
155
|
6. agent produces exactly one final result;
|
|
156
156
|
7. no agent/mailbox leak remains.
|
|
157
157
|
|
|
158
|
-
## Delegating-agent
|
|
158
|
+
## Delegating-agent turn ending
|
|
159
159
|
|
|
160
|
-
Ask a
|
|
161
|
-
|
|
160
|
+
Ask a delegation-enabled controller to delegate required reconnaissance when no
|
|
161
|
+
other concrete, necessary independent work is known.
|
|
162
162
|
|
|
163
163
|
Inspect the actual transcript and verify the delegating agent:
|
|
164
164
|
|
|
165
|
-
- ends its turn
|
|
165
|
+
- ends its turn after the assignment when nothing else useful is independently actionable;
|
|
166
|
+
- does not repeat the delegated reconnaissance locally;
|
|
167
|
+
- does not manufacture adjacent analysis merely to remain active;
|
|
168
|
+
- does not delegate substantially overlapping reconnaissance to another agent;
|
|
166
169
|
- does not poll `agent list`;
|
|
167
|
-
- does not
|
|
168
|
-
-
|
|
170
|
+
- does not use `agent inspect` or `agent steer` merely to check progress;
|
|
171
|
+
- does not send "finish", "status", or equivalent progress nudges to a healthy
|
|
172
|
+
agent;
|
|
173
|
+
- does not sleep or use another mechanism to keep the turn alive;
|
|
174
|
+
- the agent result resumes the controller session;
|
|
169
175
|
- integrates the result into one final delegating agent outcome.
|
|
170
176
|
|
|
171
177
|
## Useful concurrency
|
|
172
178
|
|
|
173
|
-
|
|
179
|
+
Delegate bounded task A and give the controller concrete, necessary independent
|
|
180
|
+
local task B.
|
|
174
181
|
|
|
175
|
-
Verify
|
|
176
|
-
|
|
182
|
+
Verify:
|
|
183
|
+
|
|
184
|
+
- B proceeds while A is active;
|
|
185
|
+
- B does not repeat A's assigned scope;
|
|
186
|
+
- once B is sufficiently complete, the controller reassesses instead of
|
|
187
|
+
manufacturing more work;
|
|
188
|
+
- if further useful progress depends on A, the controller ends its turn;
|
|
189
|
+
- A's result resumes the controller and is integrated.
|
|
190
|
+
|
|
191
|
+
Also verify a controller with two already-known independent delegated objectives
|
|
192
|
+
may delegate A and B before ending its turn. It must not create a third
|
|
193
|
+
assignment merely to increase concurrency.
|
|
177
194
|
|
|
178
195
|
## Lead `/agents` commands
|
|
179
196
|
|
package/docs/guides/recovery.md
CHANGED
|
@@ -101,6 +101,27 @@ The normal response is to inspect the returned stage/diagnostic and the current
|
|
|
101
101
|
herdr environment. Do not add client-side polling or arbitrary sleeps as an
|
|
102
102
|
operator workaround.
|
|
103
103
|
|
|
104
|
+
Managed Herdr panes must be able to reach their interactive shell prompt
|
|
105
|
+
without requiring human input. Shell startup that waits for a question,
|
|
106
|
+
confirmation, first-run wizard, credential prompt, or similar interaction can
|
|
107
|
+
prevent agent startup.
|
|
108
|
+
|
|
109
|
+
Herdr sets `HERDR_ENV=1` in pane processes, so shell configuration can use that
|
|
110
|
+
marker to disable interactive startup behavior only inside Herdr.
|
|
111
|
+
|
|
112
|
+
For example, with Oh My Zsh, place this before sourcing Oh My Zsh:
|
|
113
|
+
|
|
114
|
+
```zsh
|
|
115
|
+
[[ ${HERDR_ENV:-} == 1 ]] && zstyle ':omz:update' mode disabled
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Normal terminals keep their configured update behavior; Herdr panes skip
|
|
119
|
+
automatic Oh My Zsh update checks. Run `omz update` manually when desired.
|
|
120
|
+
|
|
121
|
+
If startup still fails, inspect the returned `pane_readiness` stage and bounded
|
|
122
|
+
pane diagnostic rather than adding arbitrary sleeps or automatically answering
|
|
123
|
+
terminal prompts.
|
|
124
|
+
|
|
104
125
|
## Cleanup or rollback failure
|
|
105
126
|
|
|
106
127
|
A `rollback_failure` can contain both:
|
package/package.json
CHANGED