@henryqw/pi-subagent 15.1.1 → 15.1.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/README.md
CHANGED
|
@@ -80,6 +80,15 @@ See the [orchestration guide](./docs/orchestration.md) for full delegation, tran
|
|
|
80
80
|
|
|
81
81
|
The bundled [`pi-subagent-delegated-development`](./skills/pi-subagent-delegated-development/SKILL.md) Skill guides Main's planning and orchestration. It adds no runtime code, config, or Role installation.
|
|
82
82
|
|
|
83
|
+
Before delegating:
|
|
84
|
+
|
|
85
|
+
- Find concrete outcomes that can ship on their own.
|
|
86
|
+
- Split only those outcomes. Give each one owner and a focused check.
|
|
87
|
+
- Run independent work in parallel.
|
|
88
|
+
- Prefer parallel delegation when at least two outcomes are independent.
|
|
89
|
+
- For naturally multi-part work, roughly three to five useful units can help.
|
|
90
|
+
- This is a guide, not a quota. Never create units just to reach it.
|
|
91
|
+
|
|
83
92
|
Its ordinary review loop is optional. Use it only when the caller or repository policy explicitly requires judgment review.
|
|
84
93
|
|
|
85
94
|
- Call `delegate_task` with `role: "reviewer"` to select the effective `reviewer` Role.
|
|
@@ -92,7 +101,9 @@ Flow is separate. It owns exact review evidence, exact `PASS` approval, validati
|
|
|
92
101
|
|
|
93
102
|
## Flow
|
|
94
103
|
|
|
95
|
-
Flow requires a clean Main worktree on an attached branch with a committed `HEAD`. Use it only for independent Git changes that can merge in any order.
|
|
104
|
+
Flow requires a clean Main worktree on an attached branch with a committed `HEAD`. Use it only for independent Git changes that can merge in any order.
|
|
105
|
+
|
|
106
|
+
Keep work together or run it in order when a split divides an invariant or adds coordination. Do not split units with overlapping mutable ownership. Do not split units that overlap files, APIs, schemas, generated output, package metadata, lockfiles, or invariants.
|
|
96
107
|
|
|
97
108
|
One Implementer launch must plausibly finish before the configured maximum runtime. Cohesion is not enough when work has several preservable, separately verifiable milestones. Split oversized dependent work into serial one-unit Flows after each milestone integrates. Units in one Flow stay independent and commuting.
|
|
98
109
|
|
|
@@ -770,7 +770,7 @@ export function registerDelegateFlow(pi: ExtensionAPI, runtime: DelegateFlowRunt
|
|
|
770
770
|
description: "Run 1–8 independent Implementers in isolated Unit Worktrees, validate and serially fast-forward each tip, with exact review only for units that declare a judgment criterion.",
|
|
771
771
|
promptSnippet: "Run a deterministic parallel-implementation, serial-verification Flow",
|
|
772
772
|
promptGuidelines: [
|
|
773
|
-
"Use delegate_flow only for cohesive units expected to commute:
|
|
773
|
+
"Use delegate_flow only for cohesive units expected to commute: make independent commuting outcomes separate units rather than combining them merely to reduce Implementer count; sequence dependent work outside delegate_flow. On naturally multi-part work, actively look for roughly 3–5 useful units, but never manufacture units, split one invariant across multiple units, assign overlapping mutable ownership, or use a quota. Combine work that overlaps files, APIs, schemas, generated output, package metadata, lockfiles, or invariants.",
|
|
774
774
|
`${TASK_NAME_CONTRACT.promptGuidance} Each delegate_flow unit must own one concrete outcome with one focused validation story: include explicit bounded requirements and its authoritative direct command/argument validation gate. If the affected flow or scope is not yet known, perform bounded read-only discovery first. Add review only for an explicit judgment that validation cannot establish.`,
|
|
775
775
|
`For each delegate_flow unit, ${MODEL_CLASS_GUIDANCE}`,
|
|
776
776
|
"If a Flow blocks, inspect its classification and call delegate_flow_continue once with explicit repair guidance; modelClass may replace that one repair's current class.",
|
package/extensions/subagent.ts
CHANGED
|
@@ -596,10 +596,10 @@ export default function subagentExtension(
|
|
|
596
596
|
description: `Delegate one selected single, parallel, or chain workflow of bounded tasks to isolated Pi Subagents. Roles: ${roleSummary()}.`,
|
|
597
597
|
promptSnippet: "Delegate one bounded single, parallel, or chain workflow to isolated roles",
|
|
598
598
|
promptGuidelines: [
|
|
599
|
-
"Call delegate_task with exactly one mode: role+name+task for one task, tasks for 1–8 independent parallel tasks, or chain for 1–8 dependent sequential tasks using {previous} for the immediately preceding assistant output;
|
|
600
|
-
`${TASK_NAME_CONTRACT.promptGuidance} Every delegate_task entry must own one concrete outcome with one focused validation story: state its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and validation; if the affected flow or scope is not yet known, perform bounded read-only discovery first; never pass the parent request unchanged.`,
|
|
599
|
+
"Call delegate_task with exactly one mode: role+name+task in single mode for one atomic task, tasks for 1–8 independent parallel tasks, or chain for 1–8 dependent sequential tasks using {previous} for the immediately preceding assistant output; prefer parallel mode whenever at least two independent outcomes exist and each is independently deliverable and independently verifiable; do not combine independent outcomes merely to reduce child count. Sequence dependent work in chain entries, and never divide one invariant across multiple entries.",
|
|
600
|
+
`${TASK_NAME_CONTRACT.promptGuidance} Every delegate_task entry must own one concrete outcome with one focused validation story: state its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and validation; if the affected flow or scope is not yet known, perform bounded read-only discovery first; never pass the parent request unchanged. For naturally multi-part delegate_task work, you may look for roughly 3–5 useful entries, but do not manufacture entries or enforce a quota.`,
|
|
601
601
|
`For each delegate_task entry, ${MODEL_CLASS_GUIDANCE} A direct model replaces only the selected route's model; its thinking level stays unchanged.`,
|
|
602
|
-
"Parallel delegate_task entries must own non-overlapping files. Keep integration and cross-cutting decisions in Main
|
|
602
|
+
"Parallel mutating delegate_task entries must own non-overlapping files and changes. Read-only delegate_task entries may inspect overlapping sources when their questions and deliverables differ. Keep integration and cross-cutting decisions in Main.",
|
|
603
603
|
"delegate_task background applies to the whole selected workflow and returns before results exist; use it only when the user explicitly asks for non-blocking work.",
|
|
604
604
|
],
|
|
605
605
|
parameters: WorkflowSchema,
|
package/package.json
CHANGED
|
@@ -11,7 +11,9 @@ You are Main, the planner/orchestrator: slice work and choose `delegate_flow` or
|
|
|
11
11
|
|
|
12
12
|
Before slicing, identify applicable repository prohibitions. If the request or plan conflicts with them, stop and resolve the conflict before delegation. Copy them into every affected task and into `review` when automated validation cannot establish compliance; never replace repository policy with generic preservation or migration assumptions. When compatibility is disallowed, require deletion of replaced paths and forbid legacy readers, aliases, adapters, dual schemas, deprecation paths, and compatibility fallbacks.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Run a concise decomposition pass. Identify independently deliverable concrete outcomes. Maximize safe parallelism at those boundaries: give each outcome focused validation and clear ownership, and parallelize commuting work. Prefer parallel delegation when at least two independent outcomes exist. For naturally multi-part work, roughly 3–5 useful units is a guide, not a quota. Never manufacture units.
|
|
15
|
+
|
|
16
|
+
Before selecting a Flow unit, require that one Implementer launch can plausibly finish before the configured maximum runtime. Cohesion alone is not enough when work has multiple preservable, separately verifiable milestones. Use `delegate_flow` for independent units expected to commute. Keep work together or sequence it when splitting would divide an invariant, overlap mutable ownership, or create coordination. Combine or sequence work that overlaps files, APIs, schemas, generated output, package metadata, lockfiles, or invariants. Units inside one Flow remain independent and commuting. Dependent work remains outside Flow. Split oversized dependent work into serial one-unit Flows after each milestone integrates; otherwise sequence it in one task or ordinary caller-controlled sequencing.
|
|
15
17
|
|
|
16
18
|
Give every unit a bounded objective, owned scope and exclusions, and its direct validation command/argument array. Each task packet must name the neighboring behavior that must stay unchanged. Include the exact test name or error when known CI evidence exists. Never claim a validation command matches unknown CI.
|
|
17
19
|
|
|
@@ -35,7 +37,7 @@ A cleanup warning does not undo successful integration. Report a cleanup warning
|
|
|
35
37
|
|
|
36
38
|
## Ordinary delegation
|
|
37
39
|
|
|
38
|
-
Use `delegate_task` for a single bounded task, independent parallel tasks, or dependent chain work that is not a Flow. Give each entry its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and focused validation. Choose `modelClass` according to the delegation tool's guidance. A direct `model` replaces only the selected route's model. The route keeps its thinking level. Keep integration and cross-cutting decisions in Main
|
|
40
|
+
Use `delegate_task` for a single bounded task, independent parallel tasks, or dependent chain work that is not a Flow. Give each entry its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and focused validation. Choose `modelClass` according to the delegation tool's guidance. A direct `model` replaces only the selected route's model. The route keeps its thinking level. Keep integration and cross-cutting decisions in Main.
|
|
39
41
|
|
|
40
42
|
### Optional evidence loop for implementation
|
|
41
43
|
|