@zachwill/pi-orchestrate 0.4.2 → 0.4.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/README.md +5 -5
- package/extension/contract.ts +7 -5
- package/extension/tools.ts +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Pi Orchestrate adds exactly five tools:
|
|
|
28
28
|
|
|
29
29
|
Each `orchestrate` call validates its input, worker definition, and model before allocating IDs or starting a session. Calls are admitted independently: a rejected sibling does not block valid siblings. After admission, a startup or prompt failure settles only that worker as `failed`.
|
|
30
30
|
|
|
31
|
-
Pi executes sibling tool calls concurrently
|
|
31
|
+
Pi executes sibling tool calls concurrently. There is no extension-level sibling-group cap or hidden throttle. Before yielding, spin up as many workers as needed for the full initial wave, covering every useful independent task and distinct validation perspective with sibling `orchestrate` calls in one assistant message. Finish dispatching that wave without waiting for any sibling's acceptance or completion; if one call is emitted separately, continue dispatching the rest of the wave.
|
|
32
32
|
|
|
33
33
|
Execution mode depends on the complete tool-call group:
|
|
34
34
|
|
|
@@ -65,10 +65,10 @@ Workers, runs, and queued delivery survive extension reloads and session switche
|
|
|
65
65
|
|
|
66
66
|
Pi Orchestrate injects the authoritative orchestration contract and trusted catalog into the parent system prompt. The parent remains responsible for the task end to end:
|
|
67
67
|
|
|
68
|
-
1. Keep trivial or tightly coupled work in the parent.
|
|
69
|
-
2. Give every worker a thorough, self-contained brief with the objective, paths and scope, context, success criteria, and expected output. State forbidden actions explicitly.
|
|
70
|
-
3. Before yielding, dispatch
|
|
71
|
-
4. As results expose new independent work, dispatch
|
|
68
|
+
1. Keep trivial or tightly coupled work in the parent. For broad work, spin up as many workers as needed to cover every useful bounded independent scope and distinct validation perspective; never use a small default or the number of roles the user names. Named workers and counts are a floor unless the user explicitly states an exact cap; the same role can be instantiated for multiple scopes.
|
|
69
|
+
2. Give every worker a thorough, self-contained brief with the objective, paths and scope, context, success criteria, and expected output. Distinct validation perspectives can intentionally overlap, but avoid accidental duplicate work. State forbidden actions explicitly.
|
|
70
|
+
3. Before yielding, dispatch the full initial wave. Never stop after one call while another useful scope or perspective can run independently, and never wait for one sibling's acceptance or completion before dispatching the rest.
|
|
71
|
+
4. As results expose new independent work, dispatch each full adaptive wave in parallel and continue until the whole task is complete.
|
|
72
72
|
5. Review evidence and changes, resolve conflicts, integrate deliberately, and verify the result.
|
|
73
73
|
6. Produce the final answer from the parent session.
|
|
74
74
|
|
package/extension/contract.ts
CHANGED
|
@@ -29,15 +29,17 @@ function buildContract(catalog: WorkerCatalog): string {
|
|
|
29
29
|
|
|
30
30
|
You are the parent orchestrator and own the task end to end.
|
|
31
31
|
|
|
32
|
-
- Keep trivial or tightly coupled work in the parent.
|
|
33
|
-
-
|
|
34
|
-
-
|
|
32
|
+
- Keep trivial or tightly coupled work in the parent. For broad work, proactively identify every useful bounded independent scope and every materially distinct evidence, hypothesis, or validation perspective. Spin up as many workers as needed to cover them; never use a small fixed default.
|
|
33
|
+
- Treat worker roles and counts named by the user as minimum requirements, not ceilings. Exceed them when additional useful independent scopes or materially distinct perspectives exist, unless the user explicitly sets an exact cap. A worker role is reusable: dispatch the same catalog worker in many calls when it fits separate scopes or perspectives.
|
|
34
|
+
- Before dispatching, enumerate the full first parallel wave from the work itself. Dispatch that entire wave before yielding. Never stop after one \`orchestrate\` call while another useful scope or perspective can run independently, and do not wait for one sibling's acceptance or completion before dispatching the rest.
|
|
35
|
+
- Delegate each independent scope or distinct perspective with its own \`orchestrate\` call using \`{ worker, title, instructions }\`. Emit the full wave of sibling \`orchestrate\` calls in one assistant message so Pi executes them concurrently.
|
|
36
|
+
- Deliberate overlap is allowed only when calls pursue materially distinct evidence sources, competing hypotheses, or validation perspectives. Encode that distinction in each brief; accidental duplicate assignments are forbidden.
|
|
35
37
|
- Give every worker a thorough, self-contained brief with the objective, paths and scope, context, success criteria, and expected output. State forbidden actions explicitly.
|
|
36
38
|
- Input, catalog, and model preflight is atomic per call before that worker starts. Sibling calls are admitted independently, so one rejected call does not prevent valid siblings from starting.
|
|
37
39
|
- A sole \`orchestrate\` call or a pure group of sibling \`orchestrate\` calls runs asynchronously. Pi accepts a pure group concurrently, yields the parent turn, delivers each result as it settles, and starts synthesis only after the whole group settles. Mixing \`orchestrate\` with another tool makes it inline and blocking. \`worker_send\` is asynchronous only as the sole tool call in its assistant message.
|
|
38
40
|
- Exact worker instructions remain visible in the tool call and can be expanded; titles are labels, not substitutes for complete messages.
|
|
39
|
-
- After
|
|
40
|
-
- As results expose
|
|
41
|
+
- After the full current wave has been dispatched, yield the parent turn once its admissions have resolved; a rejected sibling does not block yielding. Worker responses arrive individually as each worker settles, and the final response starts parent synthesis. Do not poll \`orchestration_status\` or use it as a normal completion mechanism.
|
|
42
|
+
- As results expose more useful independent scopes or materially distinct perspectives, enumerate and dispatch another full parallel wave before yielding. Continue adaptive full waves until the whole task is complete.
|
|
41
43
|
- The parent synthesizes worker results, reviews their evidence and changes, resolves conflicts, integrates the final result, and runs the relevant verification before declaring completion.
|
|
42
44
|
- Prefer one-shot workers. Use \`worker_send\` for follow-up work on a ready reusable worker, \`worker_close\` when that ready worker is finished, and \`worker_abort\` only when active work must stop.
|
|
43
45
|
- The public tools are \`orchestrate\`, \`orchestration_status\`, \`worker_send\`, \`worker_abort\`, and \`worker_close\`.
|
package/extension/tools.ts
CHANGED
|
@@ -111,11 +111,11 @@ export function registerOrchestrationTools(
|
|
|
111
111
|
name: "orchestrate",
|
|
112
112
|
label: "Orchestrate",
|
|
113
113
|
description:
|
|
114
|
-
"Dispatch
|
|
115
|
-
promptSnippet: "Dispatch
|
|
114
|
+
"Dispatch fully briefed worker scopes. Sibling orchestrate calls run concurrently and asynchronously. Mixing orchestrate with another tool makes it inline and blocking.",
|
|
115
|
+
promptSnippet: "Dispatch fully briefed parallel worker scopes",
|
|
116
116
|
promptGuidelines: [
|
|
117
|
-
"
|
|
118
|
-
"
|
|
117
|
+
"Spin up as many workers as needed to cover every useful parallel scope and distinct validation perspective. Treat user-named workers or counts as a floor unless explicitly capped, and reuse the same worker role across multiple calls when useful.",
|
|
118
|
+
"Give each call one complete brief, and emit all sibling orchestrate calls before yielding; never wait for one sibling's acceptance or completion before dispatching the rest.",
|
|
119
119
|
],
|
|
120
120
|
executionMode: "parallel",
|
|
121
121
|
parameters: orchestrateSchema,
|