@piagent/platform 1.8.0 → 1.9.1
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/AGENTS.md +7 -0
- package/CHANGELOG.md +132 -2
- package/README.md +45 -70
- package/README.vi.md +34 -61
- package/architecture/layers.json +16 -3
- package/catalog/capabilities.json +14 -7
- package/catalog/claude-model-additions.json +42 -0
- package/docs/auto-delegation-policy.md +2 -0
- package/docs/command-reference-vietnamese.md +68 -90
- package/docs/context-window-policy.md +5 -5
- package/docs/distribution-standard.md +13 -16
- package/docs/en/architecture.md +9 -1
- package/docs/herdr-workflow.md +2 -3
- package/docs/languages.json +4 -4
- package/docs/managed-local-acceptance.md +403 -0
- package/docs/mcp-and-tools.md +5 -7
- package/docs/memory-policy.md +3 -3
- package/docs/model-options.md +2 -2
- package/docs/oauth-providers.md +1 -1
- package/docs/operator-manual-vietnamese.md +82 -127
- package/docs/package-architecture-notes.md +4 -4
- package/docs/piagent-core-improvement-plan.md +3 -5
- package/docs/piagent-core-plan-checkpoint-2026-09-06.json +2 -13
- package/docs/piagent-runtime-benchmark-execution-plan.md +10 -8
- package/docs/project-adapters.md +3 -3
- package/docs/project-onboarding.md +15 -16
- package/docs/publishing-for-teams.md +3 -1
- package/docs/quality-benchmark.md +2 -0
- package/docs/quickstart-vietnamese.md +23 -24
- package/docs/release-install-policy.md +3 -2
- package/docs/research/harness-next-evidence-review.md +7 -7
- package/docs/runtime-harness-standard.md +2 -0
- package/docs/runtime-policy-design.md +2 -0
- package/docs/runtime-quality-baseline.md +2 -0
- package/docs/subagent-orchestration-capabilities.md +1 -1
- package/docs/subagents-and-multiagent.md +10 -8
- package/docs/task-implementation-contract.md +2 -0
- package/docs/task-lifecycle-vietnamese.md +2 -0
- package/docs/team-onboarding.md +28 -59
- package/docs/usage-observability.md +2 -2
- package/docs/vi/architecture.md +9 -1
- package/docs/workflow-recipes.md +6 -10
- package/docs-site/architecture.html +4 -3
- package/docs-site/assets/docs.css +80 -0
- package/docs-site/benchmark.html +7 -1
- package/docs-site/commands.html +37 -23
- package/docs-site/content/architecture.html +2 -2
- package/docs-site/content/benchmark.html +5 -0
- package/docs-site/content/commands.html +35 -22
- package/docs-site/content/ecosystem.html +144 -0
- package/docs-site/content/en/architecture.html +1 -1
- package/docs-site/content/en/benchmark.html +5 -0
- package/docs-site/content/en/commands.html +30 -13
- package/docs-site/content/en/ecosystem.html +144 -0
- package/docs-site/content/en/index.html +24 -9
- package/docs-site/content/en/quickstart.html +10 -12
- package/docs-site/content/en/security.html +1 -1
- package/docs-site/content/en/team.html +2 -2
- package/docs-site/content/en/whats-new.html +92 -1
- package/docs-site/content/en/workflows.html +29 -31
- package/docs-site/content/index.html +24 -9
- package/docs-site/content/quickstart.html +10 -12
- package/docs-site/content/security.html +2 -2
- package/docs-site/content/team.html +2 -2
- package/docs-site/content/whats-new.html +92 -1
- package/docs-site/content/workflows.html +36 -38
- package/docs-site/context-engine.html +2 -1
- package/docs-site/ecosystem.html +283 -0
- package/docs-site/en/architecture.html +3 -2
- package/docs-site/en/benchmark.html +7 -1
- package/docs-site/en/commands.html +32 -14
- package/docs-site/en/context-engine.html +2 -1
- package/docs-site/en/ecosystem.html +283 -0
- package/docs-site/en/index.html +30 -14
- package/docs-site/en/mcp-approval.html +2 -1
- package/docs-site/en/mcp-auth.html +2 -1
- package/docs-site/en/mcp-servers.html +2 -1
- package/docs-site/en/mcp.html +2 -1
- package/docs-site/en/permissions.html +2 -1
- package/docs-site/en/profiles.html +2 -1
- package/docs-site/en/quickstart.html +17 -18
- package/docs-site/en/runtime.html +2 -1
- package/docs-site/en/scope.html +2 -1
- package/docs-site/en/security.html +6 -5
- package/docs-site/en/team.html +4 -3
- package/docs-site/en/whats-new.html +100 -8
- package/docs-site/en/workflows.html +34 -35
- package/docs-site/index.html +30 -14
- package/docs-site/mcp-approval.html +2 -1
- package/docs-site/mcp-auth.html +2 -1
- package/docs-site/mcp-servers.html +2 -1
- package/docs-site/mcp.html +2 -1
- package/docs-site/permissions.html +2 -1
- package/docs-site/profiles.html +2 -1
- package/docs-site/quickstart.html +17 -18
- package/docs-site/runtime.html +2 -1
- package/docs-site/scope.html +2 -1
- package/docs-site/security.html +7 -6
- package/docs-site/team.html +4 -3
- package/docs-site/whats-new.html +100 -8
- package/docs-site/workflows.html +41 -42
- package/evals/fs5-causal-arm.v1.json +2 -2
- package/evals/private-holdout-v1/CURRENT_BOUNDARY.md +17 -0
- package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
- package/package.json +8 -7
- package/packages/piagent-core/README.md +15 -23
- package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +2 -0
- package/packages/piagent-core/extensions/experiment-loop-policy.ts +75 -0
- package/packages/piagent-core/extensions/local-state-path.js +15 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +108 -960
- package/packages/piagent-core/extensions/policy-core.js +2 -2
- package/packages/piagent-core/extensions/source-checkout-paths.ts +54 -0
- package/packages/piagent-core/managed/broker-client.mjs +49 -0
- package/packages/piagent-core/managed/capabilities.mjs +28 -0
- package/packages/piagent-core/managed/client-agent.mjs +6 -0
- package/packages/piagent-core/managed/compaction.mjs +63 -0
- package/packages/piagent-core/managed/doctor.mjs +107 -0
- package/packages/piagent-core/managed/helper-roles.mjs +57 -0
- package/packages/piagent-core/managed/native-catalog.mjs +42 -0
- package/packages/piagent-core/managed/patch-snapshot.mjs +48 -0
- package/packages/piagent-core/managed/repository-operation.mjs +84 -0
- package/packages/piagent-core/managed/request-stream.mjs +130 -0
- package/packages/piagent-core/managed/resource-loader.mjs +42 -0
- package/packages/piagent-core/managed/review-snapshot-worker.mjs +27 -0
- package/packages/piagent-core/managed/sandbox-diagnostic.mjs +12 -0
- package/packages/piagent-core/managed/search-fallback.mjs +93 -0
- package/packages/piagent-core/managed/session.mjs +493 -0
- package/packages/piagent-core/managed/store.d.mts +3 -0
- package/packages/piagent-core/managed/store.mjs +64 -0
- package/packages/piagent-core/managed/tool-boundary.mjs +275 -0
- package/packages/piagent-core/managed/tool-worker.mjs +36 -0
- package/packages/piagent-core/managed/toolchain.mjs +120 -0
- package/packages/piagent-core/managed/web-fetch.mjs +105 -0
- package/packages/piagent-core/managed/web-search.mjs +131 -0
- package/packages/piagent-core/managed/workflow.mjs +326 -0
- package/packages/piagent-core/package.json +2 -5
- package/packages/piagent-core/policies/base-policy.json +80 -26
- package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +3 -3
- package/packages/piagent-core/runtime/hooks/input-hook.ts +35 -196
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -0
- package/packages/piagent-core/runtime/inspection/approval-broker.ts +9 -1
- package/packages/piagent-core/runtime/managed-failure.d.mts +10 -0
- package/packages/piagent-core/runtime/managed-failure.mjs +166 -0
- package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +8 -29
- package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +1 -1
- package/packages/piagent-core/runtime/policy/block-remedy.ts +5 -3
- package/packages/piagent-core/runtime/registration/context-commands.ts +1 -1
- package/packages/piagent-core/runtime/registration/knowledge-tools.ts +7 -7
- package/packages/piagent-core/runtime/registration/policy-tools.ts +2 -2
- package/packages/piagent-core/runtime/registration/session-commands.ts +11 -26
- package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +1 -1
- package/packages/piagent-core/runtime/session/system-prompt.ts +6 -7
- package/packages/piagent-core/runtime/workflows/webui-runtime-command.ts +6 -6
- package/packages/piagent-core/runtime/workflows/webui-workflow.ts +6 -11
- package/packages/piagent-core/security/sensitive-text.js +9 -0
- package/packages/piagent-core/skills/piagent-ops/SKILL.md +8 -10
- package/packages/piagent-core/skills/test-audit/SKILL.md +101 -0
- package/packages/piagent-core/subagents/piagent-planner.md +1 -1
- package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-DMU7Xe_O.js → MarkdownMessage-BRPIMCRh.js} +1 -1
- package/packages/piagent-webui/dist/client/assets/index-DNJ1vH5d.js +228 -0
- package/packages/piagent-webui/dist/client/assets/{index-DVahUVWy.css → index-DgSmcnP8.css} +1 -1
- package/packages/piagent-webui/dist/client/index.html +2 -2
- package/packages/piagent-webui/extension/piagent-webui.ts +11 -11
- package/packages/piagent-webui/extension/session-stream-adapter.ts +3 -1
- package/packages/piagent-webui/extension/terminal-session-adapter.ts +6 -1
- package/packages/piagent-webui/gateway/company-relay.ts +308 -0
- package/packages/piagent-webui/gateway/control-socket.ts +39 -12
- package/packages/piagent-webui/gateway/gateway-service.ts +109 -28
- package/packages/piagent-webui/gateway/gateway-session-stream.ts +58 -2
- package/packages/piagent-webui/gateway/managed-gateway.mjs +41 -0
- package/packages/piagent-webui/gateway/managed-launch.ts +145 -0
- package/packages/piagent-webui/gateway/managed-projection.ts +20 -0
- package/packages/piagent-webui/gateway/pi-host.ts +22 -4
- package/packages/piagent-webui/gateway/runtime-session-controls.ts +5 -2
- package/packages/piagent-webui/gateway/session-approval-authority.ts +28 -0
- package/packages/piagent-webui/gateway/session-catalog.ts +11 -3
- package/packages/piagent-webui/gateway/session-command-controller.ts +8 -2
- package/packages/piagent-webui/gateway/session-file-facts.ts +25 -0
- package/packages/piagent-webui/gateway/session-inspection-registry.ts +40 -9
- package/packages/piagent-webui/gateway/session-list-cache.ts +68 -0
- package/packages/piagent-webui/gateway/session-runtime-ownership.ts +8 -1
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +20 -27
- package/packages/piagent-webui/ownership/managed-terminal-lease.ts +27 -0
- package/packages/piagent-webui/ownership/profile-state.ts +2 -0
- package/packages/piagent-webui/ownership/session-lease-store.ts +22 -1
- package/packages/piagent-webui/server/approval-projection.ts +9 -0
- package/packages/piagent-webui/server/core-inspection-provider.ts +4 -9
- package/packages/piagent-webui/server/loopback-server.ts +37 -1
- package/packages/piagent-webui/server/message-stop-reason.ts +11 -0
- package/packages/piagent-webui/server/tool-call-summary.ts +185 -0
- package/packages/piagent-webui/server/transcript-projection.ts +86 -3
- package/packs/engineering-base/pack.json +4 -0
- package/schemas/piagent-webui/runtime-command-v1.schema.json +1 -2
- package/schemas/piagent-webui/session-catalog-v1.schema.json +8 -0
- package/schemas/piagent-webui/transcript-v1.schema.json +94 -1
- package/scripts/build-docs-site.mjs +23 -12
- package/scripts/check-public-wording.mjs +5 -6
- package/scripts/check-runtime-advisories.mjs +23 -6
- package/scripts/claude-model-additions.mjs +33 -0
- package/scripts/configure-model-scope.sh +30 -6
- package/scripts/configure-subagents.sh +1 -1
- package/scripts/explain-command.mjs +5 -6
- package/scripts/init-project.sh +0 -2
- package/scripts/install-global.sh +3 -2
- package/scripts/model-scope-prune.mjs +75 -0
- package/scripts/phase-tools-evaluation.mjs +9 -4
- package/scripts/piagent-cli.mjs +51 -2
- package/scripts/piagent-dashboard.mjs +27 -4
- package/scripts/piagent-installations.mjs +26 -0
- package/scripts/piagent-studio.mjs +155 -0
- package/scripts/runtime-advisory-exceptions.json +29 -0
- package/scripts/setup.sh +10 -6
- package/scripts/team-doctor.sh +20 -1
- package/scripts/typescript-loader.mjs +6 -0
- package/scripts/verify-local.sh +2 -2
- package/templates/global/settings.json +3 -1
- package/templates/project/.pi/project-context.md +3 -3
- package/templates/project/AGENTS.md +4 -5
- package/docs/piagent-core-reasoning-research-2026-09-06.md +0 -225
- package/docs/piagent-core-research-sources-2026-09-06.json +0 -416
- package/packages/piagent-webui/dist/client/assets/index-Cui9AAV_.js +0 -176
package/docs/project-adapters.md
CHANGED
|
@@ -92,7 +92,7 @@ Quy tắc:
|
|
|
92
92
|
- Mọi key project tự khai **thay thế nguyên key** của adapter, không merge từng phần tử. Khai `protectedPaths` nghĩa là project sở hữu list đó và không nhận thay đổi từ adapter nữa.
|
|
93
93
|
- Không khai `extends` thì profile giữ nguyên hành vi cũ, self-contained.
|
|
94
94
|
|
|
95
|
-
`scripts/init-project.sh` và `/
|
|
95
|
+
`scripts/init-project.sh` và `/profile` ghi dạng `extends` khi profile đến từ built-in adapter. Update platform sau đó không cần chạm vào project nào.
|
|
96
96
|
|
|
97
97
|
## Monorepo và workspace
|
|
98
98
|
|
|
@@ -137,7 +137,7 @@ Rule nằm ở `packages/piagent-core/extensions/project-shape.js`. Cả `piagen
|
|
|
137
137
|
Default UX không bắt buộc chạy bash để set profile. Sau global install, vào project chạy:
|
|
138
138
|
|
|
139
139
|
```text
|
|
140
|
-
/
|
|
140
|
+
/profile setup
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
Nếu chưa có `.pi/piagent-profile.json`, onboarding nên dùng select-style setup: chọn profile trước, rồi chọn tech theo role. Native command là:
|
|
@@ -162,7 +162,7 @@ Kết quả ghi:
|
|
|
162
162
|
|
|
163
163
|
Sau khi agent đọc Context7 cho tech tương ứng, chỉ record snapshot ngắn bằng `piagent_profile_tech_context_record`; không lưu nguyên văn docs dài.
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
Lượt onboard (nhờ agent trong chat) cũng tạo `.pi/context-index.json`. Đây là advisory node/edge/citation map cho profile, tech, verify command, docs, risk và memory pointer; không dùng thay thế source hiện tại hoặc guard policy.
|
|
166
166
|
|
|
167
167
|
Đổi profile sau này:
|
|
168
168
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## Mục tiêu
|
|
5
5
|
|
|
6
|
-
Lần đầu gắn một project vào Pi Agent Platform,
|
|
6
|
+
Lần đầu gắn một project vào Pi Agent Platform, nên onboard trước khi giao việc implement lớn.
|
|
7
7
|
|
|
8
8
|
Luồng chuẩn là:
|
|
9
9
|
|
|
@@ -12,11 +12,16 @@ cd /path/to/project
|
|
|
12
12
|
pi
|
|
13
13
|
/login
|
|
14
14
|
<select provider/model>
|
|
15
|
-
/
|
|
16
|
-
|
|
15
|
+
/profile setup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
rồi nhờ agent bằng lời thường (từ bản 1.9.0 không còn `/onboard`):
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Đọc project này (chỉ đọc) và ghi lại project context.
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
Sau khi profile setup và lượt onboard xong, project có file:
|
|
20
25
|
|
|
21
26
|
```text
|
|
22
27
|
.pi/piagent-profile.json
|
|
@@ -29,7 +34,7 @@ pi
|
|
|
29
34
|
.pi/memory/MEMORY.md
|
|
30
35
|
```
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Profile và tech stack được chọn bằng select-style flow:
|
|
33
38
|
|
|
34
39
|
```text
|
|
35
40
|
/profile setup
|
|
@@ -42,7 +47,7 @@ Nếu Pi host chưa có native select, command trả card compact và lệnh det
|
|
|
42
47
|
|
|
43
48
|
`.pi/context-index.json` là compact advisory index dạng node/edge/citation cho profile, tech stack, verify command, docs, risk, memory pointer và task handoff đã được duyệt. Nó giúp agent tìm đúng điểm vào repo nhanh hơn, nhưng không phải source of truth hoặc security boundary.
|
|
44
49
|
|
|
45
|
-
Context index là Pi runtime state. Không đọc/ghi raw file này trong workflow thường ngày; dùng `/context`, `piagent_context_index_status`, `piagent_context_index_search`,
|
|
50
|
+
Context index là Pi runtime state. Không đọc/ghi raw file này trong workflow thường ngày; dùng `/context`, `piagent_context_index_status`, `piagent_context_index_search`, lượt onboard hoặc `piagent_context_index_record` để runtime có thể kiểm soát path và sanitize dữ liệu advisory trước khi đưa vào model.
|
|
46
51
|
|
|
47
52
|
Memory markdown là local/private mặc định và bị ignore bởi `.pi/.gitignore`. Chỉ commit memory nếu team quyết định opt-in sau khi review/redact.
|
|
48
53
|
|
|
@@ -52,7 +57,7 @@ Memory markdown là local/private mặc định và bị ignore bởi `.pi/.giti
|
|
|
52
57
|
|
|
53
58
|
Bash setup chỉ biết tạo template và detect marker. Nó không có model reasoning, không biết project purpose, module ownership, domain rule, hay risk boundary.
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
Lượt onboard nên chạy sau login/model selection để chính model sẽ dùng cho task đọc qua project, gợi ý profile, và tạo snapshot.
|
|
56
61
|
|
|
57
62
|
## Profile selection
|
|
58
63
|
|
|
@@ -116,13 +121,7 @@ Mục tiêu là hiểu cấu trúc và policy, không nhồi full repo vào cont
|
|
|
116
121
|
|
|
117
122
|
## Khi nào regenerate
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```text
|
|
122
|
-
/onboard run
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
khi có thay đổi lớn:
|
|
124
|
+
Nhờ agent onboard lại ("Đọc lại project và cập nhật project context") khi có thay đổi lớn:
|
|
126
125
|
|
|
127
126
|
- source layout đổi;
|
|
128
127
|
- framework/runtime đổi;
|
|
@@ -130,8 +129,8 @@ khi có thay đổi lớn:
|
|
|
130
129
|
- API/schema/migration/auth/provider policy đổi;
|
|
131
130
|
- project ownership hoặc domain rule đổi.
|
|
132
131
|
|
|
133
|
-
##
|
|
132
|
+
## Quan hệ với việc hằng ngày
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
Agent đọc `.pi/project-context.md` như context advisory. Nếu file còn trạng thái `Generated: not yet`, nên nhờ agent onboard trước khi giao việc lớn.
|
|
136
135
|
|
|
137
136
|
Đây là điểm khác với CLI thuần: context bootstrap trở thành một bước có artifact có thể review và tái dùng. `.pi/project-context.md` và `.pi/context-index.json` có thể commit cho team sau khi review; memory markdown thì private-by-default.
|
|
@@ -41,6 +41,8 @@ pi install /path/to/piagent
|
|
|
41
41
|
|
|
42
42
|
## Versioning
|
|
43
43
|
|
|
44
|
+
- `1.9.1`: subagent khảo sát và xác minh cho tài khoản công ty (chỉ khi Harness bật); tìm web qua search pool của Studio cho mọi vai; gửi `piagent/<version>` cho Studio. Sandbox công ty: đọc được `auth.json` nằm trong source (file dịch); giấu hẳn `.env*` (trừ file mẫu) để Vite/Vitest/Next vẫn chạy; ở thư mục không có git, lệnh chỉ đọc không còn bị tính là sửa code; E2E chạy qua `run_with_network`; bộ cài không gợi ý lệnh đã bỏ.
|
|
45
|
+
- `1.9.0`: phiên freeform — bỏ task contract và các command workflow (`/workflow`, `/fresh`, `/onboard`…); khung main/research/review cho tài khoản công ty; redact credential Studio; sửa duyệt trên WebUI.
|
|
44
46
|
- `1.8.0`: Pi 0.87.1, thêm GPT-6 Astra/Sol/Luna vào catalog, WebUI và tier routing opt-in. Không chạy lại 108 phiên hay claim hiệu suất GPT-6.
|
|
45
47
|
- `1.7.1`: Pi 0.86.1, chờ trong phiên đang mở, sửa context/usage và phục hồi; kết quả chạy lại 14 phiên lỗi được giữ riêng, không claim một full108 mới hay tiết kiệm token tổng thể.
|
|
46
48
|
- `1.7.0`: chỉ có annotated tag; macOS tag CI chạm giới hạn 40 phút hai lần nên npm và GitHub Release không được publish. Được thay bằng `1.7.1`.
|
|
@@ -152,7 +154,7 @@ pi install /path/to/piagent
|
|
|
152
154
|
2. Install the pinned terminal helper and matching Pi package.
|
|
153
155
|
3. Login OAuth provider.
|
|
154
156
|
4. Run `pi` in the target project.
|
|
155
|
-
5.
|
|
157
|
+
5. Ask the agent to inspect the project read-only and record its project context.
|
|
156
158
|
6. Choose/apply a profile inside Pi.
|
|
157
159
|
|
|
158
160
|
Chi tiết: `docs/team-onboarding.md` và `docs/distribution-standard.md`.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Quality benchmark guide
|
|
2
2
|
<!-- language: vi; english-index: docs-site/content/en/benchmark.html -->
|
|
3
3
|
|
|
4
|
+
> **Lưu ý bản 1.9.0.** Các suite và số liệu dưới đây được đo trên Piagent có task contract và command workflow (đến 1.8.x). Hai cơ chế này đã bỏ ngày 2026-09-30; journey/benchmark dựa vào bản ghi task là hồ sơ lịch sử cho tới khi được đo lại trên lượt freeform.
|
|
5
|
+
|
|
4
6
|
## Chạy và chấm tự động bằng một lệnh
|
|
5
7
|
|
|
6
8
|
Từ terminal, chạy:
|
|
@@ -67,18 +67,22 @@ Sau khi login và chọn model intended cho project understanding:
|
|
|
67
67
|
```text
|
|
68
68
|
/model # hoặc Ctrl+L để chọn model bằng selector của Pi
|
|
69
69
|
/scoped-models # optional, chỉnh danh sách Ctrl+P cycle
|
|
70
|
-
/commands
|
|
71
70
|
/mcp # kiểm tra MCP adapter/server
|
|
72
71
|
/subagents-doctor # health check subagent setup
|
|
73
|
-
/
|
|
74
|
-
/onboard run
|
|
72
|
+
/profile setup
|
|
75
73
|
/context index
|
|
76
74
|
/memory
|
|
77
75
|
```
|
|
78
76
|
|
|
77
|
+
Rồi nhờ agent onboard bằng lời thường (từ bản 1.9.0 không còn `/onboard`):
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Đọc project này (chỉ đọc) và ghi lại project context.
|
|
81
|
+
```
|
|
82
|
+
|
|
79
83
|
`Ctrl+L` mở model selector, `Ctrl+P` đổi model trong scope, `Shift+Tab` đổi mức thinking. `piagent-setup` đã config sẵn `enabledModels`, MCP baseline preset `core`, và subagents preset `safe` — muốn xem hoặc đổi thì có [model-options.md](model-options.md), [mcp-and-tools.md](mcp-and-tools.md), [subagents-and-multiagent.md](subagents-and-multiagent.md).
|
|
80
84
|
|
|
81
|
-
`/
|
|
85
|
+
Profile/tech (`/profile setup`) và lượt onboard này ghi:
|
|
82
86
|
|
|
83
87
|
```text
|
|
84
88
|
.pi/piagent-profile.json
|
|
@@ -100,7 +104,7 @@ Nếu chưa có profile/tech stack, dùng select-style flow để tránh agent t
|
|
|
100
104
|
|
|
101
105
|
`web-frontend` chọn FE + database optional; `backend-api` chọn BE + database optional; `fullstack` chọn frontend, backend và database. Nếu Pi host chưa có native select, command sẽ trả card ngắn và lệnh deterministic `/profile tech apply ...`.
|
|
102
106
|
|
|
103
|
-
`.pi/project-context.md` là snapshot context cho task sau. `.pi/context-index.json` là bản đồ node/edge/citation compact để tìm đúng điểm vào repo; vẫn phải đọc source hiện tại trước khi sửa. Không đọc/ghi raw file index trong task thường ngày; dùng `/context`,
|
|
107
|
+
`.pi/project-context.md` là snapshot context cho task sau. `.pi/context-index.json` là bản đồ node/edge/citation compact để tìm đúng điểm vào repo; vẫn phải đọc source hiện tại trước khi sửa. Không đọc/ghi raw file index trong task thường ngày; dùng `/context`, lượt onboard hoặc `piagent_context_index_record` để runtime sanitize dữ liệu advisory. Nếu snapshot còn `Generated: not yet` hoặc `/context index` báo pending/stale, nên nhờ agent onboard lại trước task lớn.
|
|
104
108
|
|
|
105
109
|
`/memory` kiểm tra chính sách memory của project. `/memory-policy` vẫn là alias. Mặc định memory là explicit-only: chỉ ghi khi user yêu cầu rõ “remember this”, không tự học transcript nền.
|
|
106
110
|
|
|
@@ -124,40 +128,35 @@ cd <project>
|
|
|
124
128
|
pi --name "ABC-123 Short task name"
|
|
125
129
|
```
|
|
126
130
|
|
|
127
|
-
Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Nếu quên đặt tên lúc mở Pi, gõ `/name ABC-123 Short task name` hoặc alias ngắn `/setname ABC-123 Short task name` trước khi làm tiếp; Agent Watch sẽ dùng tên session này trong report. Không cần paste checklist
|
|
131
|
+
Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Nếu quên đặt tên lúc mở Pi, gõ `/name ABC-123 Short task name` hoặc alias ngắn `/setname ABC-123 Short task name` trước khi làm tiếp; Agent Watch sẽ dùng tên session này trong report. Không cần paste checklist hay gõ `/task`/`/workflow` (đã bỏ từ bản 1.9.0): guard tự áp policy cho từng tool call. Muốn chỉ đọc thì nói rõ "chỉ đọc, không sửa", hoặc đổi session sang `/permission read-only`.
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
thì quay lại đúng session cũ theo name/id. Source task yêu cầu project là Git
|
|
131
|
-
working tree và profile có verify command thật. `/workflow scout` vẫn chạy ở
|
|
132
|
-
read-only mode khi chỉ cần nghiên cứu và không sửa source.
|
|
133
|
+
Nên mở session mới cho việc mới; resume thì quay lại đúng session cũ theo name/id.
|
|
133
134
|
|
|
134
135
|
Muốn chạy nhiều agent song song thì gõ `herdr` thay vì `pi`, rồi mở mỗi pane một vai: implement, review read-only, verify, notes. Herdr chỉ điều phối terminal/session, không phải security boundary — gate vẫn nằm ở Pi extension và OAuth vẫn `/login` trong Pi. Chi tiết: [herdr-workflow.md](herdr-workflow.md).
|
|
135
136
|
|
|
136
137
|
| Gõ | Khi nào |
|
|
137
138
|
|---|---|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
| `/workflow plan <mục tiêu>` | Muốn có plan trước khi đụng code. |
|
|
143
|
-
| `/workflow review current diff` | Review việc vừa làm. |
|
|
139
|
+
| `<việc cần làm>` | Đã rõ, làm luôn — nói bằng lời thường. |
|
|
140
|
+
| `<việc> … chỉ đọc, không sửa` | Scout/audit, map payment/auth/BE contract. |
|
|
141
|
+
| `Chưa sửa, lập plan cho <mục tiêu>` | Muốn có plan trước khi đụng code. |
|
|
142
|
+
| `Review diff hiện tại` | Review việc vừa làm. |
|
|
144
143
|
| `/name <task/session name>` | Đặt/đổi tên session để resume và report dễ đối chiếu. |
|
|
145
144
|
| `/usage logs` | Xem các capture khi test/build output quá dài và Pi chỉ hiện preview. |
|
|
146
|
-
| `/task-preflight
|
|
147
|
-
| `/piagent-status` | Xem
|
|
145
|
+
| `/task-preflight <việc>` | Xem context và shadow route deterministic trước khi giao việc, không gọi model. |
|
|
146
|
+
| `/piagent-status` | Xem profile, guard, runtime và model đã xác thực. |
|
|
148
147
|
| `/usage efficiency` | Xem context efficiency và task metrics có nguồn; giá trị không đo được là `null`. |
|
|
149
|
-
| `/
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
| `/
|
|
148
|
+
| `/profile be-readonly-fe` rồi nói việc | Backend read-only, làm FE. |
|
|
149
|
+
| `Commit <các file> với message …` | Commit local; không push. |
|
|
150
|
+
| `Tạo draft PR …` | Tạo PR; guard hỏi xác nhận trước khi push. |
|
|
151
|
+
| `/new` | Session đang nặng hoặc tràn context: mở session mới rồi nói lại việc. |
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
Gõ `/` trong Pi để xem command hiện có. Alias `/context-index`, `/logs` vẫn chạy. Giải thích từng lệnh: [command-reference-vietnamese.md](command-reference-vietnamese.md). Các workflow ép shape rõ (`/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`): [subagents-and-multiagent.md](subagents-and-multiagent.md). Runtime gate tools và cách agent tự dùng chúng: [operator-manual-vietnamese.md](operator-manual-vietnamese.md).
|
|
155
154
|
|
|
156
155
|
## Việc user vẫn phải làm thủ công
|
|
157
156
|
|
|
158
157
|
- Login OAuth lần đầu trong browser.
|
|
159
158
|
- Chọn provider/model intended cho project.
|
|
160
|
-
-
|
|
159
|
+
- Nhờ agent onboard lần đầu để tạo `.pi/project-context.md` và `.pi/context-index.json`.
|
|
161
160
|
- Chạy `/memory` nếu muốn kiểm tra hoặc dùng project memory.
|
|
162
161
|
- Approve project trust nếu Pi hỏi. Sau khi hiểu rõ repo, có thể dùng `piagent-auto` hoặc Pi native `--approve` cho từng lần chạy.
|
|
163
162
|
- Approve khi extension guard hỏi destructive/high-risk action.
|
|
@@ -153,7 +153,7 @@ Use this flow when the team needs both terminal commands and the Pi package:
|
|
|
153
153
|
```bash
|
|
154
154
|
node --version # >= 22.19.0
|
|
155
155
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
|
|
156
|
-
npm install -g --ignore-scripts @piagent/platform@1.
|
|
156
|
+
npm install -g --ignore-scripts @piagent/platform@1.9.1
|
|
157
157
|
piagent-install --stable --dry-run
|
|
158
158
|
piagent-install --stable
|
|
159
159
|
```
|
|
@@ -179,7 +179,7 @@ bash scripts/install-global.sh --stable
|
|
|
179
179
|
Use this only when terminal commands are not needed:
|
|
180
180
|
|
|
181
181
|
```bash
|
|
182
|
-
pi install git:github.com/Vt-mmm/piagent@v1.
|
|
182
|
+
pi install git:github.com/Vt-mmm/piagent@v1.9.1
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
Direct `pi install` does not create `piagent-*` commands on `PATH`.
|
|
@@ -475,4 +475,5 @@ Re-running the workflow from a branch instead skips publishing, because the publ
|
|
|
475
475
|
- Do not publish local trust files, OAuth tokens, `auth.json`, sessions, caches, or `.env` files.
|
|
476
476
|
- Review the resolved commit SHA before rollout; tag resolution improves reproducibility but is not signed package provenance by itself.
|
|
477
477
|
- `npm audit --audit-level=high` covers this repository's helper dependency tree. `npm run audit:runtime` separately builds the exact optional Pi host and pinned add-on dependency tree and blocks unaccepted moderate, high, or critical findings so stale or permissive peer resolution cannot hide deployed runtime risk.
|
|
478
|
+
- The only accepted runtime findings are listed in `scripts/runtime-advisory-exceptions.json`. Each entry is an owner decision for one advisory at one package path, with a reason and an end day at most 60 days after the decision. The same advisory elsewhere, any other advisory, and an expired entry still block, and the audit prints every accepted entry. For 1.9.0 (decided 2026-10-02, ends 2026-10-31) these are three denial-of-service advisories in `brace-expansion` 5.0.9, which every published Pi host pins through its npm-shrinkwrap. Remove them when a Pi host carries `brace-expansion` 5.0.12 or later.
|
|
478
479
|
- Run doctor after install, update, or rollback so package source, project profile, protected paths, and share policy are checked together.
|
|
@@ -16,17 +16,17 @@ Numbers below are the authors' reported results under their own models, datasets
|
|
|
16
16
|
|
|
17
17
|
| Source | Evidence or mechanism | What Piagent can transfer; limitation |
|
|
18
18
|
| --- | --- | --- |
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
19
|
+
| [Agent–computer interface study, NeurIPS 2024, v3](https://arxiv.org/abs/2405.15793v3) | A purpose-built agent-computer interface; reported pass@1 of 12.5% on SWE-bench and 87.7% on HumanEvalFix. | Treat tool feedback and interface design as measurable interventions. Do not assume its 2024 interface or scores transfer to another model. |
|
|
20
|
+
| [Phase-separated repair without an agent loop, 2024, v2](https://arxiv.org/abs/2407.01489v2) | Localization, repair, and validation as separate phases; reported 32.00% (96 fixes) on SWE-bench Lite at $0.70 per problem. | Keep control flow inspectable and compare against a simpler baseline. More orchestration is not inherently better. Different benchmark from the interface study's full SWE-bench result. |
|
|
21
21
|
| [EvalPlus, 2023, v3](https://arxiv.org/abs/2305.01210v3) | Mutation- and LLM-generated test inputs; HumanEval+ expands tests 80-fold. Across 26 models, the paper reports pass@k reductions up to 19.3–28.9% and changed rankings. | Strengthen independent tests and measure false acceptance, not merely acceptance rate. More cases are useful only with a trustworthy oracle and relevant partitions. |
|
|
22
22
|
| [CEGAR, Clarke et al., 2000](https://web.stanford.edu/class/cs357/cegar.pdf) | Distinguish real counterexamples from artifacts of an abstraction; refine the abstraction for spurious traces. | Preserve `unknown` and route verifier limitations away from blind source repair. The paper's guarantees concern its finite-state model/specification setting, not arbitrary JavaScript or finite random tests. |
|
|
23
23
|
| [fast-check model-based testing](https://fast-check.dev/docs/advanced/model-based-testing/) | Generate stateful command sequences, compare with a simpler model, shrink failures, replay with seed/path. | Exercise verification/recovery histories and save minimal counterexamples. The reference model must not copy the implementation's logic. |
|
|
24
24
|
| [Anthropic agent eval guidance, 2026-01-09](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents) | Separate transcript from final environment outcome, calibrate graders, validate tasks with reference solutions, distinguish pass@k from all-trial consistency. | Audit both false positives and false negatives; retain outcome and process metrics separately. This is engineering guidance, not a controlled estimate of Piagent improvement. |
|
|
25
25
|
| [AgentLens, 2026, v3](https://arxiv.org/abs/2605.12925v3) | 2,614 trajectories, eight model backends, 60 SWE-bench Verified tasks; a 1,815-trajectory subset over 47 tasks. Among passing trajectories in that subset, 10.7% were classified as Lucky Passes. | Measure blind retries, regression cycles, and verification ordering in addition to final pass rate. This is a recent preprint; its labels are not proof that a specific Piagent run is bad. |
|
|
26
26
|
| [Pi source README](https://github.com/earendil-works/pi/tree/main/packages/coding-agent) | Minimal extensible harness; default read/write/edit/bash tools, extension-based workflow customization. | Keep reusable enforcement in the extension while letting the model choose implementation structure. Minimalism does not replace project authorization or verification. |
|
|
27
|
-
|
|
|
28
|
-
| [
|
|
29
|
-
|
|
|
27
|
+
| Lean bash-only agent baseline | Bash-only actions, linear message history, independent subprocess execution. | Use an observable lean baseline and avoid hidden recovery state. Do not transplant unrestricted shell access into Piagent's protected-path policy. |
|
|
28
|
+
| [Agent SDK architecture paper, v2](https://arxiv.org/abs/2511.03690v2) | Separate SDK, tools, workspaces, and server; immutable/stateless components and portable execution. | Separate assessment from execution and UI projection; keep backend failures distinct from model failures. No numerical reduction is inferred from the abstract's qualitative production claim. |
|
|
29
|
+
| Workflow-graph checkpointing | Checkpoints and pending writes preserve completed steps; replay after a checkpoint can re-execute external calls. | Store verification receipts and resume only valid bound work. Replay is not automatically free or side-effect-free; preserve the single paid-attempt ledger. |
|
|
30
30
|
| [OpenAI evaluation guidance](https://developers.openai.com/api/docs/guides/evaluation-best-practices) | Task-specific evaluations, production failure datasets, automated scoring calibrated against human judgment. | Maintain a labelled grader audit set and separate quality, safety, and tool-selection checks. Do not add model judges as an uncalibrated completion authority. |
|
|
31
31
|
|
|
32
32
|
[OpenAI's lean-prompt guidance](https://developers.openai.com/api/docs/guides/latest-model#favor-leaner-prompts) reports an internal sample with roughly 10–15% higher eval scores, 41–66% fewer total tokens, and 33–67% lower cost. The page does not establish an equivalent Piagent workload or a fresh-token saving. This is a hypothesis for a later isolated ablation, not a reason to change prompts during a frozen benchmark or advertise those numbers.
|
|
@@ -64,9 +64,9 @@ The accompanying architecture decision and evaluation protocol define how these
|
|
|
64
64
|
|
|
65
65
|
## Follow-up: stateful recovery and replay after admission integration
|
|
66
66
|
|
|
67
|
-
Primary documentation was rechecked on 2026-08-30.
|
|
67
|
+
Primary documentation was rechecked on 2026-08-30. Current workflow-graph checkpointing documentation distinguishes full step checkpoints from completed per-node writes, and explicitly states that replay after a selected checkpoint re-executes later model/API calls. It also distinguishes exit-only, asynchronous, and synchronous durability. Piagent therefore cannot infer “exactly once” from the presence of a checkpoint: completed evidence reuse, pending-attempt reconciliation, and paid-attempt accounting need separate tests.
|
|
68
68
|
|
|
69
|
-
The
|
|
69
|
+
The same documentation's fault-tolerance guidance separates retry policy, per-attempt timeout, and exhausted-error handling. This supports keeping worker failure distinct from a source counterexample. It does not justify importing that library's default retry behavior or raising Piagent's existing ceilings. Our next recovery work must retain the actual executor/unsupported reason instead of collapsing every unavailable admission into a generic missing-proof diagnostic.
|
|
70
70
|
|
|
71
71
|
[fast-check's model-based guide](https://fast-check.dev/docs/advanced/model-based-testing/) compares command histories against a simplified model and warns against reproducing the implementation as the oracle. It provides shrinking plus seed/path/replay-path reproduction. The transferable test design is a small abstract authority/attempt model exercised by histories such as reserve → host death → reopen → reconcile → retry, not merely isolated method assertions. No fast-check dependency or general stateful adapter was installed by this checkpoint.
|
|
72
72
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Runtime harness standard
|
|
2
2
|
<!-- language: vi; english-index: docs-site/content/en/runtime.html -->
|
|
3
3
|
|
|
4
|
+
> **Hồ sơ thiết kế trước bản 1.9.0.** Task contract, command workflow (`/workflow`, `/task`, `/fresh`, `/onboard`) và các tool task/trace/verify mô tả ở đây đã bỏ ngày 2026-09-30; session giờ là freeform và guard chỉ còn kiểm tra path, quyền, xác nhận, context budget và edit trên bản đọc cũ. Tài liệu được giữ để tra cứu lịch sử. Hành vi hiện tại: [README](../README.vi.md).
|
|
5
|
+
|
|
4
6
|
## Mục tiêu
|
|
5
7
|
|
|
6
8
|
Runtime harness là “máy vận hành task” dùng chung cho nhiều project:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Runtime policy design
|
|
2
2
|
<!-- language: en -->
|
|
3
3
|
|
|
4
|
+
> **Design record from before 1.9.0.** The task contract, workflow commands (`/workflow`, `/task`, `/fresh`, `/onboard`) and task/trace/verify tools described here were retired on 2026-09-30; sessions are freeform and the guard keeps its path, permission, confirmation, context-budget and stale-edit checks. Kept for reference. Current behavior: [README](../README.md).
|
|
5
|
+
|
|
4
6
|
## Mục tiêu
|
|
5
7
|
|
|
6
8
|
Runtime policy là lớp kiểm soát cách agent đọc context, gọi tool, sửa source, chạy verify, và kết thúc task. Tài liệu này mô tả thiết kế trung lập của Pi Agent Platform, không phụ thuộc vào một project cụ thể.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Runtime quality baseline
|
|
2
2
|
<!-- language: vi; english-index: docs-site/content/en/runtime.html -->
|
|
3
3
|
|
|
4
|
+
> **Hồ sơ thiết kế trước bản 1.9.0.** Task contract, command workflow (`/workflow`, `/task`, `/fresh`, `/onboard`) và các tool task/trace/verify mô tả ở đây đã bỏ ngày 2026-09-30; session giờ là freeform và guard chỉ còn kiểm tra path, quyền, xác nhận, context budget và edit trên bản đọc cũ. Tài liệu được giữ để tra cứu lịch sử. Hành vi hiện tại: [README](../README.vi.md).
|
|
5
|
+
|
|
4
6
|
## Mục tiêu
|
|
5
7
|
|
|
6
8
|
Runtime quality baseline định nghĩa bộ kiểm soát để Pi Agent Platform có thể chạy task một cách có kỷ luật cho solo, internal team, và public package.
|
|
@@ -67,7 +67,7 @@ Core decisions:
|
|
|
67
67
|
Daily implementation:
|
|
68
68
|
|
|
69
69
|
```text
|
|
70
|
-
|
|
70
|
+
Implement <task>.
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
The parent performs review, research, planning, implementation, and verification directly. A helper dispatch must expose its runtime estimate and fresh read-only contract; otherwise the telemetry outcome is `skip`.
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# Subagents và multi-agent workflow
|
|
2
2
|
<!-- language: vi; english-index: docs-site/content/en/workflows.html -->
|
|
3
3
|
|
|
4
|
-
##
|
|
4
|
+
## Bản harness local hiện tại
|
|
5
|
+
|
|
6
|
+
Company runtime dùng hai vai trò nghiên cứu/review do Studio cấp, token theo lượt và tool worker cách ly. Main không phải chứng minh tiết kiệm 30% hoặc hai nhánh độc lập; reviewer có thể kiểm tra patch main vừa tạo. Member chỉ import trong Watch rồi dùng Auto. Cấu hình các package cá nhân bên dưới không cấp quyền chạy trong company runtime.
|
|
7
|
+
|
|
8
|
+
Phần dưới mô tả tích hợp package cá nhân của bản 1.8.0 trước khi đơn giản hóa; những đoạn về workflow/task contract và ngưỡng 30% đã được thay thế trong bản local. Xem [bằng chứng local](managed-local-acceptance.md).
|
|
9
|
+
|
|
10
|
+
## Tài liệu package cá nhân trước đây
|
|
5
11
|
|
|
6
12
|
Pi core không có subagents built-in. Theo design của Pi, subagents là extension/package. Platform này dùng `pi-subagents` làm subagent runtime vì nó hỗ trợ:
|
|
7
13
|
|
|
@@ -149,11 +155,7 @@ Giải nghĩa nhanh:
|
|
|
149
155
|
| `/parallel` | Chạy nhiều agent độc lập | Tốt cho read-only scout/review/test-gap analysis. |
|
|
150
156
|
| `/chain` | Chạy tuần tự | Output agent trước làm input agent sau qua `{previous}`. |
|
|
151
157
|
|
|
152
|
-
Nếu cần bản tổng hợp cho team mới
|
|
153
|
-
|
|
154
|
-
```text
|
|
155
|
-
/commands subagents
|
|
156
|
-
```
|
|
158
|
+
Nếu cần bản tổng hợp cho team mới, xem [command reference](command-reference-vietnamese.md#command-subagent).
|
|
157
159
|
|
|
158
160
|
## Gọi subagent tự nhiên
|
|
159
161
|
|
|
@@ -169,10 +171,10 @@ Run a review loop on this change until reviewers stop finding fixes worth doing,
|
|
|
169
171
|
Run parallel research: external docs, local code context, and practical tradeoffs.
|
|
170
172
|
```
|
|
171
173
|
|
|
172
|
-
Với workflow platform, còn có thể chỉ
|
|
174
|
+
Với workflow platform, còn có thể chỉ nói:
|
|
173
175
|
|
|
174
176
|
```text
|
|
175
|
-
|
|
177
|
+
Implement <task lớn>.
|
|
176
178
|
```
|
|
177
179
|
|
|
178
180
|
Parent agent sẽ tự quyết định:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Task Implementation Contract v2
|
|
2
2
|
<!-- language: en -->
|
|
3
3
|
|
|
4
|
+
> **Design record from before 1.9.0.** The task contract, workflow commands (`/workflow`, `/task`, `/fresh`, `/onboard`) and task/trace/verify tools described here were retired on 2026-09-30; sessions are freeform and the guard keeps its path, permission, confirmation, context-budget and stale-edit checks. Kept for reference. Current behavior: [README](../README.md).
|
|
5
|
+
|
|
4
6
|
## Muc tieu
|
|
5
7
|
|
|
6
8
|
Contract la state machine cuc bo giup Pi chung minh mot task da doc gi, duoc sua
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Vong doi task trong Pi Agent Platform
|
|
2
2
|
<!-- language: vi; english-index: docs-site/content/en/runtime.html -->
|
|
3
3
|
|
|
4
|
+
> **Hồ sơ thiết kế trước bản 1.9.0.** Task contract, command workflow (`/workflow`, `/task`, `/fresh`, `/onboard`) và các tool task/trace/verify mô tả ở đây đã bỏ ngày 2026-09-30; session giờ là freeform và guard chỉ còn kiểm tra path, quyền, xác nhận, context budget và edit trên bản đọc cũ. Tài liệu được giữ để tra cứu lịch sử. Hành vi hiện tại: [README](../README.vi.md).
|
|
5
|
+
|
|
4
6
|
## Muc tieu
|
|
5
7
|
|
|
6
8
|
Tu `v1.2.11`, mot source task duoc quan ly theo chuoi khép kín:
|
package/docs/team-onboarding.md
CHANGED
|
@@ -10,7 +10,7 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
|
|
|
10
10
|
```bash
|
|
11
11
|
node --version # >= 22.19.0
|
|
12
12
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
|
|
13
|
-
npm install -g --ignore-scripts @piagent/platform@1.
|
|
13
|
+
npm install -g --ignore-scripts @piagent/platform@1.9.1
|
|
14
14
|
piagent-install --stable
|
|
15
15
|
cd /path/to/project
|
|
16
16
|
pi
|
|
@@ -18,11 +18,12 @@ pi
|
|
|
18
18
|
<select provider/model>
|
|
19
19
|
/mcp
|
|
20
20
|
/subagents-doctor
|
|
21
|
-
/
|
|
22
|
-
/onboard run
|
|
21
|
+
/profile setup
|
|
23
22
|
/memory
|
|
24
23
|
```
|
|
25
24
|
|
|
25
|
+
Rồi nhờ agent: "Đọc project này (chỉ đọc) và ghi lại project context." (từ bản 1.9.0 không còn `/onboard`).
|
|
26
|
+
|
|
26
27
|
## Prerequisites
|
|
27
28
|
|
|
28
29
|
- Node.js >=22.19.0.
|
|
@@ -44,7 +45,7 @@ Mặc định team dùng stable helper:
|
|
|
44
45
|
```bash
|
|
45
46
|
node --version # >= 22.19.0
|
|
46
47
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
|
|
47
|
-
npm install -g --ignore-scripts @piagent/platform@1.
|
|
48
|
+
npm install -g --ignore-scripts @piagent/platform@1.9.1
|
|
48
49
|
piagent-install --stable --dry-run
|
|
49
50
|
piagent-install --stable
|
|
50
51
|
```
|
|
@@ -80,7 +81,7 @@ Khi cần kiểm tra một project sau rollout, chạy riêng:
|
|
|
80
81
|
piagent-update --version X.Y.Z --project /path/to/project
|
|
81
82
|
```
|
|
82
83
|
|
|
83
|
-
`--project` là bước phụ: tự migrate layout cũ,
|
|
84
|
+
`--project` là bước phụ: tự migrate layout cũ, bản ghi task cũ và managed block
|
|
84
85
|
trong `AGENTS.md` nếu có rồi chạy doctor strict-share. Text riêng của project
|
|
85
86
|
ngoài managed block được giữ nguyên. Nếu chỉ update global, runtime mới vẫn thay
|
|
86
87
|
checklist template cũ trong system prompt ở memory nên task dùng logic mới ngay;
|
|
@@ -171,10 +172,11 @@ Rồi chạy:
|
|
|
171
172
|
```text
|
|
172
173
|
/mcp
|
|
173
174
|
/subagents-doctor
|
|
174
|
-
/
|
|
175
|
-
/onboard run
|
|
175
|
+
/profile setup
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
+
rồi nhờ agent trong chat: "Đọc project này (chỉ đọc) và ghi lại project context."
|
|
179
|
+
|
|
178
180
|
Output chính:
|
|
179
181
|
|
|
180
182
|
- `.pi/project-context.md`
|
|
@@ -201,7 +203,7 @@ Nếu project chưa có profile/tech stack, dùng select-style flow để tránh
|
|
|
201
203
|
|
|
202
204
|
`fullstack` bắt chọn frontend, backend và database. Nếu native select chưa có trong Pi host, command trả card compact kèm lệnh deterministic `/profile tech apply ...`.
|
|
203
205
|
|
|
204
|
-
Nếu `.pi/project-context.md` còn `Generated: not yet`,
|
|
206
|
+
Nếu `.pi/project-context.md` còn `Generated: not yet`, nên nhờ agent onboard trước khi giao việc implement.
|
|
205
207
|
|
|
206
208
|
Memory mặc định là project-scoped và explicit-only. Chạy `/memory` để xem files/rules. `/memory-policy` vẫn là alias. Agent chỉ ghi durable memory khi user yêu cầu rõ ràng.
|
|
207
209
|
|
|
@@ -263,13 +265,13 @@ Project init tạo:
|
|
|
263
265
|
|
|
264
266
|
Hai file memory ở trên là local/private mặc định theo `.pi/.gitignore`; chỉ commit nếu team opt-in sau review.
|
|
265
267
|
|
|
266
|
-
Với luồng FE/BE tách repo nhưng để chung một folder làm việc, mở Pi tại folder cha và chọn `be-readonly-fe` cho chính folder cha đó. Ví dụ `Working/v-nexus-frontend/` và `Working/v-nexus-backend/` là hai Git repo riêng; `Working/.pi/piagent-profile.json` là profile của phiên Pi.
|
|
268
|
+
Với luồng FE/BE tách repo nhưng để chung một folder làm việc, mở Pi tại folder cha và chọn `be-readonly-fe` cho chính folder cha đó. Ví dụ `Working/v-nexus-frontend/` và `Working/v-nexus-backend/` là hai Git repo riêng; `Working/.pi/piagent-profile.json` là profile của phiên Pi. Nói rõ phạm vi ghi trong yêu cầu; profile `be-readonly-fe` chặn ghi vào BE:
|
|
267
269
|
|
|
268
270
|
```text
|
|
269
|
-
|
|
271
|
+
Scout BE changes read-only and create the FE remediation plan in v-nexus-frontend/plans/. Backend repo is read-only.
|
|
270
272
|
```
|
|
271
273
|
|
|
272
|
-
Plan/report có thể ghi vào `v-nexus-frontend/plans/**` nếu muốn đi cùng FE repo, hoặc `Working/plans/**` nếu muốn lưu ở workspace cha.
|
|
274
|
+
Plan/report có thể ghi vào `v-nexus-frontend/plans/**` nếu muốn đi cùng FE repo, hoặc `Working/plans/**` nếu muốn lưu ở workspace cha.
|
|
273
275
|
|
|
274
276
|
## Bước 4 — run trong Herdr
|
|
275
277
|
|
|
@@ -295,92 +297,59 @@ piagent-auto --read-only -p "Scout module mapping. Do not edit source."
|
|
|
295
297
|
|
|
296
298
|
Lệnh này wrap `pi --approve`; nó không bypass piagent guard.
|
|
297
299
|
|
|
298
|
-
## Bước 5 —
|
|
300
|
+
## Bước 5 — giao việc hằng ngày
|
|
301
|
+
|
|
302
|
+
Từ bản 1.9.0, mọi việc được yêu cầu bằng lời thường; `/workflow`, `/task`,
|
|
303
|
+
`/scout`, `/discuss`, `/fresh` đã bỏ và session không tạo task contract.
|
|
299
304
|
|
|
300
305
|
Requirement chưa rõ:
|
|
301
306
|
|
|
302
307
|
```text
|
|
303
|
-
|
|
308
|
+
Tạo plan cho feature X. Chưa implement, hỏi lại phần còn thiếu.
|
|
304
309
|
```
|
|
305
310
|
|
|
306
311
|
Task rõ:
|
|
307
312
|
|
|
308
313
|
```text
|
|
309
|
-
|
|
314
|
+
Implement feature X. Chạy test của project sau khi sửa.
|
|
310
315
|
```
|
|
311
316
|
|
|
312
317
|
Scout/audit read-only:
|
|
313
318
|
|
|
314
319
|
```text
|
|
315
|
-
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
Session nặng hoặc context overflow:
|
|
319
|
-
|
|
320
|
-
```text
|
|
321
|
-
/fresh scout <read-only scout>
|
|
322
|
-
/fresh task <bounded task>
|
|
323
|
-
/fresh be-to-fe <BE-readonly/FE request>
|
|
320
|
+
Scout payment FE mapping vs BE contract. Backend read-only. Không sửa source.
|
|
324
321
|
```
|
|
325
322
|
|
|
326
|
-
|
|
323
|
+
Session nặng hoặc context overflow: mở session mới bằng `/new` rồi nói lại việc.
|
|
327
324
|
|
|
328
|
-
|
|
325
|
+
Không paste checklist hằng ngày. Guard áp protected path, quyền, context budget
|
|
326
|
+
và xác nhận destructive/external cho từng tool call.
|
|
329
327
|
|
|
330
|
-
Runtime
|
|
328
|
+
Runtime diagnostic tools (agent chỉ dùng khi cần giải thích một lần chặn):
|
|
331
329
|
|
|
332
330
|
```text
|
|
333
331
|
piagent_exec_policy_check
|
|
334
332
|
piagent_context_budget
|
|
335
333
|
piagent_tool_policy_check
|
|
336
|
-
piagent_task_gate_check
|
|
337
334
|
```
|
|
338
335
|
|
|
339
336
|
Task cải tiến platform:
|
|
340
337
|
|
|
341
338
|
```text
|
|
342
|
-
|
|
339
|
+
Improve onboarding, model scope, MCP setup, and verification docs for team usage.
|
|
343
340
|
```
|
|
344
341
|
|
|
345
342
|
Task BE spec lên FE:
|
|
346
343
|
|
|
347
344
|
```text
|
|
348
|
-
/
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
Project memory:
|
|
352
|
-
|
|
353
|
-
```text
|
|
354
|
-
/memory
|
|
355
|
-
Remember: this repo uses pnpm, never npm.
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
External source repo:
|
|
359
|
-
|
|
360
|
-
```text
|
|
361
|
-
Use piagent_source_checkout for github.com/org/repo, inspect only relevant files, then summarize applicable patterns.
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
## Doctor
|
|
365
|
-
|
|
366
|
-
Chạy trên platform:
|
|
367
|
-
|
|
368
|
-
```bash
|
|
369
|
-
bash scripts/verify-local.sh
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
Chạy trên project:
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
bash /path/to/piagent/scripts/profile-doctor.sh /path/to/project
|
|
376
|
-
bash /path/to/piagent/scripts/team-doctor.sh /path/to/project --strict-share
|
|
377
|
-
piagent-benchmark --dry-run
|
|
345
|
+
/profile be-readonly-fe
|
|
346
|
+
Implement FE from BE contract <endpoint/spec>. Backend is read-only.
|
|
378
347
|
```
|
|
379
348
|
|
|
380
349
|
Maintainer chạy `piagent-benchmark` khi cần đo release/model bằng automatic paired
|
|
381
350
|
suite. Lệnh dùng model quota và sẽ hỏi xác nhận trước khi bắt đầu.
|
|
382
351
|
|
|
383
|
-
Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và
|
|
352
|
+
Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và nhờ agent onboard project.
|
|
384
353
|
|
|
385
354
|
## Không commit
|
|
386
355
|
|
|
@@ -278,10 +278,10 @@ Xem `contextUsage.percent`:
|
|
|
278
278
|
- `< 50%`: bình thường.
|
|
279
279
|
- `50–70%`: bắt đầu tránh đọc file lớn không cần thiết.
|
|
280
280
|
- `70–82%`: chạy `/context compact` trước task dài tiếp theo.
|
|
281
|
-
- `> 82%`:
|
|
281
|
+
- `> 82%`: mở session mới bằng `/new` cho work mới (`/fresh` đã bỏ từ bản 1.9.0).
|
|
282
282
|
- Sau compaction, `contextUsage.tokens` có thể là `null` cho đến khi có assistant response mới.
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
Từ bản 1.9.0 input hook là freeform: nội dung user dán vào được gửi nguyên văn, không còn collapse boilerplate hay lưu intake vào `.pi/task-inbox/`. Prompt quá dài thì nên tách việc hoặc mở session mới bằng `/new`.
|
|
285
285
|
|
|
286
286
|
Tool output dài cũng bị compact theo cùng triết lý: chat giữ preview, audit/report giữ capture local. Nếu verify fail và preview chưa đủ, chạy lại command targeted hơn thay vì đổ full log vào session.
|
|
287
287
|
|