@piagent/platform 1.0.2 → 1.1.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/README.md CHANGED
@@ -4,35 +4,66 @@ Reusable Pi package for project onboarding, profile-based coding workflows, guar
4
4
 
5
5
  Public docs: [piagent.io.vn](https://piagent.io.vn)
6
6
 
7
- The goal is a simple daily flow:
7
+ ## Install
8
+
9
+ Node.js `>=22.19.0`. Two commands, run from the project you want to set up:
8
10
 
9
11
  ```bash
10
- cd /path/to/project
11
- pi
12
+ npm install -g @piagent/platform
13
+ piagent-setup
12
14
  ```
13
15
 
14
- From there, Pi can onboard the project, select an operating profile, use the right tools, record task evidence, and hand off verified implementation work.
16
+ `piagent-setup` installs the exact Pi Coding Agent host this release pins, installs the Pi package, initializes the current directory, and runs the doctor. It also installs the MCP baseline, the subagents, and — when `herdr` is already on `PATH` — the Herdr Pi integration; pass `--no-mcp`, `--no-subagents`, `--no-herdr`, or `--global-only` to skip those.
15
17
 
16
- For a trusted project where you want Pi to load project-local `.pi` resources without another trust prompt on that run:
18
+ If you want [Herdr](https://herdr.dev/docs/install/), install it *before* `piagent-setup`:
17
19
 
18
20
  ```bash
19
- cd /path/to/project
20
- piagent-auto
21
+ brew install herdr # macOS
22
+ curl -fsSL https://herdr.dev/install.sh | sh # macOS or Linux
21
23
  ```
22
24
 
23
- Read-only scout mode:
25
+ The integration step is skipped with a warning when `herdr` is not on `PATH`, so installing Herdr afterwards means running `piagent-setup --global-only` again. The `curl` form runs a script fetched at install time; `brew` and the [GitHub releases](https://github.com/ogulcancelik/herdr/releases) are the reviewable alternatives. Stable Herdr covers macOS and Linux — Windows builds are preview only, which is outside this platform's rollout matrix either way.
26
+
27
+ Because it runs from an installed package, the source it writes into `.pi/settings.json` is `npm:@piagent/platform@<version>` — which means the same thing on a teammate's machine, so the file can be committed.
28
+
29
+ | Runtime surface | Team rollout status |
30
+ |---|---|
31
+ | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. |
32
+ | Linux x64 + Bash | Verified in CI for this release. |
33
+ | macOS Intel (`darwin/x64`) + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
34
+ | Linux ARM64 + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
35
+ | Native Windows | Not a team-rollout target yet; terminal helpers and shell policy rely on Bash/POSIX semantics. |
36
+ | WSL2 | Experimental and not release-gated yet. |
37
+
38
+ Pinned step-by-step rollouts, updates, rollback, and the fast-moving `--dev` channel are in [Release and install policy](docs/release-install-policy.md).
39
+
40
+ ## Daily use
24
41
 
25
42
  ```bash
26
- piagent-auto --read-only -p "Scout payment mapping. Do not edit source."
43
+ cd /path/to/project
44
+ pi
27
45
  ```
28
46
 
29
- Trusted full-access style run:
47
+ That is the daily flow. Pi onboards the project, selects an operating profile, uses the right tools, records task evidence, and hands off verified implementation work.
48
+
49
+ Running several agents side by side — one implementing, one reviewing read-only, one verifying — start `herdr` from the project instead of `pi` and open a Pi pane per role. Herdr orchestrates terminals and sessions; it is not a security boundary, so every gate still lives in the Pi extension and OAuth is still a `/login` inside Pi. See [Herdr workflow](docs/herdr-workflow.md).
50
+
51
+ First run in a new project, type `/onboard-project`. It inspects the repository with bounded context, recommends a profile, explains the tradeoffs, asks before applying, then writes `.pi/piagent-profile.json`, its lock, `.pi/tech-stack.json`, `.pi/tech-context/*`, `.pi/project-context.md`, and `.pi/memory/*`.
52
+
53
+ `/piagent-commands` lists everything else. For trusted local runs, `piagent-auto` wraps `pi --approve` and sets a permission profile for that run — it does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence. See the [command reference](docs/command-reference-vietnamese.md).
54
+
55
+ ## Uninstall
56
+
57
+ `piagent-uninstall` reports what it would remove and exits. It only acts with `--apply`, because it edits Pi settings that other tools also write to.
30
58
 
31
59
  ```bash
32
- piagent-auto --full-access -p "Run the trusted local benchmark suite."
60
+ piagent-uninstall
61
+ piagent-uninstall --apply
33
62
  ```
34
63
 
35
- `piagent-auto` is a convenience wrapper for Pi project trust (`pi --approve`). It does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence.
64
+ That removes the Pi package this platform registered. Add-ons, the Pi host, a project's state, and the npm-global helper are each opt-in and separate — `piagent-uninstall --help` lists them.
65
+
66
+ Removal targets what is registered in Pi's settings rather than what the current version installs, so a package registered by an older release still comes out. Credentials, trust decisions, sessions, todos, and project memory are never removed, at any flag combination. Files written from a template and then edited — `AGENTS.md`, `.pi/settings.json`, `.pi/project-context.md` and the like — are listed for review rather than deleted.
36
67
 
37
68
  ## What it provides
38
69
 
@@ -96,172 +127,23 @@ Inside Pi:
96
127
 
97
128
  This shows the active mode, max subagents, review lenses, Field Guide path, and writer policy without triggering a model follow-up.
98
129
 
99
- ## Install
100
-
101
- Supported for this release:
102
-
103
- | Runtime surface | Team rollout status |
104
- |---|---|
105
- | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. |
106
- | Linux x64 + Bash | Verified in CI for this release. |
107
- | macOS Intel (`darwin/x64`) + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
108
- | Linux ARM64 + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
109
- | Native Windows | Not a team-rollout target yet; terminal helpers and shell policy rely on Bash/POSIX semantics. |
110
- | WSL2 | Experimental and not release-gated yet. |
111
-
112
- Node.js `>=22.19.0` is required. Two commands:
130
+ ## Profiles
113
131
 
114
- ```bash
115
- npm install -g @piagent/platform
116
- piagent-setup
117
- ```
118
-
119
- `piagent-setup` installs the exact Pi Coding Agent host this release pins, installs the Pi package, initializes the current directory, and runs the doctor. Run it from the project you want to set up. It also installs the MCP baseline and subagents; pass `--no-mcp` and `--no-subagents` to skip them, or `--global-only` to install nothing into a project.
120
-
121
- Because it is running from an installed package, the source it writes into `.pi/settings.json` is `npm:@piagent/platform@<version>`, which means the same thing on a teammate's machine.
122
-
123
- To install each component explicitly instead — for a pinned team rollout where every step is reviewed:
124
-
125
- ```bash
126
- node --version # >= 22.19.0
127
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
128
- npm install -g --ignore-scripts @piagent/platform@1.0.2
129
- piagent-install --stable --dry-run
130
- piagent-install --stable
131
- ```
132
-
133
- `piagent-install --stable` resolves the helper's release tag to a commit SHA and installs the matching Pi package. In its output, `currentRelease` is the version of the terminal helper currently executing. The project release matrix above defines which OS/CPU surfaces this platform has verified.
134
-
135
- If you only need to install the Pi package and do not need the `piagent-*` terminal commands, pin the current release tag or a reviewed commit directly:
136
-
137
- ```bash
138
- pi install git:github.com/Vt-mmm/piagent@v1.0.2
139
- ```
140
-
141
- From a checked-out platform repo, the same helper is available as a script:
142
-
143
- ```bash
144
- bash scripts/install-global.sh --stable --dry-run
145
- bash scripts/install-global.sh --stable
146
- ```
147
-
148
- For a full update, update the exact Pi host first, then the npm-global helper, then apply its matching stable Pi package:
149
-
150
- ```bash
151
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
152
- npm install -g --ignore-scripts @piagent/platform@X.Y.Z
153
- piagent-install --stable --dry-run
154
- piagent-install --stable
155
- ```
156
-
157
- For rollback, read the target release's compatibility section and install its exact Pi host before changing the helper to `vPREVIOUS`; older hosts may reintroduce known dependency findings. If you intentionally want to change only the Pi package while keeping the terminal helper at its current version:
158
-
159
- ```bash
160
- piagent-install --version vX.Y.Z --resolve-tag --dry-run
161
- piagent-install --version vX.Y.Z --resolve-tag
162
- ```
163
-
164
- Use latest only for a personal machine or sandbox where fast updates are acceptable:
165
-
166
- ```bash
167
- bash scripts/install-global.sh --dev --dry-run
168
- bash scripts/install-global.sh --dev
169
- ```
170
-
171
- Optional Herdr integration:
172
-
173
- ```bash
174
- herdr integration install pi
175
- ```
176
-
177
- ## Uninstall
178
-
179
- `piagent-uninstall` reports what it would remove and exits. It only acts with `--apply`, because it edits Pi settings that other tools also write to.
180
-
181
- ```bash
182
- piagent-uninstall
183
- piagent-uninstall --apply
184
- ```
185
-
186
- That removes the Pi package this platform registered. Everything beyond it is opt-in:
187
-
188
- ```bash
189
- piagent-uninstall --apply --with-addons # pi-mcp-adapter, pi-subagents, pi-web-access
190
- piagent-uninstall --apply --with-host # the Pi Coding Agent host
191
- piagent-uninstall --apply --project /path/to/project # a project's profile, lock, and runtime state
192
- npm uninstall -g @piagent/platform # the npm-global helper, removed separately
193
- ```
194
-
195
- Removal targets what is registered in Pi's settings rather than what the current version installs, so a package registered by an older release still comes out.
196
-
197
- Credentials, trust decisions, sessions, todos, and project memory are never removed, at any flag combination. Files written from a template and then edited — `AGENTS.md`, `.pi/settings.json`, `.pi/project-context.md` and the like — are listed for review rather than deleted. A project's `.pi/settings.json` keeps every setting except the package entry pointing at this platform.
198
-
199
- ## Daily use
200
-
201
- ```bash
202
- cd /path/to/project
203
- pi
204
- ```
205
-
206
- First run inside a project:
132
+ Switching profile is one command inside Pi:
207
133
 
208
134
  ```text
209
- /login
210
- /model
211
- /scoped-models # optional: customize Ctrl+P model cycle
212
- /piagent-commands
213
- /mcp # inspect MCP servers
214
- /subagents-doctor # health check
215
- /onboard-project
216
- /memory-policy
135
+ /profile # status
136
+ /profile fullstack # apply
137
+ /profile setup # select profile, then select the tech for each role
217
138
  ```
218
139
 
219
- `/onboard-project` will inspect the repository with bounded context, recommend a profile, explain tradeoffs, ask before applying, then write:
220
-
221
- - `.pi/piagent-profile.json`
222
- - `.pi/piagent-profile.lock.json`
223
- - `.pi/tech-stack.json`
224
- - `.pi/tech-context/*`
225
- - `.pi/project-context.md`
226
- - `.pi/memory/*`
227
-
228
- Switch profiles later:
229
-
230
- ```text
231
- /profile # short status, no model follow-up
232
- /profile list # compact profile list
233
- /profile fullstack # apply immediately
234
- /profile be-readonly-fe # apply immediately
235
- /profile web-frontend # apply immediately
236
- /profile backend-api # apply immediately
237
- /profile auto # apply detected recommendation
238
- /profile fe # alias for web-frontend
239
- /profile be-fe # alias for be-readonly-fe
240
- /profile setup # select profile, then select role tech
241
- /profile setup fullstack # select FE, BE, and database tech
242
- /profile tech # short tech stack status
243
- /profile tech setup fullstack
244
- /profile tech apply fullstack frontend=nextjs backend=nestjs database=prisma
245
- ```
246
-
247
- The setup flow prefers native select UI. If the Pi host does not expose a select control yet, it falls back to a compact options card and an exact `/profile tech apply ...` command instead of asking the model to explain every option.
140
+ `/profile list` shows every profile and its aliases. The setup flow prefers a native select UI; where the Pi host has no select control, it falls back to a compact options card and an exact `/profile tech apply ...` line rather than asking the model to explain every option.
248
141
 
249
142
  ## Capability packs
250
143
 
251
- Capability packs group governed prompts, skills, subagents, policies, adapters, recipes, and eval scenarios behind a declarative manifest. Project profiles select exact pack versions and explicitly grant owner, lifecycle, filesystem, network, and external-action boundaries.
144
+ Capability packs group governed prompts, skills, subagents, policies, adapters, recipes, and eval scenarios behind a declarative manifest. Project profiles select exact pack versions and explicitly grant owner, lifecycle, filesystem, network, and external-action boundaries. The generated lock is deterministic and records profile, pack, artifact, and permission digests.
252
145
 
253
- ```bash
254
- piagent-capabilities catalog --check
255
- piagent-capabilities doctor \
256
- --profile .pi/piagent-profile.json \
257
- --lock .pi/piagent-profile.lock.json
258
- piagent-capabilities resolve \
259
- --profile .pi/piagent-profile.json \
260
- --output .pi/piagent-profile.lock.json \
261
- --package-source ../
262
- ```
263
-
264
- The generated lock is deterministic and records profile, pack, artifact, and permission digests. See [Capability packs](docs/capability-packs.md).
146
+ Commands and lock format: [Capability packs](docs/capability-packs.md).
265
147
 
266
148
  ## Built-in profiles
267
149
 
@@ -281,125 +163,34 @@ The generated lock is deterministic and records profile, pack, artifact, and per
281
163
 
282
164
  ## Main workflows
283
165
 
284
- ### General implementation
285
-
286
- ```text
287
- /task Implement <bounded task>. Follow profile, required context, protected paths, verify commands, and trace.
288
- ```
289
-
290
- Use `/task` when the requirement is clear enough to implement.
291
-
292
- ### Guarded Git workflows
293
-
294
- Pi Agent intentionally keeps Git as a capability instead of adding a `/git-*` namespace. Use short workflow commands or natural language:
295
-
296
- ```text
297
- /commit docs: update onboarding notes
298
- /pr Add guarded git workflow
299
- ```
300
-
301
- `/commit` starts a governed local-commit workflow: inspect status/diff, stage only the intended files, run relevant verification, then commit locally. It does not push.
302
-
303
- `/pr` starts a governed pull-request workflow: inspect branch/status/commits, handle uncommitted changes explicitly, then ask for confirmation before any `git push` or GitHub PR create/update action. Draft PRs are the default unless the user asks for ready-for-review.
304
-
305
- Broad staging commands such as `git add .`, `git add -A`, `git add --all`, `git add -- .`, and `git add :/` require confirmation so unrelated or private files are not swept into a commit silently.
306
-
307
- For read-only investigation:
308
-
309
- ```text
310
- /scout Scout <module/spec/contract/risk>. Do not edit source.
311
- ```
312
-
313
- Use `/scout` for payment/auth/data/BE-contract mapping before deciding whether to implement.
314
-
315
- When the current session is already heavy, use the fresh workflow commands. They open a new governed Pi session and replay the compact workflow prompt automatically:
166
+ Everything below is typed inside a Pi session. `/piagent-commands` lists the full set; [command reference](docs/command-reference-vietnamese.md) explains each one.
316
167
 
317
- ```text
318
- /fresh-task <request>
319
- /fresh-scout <read-only request>
320
- /fresh-be-to-fe <backend-readonly/frontend request>
321
- ```
322
-
323
- The input guard also collapses pasted mandatory-flow boilerplate automatically. Users should not paste the full piagent checklist into every task.
324
-
325
- ### Screenshots and local images
326
-
327
- If a chat box paste or screen capture produces a local image path instead of a native Pi image attachment, paste the path directly in the task:
328
-
329
- ```text
330
- /scout Check this UI state from screenshot /var/folders/.../screenshot.png
331
- ```
332
-
333
- The input guard converts supported local image paths (`.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`) into Pi image attachments and rewrites the prompt to:
334
-
335
- ```text
336
- /scout Check this UI state from screenshot [image1]
337
- ```
338
-
339
- Limits: up to 4 chat images, 8 MB each. For oversized images, use Pi's `read` tool on the file so Pi can resize it.
340
-
341
- ### Project improvement
342
-
343
- ```text
344
- /platform-improve Improve <platform/setup/workflow behavior>. Update docs and verification.
345
- ```
346
-
347
- Use `/platform-improve` for package-level work such as setup, MCP, model scope, memory, runtime policy, prompts, skills, or subagent workflows.
348
-
349
- ### Backend spec to frontend
350
-
351
- ```text
352
- /profile be-readonly-fe
353
- /be-to-fe Implement frontend support for <backend endpoint/spec>. Backend is read-only.
354
- ```
168
+ | Command | Use when |
169
+ |---|---|
170
+ | `/task <request>` | The requirement is clear enough to implement. |
171
+ | `/scout <request>` | Read-only investigation — payment, auth, data, or backend-contract mapping — before deciding whether to implement. |
172
+ | `/discuss <rough request>` | The requirement is not clear yet. |
173
+ | `/plan <goal>` | You want a plan before any edit. |
174
+ | `/review current diff` | Reviewing work already done. |
175
+ | `/commit <message>` | Governed local commit: inspect status and diff, stage only the intended files, run verification, commit. Never pushes. |
176
+ | `/pr <title>` | Governed pull request: confirms before any `git push` or GitHub write. Draft by default. |
177
+ | `/be-to-fe <request>` | Backend or spec is read-only and the implementation target is frontend. Pair with `/profile be-readonly-fe`. |
178
+ | `/platform-improve <request>` | Package-level work: setup, MCP, model scope, memory, runtime policy, prompts, skills, subagents. |
179
+ | `/fresh-task`, `/fresh-scout`, `/fresh-be-to-fe` | The current session is already heavy. Opens a new governed session and replays the compact workflow prompt. |
355
180
 
356
- Use `/be-to-fe` when the backend/spec must be inspected read-only and the implementation target is frontend.
181
+ Git stays a capability rather than a `/git-*` namespace, so natural language works too. Broad staging — `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` — requires confirmation, so unrelated or private files are not swept into a commit silently.
357
182
 
358
- ### Planning and clarification
183
+ Paste a local screenshot path straight into a task and the guard attaches it as `[image1]` before the model sees the prompt: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, up to 4 images at 8 MB each. The guard also collapses pasted mandatory-flow boilerplate, so there is no need to paste a checklist into every task.
359
184
 
360
- ```text
361
- /discuss <rough request>
362
- /plan <goal>
363
- /review current diff
364
- ```
185
+ A spec that lives outside the project — the one just downloaded to `~/Downloads` — is read with `piagent_document_read` once its directory is listed in the profile's `additionalReadRoots`. The grant is read-only, covers `.md`, `.txt`, `.csv`, `.json`, `.yaml`, `.pdf`, and `.docx` only, and does not open anything `protectedPaths` covers. See [command reference](docs/command-reference-vietnamese.md).
365
186
 
366
187
  ## Model selection
367
188
 
368
- Model selection is handled by Pi’s native UI.
369
-
370
- ```text
371
- /model # selector
372
- Ctrl+L # selector hotkey
373
- /scoped-models # edit model cycle scope
374
- Ctrl+P # cycle scoped models
375
- Shift+Tab # cycle thinking level when supported by the selected model
376
- ```
377
-
378
- Global setup can seed `enabledModels`. To inspect or re-apply:
379
-
380
- ```bash
381
- piagent-models
382
- piagent-model-scope --preset full
383
- ```
189
+ Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the scoped set, `Shift+Tab` to cycle thinking level where the model supports it. Global setup seeds `enabledModels`; see [Model options](docs/model-options.md) to inspect or re-apply it.
384
190
 
385
191
  ## MCP setup
386
192
 
387
- Global setup installs `pi-mcp-adapter` and seeds the `core` MCP preset unless disabled.
388
-
389
- ```bash
390
- piagent-mcp --preset core --scope global --replace
391
- piagent-mcp --preset popular --scope global --replace
392
- piagent-mcp --preset design --scope project --project /path/to/project
393
- piagent-mcp --list
394
- ```
395
-
396
- If the repo is cloned from Git and npm bins are not linked yet:
397
-
398
- ```bash
399
- bash /path/to/piagent/scripts/configure-mcp.sh --preset core --scope global --replace
400
- ```
401
-
402
- Preset summary:
193
+ `piagent-setup` and `piagent-install` both install `pi-mcp-adapter` and seed the `core` preset. Pass `--no-mcp` to skip it.
403
194
 
404
195
  | Preset | Includes |
405
196
  |---|---|
@@ -407,59 +198,15 @@ Preset summary:
407
198
  | `popular` | core + Playwright + Figma remote |
408
199
  | `all` | popular + Figma desktop/local |
409
200
 
410
- Keep secrets in environment variables, never in committed config:
201
+ Seeding writes server definitions; it does not start or authenticate anything. Servers connect lazily, so each one needs its own prerequisite before its first call: Chrome DevTools needs a local Chrome, and GitHub needs Docker running plus `GITHUB_PERSONAL_ACCESS_TOKEN` exported. `piagent-mcp --list` prints what each server requires. Project-scope `.mcp.json` files ship empty on purpose — the shared baseline is the global config, not the project one.
411
202
 
412
- ```bash
413
- export CONTEXT7_API_KEY=ctx7sk_...
414
- export GITHUB_PERSONAL_ACCESS_TOKEN=<github-token>
415
- ```
203
+ Keep provider keys in environment variables, never in committed config. Switching presets and per-project scoping: [MCP and tools](docs/mcp-and-tools.md).
416
204
 
417
205
  ## Subagents
418
206
 
419
- Global setup installs `pi-subagents` and applies the `safe` preset unless disabled.
420
-
421
- ```bash
422
- piagent-subagents --preset safe
423
- ```
207
+ `piagent-setup` installs `pi-subagents` with the `safe` preset unless disabled. Daily task prompts stay solo-first: they delegate bounded scout, planning, and review work only when it is independent enough to be worth the cost, and the final handoff states whether subagents were used and why.
424
208
 
425
- Fallback when cloned from Git without npm bins:
426
-
427
- ```bash
428
- bash /path/to/piagent/scripts/configure-subagents.sh --preset safe
429
- ```
430
-
431
- Common Pi commands:
432
-
433
- ```text
434
- /subagents-doctor
435
- /subagents-models
436
- /subagents-fleet
437
- /subagent-cost
438
- /run piagent-scout "Map the auth flow. Read-only."
439
- /run piagent-planner "Plan implementation from context.md."
440
- /run piagent-worker "Implement the approved plan."
441
- /run piagent-reviewer "Review current diff."
442
- ```
443
-
444
- Daily task prompts are solo-first: they can delegate bounded scout/planning/review work when useful, and the final handoff should state whether subagents were used and why.
445
-
446
- Optional web/docs research support:
447
-
448
- ```bash
449
- pi install npm:pi-web-access@0.13.0
450
- ```
451
-
452
- ## Optional preseed setup
453
-
454
- Most projects do not need shell init. Use this only when you want to pre-create `.pi` files in a repo or bootstrap team templates:
455
-
456
- ```bash
457
- bash /path/to/piagent/scripts/setup.sh /path/to/project \
458
- --profile be-readonly-fe \
459
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
460
- --mcp-preset core \
461
- --subagents-preset safe
462
- ```
209
+ `/subagents-doctor` runs a health check; `/run piagent-scout "…"` and its planner, worker, and reviewer counterparts dispatch work. See [Subagents and multi-agent](docs/subagents-and-multiagent.md).
463
210
 
464
211
  ## Repository layout
465
212
 
@@ -479,49 +226,13 @@ piagent/
479
226
 
480
227
  ## Verification
481
228
 
482
- ```bash
483
- npm ci --ignore-scripts --legacy-peer-deps
484
- npm run typecheck
485
- npm test
486
- npm run benchmark:redaction
487
- bash scripts/verify-local.sh
488
- bash scripts/team-doctor.sh . --strict-share
489
- pi list --approve
490
- ```
491
-
492
- Quality benchmark:
493
-
494
- ```bash
495
- bash scripts/quality-benchmark.sh /path/to/project --init
496
- bash scripts/quality-benchmark.sh /path/to/project --record \
497
- --scenario bounded-source-fix \
498
- --surface pi \
499
- --result pass \
500
- --tokens 12345 \
501
- --verify "npm test"
502
- ```
503
-
504
- Sensitive-data redaction benchmark:
229
+ One command runs the full local gate — typecheck, tests, capability catalog, doctor, and the scaffold check:
505
230
 
506
231
  ```bash
507
- npm run benchmark:redaction
508
- ```
509
-
510
- Usage / token follow-up:
511
-
512
- ```text
513
- /task-preflight
514
- /task-preflight compact
515
- /piagent-usage
516
- /session
232
+ npm run verify
517
233
  ```
518
234
 
519
- From another terminal:
520
-
521
- ```bash
522
- piagent-usage /path/to/project
523
- bash scripts/pi-session-stats.sh /path/to/project
524
- ```
235
+ Individual checks and the contributor flow are in [CONTRIBUTING.md](CONTRIBUTING.md). Token and session follow-up is `/piagent-usage` inside Pi; see [Usage observability](docs/usage-observability.md). Comparing agent surfaces and models on the same scenarios: [Quality benchmark guide](docs/quality-benchmark.md).
525
236
 
526
237
  ## Public safety
527
238
 
@@ -559,6 +270,7 @@ This repository intentionally excludes:
559
270
  - [Subagent orchestration capabilities](docs/subagent-orchestration-capabilities.md)
560
271
  - [Context-window policy](docs/context-window-policy.md)
561
272
  - [Memory policy](docs/memory-policy.md)
273
+ - [Task lifecycle tiếng Việt](docs/task-lifecycle-vietnamese.md)
562
274
  - [Task implementation contract](docs/task-implementation-contract.md)
563
275
  - [Runtime quality baseline](docs/runtime-quality-baseline.md)
564
276
  - [Usage observability](docs/usage-observability.md)
@@ -571,7 +283,7 @@ This repository intentionally excludes:
571
283
 
572
284
  ## Maturity
573
285
 
574
- The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.0.2` or a reviewed commit.
286
+ The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.1.1` or a reviewed commit.
575
287
 
576
288
  Ready for:
577
289
 
@@ -177,6 +177,45 @@ Tech stack option theo profile:
177
177
 
178
178
  Sau khi chọn tech, platform tạo `.pi/tech-stack.json` và các file `.pi/tech-context/<tech>.json`. `/onboard-project` sẽ đưa các pointer này vào `.pi/context-index.json`. File context chỉ nên chứa tóm tắt ngắn/citation từ Context7, không lưu nguyên văn docs dài, token, session, hoặc secret.
179
179
 
180
+ ## Đọc tài liệu ngoài project
181
+
182
+ Tài liệu tải về `~/Downloads` rồi kéo vào CLI thường không đọc được, vì mặc định agent chỉ làm việc trong project. Tool `piagent_document_read` mở đúng một khe: đọc **tài liệu**, **chỉ đọc**, trong các folder đã cấp trước.
183
+
184
+ | Thành phần | Giá trị |
185
+ |---|---|
186
+ | Tool | `piagent_document_read` |
187
+ | Input | `path` — absolute, `~/...`, hoặc relative theo project |
188
+ | Định dạng | `.md`, `.markdown`, `.txt`, `.text`, `.csv`, `.tsv`, `.json`, `.yaml`, `.yml`, `.pdf`, `.docx` |
189
+ | Giới hạn | 12 MB/file; 400.000 ký tự sau khi trích, dài hơn thì cắt và báo `truncated` |
190
+ | Cấp quyền | `additionalReadRoots` trong `.pi/piagent-profile.json`, hoặc biến môi trường `PIAGENT_ADDITIONAL_READ_ROOTS` |
191
+
192
+ Cấp folder cố định trong profile:
193
+
194
+ ```json
195
+ {
196
+ "additionalReadRoots": ["~/Downloads", "~/Documents/specs"]
197
+ }
198
+ ```
199
+
200
+ Cấp tạm cho một session, ngăn cách bằng `:` giống `PATH`:
201
+
202
+ ```bash
203
+ PIAGENT_ADDITIONAL_READ_ROOTS="$HOME/Downloads:$HOME/Documents/specs" pi
204
+ ```
205
+
206
+ Sau đó nói thẳng path là được: `Đọc ~/Downloads/spec-v2.docx rồi tóm tắt yêu cầu`.
207
+
208
+ Bốn ràng buộc không đổi khi cấp thêm root:
209
+
210
+ - **Chỉ đọc.** Root được cấp không mở quyền ghi, xoá, hay chạy lệnh trong đó.
211
+ - **Chỉ tài liệu.** File nằm trong root được cấp nhưng sai đuôi — `.pem`, `.sh`, `.env` — vẫn bị từ chối.
212
+ - **`protectedPaths` luôn thắng.** Root được cấp không mở được path mà project đang bảo vệ.
213
+ - **Nội dung là dữ liệu, không phải lệnh.** Text trả về đã qua redaction và có header nói rõ đây là dữ liệu người dùng; câu lệnh viết trong tài liệu không được thi hành.
214
+
215
+ Cả hai kiểm tra — nằm trong root và đúng đuôi — đều chạy trên path đã canonical hoá. Nên symlink trong root mà trỏ ra ngoài bị chặn, và symlink tên `notes.md` trỏ vào `id_rsa` cũng bị chặn.
216
+
217
+ `.docx` đọc trực tiếp, không cần cài gì; text bị xoá bởi tracked change chưa accept sẽ không lẫn vào nội dung. `.pdf` cần `pdftotext` (macOS `brew install poppler`, Debian/Ubuntu `apt install poppler-utils`); thiếu binary thì tool báo thiếu chứ không trả tài liệu rỗng.
218
+
180
219
  ## Command native của Pi
181
220
 
182
221
  Các command này thuộc Pi core hoặc package Pi chính. Tên/availability có thể phụ thuộc version Pi.
@@ -379,11 +418,11 @@ Các lệnh này chạy ngoài Pi.
379
418
 
380
419
  | Command | Dùng khi nào |
381
420
  |---|---|
382
- | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1` | Cài Pi CLI tương thích với release hiện tại. |
383
- | `npm install -g --ignore-scripts @piagent/platform@1.0.2` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
384
- | `pi install git:github.com/Vt-mmm/piagent@v1.0.2` | Cài pinned release khi cần reproducible team setup. |
421
+ | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0` | Cài Pi CLI tương thích với release hiện tại. |
422
+ | `npm install -g --ignore-scripts @piagent/platform@1.1.1` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
423
+ | `pi install git:github.com/Vt-mmm/piagent@v1.1.1` | Cài pinned release khi cần reproducible team setup. |
385
424
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
386
- | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, npm-global helper và Pi package. v1.0.2 yêu cầu Pi `0.81.1`. |
425
+ | Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Full update: đồng bộ host, npm-global helper và Pi package. Mỗi release pin một Pi host chính xác; lấy đúng version của release đang cài trong [release/install policy](release-install-policy.md). |
387
426
  | Cài exact Pi host ghi trong release cũ, rồi helper `vPREVIOUS` và `piagent-install --stable` | Full rollback; đánh giá dependency risk của host cũ trước khi hạ version. |
388
427
  | `piagent-install --stable --dry-run` | Preview Pi package matching với helper hiện tại; stable resolve tag → commit SHA. |
389
428
  | `piagent-install --stable` | Cài Pi package matching với helper hiện tại bằng resolved commit SHA. |