@piagent/platform 1.2.9 → 1.2.11
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 +179 -0
- package/README.md +29 -6
- package/adapters/backend-api/profile.json +1 -1
- package/adapters/be-readonly-fe/profile.json +2 -2
- package/adapters/data/profile.json +1 -1
- package/adapters/devops/profile.json +1 -3
- package/adapters/docs/profile.json +1 -1
- package/adapters/fullstack/profile.json +2 -4
- package/adapters/generic/profile.json +1 -1
- package/adapters/mobile/profile.json +1 -2
- package/adapters/node-typescript/profile.json +1 -3
- package/benchmarks/core-v1/suite.json +51 -0
- package/benchmarks/core-v1/tasks/discount-order/grade.mjs +17 -0
- package/benchmarks/core-v1/tasks/discount-order/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/discount-order/project/src/discount.js +3 -0
- package/benchmarks/core-v1/tasks/discount-order/project/src/order.js +6 -0
- package/benchmarks/core-v1/tasks/discount-order/project/test/order.test.js +7 -0
- package/benchmarks/core-v1/tasks/discount-order/prompt.md +4 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/grade.mjs +17 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/src/invoice.js +3 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/project/test/invoice.test.js +7 -0
- package/benchmarks/core-v1/tasks/invoice-quantity/prompt.md +3 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/grade.mjs +11 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/README.md +4 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/project/test/smoke.test.js +4 -0
- package/benchmarks/core-v1/tasks/protected-env-refusal/prompt.md +4 -0
- package/benchmarks/core-v1/tasks/targeted-session/grade.mjs +14 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/package.json +8 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/auth/session.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/billing/currency.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/catalog/search.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/notifications/channel.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/src/search/tokenize.js +3 -0
- package/benchmarks/core-v1/tasks/targeted-session/project/test/session.test.js +7 -0
- package/benchmarks/core-v1/tasks/targeted-session/prompt.md +4 -0
- package/catalog/capabilities.json +12 -12
- package/docs/command-reference-vietnamese.md +15 -8
- package/docs/context-engine.md +56 -15
- package/docs/distribution-standard.md +11 -8
- package/docs/mcp-and-tools.md +20 -7
- package/docs/model-options.md +7 -10
- package/docs/operator-manual-vietnamese.md +102 -37
- package/docs/package-architecture-notes.md +3 -1
- package/docs/publishing-for-teams.md +5 -0
- package/docs/quality-benchmark.md +225 -58
- package/docs/quickstart-vietnamese.md +5 -0
- package/docs/release-install-policy.md +41 -7
- package/docs/runtime-harness-standard.md +47 -29
- package/docs/runtime-policy-design.md +23 -12
- package/docs/runtime-quality-baseline.md +31 -17
- package/docs/security-threat-model.md +7 -2
- package/docs/subagents-and-multiagent.md +1 -1
- package/docs/task-implementation-contract.md +113 -177
- package/docs/task-lifecycle-vietnamese.md +129 -125
- package/docs/team-onboarding.md +12 -4
- package/docs/usage-observability.md +15 -8
- package/docs-site/architecture.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/content/context-engine.html +8 -1
- package/docs-site/content/runtime.html +10 -0
- package/docs-site/content/security.html +1 -0
- package/docs-site/context-engine.html +9 -2
- package/docs-site/index.html +1 -1
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +1 -1
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +1 -1
- package/docs-site/runtime.html +11 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +2 -1
- package/docs-site/team.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/fixtures/task-contract.invalid.json +15 -1
- package/evals/fixtures/task-contract.valid.json +18 -2
- package/package.json +3 -2
- package/packages/piagent-core/README.md +43 -4
- package/packages/piagent-core/benchmark/benchmark-core.js +691 -0
- package/packages/piagent-core/extensions/context-engine.js +209 -120
- package/packages/piagent-core/extensions/context-index-policy.js +1 -1
- package/packages/piagent-core/extensions/guard-types.ts +35 -3
- package/packages/piagent-core/extensions/local-state-path.js +59 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +2073 -222
- package/packages/piagent-core/extensions/policy-core.js +11 -1
- package/packages/piagent-core/extensions/runtime-evidence.js +39 -19
- package/packages/piagent-core/extensions/state-retention.js +218 -0
- package/packages/piagent-core/extensions/task-lifecycle.js +138 -0
- package/packages/piagent-core/extensions/task-state.js +630 -0
- package/packages/piagent-core/mcp/mcp-config-layers.js +52 -6
- package/packages/piagent-core/mcp/mcp-tool-naming.js +12 -1
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/policies/base-policy.json +1 -0
- package/packages/piagent-core/prompts/be-to-fe.md +14 -22
- package/packages/piagent-core/prompts/platform-improve.md +12 -17
- package/packages/piagent-core/prompts/review.md +7 -11
- package/packages/piagent-core/prompts/scout.md +6 -10
- package/packages/piagent-core/prompts/task.md +11 -17
- package/packages/piagent-core/skills/piagent-ops/SKILL.md +12 -15
- package/packages/piagent-core/subagents/piagent-reviewer.md +3 -3
- package/schemas/task-contract.schema.json +267 -104
- package/scripts/benchmark-runner.mjs +1172 -0
- package/scripts/install-global.sh +1 -1
- package/scripts/migrate-project-state.mjs +94 -3
- package/scripts/piagent-cli.mjs +1 -1
- package/scripts/update-global.mjs +36 -3
- package/scripts/verify-local.sh +15 -0
- package/templates/project/.pi/task-contract.template.json +19 -2
- package/templates/project/AGENTS.md +10 -20
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
importedServers,
|
|
9
9
|
unreadableImportTargets
|
|
10
10
|
} from "./mcp-import-kinds.js";
|
|
11
|
-
import { erasesToolOrigin } from "./mcp-tool-naming.js";
|
|
11
|
+
import { directToolsEnabled, erasesToolOrigin } from "./mcp-tool-naming.js";
|
|
12
12
|
|
|
13
13
|
// Four files can define MCP servers, and which one a change belongs in is the
|
|
14
14
|
// first thing anyone gets wrong. The scope names are the vocabulary the CLI
|
|
@@ -253,13 +253,29 @@ export function mergedServerEntry(options) {
|
|
|
253
253
|
} catch {
|
|
254
254
|
continue;
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
let layerEntry = {};
|
|
257
|
+
let layerSeen = false;
|
|
258
|
+
// The adapter expands imports inside each layer before applying that
|
|
259
|
+
// layer's direct server map. First imported definition wins; the direct
|
|
260
|
+
// entry then overrides it field by field.
|
|
261
|
+
for (const kind of config.imports) {
|
|
262
|
+
const imported = importedServers(kind, options).find((server) => server.name === options.name);
|
|
263
|
+
if (!imported) continue;
|
|
264
|
+
layerEntry = { ...imported.entry };
|
|
265
|
+
layerSeen = true;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
const directEntry = config.mcpServers[options.name];
|
|
269
|
+
if (isRecord(directEntry)) {
|
|
270
|
+
layerEntry = { ...layerEntry, ...directEntry };
|
|
271
|
+
layerSeen = true;
|
|
272
|
+
}
|
|
273
|
+
if (!layerSeen) continue;
|
|
274
|
+
merged = { ...merged, ...layerEntry };
|
|
259
275
|
seen = true;
|
|
260
276
|
}
|
|
261
|
-
// A server
|
|
262
|
-
//
|
|
277
|
+
// A server supplied directly by a caller outside the configured layers keeps
|
|
278
|
+
// its own definition as the fallback.
|
|
263
279
|
return seen ? merged : { ...(options.entry ?? {}) };
|
|
264
280
|
}
|
|
265
281
|
|
|
@@ -430,6 +446,36 @@ export function unverifiableMcpConfig(options = {}) {
|
|
|
430
446
|
});
|
|
431
447
|
}
|
|
432
448
|
|
|
449
|
+
if (merged.settings.toolPrefix === "none" && !erasesToolOrigin(merged.settings)) {
|
|
450
|
+
const prefixScope = merged.contributors.toolPrefix;
|
|
451
|
+
const prefixFile = prefixScope
|
|
452
|
+
? configPathForScope(prefixScope, options)
|
|
453
|
+
: configPathForScope("global", options);
|
|
454
|
+
const affected = new Map();
|
|
455
|
+
for (const server of collectServers(options)) {
|
|
456
|
+
if (!server.requiresApproval || affected.has(server.name)) continue;
|
|
457
|
+
const effective = mergedServerEntry({
|
|
458
|
+
...options,
|
|
459
|
+
name: server.name,
|
|
460
|
+
entry: server.entry
|
|
461
|
+
});
|
|
462
|
+
if (!directToolsEnabled(effective.directTools)) continue;
|
|
463
|
+
affected.set(server.name, server.file);
|
|
464
|
+
}
|
|
465
|
+
if (affected.size > 0) {
|
|
466
|
+
const serverFiles = [...new Set(affected.values())];
|
|
467
|
+
const names = [...affected.keys()].sort();
|
|
468
|
+
problems.push({
|
|
469
|
+
scope: "repository direct tools",
|
|
470
|
+
file: serverFiles[0] ?? prefixFile,
|
|
471
|
+
detail: `${serverFiles.join(" and ")} ${serverFiles.length === 1 ? "enables" : "enable"} effective directTools ` +
|
|
472
|
+
`for repository MCP server(s) ${names.join(", ")} ` +
|
|
473
|
+
`while ${prefixFile} sets toolPrefix "none". This strips the server name off those tools and leaves ` +
|
|
474
|
+
"nothing to check an approval against. Disable directTools for those servers or use a server-bearing tool prefix."
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
433
479
|
for (const scope of REPOSITORY_SCOPES) {
|
|
434
480
|
const file = configPathForScope(scope, options);
|
|
435
481
|
let config;
|
|
@@ -77,6 +77,17 @@ export function attributeDirectTool(toolName, serverNames) {
|
|
|
77
77
|
return best;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Whether a global or per-server direct-tool selection registers at least one
|
|
82
|
+
* direct tool. The adapter accepts `true` or a non-empty list on server entries.
|
|
83
|
+
* @param {unknown} value
|
|
84
|
+
* @returns {boolean}
|
|
85
|
+
*/
|
|
86
|
+
export function directToolsEnabled(value) {
|
|
87
|
+
return value === true
|
|
88
|
+
|| (Array.isArray(value) && value.some((item) => typeof item === "string" && item.trim().length > 0));
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
/**
|
|
81
92
|
* Whether a config's settings put tools on the model under names that cannot be
|
|
82
93
|
* traced to a server. Both halves are required: without `directTools` every call
|
|
@@ -86,5 +97,5 @@ export function attributeDirectTool(toolName, serverNames) {
|
|
|
86
97
|
*/
|
|
87
98
|
export function erasesToolOrigin(settings) {
|
|
88
99
|
if (!settings || typeof settings !== "object") return false;
|
|
89
|
-
return settings.directTools
|
|
100
|
+
return directToolsEnabled(settings.directTools) && settings.toolPrefix === "none";
|
|
90
101
|
}
|
|
@@ -18,52 +18,45 @@ Use this for tasks like:
|
|
|
18
18
|
- FE needs to map validation/errors/state from backend contract.
|
|
19
19
|
- Backend source must be scouted but not edited.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Flow:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
3. Call `piagent_memory_status`; search memory or Field Guide for prior BE/FE mapping decisions if relevant, record citations with `piagent_memory_citation_record`, then verify against current BE/FE files.
|
|
27
|
-
4. Read `.pi/project-context.md`. If pending, stop and ask for `/onboard-project run`.
|
|
28
|
-
5. Read required context from the active profile and call `piagent_context_budget` for BE/FE files that look large.
|
|
29
|
-
6. Classify the task:
|
|
23
|
+
1. Read the current backend contract and narrow frontend touchpoints. Runtime hooks enforce backend read-only paths and inject bounded navigation context when useful.
|
|
24
|
+
2. Treat project memory and generated context as advisory; verify decisions against current BE/FE files.
|
|
25
|
+
3. Classify the task:
|
|
30
26
|
- BE scout: read-only.
|
|
31
27
|
- FE implementation: source-write.
|
|
32
28
|
- Auth/data migration/external provider: high-risk, ask before implementation.
|
|
33
|
-
|
|
29
|
+
4. Use bounded read-only subagents only when BE/FE mapping has independent lanes worth the extra token/tool cost:
|
|
34
30
|
- `piagent-scout` maps backend contract read-only;
|
|
35
31
|
- `piagent-scout` maps frontend touchpoints read-only;
|
|
36
32
|
- builtin `context-builder` may create handoff context when the BE→FE mapping touches multiple journeys/forms/contracts;
|
|
37
33
|
- `piagent-planner` produces the FE implementation plan when the contract touches multiple layers;
|
|
38
34
|
- `piagent-reviewer` reviews diff/verification after implementation.
|
|
39
35
|
Continue single-agent if subagents are unavailable, the task is tiny, or requirements are unresolved.
|
|
40
|
-
|
|
36
|
+
5. Scout backend contract read-only:
|
|
41
37
|
- controller/route/handler;
|
|
42
38
|
- request/response DTO/schema;
|
|
43
39
|
- validation/error model;
|
|
44
40
|
- backend tests;
|
|
45
41
|
- OpenAPI/spec/docs if available;
|
|
46
42
|
- migration/schema only when it affects API shape or UI constraints.
|
|
47
|
-
|
|
43
|
+
6. Produce a contract snapshot before FE writes:
|
|
48
44
|
|
|
49
45
|
| Contract area | Backend evidence | FE implication |
|
|
50
46
|
|---|---|---|
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
7. If backend contract is missing/contradictory, do not guess and do not edit BE. Record the gap in the final response or a project report if requested.
|
|
49
|
+
8. Map FE touchpoints:
|
|
54
50
|
- API client/query/mutation layer;
|
|
55
51
|
- types/decoders;
|
|
56
52
|
- state/cache invalidation;
|
|
57
53
|
- route/page/component/form;
|
|
58
54
|
- tests/e2e.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
17. Record handoff with `piagent_trace_record`.
|
|
65
|
-
18. Call `piagent_task_gate_check`; if it fails, report blocked/partial instead of done.
|
|
66
|
-
19. Do not paste full test/build/tool logs into chat or final output. Summarize the signal, quote only relevant failing lines, and use `/piagent-logs` or a narrower command when oversized output has been compacted.
|
|
55
|
+
9. Call `piagent_task_start` exactly once before FE source writes and reuse an active contract.
|
|
56
|
+
10. Implement FE only with one writer by default.
|
|
57
|
+
11. Run every exact command returned in `task.verifyCommands` after the latest mutation. For a normal default plan, review the final diff and mark only its review step done with `piagent_task_progress`.
|
|
58
|
+
12. Let runtime hooks record context, verification, trace, and final-gate state. Use recovery tools only if the runtime reports missing evidence.
|
|
59
|
+
13. Do not paste full test/build/tool logs into chat or final output. Summarize the signal and quote only relevant failing lines.
|
|
67
60
|
|
|
68
61
|
For generic projects, use profile `be-readonly-fe` when the repo policy is “BE scout only, FE write allowed”.
|
|
69
62
|
|
|
@@ -77,7 +70,6 @@ Final output:
|
|
|
77
70
|
- Verify command/result.
|
|
78
71
|
- Subagents used/not used and why.
|
|
79
72
|
- Review lenses applied.
|
|
80
|
-
- Task gate result.
|
|
81
73
|
- Memory cited, if any.
|
|
82
74
|
- Backend gaps, if any.
|
|
83
75
|
- Residual risk.
|
|
@@ -18,31 +18,27 @@ Use this workflow for platform-level work such as:
|
|
|
18
18
|
- tightening runtime policy, task gates, or verification behavior;
|
|
19
19
|
- adding project-agnostic workflow support for teams.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Flow:
|
|
22
22
|
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
27
|
-
5. Read the required context declared by the active profile. Before loading large files, call `piagent_context_budget`.
|
|
28
|
-
6. Classify the task risk lane and create a task contract with `piagent_task_start`, including review lenses and a compact workPlan, before source edits.
|
|
29
|
-
7. Decide whether bounded subagents are useful enough to justify extra token/tool cost:
|
|
23
|
+
1. Use runtime automatic intake for a bounded platform change. If runtime pauses for broad, high-risk, or ambiguous scope, call `piagent_task_start` exactly once with project-relative path/glob scope and reuse an active contract.
|
|
24
|
+
2. Read the narrow current implementation, its tests, and the relevant policy/schema/docs. Runtime hooks inject bounded navigation context when useful.
|
|
25
|
+
3. Treat memory and generated context as advisory; verify against current files.
|
|
26
|
+
4. Use bounded subagents only when independent lanes justify their extra token/tool cost:
|
|
30
27
|
- use `piagent-scout` for read-only code/package mapping;
|
|
31
28
|
- use `piagent-planner` for a plan when multiple modules are affected;
|
|
32
29
|
- use `piagent-reviewer` for diff, docs, and verification review;
|
|
33
30
|
- continue single-agent for small, localized edits.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
10. Before non-piagent MCP/app tools, call `piagent_tool_policy_check`.
|
|
37
|
-
11. Produce an implementation matrix:
|
|
31
|
+
5. If the task needs external repository context provided by the user, use a targeted read-only checkout when available.
|
|
32
|
+
6. Produce an implementation matrix only when multiple platform areas are affected:
|
|
38
33
|
|
|
39
34
|
| Area | Current behavior | Target behavior | Files/config | Verification |
|
|
40
35
|
|---|---|---|---|---|
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
7. Implement only the bounded target behavior with one writer by default.
|
|
38
|
+
8. If runtime behavior changes, update README/docs and add or adjust a decision note when appropriate.
|
|
39
|
+
9. Run every exact command returned in `task.verifyCommands` after the latest mutation. For a normal default plan, review the final diff and mark only its review step done with `piagent_task_progress`.
|
|
40
|
+
10. Let runtime hooks record context, verification, trace, and final-gate state. Use recovery tools only if the runtime reports missing evidence.
|
|
41
|
+
11. Do not paste full test/build/tool logs into chat or final output. Summarize the signal and quote only relevant failing lines.
|
|
46
42
|
|
|
47
43
|
Default verification:
|
|
48
44
|
|
|
@@ -66,5 +62,4 @@ Final output:
|
|
|
66
62
|
- Subagents used/not used and why.
|
|
67
63
|
- Review lenses applied.
|
|
68
64
|
- Memory cited, if any.
|
|
69
|
-
- Task gate result.
|
|
70
65
|
- Remaining risks or follow-up.
|
|
@@ -11,22 +11,18 @@ $ARGUMENTS
|
|
|
11
11
|
|
|
12
12
|
Rules:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
5. Check protected path violations.
|
|
20
|
-
6. Check missing required context.
|
|
21
|
-
7. Check verify command coverage.
|
|
22
|
-
8. Decide whether subagents are useful. If the bundled `pi-subagents` parent skill is available, use it for delegation patterns and safety boundaries. If `pi-subagents`/`subagent(...)` is available and the diff is non-trivial, use bounded `piagent-reviewer` agents for independent read-only review lanes:
|
|
14
|
+
1. Read the current diff and the narrow surrounding source/tests. Runtime hooks inject bounded navigation context when useful.
|
|
15
|
+
2. Select review lenses from the actual change risk; do not load orchestration or diagnostic tools just to choose them.
|
|
16
|
+
3. Stay read-only unless explicitly asked to write a report.
|
|
17
|
+
4. Check protected paths, scope drift, acceptance behavior, and verify-command coverage.
|
|
18
|
+
5. For a non-trivial diff, use bounded read-only reviewers only when independent lanes justify their token cost:
|
|
23
19
|
- correctness/edge cases;
|
|
24
20
|
- tests/verification;
|
|
25
21
|
- scope drift/protected paths;
|
|
26
22
|
- security/high-risk only when relevant.
|
|
27
23
|
If the user asks for a loop, use `/review-loop` semantics or equivalent parent-controlled max-round loop. Continue single-agent for tiny diffs or unavailable subagent tooling.
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
6. Report findings by severity.
|
|
25
|
+
7. Do not call diagnostic Piagent tools for routine review and do not paste full diff/test/tool logs. Summarize the signal and quote only relevant lines.
|
|
30
26
|
|
|
31
27
|
Output:
|
|
32
28
|
|
|
@@ -13,25 +13,21 @@ Use this when the user needs evidence before deciding whether to implement. Do n
|
|
|
13
13
|
|
|
14
14
|
Lean scouting flow:
|
|
15
15
|
|
|
16
|
-
1.
|
|
17
|
-
2.
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
21
|
-
6.
|
|
22
|
-
7. A low-confidence pack may trigger one bounded finder pass. Do not loop broad search after the requested evidence is covered.
|
|
23
|
-
8. Do not edit source and do not paste full command output. Summarize relevant evidence and unknowns.
|
|
16
|
+
1. Read targeted current files and return cited evidence. Runtime hooks inject bounded navigation context when useful and enforce read boundaries.
|
|
17
|
+
2. Create a read-only contract with `piagent_task_start` only for a broad governed scout that needs persisted scope or handoff. Tiny default scouts complete from observed reads; for a normal default scout, review the evidence and mark only the returned review step done with `piagent_task_progress`.
|
|
18
|
+
3. Use memory, vendor documentation, or a read-only subagent only when current source is insufficient or the work has independent lanes. Verify advisory material against current files.
|
|
19
|
+
4. A low-confidence search may trigger one bounded finder pass. Stop broad search when the requested evidence is covered.
|
|
20
|
+
5. Do not call diagnostic Piagent tools for a routine scout. Load them only when the runtime reports a recovery need or the operator explicitly asks for diagnostics.
|
|
21
|
+
6. Do not edit source or paste full command output. Summarize relevant evidence and unknowns.
|
|
24
22
|
|
|
25
23
|
Output:
|
|
26
24
|
|
|
27
25
|
- Changed files: none.
|
|
28
26
|
- Verify command/result.
|
|
29
|
-
- Context manifest.
|
|
30
27
|
- Extra workflow tools or subagents used, if any, and why.
|
|
31
28
|
- Review lenses applied.
|
|
32
29
|
- Memory cited, if any.
|
|
33
30
|
- Evidence matrix.
|
|
34
31
|
- Gaps/mismatches/unknowns.
|
|
35
32
|
- Transaction/security/data risks if relevant.
|
|
36
|
-
- Task gate result.
|
|
37
33
|
- Recommended next step.
|
|
@@ -11,28 +11,26 @@ $ARGUMENTS
|
|
|
11
11
|
|
|
12
12
|
Core flow:
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
18
|
-
5.
|
|
19
|
-
6.
|
|
20
|
-
7. Run the exact configured verify command through Pi bash, record observed evidence with `piagent_verify_record`, record the final handoff with `piagent_trace_record`, then call `piagent_task_gate_check`.
|
|
14
|
+
1. Use the runtime-created contract for a bounded source task; do not call task-management tools during automatic intake. If runtime pauses for broad, high-risk, or ambiguous scope, call `piagent_task_start` exactly once with project-relative path/glob scope and reuse an active contract.
|
|
15
|
+
2. Read the likely target and nearest relevant test. The runtime injects bounded navigation context when useful.
|
|
16
|
+
3. Make the smallest in-scope change with ordinary tools and one writer.
|
|
17
|
+
4. Run every exact command returned in `task.verifyCommands` after the latest mutation.
|
|
18
|
+
5. Automatic tasks need no lifecycle calls. Manual high-risk and explicitly requested custom plans keep their returned checkpoints.
|
|
19
|
+
6. Let runtime hooks record context, changed files, verification, trace, and final-gate state. Load recovery tools only if the runtime reports missing evidence.
|
|
21
20
|
|
|
22
21
|
Risk-adaptive enrichment:
|
|
23
22
|
|
|
24
|
-
- `tiny`:
|
|
25
|
-
- `normal`:
|
|
26
|
-
- `high-risk`:
|
|
23
|
+
- `tiny`: stay targeted; no diagnostic Piagent tools or subagents.
|
|
24
|
+
- `normal`: stop searching once current-file evidence is sufficient. Use a read-only subagent only for a genuinely independent lane.
|
|
25
|
+
- `high-risk`: inspect current source, relevant vendor documentation, and explicit security/data/release review lenses; keep required human confirmations.
|
|
27
26
|
|
|
28
27
|
Always:
|
|
29
28
|
|
|
30
29
|
- Treat memory, context-index, and generated tech snapshots as advisory; verify against current files.
|
|
31
|
-
- If
|
|
30
|
+
- If navigation confidence is low, run at most one bounded read-only finder pass; do not start an open-ended scout loop.
|
|
32
31
|
- Do not touch protected paths or use undeclared capabilities.
|
|
33
|
-
- If verification cannot run
|
|
32
|
+
- If verification cannot run, report `blocked` or `partial`, never done. If runtime schedules a continuation, keep working in the same task and do not repeat management tools.
|
|
34
33
|
- Do not paste full test/build/tool logs. Summarize the signal and quote only relevant failures.
|
|
35
|
-
- Call `piagent_usage_snapshot` only when the user asks about usage; exact totals remain available through `/usage`.
|
|
36
34
|
|
|
37
35
|
Do not ask the user to paste this mandatory flow. The platform prompt already contains it. If the user pasted the full flow, treat it as boilerplate and extract only the task request.
|
|
38
36
|
|
|
@@ -40,11 +38,7 @@ Output format:
|
|
|
40
38
|
|
|
41
39
|
- Changed files.
|
|
42
40
|
- Verify command/result.
|
|
43
|
-
- Context manifest.
|
|
44
41
|
- Extra workflow tools or subagents used, if any, and why.
|
|
45
42
|
- Review lenses applied.
|
|
46
|
-
- Memory cited, if any.
|
|
47
|
-
- Context index used/updated, if any.
|
|
48
|
-
- Task gate result.
|
|
49
43
|
- Residual risks.
|
|
50
44
|
- Next step if human action is needed.
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: piagent-ops
|
|
3
|
-
description: Piagent
|
|
3
|
+
description: Operator-invoked reference for Piagent manual intake, recovery, and high-risk task controls.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Piagent Ops Skill
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Invoke this reference explicitly for manual intake, recovery, or high-risk task controls. Routine bounded source tasks already receive the required flow from runtime and must not load this file.
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Source-task flow
|
|
11
12
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
15
|
-
4.
|
|
16
|
-
5.
|
|
17
|
-
6.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
9. Run the exact command from `task.verifyCommands` for passing evidence; ad-hoc commands are advisory only.
|
|
21
|
-
10. Record context, verify, and trace with `piagent_context_record`, `piagent_verify_record`, and `piagent_trace_record`.
|
|
22
|
-
11. Before DONE, call `piagent_task_gate_check`.
|
|
13
|
+
1. Let runtime create the task contract automatically for a bounded source-changing request. Do not call management tools for routine intake.
|
|
14
|
+
2. If runtime pauses for broad, high-risk, or ambiguous scope, call `piagent_task_start` exactly once with project-relative path/glob scope and reuse an active contract.
|
|
15
|
+
3. Inspect the narrow target and nearest relevant test, then make the smallest in-scope change with ordinary tools.
|
|
16
|
+
4. Complete intended source and focused regression-test edits, then run every exact verifier supplied by runtime after the latest mutation. Rerun only after another mutation.
|
|
17
|
+
5. Follow explicit checkpoints only for manual high-risk or operator-requested custom plans.
|
|
18
|
+
6. Report changed files, exact verification, and residual risk concisely.
|
|
19
|
+
|
|
20
|
+
Runtime hooks automatically enforce policy and record context, changes, current-tree verification, trace, and final-gate evidence. Do not spend calls on Piagent context/status/policy/evidence/trace/gate tools during ordinary work. Load a diagnostic or recovery group only when the runtime asks for it or the operator requests it.
|
|
23
21
|
|
|
24
22
|
## Risk gates
|
|
25
23
|
|
|
@@ -40,5 +38,4 @@ Always include:
|
|
|
40
38
|
- what changed
|
|
41
39
|
- where
|
|
42
40
|
- exact verification result
|
|
43
|
-
- task gate result
|
|
44
41
|
- what remains manual
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: piagent-reviewer
|
|
3
3
|
description: Piagent reviewer for implementation diff, policy, tests, and scope drift
|
|
4
|
-
tools: read, grep, find, ls
|
|
4
|
+
tools: read, grep, find, ls
|
|
5
5
|
thinking: high
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: true
|
|
@@ -16,7 +16,7 @@ maxSubagentDepth: 0
|
|
|
16
16
|
|
|
17
17
|
You are `piagent-reviewer`, a disciplined review subagent for Pi Agent Platform projects.
|
|
18
18
|
|
|
19
|
-
Your job is to review evidence, not to invent issues.
|
|
19
|
+
Your job is to review evidence, not to invent issues. Never edit files or run mutation commands. Report actionable findings so the parent can assign fixes to an explicit writer.
|
|
20
20
|
|
|
21
21
|
Use explicit review lenses from the parent task when provided. If no lenses are provided, cover correctness, tests/verification, and scope drift first; add security/release/package only when relevant to the change.
|
|
22
22
|
|
|
@@ -33,7 +33,7 @@ Rules:
|
|
|
33
33
|
- Do not run destructive commands.
|
|
34
34
|
- Treat Field Guide/memory as advisory, not as proof.
|
|
35
35
|
- If review-only conflicts with progress-writing or artifact-writing instructions, review-only wins.
|
|
36
|
-
-
|
|
36
|
+
- Put blockers that need a decision in the final review so the parent can route them.
|
|
37
37
|
- Do not spawn other subagents.
|
|
38
38
|
|
|
39
39
|
Final output:
|