@ferris1225/pi-subagents 5.0.6 → 6.0.0
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/CHANGELOG.md +39 -0
- package/README.md +95 -67
- package/index.ts +1 -1
- package/package.json +1 -6
- package/src/configuration/role-migration.ts +2 -2
- package/src/configuration/setup.ts +4 -2
- package/src/configuration/ui.ts +144 -132
- package/src/delegation/dispatch.ts +1 -1
- package/src/delegation/prompt.ts +6 -5
- package/src/execution/spawn.ts +15 -5
- package/src/isolation/cleanup.ts +9 -5
- package/src/isolation/manifest-mutation.ts +73 -0
- package/src/isolation/recovery.ts +24 -16
- package/src/lifecycle/durable.ts +61 -25
- package/src/lifecycle/runtime.ts +9 -3
- package/src/lifecycle/stop.ts +2 -2
- package/src/lifecycle/thread-lifecycle.ts +4 -1
- package/src/lifecycle/thread-restore.ts +15 -5
- package/src/lifecycle/thread-shared.ts +15 -3
- package/src/presentation/monitor.ts +5 -3
- package/src/presentation/widget.ts +157 -113
- package/src/workflow/acceptance.ts +67 -0
- package/src/workflow/durable.ts +32 -12
- package/src/workflow/engine.ts +118 -30
- package/src/workflow/plan.ts +25 -4
- package/src/workflow/state.ts +6 -0
- package/src/workflow/templates.ts +156 -0
- package/src/workflow/tool.ts +23 -104
- package/skills/workflow/SKILL.md +0 -268
- package/src/workflow/files.ts +0 -236
- package/workflows/code-review.md +0 -38
- package/workflows/migration.md +0 -42
- package/workflows/research.md +0 -48
package/src/workflow/files.ts
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow definition discovery.
|
|
3
|
-
*
|
|
4
|
-
* A graph can be declared inline in the tool call or saved as a file so it can
|
|
5
|
-
* be reviewed, versioned, and re-run. Files are read from three scopes with the
|
|
6
|
-
* same override rule as agents — builtin < user < project, where the same name
|
|
7
|
-
* wins at the higher scope:
|
|
8
|
-
*
|
|
9
|
-
* builtin : <package>/workflows (shipped templates)
|
|
10
|
-
* user : <agentDir>/workflows (~/.pi/agent/workflows)
|
|
11
|
-
* project : <cwd...>/.pi/workflows (nearest, walking up)
|
|
12
|
-
*
|
|
13
|
-
* Two file shapes are accepted: a JSON document, and Markdown with a `json`
|
|
14
|
-
* fenced block holding the plan (so a template can explain itself in prose and
|
|
15
|
-
* keep the graph machine-readable).
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { type Dirent, existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
19
|
-
import { chmod, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
20
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
21
|
-
import { fileURLToPath } from "node:url";
|
|
22
|
-
import { CONFIG_DIR_NAME, getAgentDir, parseFrontmatter, withFileMutationQueue } from "@earendil-works/pi-coding-agent";
|
|
23
|
-
import { migrateStoredAgentName, migrateStoredWorkflowRoles } from "../configuration/role-migration.ts";
|
|
24
|
-
import type { WorkflowPlanInput } from "./plan.ts";
|
|
25
|
-
|
|
26
|
-
/** Which workflow directories discovery reads. Same precedence as the templates
|
|
27
|
-
* they ship with: project > user > built-in for the same name. */
|
|
28
|
-
export type WorkflowScope = "user" | "project" | "both";
|
|
29
|
-
|
|
30
|
-
export type WorkflowSource = "builtin" | "user" | "project";
|
|
31
|
-
|
|
32
|
-
export interface WorkflowDefinition {
|
|
33
|
-
name: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
plan: WorkflowPlanInput;
|
|
36
|
-
filePath: string;
|
|
37
|
-
source: WorkflowSource;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
41
|
-
/** <package>/workflows — templates shipped with this extension. */
|
|
42
|
-
export const BUILTIN_WORKFLOWS_DIR = join(here, "..", "..", "workflows");
|
|
43
|
-
|
|
44
|
-
function isDirectory(path: string): boolean {
|
|
45
|
-
try {
|
|
46
|
-
return statSync(path).isDirectory();
|
|
47
|
-
} catch {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function findNearestProjectWorkflowsDir(cwd: string): string | null {
|
|
53
|
-
let current = cwd;
|
|
54
|
-
while (true) {
|
|
55
|
-
const candidate = join(current, CONFIG_DIR_NAME, "workflows");
|
|
56
|
-
if (isDirectory(candidate)) return candidate;
|
|
57
|
-
const parent = dirname(current);
|
|
58
|
-
if (parent === current) return null;
|
|
59
|
-
current = parent;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** Accept either the full plan object or a bare node array. */
|
|
64
|
-
function asPlan(value: unknown, fallbackName: string): WorkflowPlanInput | undefined {
|
|
65
|
-
const raw = Array.isArray(value) ? { nodes: value } : value;
|
|
66
|
-
if (!raw || typeof raw !== "object") return undefined;
|
|
67
|
-
const record = raw as Record<string, unknown>;
|
|
68
|
-
if (!Array.isArray(record.nodes)) return undefined;
|
|
69
|
-
return {
|
|
70
|
-
name: typeof record.name === "string" && record.name.trim() ? record.name.trim() : fallbackName,
|
|
71
|
-
...(typeof record.description === "string" && record.description.trim()
|
|
72
|
-
? { description: record.description.trim() }
|
|
73
|
-
: {}),
|
|
74
|
-
// The compiler validates every field; never sanitize away dependencies.
|
|
75
|
-
nodes: record.nodes as WorkflowPlanInput["nodes"],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const JSON_FENCE = /^[ \t]*```json[ \t]*\r?\n([\s\S]*?)^[ \t]*```/mu;
|
|
80
|
-
|
|
81
|
-
function fencedJson(body: string): string | undefined {
|
|
82
|
-
return JSON_FENCE.exec(body)?.[1];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** Read one definition file. Returns an error string instead of throwing so a
|
|
86
|
-
* broken file in a shared directory cannot hide the rest of the catalog. */
|
|
87
|
-
export function readWorkflowFile(
|
|
88
|
-
filePath: string,
|
|
89
|
-
source: WorkflowSource,
|
|
90
|
-
): { definition?: WorkflowDefinition; error?: string } {
|
|
91
|
-
const fallbackName = basename(filePath).replace(/\.(json|md)$/iu, "");
|
|
92
|
-
let content: string;
|
|
93
|
-
try {
|
|
94
|
-
content = readFileSync(filePath, "utf8");
|
|
95
|
-
} catch (error) {
|
|
96
|
-
return { error: `${filePath}: ${error instanceof Error ? error.message : String(error)}` };
|
|
97
|
-
}
|
|
98
|
-
if (/\.json$/iu.test(filePath)) {
|
|
99
|
-
let parsed: unknown;
|
|
100
|
-
try {
|
|
101
|
-
parsed = JSON.parse(content);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
return { error: `${filePath}: invalid JSON (${error instanceof Error ? error.message : String(error)})` };
|
|
104
|
-
}
|
|
105
|
-
const plan = asPlan(parsed, fallbackName);
|
|
106
|
-
if (!plan) return { error: `${filePath}: expected { name?, description?, nodes: [{ id, agent, task, dependsOn? }] }.` };
|
|
107
|
-
return { definition: { name: plan.name ?? fallbackName, ...(plan.description ? { description: plan.description } : {}), plan, filePath, source } };
|
|
108
|
-
}
|
|
109
|
-
const { frontmatter, body } = parseFrontmatter<Record<string, string>>(content);
|
|
110
|
-
const json = fencedJson(body);
|
|
111
|
-
if (json === undefined) return { error: `${filePath}: a Markdown workflow needs a \`\`\`json fenced block holding the plan.` };
|
|
112
|
-
let parsed: unknown;
|
|
113
|
-
try {
|
|
114
|
-
parsed = JSON.parse(json);
|
|
115
|
-
} catch (error) {
|
|
116
|
-
return { error: `${filePath}: invalid JSON in the fenced block (${error instanceof Error ? error.message : String(error)})` };
|
|
117
|
-
}
|
|
118
|
-
const name = typeof frontmatter.name === "string" && frontmatter.name.trim() ? frontmatter.name.trim() : fallbackName;
|
|
119
|
-
const plan = asPlan(parsed, name);
|
|
120
|
-
if (!plan) return { error: `${filePath}: expected a plan object or a node array in the fenced block.` };
|
|
121
|
-
const description = typeof frontmatter.description === "string" && frontmatter.description.trim()
|
|
122
|
-
? frontmatter.description.trim()
|
|
123
|
-
: plan.description;
|
|
124
|
-
return {
|
|
125
|
-
definition: { name: plan.name ?? name, ...(description ? { description } : {}), plan, filePath, source },
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/** Migrate an already trusted, selected saved definition on disk. Discovery
|
|
130
|
-
* stays read-only; inline input is never translated into a different role. */
|
|
131
|
-
export async function migrateWorkflowDefinition(definition: WorkflowDefinition): Promise<WorkflowDefinition> {
|
|
132
|
-
if (definition.source === "builtin" || !definition.plan.nodes.some((node) =>
|
|
133
|
-
typeof node?.agent === "string" && migrateStoredAgentName(node.agent.trim()) !== node.agent.trim(),
|
|
134
|
-
)) return definition;
|
|
135
|
-
|
|
136
|
-
return withFileMutationQueue(definition.filePath, async () => {
|
|
137
|
-
const content = await readFile(definition.filePath, "utf8");
|
|
138
|
-
const isJson = /\.json$/iu.test(definition.filePath);
|
|
139
|
-
// parseFrontmatter normalizes newlines and trims the body; retain the raw
|
|
140
|
-
// prefix here so migration changes only the JSON block.
|
|
141
|
-
const bodyOffset = /^\uFEFF?---[\s\S]*?\r?\n---[^\r\n]*(?:\r?\n|$)/u.exec(content)?.[0].length ?? 0;
|
|
142
|
-
const body = content.slice(bodyOffset);
|
|
143
|
-
const json = isJson ? content : fencedJson(body);
|
|
144
|
-
if (json === undefined) throw new Error(`Cannot migrate workflow ${definition.filePath}: missing JSON block.`);
|
|
145
|
-
const parsed: unknown = JSON.parse(json);
|
|
146
|
-
if (migrateStoredWorkflowRoles(parsed)) {
|
|
147
|
-
const newline = content.includes("\r\n") ? "\r\n" : "\n";
|
|
148
|
-
const serialized = JSON.stringify(parsed, null, 2).replace(/\n/gu, newline) + newline;
|
|
149
|
-
const nextBody = body.replace(JSON_FENCE, (block, source: string) => block.replace(source, () => serialized));
|
|
150
|
-
const next = isJson ? serialized : content.slice(0, bodyOffset) + nextBody;
|
|
151
|
-
const temporary = `${definition.filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
152
|
-
try {
|
|
153
|
-
const { mode } = await stat(definition.filePath);
|
|
154
|
-
await writeFile(temporary, next, { encoding: "utf8", mode });
|
|
155
|
-
await chmod(temporary, mode);
|
|
156
|
-
await rename(temporary, definition.filePath);
|
|
157
|
-
} finally {
|
|
158
|
-
await rm(temporary, { force: true }).catch(() => undefined);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const current = readWorkflowFile(definition.filePath, definition.source);
|
|
162
|
-
if (!current.definition) throw new Error(current.error ?? `Cannot read migrated workflow ${definition.filePath}.`);
|
|
163
|
-
return current.definition;
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function loadDefinitionsFromDir(dir: string, source: WorkflowSource): WorkflowDefinition[] {
|
|
168
|
-
if (!existsSync(dir)) return [];
|
|
169
|
-
let entries: Dirent[];
|
|
170
|
-
try {
|
|
171
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
172
|
-
} catch {
|
|
173
|
-
return [];
|
|
174
|
-
}
|
|
175
|
-
const definitions: WorkflowDefinition[] = [];
|
|
176
|
-
for (const entry of entries) {
|
|
177
|
-
if (!/\.(?:json|md)$/iu.test(entry.name)) continue;
|
|
178
|
-
if (!entry.isFile() && !entry.isSymbolicLink()) continue;
|
|
179
|
-
const { definition } = readWorkflowFile(join(dir, entry.name), source);
|
|
180
|
-
if (definition) definitions.push(definition);
|
|
181
|
-
}
|
|
182
|
-
return definitions;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface DiscoverWorkflowsOptions {
|
|
186
|
-
scope?: WorkflowScope;
|
|
187
|
-
projectTrusted?: boolean;
|
|
188
|
-
builtinDir?: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Every workflow definition visible from `cwd`, merged with project > user >
|
|
193
|
-
* builtin precedence for the same name and sorted by name.
|
|
194
|
-
*/
|
|
195
|
-
export function discoverWorkflows(cwd: string, options: DiscoverWorkflowsOptions = {}): WorkflowDefinition[] {
|
|
196
|
-
const scope = options.scope ?? "both";
|
|
197
|
-
const projectDir = findNearestProjectWorkflowsDir(cwd);
|
|
198
|
-
const builtin = loadDefinitionsFromDir(options.builtinDir ?? BUILTIN_WORKFLOWS_DIR, "builtin");
|
|
199
|
-
const user = scope === "project" ? [] : loadDefinitionsFromDir(join(getAgentDir(), "workflows"), "user");
|
|
200
|
-
const project =
|
|
201
|
-
scope === "user" || !projectDir || options.projectTrusted !== true
|
|
202
|
-
? []
|
|
203
|
-
: loadDefinitionsFromDir(projectDir, "project");
|
|
204
|
-
|
|
205
|
-
const byName = new Map<string, WorkflowDefinition>();
|
|
206
|
-
for (const definition of builtin) byName.set(definition.name, definition);
|
|
207
|
-
for (const definition of user) byName.set(definition.name, definition);
|
|
208
|
-
for (const definition of project) byName.set(definition.name, definition);
|
|
209
|
-
return [...byName.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/** Resolve a name or file path to a definition; error text names what is available. */
|
|
213
|
-
export function resolveWorkflowDefinition(
|
|
214
|
-
cwd: string,
|
|
215
|
-
request: { name?: string; path?: string },
|
|
216
|
-
options: DiscoverWorkflowsOptions = {},
|
|
217
|
-
): { definition?: WorkflowDefinition; error?: string } {
|
|
218
|
-
if (request.name?.trim() && request.path?.trim()) return { error: "provide a workflow name or file path, not both." };
|
|
219
|
-
if (request.path) {
|
|
220
|
-
if (options.projectTrusted !== true) return { error: "workflow files require a trusted project." };
|
|
221
|
-
const filePath = resolve(cwd, request.path);
|
|
222
|
-
if (!existsSync(filePath)) return { error: `workflow file not found: ${filePath}` };
|
|
223
|
-
const read = readWorkflowFile(filePath, "project");
|
|
224
|
-
if (read.error) return { error: read.error };
|
|
225
|
-
return read;
|
|
226
|
-
}
|
|
227
|
-
const name = request.name?.trim();
|
|
228
|
-
if (!name) return { error: "provide either inline nodes, a workflow name, or a workflow file path." };
|
|
229
|
-
const available = discoverWorkflows(cwd, options);
|
|
230
|
-
const match = available.find((definition) => definition.name.toLowerCase() === name.toLowerCase());
|
|
231
|
-
if (!match) {
|
|
232
|
-
const names = available.map((definition) => definition.name).join(", ");
|
|
233
|
-
return { error: `no workflow named "${name}". Available: ${names || "none"}. Save one under .pi/workflows/ or ~/.pi/agent/workflows/.` };
|
|
234
|
-
}
|
|
235
|
-
return { definition: match };
|
|
236
|
-
}
|
package/workflows/code-review.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-review
|
|
3
|
-
description: Inspect an implementation, then challenge only the reported findings.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Code review workflow
|
|
7
|
-
|
|
8
|
-
Use one `sentinel` run for an ordinary review. This two-node template is for a
|
|
9
|
-
substantial change where independent verification of findings earns another
|
|
10
|
-
session. The sentinel inspects the implementation; the skeptic checks its named
|
|
11
|
-
claims and returns the final review. They do not perform two general reviews.
|
|
12
|
-
|
|
13
|
-
Copy this file to `.pi/workflows/code-review.md` and replace `<TARGET>` with the
|
|
14
|
-
branch, commit range, or paths under review. Include any existing main research
|
|
15
|
-
and checks in the review brief so the sentinel can reuse them. If the first
|
|
16
|
-
result must decide whether a second phase is needed, dispatch only the sentinel
|
|
17
|
-
and make that decision in main.
|
|
18
|
-
|
|
19
|
-
Run with `subagent_workflow({ workflow: "code-review" })`, or use an explicit
|
|
20
|
-
`file` path. Omit isolation overrides for these read-only reviews.
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"nodes": [
|
|
25
|
-
{
|
|
26
|
-
"id": "review",
|
|
27
|
-
"agent": "sentinel",
|
|
28
|
-
"task": "Review <TARGET> against the stated requirements and relevant callers. Establish the diff once, then inspect correctness, regressions, compatibility, and concrete failure paths within that target. Reuse existing research and valid checks; run a focused reproduction only to resolve a suspected defect. Stay read-only and do not change Git state. Return confirmed actionable findings with path:line, trigger, consequence, evidence, and smallest fix; include checks and material gaps. State clearly if no confirmed findings were found."
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "verify",
|
|
32
|
-
"agent": "skeptic",
|
|
33
|
-
"dependsOn": ["review"],
|
|
34
|
-
"task": "Test only the specific defect claims reported here:\n\n{{review}}\n\nTry to disprove each claim against its callers, invariants, or focused checks. Reuse valid evidence; do not repeat the general review. If there are no defect claims, report that and stop. Stay read-only and do not change Git state. Return the final review: surviving confirmed findings ordered by severity with trigger, consequence, evidence, and smallest fix; briefly state refuted or unresolved claims, checks, and remaining limits."
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
```
|
package/workflows/migration.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: migration
|
|
3
|
-
description: Apply two already planned migration slices, then challenge the integrated result with the project gate.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Migration workflow
|
|
7
|
-
|
|
8
|
-
Use this template after main has established the target, interface contract,
|
|
9
|
-
and disjoint writer scopes. If discovery determines those boundaries, run that
|
|
10
|
-
discovery first and decide in main; a static graph cannot rewrite its own nodes.
|
|
11
|
-
Replace <TARGET>, <CONTRACT> (the shared interface contract or its file path),
|
|
12
|
-
both slice briefs, and every example scope before running. Each child needs the
|
|
13
|
-
contract in its own brief because it cannot see main's conversation.
|
|
14
|
-
Each slice owns its implementation and regression tests. Keep coupled changes
|
|
15
|
-
with one owner. Use sentinel for a separate implementation review or skeptic
|
|
16
|
-
for a named assumption the gate cannot test; main owns final integration and release.
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"nodes": [
|
|
21
|
-
{
|
|
22
|
-
"id": "apply-core",
|
|
23
|
-
"agent": "artisan",
|
|
24
|
-
"task": "Migrate the core slice to <TARGET>. <CORE_CHANGE>. Interface contract: <CONTRACT>. Follow the declared write scope. Implement the change and its regression tests together; run the relevant checks. Report changed paths, command results, and blockers. If the plan conflicts with the code or requires another slice's files, stop and report evidence rather than inventing a new scope.",
|
|
25
|
-
"scope": { "paths": ["src/core", "test/core"] }
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "apply-adapters",
|
|
29
|
-
"agent": "artisan",
|
|
30
|
-
"task": "Migrate the adapter slice to <TARGET>. <ADAPTER_CHANGE>. Interface contract: <CONTRACT>. Follow the declared write scope. Implement the change and its regression tests together; run the relevant checks. Report changed paths, command results, and blockers. If the plan conflicts with the code or requires another slice's files, stop and report evidence rather than inventing a new scope.",
|
|
31
|
-
"scope": { "paths": ["src/adapters", "test/adapters"] }
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "gate",
|
|
35
|
-
"agent": "artisan",
|
|
36
|
-
"task": "Challenge the integrated migration using the project's documented required checks. Interface contract: <CONTRACT>. Verify both slices meet their done conditions before proceeding; report missing prerequisites instead of guessing. Run the required commands; inspect cross-slice call sites for mismatches. Fix failures caused by this migration within its authorized scope. Report commands, results, and unverified risks.\n\nCore:\n{{apply-core}}\n\nAdapters:\n{{apply-adapters}}",
|
|
37
|
-
"dependsOn": ["apply-core", "apply-adapters"],
|
|
38
|
-
"scope": { "paths": ["src/core", "test/core", "src/adapters", "test/adapters"] }
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
```
|
package/workflows/research.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: research
|
|
3
|
-
description: Research a question from independent angles, synthesise the answer, then verify its factual claims.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Research workflow
|
|
7
|
-
|
|
8
|
-
Three researchers take different angles, a synthesis node turns them into one
|
|
9
|
-
answer, and a verification node checks the claims that would embarrass you if
|
|
10
|
-
they were wrong. This template deliberately separates synthesis from challenge;
|
|
11
|
-
combine them for a bounded question when main can verify the decisive sources.
|
|
12
|
-
|
|
13
|
-
Replace every <QUESTION> in a copy of this file (the first three nodes run concurrently), then
|
|
14
|
-
run `subagent_workflow({ "workflow": "research" })`.
|
|
15
|
-
|
|
16
|
-
```json
|
|
17
|
-
{
|
|
18
|
-
"nodes": [
|
|
19
|
-
{
|
|
20
|
-
"id": "primary",
|
|
21
|
-
"agent": "scout",
|
|
22
|
-
"task": "Research <QUESTION> from first-party sources only: official documentation, specifications, release notes, and the project's own repository. Record versions and dates. Cite every fact you state. Mark anything you could only find second-hand."
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "practice",
|
|
26
|
-
"agent": "scout",
|
|
27
|
-
"task": "Research <QUESTION> from practice: issue threads, migration notes, benchmarks, and post-mortems that describe what actually happened when people used it. Separate reported experience from vendor claims and cite each source."
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": "codebase",
|
|
31
|
-
"agent": "scout",
|
|
32
|
-
"task": "Establish what this repository already does about <QUESTION>: the relevant modules, configuration, and tests, with path:line citations. State where the code disagrees with the documentation if you find such a place."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"id": "synthesis",
|
|
36
|
-
"agent": "scout",
|
|
37
|
-
"task": "Answer <QUESTION> from these three research passes. Reconcile disagreements explicitly instead of averaging them, and check dates, versions, and conditions when official claims conflict with observed practice; prefer the evidence that applies to this question.\n\nFirst-party:\n{{primary}}\n\nPractice:\n{{practice}}\n\nThis repository:\n{{codebase}}\n\nWrite: the answer, the evidence behind it, the open questions, and what would change the answer.",
|
|
38
|
-
"dependsOn": ["primary", "practice", "codebase"]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"id": "verify",
|
|
42
|
-
"agent": "scout",
|
|
43
|
-
"task": "Try to disprove the decisive claims in this answer: read the cited sources, seek counterexamples and conflicting versions, and distinguish factual mistakes from uncertainty. Return the corrected answer with citations, a concise list of changes, and claims that remain unverified. Do not claim execution-based reproduction; this role is read-only.\n\n{{synthesis}}",
|
|
44
|
-
"dependsOn": ["synthesis"]
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
```
|