@piagent/platform 1.2.7 → 1.2.9

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +2 -2
  3. package/docs/command-reference-vietnamese.md +4 -4
  4. package/docs/context-engine.md +11 -1
  5. package/docs/distribution-standard.md +7 -7
  6. package/docs/operator-manual-vietnamese.md +7 -7
  7. package/docs/publishing-for-teams.md +2 -0
  8. package/docs/release-install-policy.md +6 -6
  9. package/docs/security-threat-model.md +2 -1
  10. package/docs/subagent-orchestration-capabilities.md +2 -2
  11. package/docs/subagents-and-multiagent.md +5 -5
  12. package/docs/team-onboarding.md +2 -2
  13. package/docs-site/architecture.html +1 -1
  14. package/docs-site/commands.html +1 -1
  15. package/docs-site/context-engine.html +1 -1
  16. package/docs-site/index.html +1 -1
  17. package/docs-site/mcp-approval.html +1 -1
  18. package/docs-site/mcp-auth.html +1 -1
  19. package/docs-site/mcp-servers.html +1 -1
  20. package/docs-site/mcp.html +1 -1
  21. package/docs-site/permissions.html +1 -1
  22. package/docs-site/profiles.html +1 -1
  23. package/docs-site/quickstart.html +1 -1
  24. package/docs-site/runtime.html +1 -1
  25. package/docs-site/scope.html +1 -1
  26. package/docs-site/security.html +1 -1
  27. package/docs-site/team.html +1 -1
  28. package/docs-site/workflows.html +1 -1
  29. package/package.json +1 -1
  30. package/packages/piagent-core/capabilities/capability-core.js +3 -0
  31. package/packages/piagent-core/extensions/context-engine.js +149 -71
  32. package/packages/piagent-core/extensions/context-index-policy.js +136 -0
  33. package/packages/piagent-core/extensions/piagent-guard.ts +67 -67
  34. package/packages/piagent-core/package.json +1 -1
  35. package/scripts/audit-runtime-host.sh +1 -1
  36. package/scripts/context-engine.mjs +22 -20
  37. package/scripts/install-global.sh +10 -5
  38. package/scripts/setup.sh +9 -2
  39. package/scripts/team-doctor.sh +3 -0
  40. package/scripts/update-global.mjs +1 -1
  41. package/scripts/verify-local.sh +4 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,49 @@
2
2
 
3
3
  This file records release-facing changes for Pi Agent Platform. Copy the relevant version block into GitHub Releases when publishing a tag.
4
4
 
5
+ ## v1.2.9 - 2026-07-31
6
+
7
+ ### Security
8
+
9
+ - Context Engine CLI và runtime giờ dùng chung một policy resolver. Base policy,
10
+ profile `extends`, `protectedPaths`, `shellProtectedPaths`, `readOnlyPaths` và
11
+ custom context-index path cùng tạo ra một canonical exclusion list; context
12
+ search/pack không còn đọc một view khác với guard.
13
+
14
+ - Context index metadata ghi versioned exclusion digest. Search, pack, impact và
15
+ auto-context rebuild incremental khi digest hiện hành khác digest đã build,
16
+ đồng thời lọc lại candidate ở read time. Index cũ tạo bằng luật yếu hơn vì vậy
17
+ tự loại nội dung protected trước khi model nhận context.
18
+
19
+ - Context Engine từ chối source-shaped symlink và canonical path đi ra ngoài
20
+ project ở cả build, stale check và pack read.
21
+
22
+ - API build, ensure, search, pack và impact giờ fail-closed nếu caller không
23
+ truyền `excludePatterns` tường minh. `[]` vẫn được hỗ trợ cho low-level tool
24
+ chủ ý chạy không loại trừ; caller mới không còn vô tình quay về permissive
25
+ default.
26
+
27
+ ### Fixed
28
+
29
+ - `piagent-update --dry-run --project ...` báo trực tiếp khi helper thiếu project
30
+ migrator thay vì chạy Node rồi trả stack `MODULE_NOT_FOUND`.
31
+
32
+ ### Documentation
33
+
34
+ - Tài liệu ghi rõ dynamic tools, auto context và Context Engine telemetry bật mặc
35
+ định; telemetry vẫn chỉ lưu metadata/hash đã redact, không lưu prompt hay tool
36
+ output thô.
37
+
38
+ ## v1.2.8 - 2026-07-31
39
+
40
+ ### Changed
41
+
42
+ - Global setup/update now installs `pi-web-access@0.17.0` by default so builtin researcher subagents can browse/search/fetch external sources instead of being limited to local repo/docs. Machines that cannot use web research can opt out with `--no-web-access`.
43
+
44
+ ### Fixed
45
+
46
+ - Global install/update now removes older platform-owned `pi-web-access` registrations before installing the reviewed exact version, forcing Pi's shared npm package tree to refresh stale transitive dependencies.
47
+
5
48
  ## v1.2.7 - 2026-07-31
6
49
 
7
50
  ### Security
package/README.md CHANGED
@@ -211,7 +211,7 @@ Keep provider keys in environment variables, never in committed config. Switchin
211
211
 
212
212
  ## Subagents
213
213
 
214
- `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.
214
+ `piagent-setup` installs `pi-subagents` with the `safe` preset and `pi-web-access` for web-backed researcher runs unless disabled. Daily task prompts stay solo-first: they delegate bounded scout, planning, research, 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.
215
215
 
216
216
  `/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).
217
217
 
@@ -291,7 +291,7 @@ This repository intentionally excludes:
291
291
 
292
292
  ## Maturity
293
293
 
294
- 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.2.7` or a reviewed commit.
294
+ 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.2.9` or a reviewed commit.
295
295
 
296
296
  Ready for:
297
297
 
@@ -465,8 +465,8 @@ Các lệnh này chạy ngoài Pi.
465
465
  | Command | Dùng khi nào |
466
466
  |---|---|
467
467
  | `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. |
468
- | `npm install -g --ignore-scripts @piagent/platform@1.2.7` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
469
- | `pi install git:github.com/Vt-mmm/piagent@v1.2.7` | Cài pinned release khi cần reproducible team setup. |
468
+ | `npm install -g --ignore-scripts @piagent/platform@1.2.9` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
469
+ | `pi install git:github.com/Vt-mmm/piagent@v1.2.9` | Cài pinned release khi cần reproducible team setup. |
470
470
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
471
471
  | `piagent-update --check` | Báo version hiện tại vs version sẽ lên cho cả ba thành phần; không cài gì. |
472
472
  | `piagent-update` | Full update global một lệnh cho cả máy: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. |
@@ -498,8 +498,8 @@ Các lệnh này chạy ngoài Pi.
498
498
  | `piagent-mcp --preset popular --scope global --replace` | Apply the governed MCP popular baseline: core + Playwright + Figma remote. |
499
499
  | `piagent-mcp --list` | List MCP presets. |
500
500
  | `piagent-subagents --preset safe` | Re-apply subagent safe config. |
501
- | `pi install npm:pi-web-access@0.13.0` | Optional: cấp web/search/fetch tools cho builtin `researcher`. |
502
- | `piagent-setup <project> --with-web-access` | Setup project + optional web access cho research subagents. |
501
+ | `pi install npm:pi-web-access@0.17.0` | Cấp web/search/fetch tools cho builtin `researcher`; platform setup/update cài mặc định từ `v1.2.8`. |
502
+ | `piagent-setup <project> --no-web-access` | Setup project nhưng bỏ web access khi máy không được phép browse/fetch external source. |
503
503
  | `piagent-usage /path/to/project` | Lấy exact usage của session mới nhất từ terminal khác. |
504
504
  | `piagent-usage --history /path/to/project --days 7` | Tổng usage lịch sử của project, gồm session đã end. |
505
505
  | `piagent-usage --history --all-projects --days 7 --csv` | Xuất usage tuần toàn máy để đưa vào report. |
@@ -34,7 +34,10 @@ task
34
34
  model, thinking, active-tool count, usage, retrieval confidence và đường dẫn
35
35
  tương đối đã được guard redaction.
36
36
 
37
- Rollback flags:
37
+ Ba cơ chế `PIAGENT_DYNAMIC_TOOLS`, `PIAGENT_AUTO_CONTEXT` và
38
+ `PIAGENT_CONTEXT_TELEMETRY` đều **bật mặc định** từ `v1.2.6`. Telemetry chỉ ghi
39
+ operational metadata/hash như mô tả dưới đây, không ghi prompt hoặc tool output
40
+ thô. Tắt riêng từng cơ chế cho một lần chạy bằng:
38
41
 
39
42
  ```bash
40
43
  PIAGENT_DYNAMIC_TOOLS=off pi
@@ -82,6 +85,13 @@ Context pack tách repo map và source snippets, sau đó dừng cứng tại to
82
85
  budget. Index chỉ là navigation evidence; model phải đọc file hiện tại trước
83
86
  khi edit.
84
87
 
88
+ Các API có thể build hoặc đọc nội dung (`build`, `ensure`, `search`, `pack`,
89
+ `impact`) bắt buộc caller truyền `excludePatterns` tường minh và fail-closed
90
+ nếu thiếu. Runtime và CLI lấy danh sách này từ shared project policy resolver;
91
+ low-level tool hoặc test chỉ dùng `[]` khi chủ ý chọn không loại trừ. API
92
+ `status` vẫn có thể đọc metadata mà không cần policy vì nó không đọc source
93
+ content.
94
+
85
95
  ## P2: compaction, finder và test impact
86
96
 
87
97
  - `/context impact` đi ngược import graph từ file thay đổi và tìm test liên quan.
@@ -14,9 +14,9 @@ Repo này phải chạy được cho nhiều project/domain khác nhau. Vì vậ
14
14
 
15
15
  | Use case | Package source |
16
16
  |---|---|
17
- | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.2.7` |
17
+ | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.2.9` |
18
18
  | Personal/sandbox dev | `git:github.com/Vt-mmm/piagent` |
19
- | Registry distribution | `npm:@piagent/platform@1.2.7` |
19
+ | Registry distribution | `npm:@piagent/platform@1.2.9` |
20
20
  | Enterprise npm (fork under another scope) | `npm:@your-scope/platform@x.y.z` |
21
21
  | Local platform dev | `/path/to/piagent` |
22
22
 
@@ -26,7 +26,7 @@ Latest tiện cho máy cá nhân muốn nhận cập nhật nhanh. Pin tag/commi
26
26
 
27
27
  | Channel | Command | Target | Policy |
28
28
  |---|---|---|---|
29
- | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.2.7` | Install the Pi package matching the helper. |
29
+ | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.2.9` | Install the Pi package matching the helper. |
30
30
  | `exact` | `bash scripts/install-global.sh --version vX.Y.Z --resolve-tag` | Requested tag resolved to commit SHA | Pi-package-only rollout, rollback, and incident recovery. |
31
31
  | `dev` | `bash scripts/install-global.sh --dev` | Moving Git source | Personal/sandbox only; do not commit into project settings. |
32
32
  | `local` | `bash scripts/install-global.sh --local` | Current checkout path | Platform development only. |
@@ -53,7 +53,7 @@ Root `package.json` có `pi` manifest trỏ tới:
53
53
  Do đó team có thể:
54
54
 
55
55
  ```bash
56
- pi install git:github.com/Vt-mmm/piagent@v1.2.7
56
+ pi install git:github.com/Vt-mmm/piagent@v1.2.9
57
57
  ```
58
58
 
59
59
  Không cần biết internal folder `packages/piagent-core`. Source không pin chỉ dành cho personal/sandbox như bảng channel ở trên.
@@ -65,12 +65,12 @@ Team nên install global package một lần:
65
65
  ```bash
66
66
  node --version # >= 22.19.0
67
67
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
68
- npm install -g --ignore-scripts @piagent/platform@1.2.7
68
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
69
69
  piagent-install --stable --dry-run
70
70
  piagent-install --stable
71
71
  ```
72
72
 
73
- `pi install git:github.com/Vt-mmm/piagent@v1.2.7` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.2.7`.
73
+ `pi install git:github.com/Vt-mmm/piagent@v1.2.9` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.2.9`.
74
74
 
75
75
  Support matrix hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy smoke trước rollout; native Windows chưa phải target rollout team; WSL2 experimental. Chi tiết và version runtime nằm trong [release/install policy](release-install-policy.md).
76
76
 
@@ -120,7 +120,7 @@ Nếu muốn commit sẵn `.pi/piagent-profile.json` vào repo hoặc bootstrap
120
120
  ```bash
121
121
  bash scripts/setup.sh /path/to/project \
122
122
  --profile be-readonly-fe \
123
- --package-source git:github.com/Vt-mmm/piagent@v1.2.7 \
123
+ --package-source git:github.com/Vt-mmm/piagent@v1.2.9 \
124
124
  --mcp-preset core \
125
125
  --subagents-preset safe
126
126
  ```
@@ -18,12 +18,12 @@ Support matrix release hiện tại: macOS Apple Silicon + Bash và Linux x64 +
18
18
  ```bash
19
19
  node --version # >= 22.19.0
20
20
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
21
- npm install -g --ignore-scripts @piagent/platform@1.2.7
21
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
22
22
  piagent-install --stable --dry-run
23
23
  piagent-install --stable
24
24
  ```
25
25
 
26
- Khi seed `.pi/settings.json` cho team/repo cần audit lặp lại, giữ package source dạng pinned tag như `git:github.com/Vt-mmm/piagent@v1.2.7`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
26
+ Khi seed `.pi/settings.json` cho team/repo cần audit lặp lại, giữ package source dạng pinned tag như `git:github.com/Vt-mmm/piagent@v1.2.9`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
27
27
 
28
28
  Nếu đang ở source checkout của platform, dùng helper theo channel để preview trước khi đổi:
29
29
 
@@ -99,7 +99,7 @@ install package once
99
99
 
100
100
  ```bash
101
101
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
102
- npm install -g --ignore-scripts @piagent/platform@1.2.7
102
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
103
103
  piagent-install --stable --dry-run
104
104
  piagent-install --stable
105
105
  ```
@@ -282,7 +282,7 @@ Không phải daily default. Dùng khi muốn tạo sẵn `.pi` files cho projec
282
282
  bash /path/to/piagent/scripts/setup.sh /path/to/project \
283
283
  --project-only \
284
284
  --profile auto \
285
- --package-source git:github.com/Vt-mmm/piagent@v1.2.7 \
285
+ --package-source git:github.com/Vt-mmm/piagent@v1.2.9 \
286
286
  --mcp-preset core \
287
287
  --subagents-preset safe
288
288
  ```
@@ -894,8 +894,8 @@ Watchdog là optional adversarial reviewer ở cuối turn, không bật mặc
894
894
 
895
895
  | Command | Dùng để |
896
896
  |---|---|
897
- | `npm install -g --ignore-scripts @piagent/platform@1.2.7` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
898
- | `pi install git:github.com/Vt-mmm/piagent@v1.2.7` | Install pinned release cho reproducible team setup. |
897
+ | `npm install -g --ignore-scripts @piagent/platform@1.2.9` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
898
+ | `pi install git:github.com/Vt-mmm/piagent@v1.2.9` | Install pinned release cho reproducible team setup. |
899
899
  | `pi install git:github.com/Vt-mmm/piagent` | Install latest platform package cho máy cá nhân/sandbox. |
900
900
  | 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, terminal 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). |
901
901
  | Cài exact Pi host ghi trong release cũ, rồi helper `vPREVIOUS` và `piagent-install --stable` | Full rollback; đánh giá lại dependency findings của host cũ trước khi hạ version. |
@@ -1002,7 +1002,7 @@ Mở lại Pi session sau khi install.
1002
1002
  Cài lại terminal helper đúng release rồi kiểm tra `PATH`:
1003
1003
 
1004
1004
  ```bash
1005
- npm install -g --ignore-scripts @piagent/platform@1.2.7
1005
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
1006
1006
  command -v piagent-install
1007
1007
  ```
1008
1008
 
@@ -60,6 +60,8 @@ pi install /path/to/piagent
60
60
  - `1.2.5`: updater đọc đúng metadata singleton-array của npm 12.
61
61
  - `1.2.6`: Context Engine v2, dynamic tool loading, hard-budget retrieval, semantic compaction, Agent Watch telemetry/feedback và quality benchmark theo context efficiency.
62
62
  - `1.2.7`: refresh exact MCP/subagent add-on pins, loại dependency URL/static-server có advisory và chặn cả moderate advisory trong runtime release gate.
63
+ - `1.2.8`: cài `pi-web-access@0.17.0` mặc định trong setup/update để researcher subagents có web/search/fetch thật; thêm `--no-web-access` cho máy không được phép browse.
64
+ - `1.2.9`: hợp nhất Context Engine exclusion policy giữa CLI và runtime, resolve profile `extends`, loại `readOnlyPaths`, tự rebuild index khi policy digest đổi, chặn symlink source ra ngoài project, và làm rõ lỗi thiếu migrator trong update dry-run.
63
65
 
64
66
  ## Không publish
65
67
 
@@ -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.7 | Rollout guidance |
13
+ | Surface | Status for v1.2.9 | 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.7` | Fixed after resolution | Default for team rollout. |
36
+ | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.9` | 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.7
56
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
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.7 (helper package version)
65
- tag: v1.2.7
64
+ currentRelease: v1.2.9 (helper package version)
65
+ tag: v1.2.9
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.7
82
+ pi install git:github.com/Vt-mmm/piagent@v1.2.9
83
83
  ```
84
84
 
85
85
  Direct `pi install` does not create `piagent-*` commands on `PATH`.
@@ -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.7, and WSL2 is experimental/unverified.
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.9, 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
@@ -42,6 +42,7 @@ The final category is outside the containment capability of the Piagent guard. I
42
42
  | Direct or nested path-like tool input | Bounded recursive input inspection, protected-path precedence, repository boundary checks, filesystem capability scopes, and read-only profile paths | A new carrier or field name must be classified before it can be treated as controlled. Unknown/ambiguous tools fail closed where policy requires confirmation. |
43
43
  | Shell glob reaching a protected file | Glob candidates are read from the same expanded, resolved word list as every other check and matched against examples of each protected pattern, so a pattern assembled by an expansion (`{cat,.env*}`, `cat $({echo,.env*})`, `{bash,} -c 'cat .env*'`, `echo .env* | xargs cat`) is seen. This is the only check that can answer for a pattern at all, since `.env*` matches no protected literal. Whether a word is matched against filenames is decided per character, so a quoted metacharacter names a file instead (`{".env*",x}`). A redirection is read by the rule the shell uses — it opens its target only where that target expands to exactly one word, and is refused as an ambiguous redirect otherwise (`> "{.env,}"{,}`, `> {.env,other}`), while a word that can still disappear, an unset variable or a pattern under `nullglob`, leaves the count unknowable and keeps every candidate | Matching is against generated examples of each protected pattern, not against the filesystem, so a protected pattern whose examples do not represent every real name it covers can leave a matching file unnamed. Bounded expansion refuses rather than enumerates when a glob is too broad to expand. |
44
44
  | Encoding, case variation, traversal, or symbolic-link alias | Single percent decode, case-insensitive protected matching, canonical resolution for existing paths, traversal/repository escape rejection | Filesystem races and code executing outside observed tool paths require an OS boundary. |
45
+ | Context index built with weaker or stale path rules | CLI and runtime share one resolved exclusion policy covering base policy, adapter inheritance, protected, shell-protected, and read-only paths. Content APIs require an explicit exclusion list and fail closed when it is omitted. A versioned exclusion digest forces incremental rebuild on policy drift; search/pack filter candidates again at read time, and source-shaped symlinks or canonical paths outside the project are refused. | Context Engine remains an application-level local cache. An explicit empty exclusion list is still available to intentional low-level callers; filesystem races and a process with direct OS access require an OS boundary. |
45
46
  | Shell glob, brace, redirection, wrapper, assignment, or command composition | Static Bash operand/action analysis with bounded expansion and regression cases; protected input is denied and external mutation is confirmation-gated. A path the analysis cannot resolve — literal text concatenated with a substitution, as in `.en$(echo v)` — is refused rather than matched on its literal half | Runtime-generated interpreter payloads cannot be fully understood by static parsing. Sensitive output redaction is a backstop, not containment. |
46
47
  | Secret returned in tool output | Shared contextual redaction across guarded text/results and synthetic recall benchmark | High-entropy, novel secret formats, or transformed output such as base64-encoded content can evade pattern-based redaction. Never intentionally print real secrets. |
47
48
  | Malicious project profile or relaxed capability lock | Trust-aware profile loading, deterministic lock digest, base-policy/source integrity, protected self-state, and fail-closed verification | An already trusted malicious repository can execute code through mechanisms outside the guard. |
@@ -42,7 +42,7 @@ Core decisions:
42
42
  - `scheduledRuns.enabled: false`
43
43
  - bounded `maxSubagentDepth`, spawn cap, and parallel concurrency
44
44
  - `scripts/setup.sh` / `scripts/install-global.sh`
45
- - optional `--with-web-access` installs `npm:pi-web-access@0.13.0` for web/docs research
45
+ - install `npm:pi-web-access@0.17.0` by default for web/docs research; `--no-web-access` opts out
46
46
  - Workflow prompts
47
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
@@ -81,7 +81,7 @@ Parallel review:
81
81
  Research-heavy task:
82
82
 
83
83
  ```bash
84
- pi install npm:pi-web-access@0.13.0
84
+ pi install npm:pi-web-access@0.17.0
85
85
  ```
86
86
 
87
87
  ```text
@@ -103,15 +103,15 @@ Sau khi mở session mới hoặc `/reload`:
103
103
 
104
104
  `/subagents-doctor` là lệnh đầu tiên nên chạy nếu không thấy tool/agent.
105
105
 
106
- Optional research support:
106
+ Web research support is installed by default in team setup/update:
107
107
 
108
108
  ```bash
109
- pi install npm:pi-web-access@0.13.0
110
- # hoặc
111
- bash /path/to/piagent/scripts/setup.sh . --with-web-access
109
+ pi install npm:pi-web-access@0.17.0
110
+ # hoặc full setup/update:
111
+ bash /path/to/piagent/scripts/setup.sh .
112
112
  ```
113
113
 
114
- `researcher` builtin cần web/search/fetch tools từ package này. Không bật mặc định để tránh tăng tool surface cho team không cần web research.
114
+ `researcher` builtin cần web/search/fetch tools từ package này. Từ `v1.2.8`, platform cài package này mặc định để `/parallel-research` không bị giới hạn ở local repo/docs. Nếu một máy thật sự không được phép browse/fetch web, dùng `--no-web-access`.
115
115
 
116
116
  Giải nghĩa nhanh:
117
117
 
@@ -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.7
12
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
13
13
  piagent-install --stable
14
14
  cd /path/to/project
15
15
  pi
@@ -43,7 +43,7 @@ Mặc định team dùng stable helper:
43
43
  ```bash
44
44
  node --version # >= 22.19.0
45
45
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
46
- npm install -g --ignore-scripts @piagent/platform@1.2.7
46
+ npm install -g --ignore-scripts @piagent/platform@1.2.9
47
47
  piagent-install --stable --dry-run
48
48
  piagent-install --stable
49
49
  ```
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.7 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.9 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/platform",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -800,6 +800,9 @@ function buildCoreIntegrity(root) {
800
800
  // context and records the resulting telemetry, so it is part of the
801
801
  // runtime trust boundary enforced by the profile lock.
802
802
  "packages/piagent-core/extensions/context-engine.js",
803
+ // context-index-policy.js resolves adapter inheritance and decides which
804
+ // protected paths the context engine must never ingest.
805
+ "packages/piagent-core/extensions/context-index-policy.js",
803
806
  // guard-io.js loads the project profile and guard-shell-analysis.ts decides
804
807
  // what a command is about to reach, so tampering with either changes what
805
808
  // the guard enforces. guard-types.ts is deliberately absent: it is erased