@piagent/platform 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +34 -27
- package/catalog/capabilities.json +8 -8
- package/docs/auto-delegation-policy.md +4 -4
- package/docs/command-reference-vietnamese.md +121 -81
- package/docs/context-window-policy.md +7 -6
- package/docs/distribution-standard.md +27 -10
- package/docs/herdr-workflow.md +3 -2
- package/docs/memory-policy.md +6 -3
- package/docs/operator-manual-vietnamese.md +107 -69
- package/docs/package-architecture-notes.md +6 -6
- package/docs/project-adapters.md +4 -4
- package/docs/project-onboarding.md +12 -11
- package/docs/publishing-for-teams.md +2 -1
- package/docs/quickstart-vietnamese.md +26 -22
- package/docs/release-install-policy.md +6 -6
- package/docs/runtime-harness-standard.md +7 -7
- package/docs/runtime-policy-design.md +1 -1
- package/docs/runtime-quality-baseline.md +1 -1
- package/docs/security-threat-model.md +1 -1
- package/docs/subagent-orchestration-capabilities.md +3 -3
- package/docs/subagents-and-multiagent.md +4 -4
- package/docs/task-implementation-contract.md +4 -4
- package/docs/task-lifecycle-vietnamese.md +2 -2
- package/docs/team-onboarding.md +22 -18
- package/docs/usage-observability.md +29 -8
- package/docs/workflow-recipes.md +12 -9
- package/docs-site/architecture.html +1 -1
- package/docs-site/commands.html +19 -15
- package/docs-site/content/commands.html +18 -14
- package/docs-site/content/permissions.html +11 -11
- package/docs-site/content/quickstart.html +12 -11
- package/docs-site/content/team.html +1 -1
- package/docs-site/content/workflows.html +17 -17
- 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 +12 -12
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +13 -12
- package/docs-site/runtime.html +1 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -1
- package/docs-site/team.html +2 -2
- package/docs-site/workflows.html +18 -18
- package/package.json +1 -1
- package/packages/piagent-core/README.md +28 -26
- package/packages/piagent-core/extensions/piagent-guard.ts +1416 -196
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/prompts/be-to-fe.md +4 -3
- package/packages/piagent-core/prompts/discuss.md +2 -2
- package/packages/piagent-core/prompts/plan.md +1 -1
- package/packages/piagent-core/prompts/platform-improve.md +2 -1
- package/packages/piagent-core/prompts/pr.md +1 -1
- package/packages/piagent-core/prompts/review.md +2 -1
- package/packages/piagent-core/prompts/scout.md +3 -2
- package/packages/piagent-core/prompts/task.md +3 -2
- package/scripts/init-project.sh +4 -3
- package/scripts/install-global.sh +47 -1
- package/scripts/profile-doctor.sh +1 -1
- package/scripts/setup.sh +4 -3
- package/scripts/team-doctor.sh +6 -8
- package/scripts/verify-local.sh +18 -17
- package/templates/project/.pi/context-index.json +2 -2
- package/templates/project/.pi/project-context.md +3 -3
- package/templates/project/AGENTS.md +4 -4
- package/packages/piagent-core/prompts/memory-policy.md +0 -52
- package/packages/piagent-core/prompts/model-options.md +0 -68
- package/packages/piagent-core/prompts/onboard-project.md +0 -147
- package/packages/piagent-core/prompts/piagent-commands.md +0 -68
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Mục tiêu
|
|
4
4
|
|
|
5
|
-
Lần đầu gắn một project vào Pi Agent Platform, không nên nhảy thẳng vào `/task`.
|
|
5
|
+
Lần đầu gắn một project vào Pi Agent Platform, không nên nhảy thẳng vào `/workflow task`.
|
|
6
6
|
|
|
7
7
|
Luồng chuẩn là:
|
|
8
8
|
|
|
@@ -11,10 +11,11 @@ cd /path/to/project
|
|
|
11
11
|
pi
|
|
12
12
|
/login
|
|
13
13
|
<select provider/model>
|
|
14
|
-
/onboard
|
|
14
|
+
/onboard
|
|
15
|
+
/onboard run
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
Sau khi `/onboard
|
|
18
|
+
`/onboard` mở menu/status runtime. Sau khi `/onboard run` chạy xong, project có file:
|
|
18
19
|
|
|
19
20
|
```text
|
|
20
21
|
.pi/piagent-profile.json
|
|
@@ -27,7 +28,7 @@ Sau khi `/onboard-project` chạy xong, project có file:
|
|
|
27
28
|
.pi/memory/MEMORY.md
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
`/onboard
|
|
31
|
+
`/onboard run` là nơi profile và tech stack được chọn trong onboarding workflow. Ưu tiên select-style flow:
|
|
31
32
|
|
|
32
33
|
```text
|
|
33
34
|
/profile setup
|
|
@@ -40,7 +41,7 @@ Nếu Pi host chưa có native select, command trả card compact và lệnh det
|
|
|
40
41
|
|
|
41
42
|
`.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.
|
|
42
43
|
|
|
43
|
-
Context index là Pi runtime state. Không đọc/ghi raw file này trong workflow thường ngày; dùng `/context
|
|
44
|
+
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`, `/onboard run` 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.
|
|
44
45
|
|
|
45
46
|
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.
|
|
46
47
|
|
|
@@ -50,7 +51,7 @@ Memory markdown là local/private mặc định và bị ignore bởi `.pi/.giti
|
|
|
50
51
|
|
|
51
52
|
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.
|
|
52
53
|
|
|
53
|
-
`/onboard
|
|
54
|
+
`/onboard run` phải chạy sau login/model selection để chính model sẽ dùng cho task đọc qua project, chọn/gợi ý profile, và tạo snapshot.
|
|
54
55
|
|
|
55
56
|
## Profile selection
|
|
56
57
|
|
|
@@ -108,8 +109,8 @@ Mục tiêu là hiểu cấu trúc và policy, không nhồi full repo vào cont
|
|
|
108
109
|
`piagent_project_onboarding_record` sẽ tự ghi thêm `.pi/context-index.json` khi tool có sẵn. Nếu cần kiểm tra nhanh, dùng:
|
|
109
110
|
|
|
110
111
|
```text
|
|
111
|
-
/context
|
|
112
|
-
/context
|
|
112
|
+
/context index
|
|
113
|
+
/context search <keyword>
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
## Khi nào regenerate
|
|
@@ -117,7 +118,7 @@ Mục tiêu là hiểu cấu trúc và policy, không nhồi full repo vào cont
|
|
|
117
118
|
Chạy lại:
|
|
118
119
|
|
|
119
120
|
```text
|
|
120
|
-
/onboard
|
|
121
|
+
/onboard run
|
|
121
122
|
```
|
|
122
123
|
|
|
123
124
|
khi có thay đổi lớn:
|
|
@@ -128,8 +129,8 @@ khi có thay đổi lớn:
|
|
|
128
129
|
- API/schema/migration/auth/provider policy đổi;
|
|
129
130
|
- project ownership hoặc domain rule đổi.
|
|
130
131
|
|
|
131
|
-
## Relationship với `/task`
|
|
132
|
+
## Relationship với `/workflow task`
|
|
132
133
|
|
|
133
|
-
`/task` sẽ yêu cầu đọc `.pi/project-context.md`. Nếu file còn trạng thái `Generated: not yet`, agent phải dừng và yêu cầu chạy `/onboard
|
|
134
|
+
`/workflow task` sẽ yêu cầu đọc `.pi/project-context.md`. Nếu file còn trạng thái `Generated: not yet`, agent phải dừng và yêu cầu chạy `/onboard run` trước.
|
|
134
135
|
|
|
135
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.
|
|
@@ -54,6 +54,7 @@ pi install /path/to/piagent
|
|
|
54
54
|
- `1.1.9`: notice update hiện đúng trên bản cài bằng `pi install git:` — bản cài nhận diện theo vị trí thư mục, không theo `.git`.
|
|
55
55
|
- `1.2.0`: `piagent-mcp` quản lý server đầy đủ, server do repo mang theo phải được duyệt mới dùng được, và `/piagent-mcp` là command trong session chứ không phải nhờ model chạy bash.
|
|
56
56
|
- `1.2.1`: approval gate thật sự phủ direct tool và server đến qua `imports` — hai đường vòng mà bản `1.2.0` để hở; kèm một loạt fix về containment khi vendor, độ sâu shell guard, và credential trong URL.
|
|
57
|
+
- `1.2.2`: tool output dài được compact vào preview trong Pi và capture local cho Agent Watch/report; thêm `/setname` và `/logs` cho session naming và log audit gọn.
|
|
57
58
|
|
|
58
59
|
## Không publish
|
|
59
60
|
|
|
@@ -69,7 +70,7 @@ pi install /path/to/piagent
|
|
|
69
70
|
2. Install the pinned terminal helper and matching Pi package.
|
|
70
71
|
3. Login OAuth provider.
|
|
71
72
|
4. Run `pi` in the target project.
|
|
72
|
-
5. Run `/onboard
|
|
73
|
+
5. Run `/onboard`.
|
|
73
74
|
6. Choose/apply a profile inside Pi.
|
|
74
75
|
|
|
75
76
|
Chi tiết: `docs/team-onboarding.md` và `docs/distribution-standard.md`.
|
|
@@ -66,17 +66,18 @@ Sau khi login và chọn model intended cho project understanding:
|
|
|
66
66
|
```text
|
|
67
67
|
/model # hoặc Ctrl+L để chọn model bằng selector của Pi
|
|
68
68
|
/scoped-models # optional, chỉnh danh sách Ctrl+P cycle
|
|
69
|
-
/
|
|
69
|
+
/commands
|
|
70
70
|
/mcp # kiểm tra MCP adapter/server
|
|
71
71
|
/subagents-doctor # health check subagent setup
|
|
72
|
-
/onboard
|
|
73
|
-
/
|
|
74
|
-
/
|
|
72
|
+
/onboard
|
|
73
|
+
/onboard run
|
|
74
|
+
/context index
|
|
75
|
+
/memory
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
`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).
|
|
78
79
|
|
|
79
|
-
`/onboard
|
|
80
|
+
`/onboard` yêu cầu model đọc qua project theo phạm vi có kiểm soát, rồi ghi:
|
|
80
81
|
|
|
81
82
|
```text
|
|
82
83
|
.pi/piagent-profile.json
|
|
@@ -98,9 +99,9 @@ Nếu chưa có profile/tech stack, dùng select-style flow để tránh agent t
|
|
|
98
99
|
|
|
99
100
|
`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 ...`.
|
|
100
101
|
|
|
101
|
-
`.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
|
|
102
|
+
`.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`, `/onboard run` 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, agent phải dừng trước task lớn và yêu cầu chạy `/onboard run`.
|
|
102
103
|
|
|
103
|
-
`/memory
|
|
104
|
+
`/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.
|
|
104
105
|
|
|
105
106
|
## Bước 4 — init thêm project khác
|
|
106
107
|
|
|
@@ -119,33 +120,36 @@ Nó ghi `npm:@piagent/platform@<version>` vào `.pi/settings.json` — portable,
|
|
|
119
120
|
|
|
120
121
|
```bash
|
|
121
122
|
cd <project>
|
|
122
|
-
pi
|
|
123
|
+
pi --name "ABC-123 Short task name"
|
|
123
124
|
```
|
|
124
125
|
|
|
125
|
-
Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Không cần paste checklist — input guard tự collapse boilerplate, và `/task` tự cân nhắc gọi scout/planner/reviewer khi task đủ lớn.
|
|
126
|
+
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 — input guard tự collapse boilerplate, và `/workflow task` tự cân nhắc gọi scout/planner/reviewer khi task đủ lớn.
|
|
126
127
|
|
|
127
128
|
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).
|
|
128
129
|
|
|
129
130
|
| Gõ | Khi nào |
|
|
130
131
|
|---|---|
|
|
131
|
-
| `/
|
|
132
|
-
| `/
|
|
133
|
-
| `/
|
|
134
|
-
| `/
|
|
135
|
-
| `/
|
|
136
|
-
| `/
|
|
137
|
-
| `/
|
|
138
|
-
| `/
|
|
139
|
-
| `/
|
|
140
|
-
|
|
141
|
-
`/
|
|
132
|
+
| `/workflow` | Mở menu chọn task/scout/review/git/onboard. |
|
|
133
|
+
| `/workflow discuss <ý tưởng>` | Requirement chưa rõ, muốn hỏi lại trước. |
|
|
134
|
+
| `/workflow task <việc>` | Đã rõ, làm luôn. |
|
|
135
|
+
| `/workflow scout <việc>` | Chỉ đọc, không sửa — map payment/auth/BE contract. |
|
|
136
|
+
| `/workflow plan <mục tiêu>` | Muốn có plan trước khi đụng code. |
|
|
137
|
+
| `/workflow review current diff` | Review việc vừa làm. |
|
|
138
|
+
| `/name <task/session name>` | Đặt/đổi tên session để resume và report dễ đối chiếu. |
|
|
139
|
+
| `/usage logs` | Xem các capture khi test/build output quá dài và Pi chỉ hiện preview. |
|
|
140
|
+
| `/workflow be-to-fe <việc>` | Backend read-only, làm FE. |
|
|
141
|
+
| `/workflow commit <message>` | Commit local có kiểm soát, không push. |
|
|
142
|
+
| `/workflow pr <title>` | Tạo PR, hỏi xác nhận trước khi push. |
|
|
143
|
+
| `/fresh task|scout|be-to-fe <việc>` | Session đang nặng hoặc tràn context. |
|
|
144
|
+
|
|
145
|
+
`/commands` liệt kê hết. Các alias cũ như `/task`, `/scout`, `/be-to-fe`, `/fresh-task`, `/context-index`, `/logs` vẫn chạy nhưng không còn là đường onboard chính. 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).
|
|
142
146
|
|
|
143
147
|
## Việc user vẫn phải làm thủ công
|
|
144
148
|
|
|
145
149
|
- Login OAuth lần đầu trong browser.
|
|
146
150
|
- Chọn provider/model intended cho project.
|
|
147
|
-
- Chạy `/onboard
|
|
148
|
-
- Chạy `/memory
|
|
151
|
+
- Chạy `/onboard run` lần đầu để tạo `.pi/project-context.md` và `.pi/context-index.json`.
|
|
152
|
+
- Chạy `/memory` nếu muốn kiểm tra hoặc dùng project memory.
|
|
149
153
|
- 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.
|
|
150
154
|
- Approve khi extension guard hỏi destructive/high-risk action.
|
|
151
155
|
|
|
@@ -10,7 +10,7 @@ This file is the canonical install, update, rollback, and release checklist. Oth
|
|
|
10
10
|
|
|
11
11
|
All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.82.0`. The Pi host is installed as a Node CLI; Pi Agent Platform still defines its own release matrix because the terminal helpers and shell policy rely on Bash/POSIX behavior.
|
|
12
12
|
|
|
13
|
-
| Surface | Status for v1.2.
|
|
13
|
+
| Surface | Status for v1.2.3 | Rollout guidance |
|
|
14
14
|
|---|---|---|
|
|
15
15
|
| macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. | Safe default for team rollout after normal project smoke tests. |
|
|
16
16
|
| Linux x64 + Bash | Verified in GitHub Actions. | Safe default for CI/server usage after normal project smoke tests. |
|
|
@@ -33,7 +33,7 @@ These three components are versioned independently. A full install, update, or r
|
|
|
33
33
|
|
|
34
34
|
| Channel | Source shape | Mutability | Use when |
|
|
35
35
|
|---|---|---:|---|
|
|
36
|
-
| `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.
|
|
36
|
+
| `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.3` | Fixed after resolution | Default for team rollout. |
|
|
37
37
|
| `exact` | Tag, reviewed commit, or a tag resolved with `--resolve-tag` | Fixed when using a commit SHA | Pi-package-only roll forward, rollback, or reproduction. |
|
|
38
38
|
| `dev` | `git:github.com/Vt-mmm/piagent` | Moving | Personal machine or sandbox only. |
|
|
39
39
|
| `local` | `/path/to/piagent` | Local workspace | Platform development and dry-run validation. |
|
|
@@ -53,7 +53,7 @@ Use this flow when the team needs both terminal commands and the Pi package:
|
|
|
53
53
|
```bash
|
|
54
54
|
node --version # >= 22.19.0
|
|
55
55
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
56
|
-
npm install -g --ignore-scripts @piagent/platform@1.2.
|
|
56
|
+
npm install -g --ignore-scripts @piagent/platform@1.2.3
|
|
57
57
|
piagent-install --stable --dry-run
|
|
58
58
|
piagent-install --stable
|
|
59
59
|
```
|
|
@@ -61,8 +61,8 @@ piagent-install --stable
|
|
|
61
61
|
The stable preview and apply output includes:
|
|
62
62
|
|
|
63
63
|
```text
|
|
64
|
-
currentRelease: v1.2.
|
|
65
|
-
tag: v1.2.
|
|
64
|
+
currentRelease: v1.2.3 (helper package version)
|
|
65
|
+
tag: v1.2.3
|
|
66
66
|
resolvedCommit: <40-char-sha>
|
|
67
67
|
source: git:github.com/Vt-mmm/piagent@<40-char-sha>
|
|
68
68
|
```
|
|
@@ -79,7 +79,7 @@ bash scripts/install-global.sh --stable
|
|
|
79
79
|
Use this only when terminal commands are not needed:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
pi install git:github.com/Vt-mmm/piagent@v1.2.
|
|
82
|
+
pi install git:github.com/Vt-mmm/piagent@v1.2.3
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Direct `pi install` does not create `piagent-*` commands on `PATH`.
|
|
@@ -24,7 +24,7 @@ Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecy
|
|
|
24
24
|
|---|---|---|
|
|
25
25
|
| Risk lane | `riskLane` + profile `hardGates` | Chặn auth, release, provider config, destructive action, database migration. |
|
|
26
26
|
| Intake | `piagent_task_start` | Mỗi task có scope, output, acceptance criteria trước khi edit. |
|
|
27
|
-
| Context rules | `/onboard
|
|
27
|
+
| Context rules | `/onboard run`, `.pi/project-context.md`, `requiredContext`, context manifest | Giảm token và tránh đọc toàn repo. |
|
|
28
28
|
| Test matrix | `verifyCommands` + observed verify evidence | DONE phải có exact verify command thực chạy qua Pi bash hoặc `N/A` rõ lý do. |
|
|
29
29
|
| Trace | `piagent_trace_record`, `.pi/piagent-state/traces.jsonl`, session entry | Có audit trail cho task. |
|
|
30
30
|
| Protected paths | `protectedPaths` trong profile + extension guard | Mỗi project có vùng cấm riêng. |
|
|
@@ -43,12 +43,12 @@ Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecy
|
|
|
43
43
|
|
|
44
44
|
## Workflow prompts
|
|
45
45
|
|
|
46
|
-
- `/platform-improve`: update package/platform behavior.
|
|
47
|
-
- `/be-to-fe`: scout backend/spec read-only, create contract snapshot, implement frontend only.
|
|
48
|
-
- `/task`: governed implementation lifecycle.
|
|
49
|
-
- `/plan`: create implementation plan.
|
|
50
|
-
- `/discuss`: clarify before work.
|
|
51
|
-
- `/review`: review diff/source with evidence.
|
|
46
|
+
- `/workflow platform-improve`: update package/platform behavior.
|
|
47
|
+
- `/workflow be-to-fe`: scout backend/spec read-only, create contract snapshot, implement frontend only.
|
|
48
|
+
- `/workflow task`: governed implementation lifecycle.
|
|
49
|
+
- `/workflow plan`: create implementation plan.
|
|
50
|
+
- `/workflow discuss`: clarify before work.
|
|
51
|
+
- `/workflow review`: review diff/source with evidence.
|
|
52
52
|
|
|
53
53
|
## Task lifecycle chuẩn
|
|
54
54
|
|
|
@@ -73,7 +73,7 @@ The runtime separates the active autonomy profile from the project profile:
|
|
|
73
73
|
| `workspace-write` | Default governed implementation mode. Existing protected-path, shell, capability, context, verify, and final gates remain active. |
|
|
74
74
|
| `trusted-full-access` | Trusted automation mode for known repos. It can relax tool-registry blocks and capability filesystem scopes inside the guard, but protected paths, secret redaction, capability-lock integrity, and destructive/external confirmation still apply. |
|
|
75
75
|
|
|
76
|
-
`PIAGENT_PERMISSION_PROFILE` can override the profile for a single run. Invalid values fail closed to `read-only`. Inside Pi, `/read-only`, `/workspace-write`, and `/full-access` set a session-local override without writing the project profile. Precedence is launch env, then session command, then project profile, then policy default. `permissionProfiles.allowedModes` in base policy acts like a managed allowlist; removing `trusted-full-access` from that list disables it for the installation.
|
|
76
|
+
`PIAGENT_PERMISSION_PROFILE` can override the profile for a single run. Invalid values fail closed to `read-only`. Inside Pi, `/permission read-only`, `/permission workspace-write`, and `/permission full-access` set a session-local override without writing the project profile. Legacy aliases `/read-only`, `/workspace-write`, and `/full-access` still work. Precedence is launch env, then session command, then project profile, then policy default. `permissionProfiles.allowedModes` in base policy acts like a managed allowlist; removing `trusted-full-access` from that list disables it for the installation.
|
|
77
77
|
|
|
78
78
|
## Task lifecycle
|
|
79
79
|
|
|
@@ -29,7 +29,7 @@ Runtime behavior:
|
|
|
29
29
|
- `read-only` chặn shell, write/edit, và unknown non-piagent tools;
|
|
30
30
|
- `workspace-write` là default cho implementation có guard;
|
|
31
31
|
- `trusted-full-access` nới tool/scope autonomy trong môi trường trusted nhưng không tắt protected paths, redaction, capability lock, hoặc human gate cho destructive/external action.
|
|
32
|
-
- `/full-access <task>` bật `trusted-full-access` cho session hiện tại rồi gửi phần task còn lại cho agent; `/permission
|
|
32
|
+
- `/permission full-access <task>` bật `trusted-full-access` cho session hiện tại rồi gửi phần task còn lại cho agent; `/permission status` hiển thị mode và boundary đang active. Alias `/full-access <task>` và `/permission-status` vẫn chạy.
|
|
33
33
|
|
|
34
34
|
## 1. Exec policy
|
|
35
35
|
|
|
@@ -21,7 +21,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
|
|
|
21
21
|
- The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
|
|
22
22
|
- Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
|
|
23
23
|
- A human remains available to approve destructive and external-provider actions.
|
|
24
|
-
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.
|
|
24
|
+
- Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.3, and WSL2 is experimental/unverified.
|
|
25
25
|
- Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
|
|
26
26
|
|
|
27
27
|
## Threat actors and failure modes
|
|
@@ -9,7 +9,7 @@ Package used:
|
|
|
9
9
|
|
|
10
10
|
## Kết luận
|
|
11
11
|
|
|
12
|
-
Pi Agent Platform uses `pi-subagents` for child sessions, parallel read-only work, review loops, and structured handoffs. The platform keeps a safe default configuration and documents advanced commands separately so daily users can still start with `/task`.
|
|
12
|
+
Pi Agent Platform uses `pi-subagents` for child sessions, parallel read-only work, review loops, and structured handoffs. The platform keeps a safe default configuration and documents advanced commands separately so daily users can still start with `/workflow task`.
|
|
13
13
|
|
|
14
14
|
Core decisions:
|
|
15
15
|
|
|
@@ -44,7 +44,7 @@ Core decisions:
|
|
|
44
44
|
- `scripts/setup.sh` / `scripts/install-global.sh`
|
|
45
45
|
- optional `--with-web-access` installs `npm:pi-web-access@0.13.0` for web/docs research
|
|
46
46
|
- Workflow prompts
|
|
47
|
-
- `/task`, `/plan`, `/review`, `/be-to-fe`, `/platform-improve` instruct the parent to auto-delegate when work is independent and bounded
|
|
47
|
+
- `/workflow task`, `/workflow plan`, `/workflow review`, `/workflow be-to-fe`, `/workflow platform-improve` instruct the parent to auto-delegate when work is independent and bounded
|
|
48
48
|
- Docs
|
|
49
49
|
- command reference lists prompt shortcuts, watchdog/profile commands, supervisor control, output/fork/worktree options
|
|
50
50
|
|
|
@@ -63,7 +63,7 @@ Core decisions:
|
|
|
63
63
|
Daily implementation:
|
|
64
64
|
|
|
65
65
|
```text
|
|
66
|
-
/task Implement <task>.
|
|
66
|
+
/workflow task Implement <task>.
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Review until clean:
|
|
@@ -18,7 +18,7 @@ Pi core không có subagents built-in. Theo design của Pi, subagents là exten
|
|
|
18
18
|
|
|
19
19
|
Từ `v0.3.7`, `scripts/setup.sh` mặc định cài `pi-subagents` và chạy config preset `safe`.
|
|
20
20
|
|
|
21
|
-
Workflow prompts của platform dùng **solo-first orchestration policy**: khi anh chạy `/task`, `/be-to-fe`, `/platform-improve`, `/plan`, hoặc `/review`, parent agent đọc `piagent_orchestration_policy`, lập task tree/review lenses, rồi mới cân nhắc subagent cho phần việc độc lập. Anh không bắt buộc phải gọi `/run` nếu chỉ muốn task hoàn chỉnh, và platform cũng không spawn swarm khi task nhỏ.
|
|
21
|
+
Workflow prompts của platform dùng **solo-first orchestration policy**: khi anh chạy `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, hoặc `/workflow review`, parent agent đọc `piagent_orchestration_policy`, lập task tree/review lenses, rồi mới cân nhắc subagent cho phần việc độc lập. Anh không bắt buộc phải gọi `/run` nếu chỉ muốn task hoàn chỉnh, và platform cũng không spawn swarm khi task nhỏ. Alias cũ như `/task` vẫn giữ cùng policy.
|
|
22
22
|
|
|
23
23
|
Kiểm tra nhanh policy trong Pi:
|
|
24
24
|
|
|
@@ -129,7 +129,7 @@ Giải nghĩa nhanh:
|
|
|
129
129
|
Nếu cần bản tổng hợp cho team mới:
|
|
130
130
|
|
|
131
131
|
```text
|
|
132
|
-
/
|
|
132
|
+
/commands subagents
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
## Gọi subagent tự nhiên
|
|
@@ -149,7 +149,7 @@ Run parallel research: external docs, local code context, and practical tradeoff
|
|
|
149
149
|
Với workflow platform, còn có thể chỉ gọi:
|
|
150
150
|
|
|
151
151
|
```text
|
|
152
|
-
/task Implement <task lớn>.
|
|
152
|
+
/workflow task Implement <task lớn>.
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
Parent agent sẽ tự quyết định:
|
|
@@ -324,7 +324,7 @@ Use:
|
|
|
324
324
|
|
|
325
325
|
```text
|
|
326
326
|
/subagent-cost
|
|
327
|
-
/
|
|
327
|
+
/usage
|
|
328
328
|
/session
|
|
329
329
|
```
|
|
330
330
|
|
|
@@ -131,7 +131,7 @@ Use piagent_context first.
|
|
|
131
131
|
Use piagent_orchestration_policy; default to solo-first, create a compact task tree, and choose review lenses before spawning subagents.
|
|
132
132
|
Use piagent_context_index_status/search as advisory navigation when available; verify cited files before editing.
|
|
133
133
|
Use piagent_memory_status and search memory when relevant; memory is advisory only.
|
|
134
|
-
Read .pi/project-context.md; if it is pending, stop and request /onboard
|
|
134
|
+
Read .pi/project-context.md; if it is pending, stop and request /onboard run.
|
|
135
135
|
Create a Task Implementation Contract with piagent_task_start.
|
|
136
136
|
Check large context with piagent_context_budget.
|
|
137
137
|
Check complex/high-impact shell with piagent_exec_policy_check.
|
|
@@ -193,8 +193,8 @@ Exact command identity matters. If the task profile says `npm test`, record `npm
|
|
|
193
193
|
|
|
194
194
|
## Named implementation recipes
|
|
195
195
|
|
|
196
|
-
- `/platform-improve`: dùng cho task cải tiến setup, docs, prompt, MCP, model, memory, runtime policy, hoặc subagent workflow của platform.
|
|
197
|
-
- `/be-to-fe`: dùng cho task scout BE contract read-only rồi implement FE.
|
|
198
|
-
- `/memory
|
|
196
|
+
- `/workflow platform-improve`: dùng cho task cải tiến setup, docs, prompt, MCP, model, memory, runtime policy, hoặc subagent workflow của platform.
|
|
197
|
+
- `/workflow be-to-fe`: dùng cho task scout BE contract read-only rồi implement FE.
|
|
198
|
+
- `/memory`: dùng cho task kiểm tra/ghi nhớ explicit project memory.
|
|
199
199
|
|
|
200
200
|
Hai recipe này vẫn phải tạo/giữ Task Implementation Contract khi có source writes.
|
|
@@ -14,7 +14,7 @@ Contract fields và enforcement level nằm ở [task-implementation-contract.md
|
|
|
14
14
|
|
|
15
15
|
Harness cung cấp:
|
|
16
16
|
|
|
17
|
-
- `/scout` — pha read-only, không được sửa source. Dùng để map payment/auth/BE contract trước khi quyết có làm hay không.
|
|
17
|
+
- `/workflow scout` — pha read-only, không được sửa source. Dùng để map payment/auth/BE contract trước khi quyết có làm hay không. Alias `/scout` vẫn chạy.
|
|
18
18
|
- `piagent_context_index_search` — bản đồ node/edge/citation compact để tìm điểm vào repo. Kết quả là **advisory**: phải mở file thật và verify trước khi sửa.
|
|
19
19
|
- `piagent_memory_search` + `piagent_memory_citation_record` — Field Guide và memory của project, cũng advisory, cũng phải verify lại.
|
|
20
20
|
- `piagent_source_checkout` — cache repo ngoài để đọc có mục tiêu.
|
|
@@ -82,7 +82,7 @@ Nghĩa là `true`, `echo ok`, `npm test || true` không mua được chữ "done
|
|
|
82
82
|
|
|
83
83
|
| Pha | Trạng thái | Căn cứ |
|
|
84
84
|
|---|---|---|
|
|
85
|
-
| Research | **Đủ** | `/scout`, context index, memory, Context7, source checkout |
|
|
85
|
+
| Research | **Đủ** | `/workflow scout`, context index, memory, Context7, source checkout |
|
|
86
86
|
| Plan | **Đủ** | `piagent_task_start` + 19 field contract + `workPlan` |
|
|
87
87
|
| Execute | **Đủ** | Chặn trước thực thi ở mọi đường: tool, MCP, shell |
|
|
88
88
|
| Verify | **Mạnh** | Bằng chứng phải quan sát được và khớp lệnh, không tự khai được |
|
package/docs/team-onboarding.md
CHANGED
|
@@ -9,7 +9,7 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
|
|
|
9
9
|
```bash
|
|
10
10
|
node --version # >= 22.19.0
|
|
11
11
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
12
|
-
npm install -g --ignore-scripts @piagent/platform@1.2.
|
|
12
|
+
npm install -g --ignore-scripts @piagent/platform@1.2.3
|
|
13
13
|
piagent-install --stable
|
|
14
14
|
cd /path/to/project
|
|
15
15
|
pi
|
|
@@ -17,8 +17,9 @@ pi
|
|
|
17
17
|
<select provider/model>
|
|
18
18
|
/mcp
|
|
19
19
|
/subagents-doctor
|
|
20
|
-
/onboard
|
|
21
|
-
/
|
|
20
|
+
/onboard
|
|
21
|
+
/onboard run
|
|
22
|
+
/memory
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
## Prerequisites
|
|
@@ -42,7 +43,7 @@ Mặc định team dùng stable helper:
|
|
|
42
43
|
```bash
|
|
43
44
|
node --version # >= 22.19.0
|
|
44
45
|
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
|
|
45
|
-
npm install -g --ignore-scripts @piagent/platform@1.2.
|
|
46
|
+
npm install -g --ignore-scripts @piagent/platform@1.2.3
|
|
46
47
|
piagent-install --stable --dry-run
|
|
47
48
|
piagent-install --stable
|
|
48
49
|
```
|
|
@@ -70,7 +71,7 @@ piagent-update --check
|
|
|
70
71
|
piagent-update --project /path/to/project
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
`--check` chỉ báo version, không đụng gì. Lên đúng một bản cụ thể thì `piagent-update --version 1.2.
|
|
74
|
+
`--check` chỉ báo version, không đụng gì. Lên đúng một bản cụ thể thì `piagent-update --version 1.2.3`.
|
|
74
75
|
|
|
75
76
|
Không cần ai nhớ đi kiểm tra: khi có release mới, Pi tự báo ngay ở dòng notice lúc mở session, kèm luôn lệnh chạy.
|
|
76
77
|
|
|
@@ -148,7 +149,8 @@ Rồi chạy:
|
|
|
148
149
|
```text
|
|
149
150
|
/mcp
|
|
150
151
|
/subagents-doctor
|
|
151
|
-
/onboard
|
|
152
|
+
/onboard
|
|
153
|
+
/onboard run
|
|
152
154
|
```
|
|
153
155
|
|
|
154
156
|
Output chính:
|
|
@@ -177,9 +179,9 @@ Nếu project chưa có profile/tech stack, dùng select-style flow để tránh
|
|
|
177
179
|
|
|
178
180
|
`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 ...`.
|
|
179
181
|
|
|
180
|
-
Nếu `.pi/project-context.md` còn `Generated: not yet`, không nên chạy `/task` implementation.
|
|
182
|
+
Nếu `.pi/project-context.md` còn `Generated: not yet`, không nên chạy `/workflow task` implementation.
|
|
181
183
|
|
|
182
|
-
Memory mặc định là project-scoped và explicit-only. Chạy `/memory
|
|
184
|
+
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.
|
|
183
185
|
|
|
184
186
|
Đổi profile sau này:
|
|
185
187
|
|
|
@@ -268,31 +270,33 @@ Lệnh này wrap `pi --approve`; nó không bypass piagent guard.
|
|
|
268
270
|
Requirement chưa rõ:
|
|
269
271
|
|
|
270
272
|
```text
|
|
271
|
-
/discuss Tạo plan cho feature X. Chưa implement.
|
|
273
|
+
/workflow discuss Tạo plan cho feature X. Chưa implement.
|
|
272
274
|
```
|
|
273
275
|
|
|
274
276
|
Task rõ:
|
|
275
277
|
|
|
276
278
|
```text
|
|
277
|
-
/task Implement feature X. Follow project profile, protected paths, required context, exec policy, context budget, tool policy, verify, trace, and task gate.
|
|
279
|
+
/workflow task Implement feature X. Follow project profile, protected paths, required context, exec policy, context budget, tool policy, verify, trace, and task gate.
|
|
278
280
|
```
|
|
279
281
|
|
|
280
282
|
Scout/audit read-only:
|
|
281
283
|
|
|
282
284
|
```text
|
|
283
|
-
/scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
|
|
285
|
+
/workflow scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
|
|
284
286
|
```
|
|
285
287
|
|
|
286
288
|
Session nặng hoặc context overflow:
|
|
287
289
|
|
|
288
290
|
```text
|
|
289
|
-
/fresh
|
|
290
|
-
/fresh
|
|
291
|
-
/fresh
|
|
291
|
+
/fresh scout <read-only scout>
|
|
292
|
+
/fresh task <bounded task>
|
|
293
|
+
/fresh be-to-fe <BE-readonly/FE request>
|
|
292
294
|
```
|
|
293
295
|
|
|
294
296
|
Không paste full mandatory flow hằng ngày. Platform prompts/tools đã chứa checklist; input guard sẽ tự collapse boilerplate nếu paste nhầm.
|
|
295
297
|
|
|
298
|
+
Alias cũ `/discuss`, `/task`, `/scout`, `/fresh-*` vẫn chạy cho power user, nhưng tài liệu onboard team dùng `/workflow`, `/name`, `/fresh`, và `/usage` để dễ nhớ hơn.
|
|
299
|
+
|
|
296
300
|
Runtime gate tools:
|
|
297
301
|
|
|
298
302
|
```text
|
|
@@ -305,19 +309,19 @@ piagent_task_gate_check
|
|
|
305
309
|
Task cải tiến platform:
|
|
306
310
|
|
|
307
311
|
```text
|
|
308
|
-
/platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage.
|
|
312
|
+
/workflow platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage.
|
|
309
313
|
```
|
|
310
314
|
|
|
311
315
|
Task BE spec lên FE:
|
|
312
316
|
|
|
313
317
|
```text
|
|
314
|
-
/be-to-fe Implement FE from BE contract <endpoint/spec>. Backend is read-only.
|
|
318
|
+
/workflow be-to-fe Implement FE from BE contract <endpoint/spec>. Backend is read-only.
|
|
315
319
|
```
|
|
316
320
|
|
|
317
321
|
Project memory:
|
|
318
322
|
|
|
319
323
|
```text
|
|
320
|
-
/memory
|
|
324
|
+
/memory
|
|
321
325
|
Remember: this repo uses pnpm, never npm.
|
|
322
326
|
```
|
|
323
327
|
|
|
@@ -343,7 +347,7 @@ bash /path/to/piagent/scripts/team-doctor.sh /path/to/project --strict-share
|
|
|
343
347
|
bash /path/to/piagent/scripts/quality-benchmark.sh /path/to/project --init
|
|
344
348
|
```
|
|
345
349
|
|
|
346
|
-
Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và chạy `/onboard
|
|
350
|
+
Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và chạy `/onboard run`.
|
|
347
351
|
|
|
348
352
|
## Không commit
|
|
349
353
|
|
|
@@ -13,9 +13,11 @@ Pi có sẵn footer hiển thị token/cache usage, cost, context usage, model h
|
|
|
13
13
|
Piagent package thêm command:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
/
|
|
17
|
-
/
|
|
18
|
-
/
|
|
16
|
+
/usage
|
|
17
|
+
/context preflight
|
|
18
|
+
/context compact
|
|
19
|
+
/usage logs
|
|
20
|
+
/usage live
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
Agent cũng có thể gọi tool:
|
|
@@ -25,7 +27,7 @@ piagent_usage_snapshot
|
|
|
25
27
|
piagent_context_preflight
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
`/
|
|
30
|
+
`/usage` hiển thị:
|
|
29
31
|
|
|
30
32
|
- session file;
|
|
31
33
|
- session id/name;
|
|
@@ -35,7 +37,7 @@ piagent_context_preflight
|
|
|
35
37
|
- active branch entries / total entries;
|
|
36
38
|
- lệnh để lấy exact token/cost totals từ terminal khác.
|
|
37
39
|
|
|
38
|
-
`/
|
|
40
|
+
`/context preflight` hiển thị:
|
|
39
41
|
|
|
40
42
|
- workflow đang định chạy;
|
|
41
43
|
- live context;
|
|
@@ -44,7 +46,9 @@ piagent_context_preflight
|
|
|
44
46
|
- recommendation: `ok`, `watch`, `compact`, hoặc `fresh-session`;
|
|
45
47
|
- fresh workflow commands nếu session hiện tại quá nặng.
|
|
46
48
|
|
|
47
|
-
`/
|
|
49
|
+
`/context compact` gọi Pi compaction với hướng dẫn giữ lại decisions, blockers, changed files, verify command, và next action.
|
|
50
|
+
|
|
51
|
+
`/usage logs` không tail realtime. Nó chỉ hiển thị policy compact và vài capture mới nhất khi tool output quá dài. Capture nằm trong `.pi/piagent-state/tool-results/`, đã qua redaction trước khi ghi, để Agent Watch/report đọc offline mà Pi TUI không phải nhồi full terminal log vào transcript. Alias `/logs` vẫn chạy.
|
|
48
52
|
|
|
49
53
|
Giới hạn kỹ thuật: extension command context expose `ctx.getContextUsage()`, phù hợp để biết context window đang dùng bao nhiêu. Exact billed totals như `input`, `output`, `cacheRead`, `cacheWrite`, `cost` là API của Pi `/session` và RPC `get_session_stats`.
|
|
50
54
|
|
|
@@ -104,8 +108,23 @@ History mode đọc trực tiếp `~/.pi/agent/sessions/**/*.jsonl`, cộng usag
|
|
|
104
108
|
- `input`, `output`, `cacheRead`, `cacheWrite`, `reasoning`, `totalTokens`;
|
|
105
109
|
- `cost.total`;
|
|
106
110
|
- số user messages, assistant messages, tool calls, tool results;
|
|
111
|
+
- session name từ `session_info.name`, dùng để Agent Watch/report đối chiếu task;
|
|
107
112
|
- breakdown theo project và top sessions.
|
|
108
113
|
|
|
114
|
+
Để session name rõ ngay trong report, mở Pi bằng:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pi --name "ABC-123 Short task name"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Hoặc đổi tên phiên đang mở trong Pi:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
/name ABC-123 Short task name
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Alias ngắn `/setname ABC-123 Short task name` vẫn chạy. Nếu tắt nhầm terminal/app, vào lại project rồi dùng `pi --continue` cho phiên gần nhất, hoặc `pi --resume` để chọn theo session name/id. Trong Pi có thể gõ `/resume` để xem reminder ngắn.
|
|
127
|
+
|
|
109
128
|
Mặc định history mode **bao gồm subagent session files** vì đó là usage thật của máy. Dùng `--no-subagents` khi chỉ muốn parent/main sessions.
|
|
110
129
|
|
|
111
130
|
Format hỗ trợ:
|
|
@@ -136,12 +155,14 @@ Xem `contextUsage.percent`:
|
|
|
136
155
|
|
|
137
156
|
- `< 50%`: bình thường.
|
|
138
157
|
- `50–70%`: bắt đầu tránh đọc file lớn không cần thiết.
|
|
139
|
-
- `70–82%`: chạy `/
|
|
140
|
-
- `> 82%`: dùng `/fresh
|
|
158
|
+
- `70–82%`: chạy `/context compact` trước task dài tiếp theo.
|
|
159
|
+
- `> 82%`: dùng `/fresh task`, `/fresh scout`, hoặc `/fresh be-to-fe` cho work mới.
|
|
141
160
|
- Sau compaction, `contextUsage.tokens` có thể là `null` cho đến khi có assistant response mới.
|
|
142
161
|
|
|
143
162
|
Nếu user paste full mandatory-flow boilerplate, platform input guard sẽ collapse về workflow command ngắn. Nếu prompt quá dài thật, platform có thể lưu intake vào `.pi/task-inbox/` local gitignored rồi replay bằng fresh workflow command.
|
|
144
163
|
|
|
164
|
+
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.
|
|
165
|
+
|
|
145
166
|
## Khi nào ghi benchmark
|
|
146
167
|
|
|
147
168
|
Sau một task cần so sánh workflow/model bằng số liệu:
|