@piagent/platform 1.7.1 → 1.9.0

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 (227) hide show
  1. package/AGENTS.md +7 -0
  2. package/CHANGELOG.md +113 -1
  3. package/README.md +45 -70
  4. package/README.vi.md +34 -61
  5. package/architecture/layers.json +16 -3
  6. package/catalog/capabilities.json +14 -7
  7. package/catalog/claude-model-additions.json +42 -0
  8. package/docs/auto-delegation-policy.md +2 -0
  9. package/docs/command-reference-vietnamese.md +69 -91
  10. package/docs/context-window-policy.md +5 -5
  11. package/docs/distribution-standard.md +16 -19
  12. package/docs/en/architecture.md +9 -1
  13. package/docs/herdr-workflow.md +2 -3
  14. package/docs/languages.json +4 -4
  15. package/docs/managed-local-acceptance.md +403 -0
  16. package/docs/mcp-and-tools.md +5 -7
  17. package/docs/memory-policy.md +3 -3
  18. package/docs/model-options.md +22 -17
  19. package/docs/oauth-providers.md +1 -1
  20. package/docs/operator-manual-vietnamese.md +85 -130
  21. package/docs/package-architecture-notes.md +4 -4
  22. package/docs/piagent-core-improvement-plan.md +3 -5
  23. package/docs/piagent-core-plan-checkpoint-2026-09-06.json +2 -13
  24. package/docs/piagent-runtime-benchmark-execution-plan.md +10 -8
  25. package/docs/project-adapters.md +3 -3
  26. package/docs/project-onboarding.md +15 -16
  27. package/docs/publishing-for-teams.md +3 -1
  28. package/docs/quality-benchmark.md +2 -0
  29. package/docs/quickstart-vietnamese.md +24 -25
  30. package/docs/release-install-policy.md +16 -11
  31. package/docs/research/harness-next-evidence-review.md +7 -7
  32. package/docs/runtime-harness-standard.md +2 -0
  33. package/docs/runtime-policy-design.md +2 -0
  34. package/docs/runtime-quality-baseline.md +2 -0
  35. package/docs/subagent-orchestration-capabilities.md +1 -1
  36. package/docs/subagents-and-multiagent.md +10 -8
  37. package/docs/task-implementation-contract.md +2 -0
  38. package/docs/task-lifecycle-vietnamese.md +2 -0
  39. package/docs/team-onboarding.md +33 -64
  40. package/docs/usage-observability.md +2 -2
  41. package/docs/vi/architecture.md +9 -1
  42. package/docs/workflow-recipes.md +6 -10
  43. package/docs-site/architecture.html +4 -3
  44. package/docs-site/assets/docs.css +80 -0
  45. package/docs-site/benchmark.html +7 -1
  46. package/docs-site/commands.html +37 -23
  47. package/docs-site/content/architecture.html +2 -2
  48. package/docs-site/content/benchmark.html +5 -0
  49. package/docs-site/content/commands.html +35 -22
  50. package/docs-site/content/ecosystem.html +144 -0
  51. package/docs-site/content/en/architecture.html +1 -1
  52. package/docs-site/content/en/benchmark.html +5 -0
  53. package/docs-site/content/en/commands.html +30 -13
  54. package/docs-site/content/en/ecosystem.html +144 -0
  55. package/docs-site/content/en/index.html +24 -9
  56. package/docs-site/content/en/quickstart.html +10 -12
  57. package/docs-site/content/en/runtime.html +1 -1
  58. package/docs-site/content/en/security.html +1 -1
  59. package/docs-site/content/en/team.html +2 -2
  60. package/docs-site/content/en/whats-new.html +89 -1
  61. package/docs-site/content/en/workflows.html +29 -31
  62. package/docs-site/content/index.html +24 -9
  63. package/docs-site/content/quickstart.html +10 -12
  64. package/docs-site/content/runtime.html +2 -2
  65. package/docs-site/content/security.html +2 -2
  66. package/docs-site/content/team.html +2 -2
  67. package/docs-site/content/whats-new.html +89 -1
  68. package/docs-site/content/workflows.html +36 -38
  69. package/docs-site/context-engine.html +2 -1
  70. package/docs-site/ecosystem.html +283 -0
  71. package/docs-site/en/architecture.html +3 -2
  72. package/docs-site/en/benchmark.html +7 -1
  73. package/docs-site/en/commands.html +32 -14
  74. package/docs-site/en/context-engine.html +2 -1
  75. package/docs-site/en/ecosystem.html +283 -0
  76. package/docs-site/en/index.html +30 -14
  77. package/docs-site/en/mcp-approval.html +2 -1
  78. package/docs-site/en/mcp-auth.html +2 -1
  79. package/docs-site/en/mcp-servers.html +2 -1
  80. package/docs-site/en/mcp.html +2 -1
  81. package/docs-site/en/permissions.html +2 -1
  82. package/docs-site/en/profiles.html +2 -1
  83. package/docs-site/en/quickstart.html +17 -18
  84. package/docs-site/en/runtime.html +3 -2
  85. package/docs-site/en/scope.html +2 -1
  86. package/docs-site/en/security.html +6 -5
  87. package/docs-site/en/team.html +4 -3
  88. package/docs-site/en/whats-new.html +97 -8
  89. package/docs-site/en/workflows.html +34 -35
  90. package/docs-site/index.html +30 -14
  91. package/docs-site/mcp-approval.html +2 -1
  92. package/docs-site/mcp-auth.html +2 -1
  93. package/docs-site/mcp-servers.html +2 -1
  94. package/docs-site/mcp.html +2 -1
  95. package/docs-site/permissions.html +2 -1
  96. package/docs-site/profiles.html +2 -1
  97. package/docs-site/quickstart.html +17 -18
  98. package/docs-site/runtime.html +4 -3
  99. package/docs-site/scope.html +2 -1
  100. package/docs-site/security.html +7 -6
  101. package/docs-site/team.html +4 -3
  102. package/docs-site/whats-new.html +97 -8
  103. package/docs-site/workflows.html +41 -42
  104. package/evals/fs5-causal-arm.v1.json +2 -2
  105. package/evals/private-holdout-v1/CURRENT_BOUNDARY.md +17 -0
  106. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  107. package/package.json +10 -9
  108. package/packages/piagent-core/README.md +15 -23
  109. package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +2 -0
  110. package/packages/piagent-core/extensions/experiment-loop-policy.ts +75 -0
  111. package/packages/piagent-core/extensions/local-state-path.js +15 -0
  112. package/packages/piagent-core/extensions/piagent-guard.ts +108 -960
  113. package/packages/piagent-core/extensions/policy-core.js +2 -2
  114. package/packages/piagent-core/extensions/source-checkout-paths.ts +54 -0
  115. package/packages/piagent-core/managed/broker-client.mjs +49 -0
  116. package/packages/piagent-core/managed/capabilities.mjs +28 -0
  117. package/packages/piagent-core/managed/compaction.mjs +63 -0
  118. package/packages/piagent-core/managed/doctor.mjs +107 -0
  119. package/packages/piagent-core/managed/native-catalog.mjs +42 -0
  120. package/packages/piagent-core/managed/patch-snapshot.mjs +48 -0
  121. package/packages/piagent-core/managed/repository-operation.mjs +84 -0
  122. package/packages/piagent-core/managed/request-stream.mjs +129 -0
  123. package/packages/piagent-core/managed/resource-loader.mjs +42 -0
  124. package/packages/piagent-core/managed/review-snapshot-worker.mjs +27 -0
  125. package/packages/piagent-core/managed/sandbox-diagnostic.mjs +12 -0
  126. package/packages/piagent-core/managed/search-fallback.mjs +93 -0
  127. package/packages/piagent-core/managed/session.mjs +472 -0
  128. package/packages/piagent-core/managed/store.d.mts +3 -0
  129. package/packages/piagent-core/managed/store.mjs +64 -0
  130. package/packages/piagent-core/managed/tool-boundary.mjs +243 -0
  131. package/packages/piagent-core/managed/tool-worker.mjs +36 -0
  132. package/packages/piagent-core/managed/toolchain.mjs +120 -0
  133. package/packages/piagent-core/managed/web-fetch.mjs +105 -0
  134. package/packages/piagent-core/managed/web-search.mjs +96 -0
  135. package/packages/piagent-core/managed/workflow.mjs +299 -0
  136. package/packages/piagent-core/package.json +3 -6
  137. package/packages/piagent-core/policies/base-policy.json +80 -26
  138. package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +3 -3
  139. package/packages/piagent-core/runtime/hooks/input-hook.ts +35 -196
  140. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -0
  141. package/packages/piagent-core/runtime/inspection/approval-broker.ts +9 -1
  142. package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +1 -1
  143. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +1 -1
  144. package/packages/piagent-core/runtime/managed-failure.d.mts +10 -0
  145. package/packages/piagent-core/runtime/managed-failure.mjs +164 -0
  146. package/packages/piagent-core/runtime/model/model-route-policy.ts +33 -13
  147. package/packages/piagent-core/runtime/model/model-route-types.ts +10 -6
  148. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +8 -29
  149. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +1 -1
  150. package/packages/piagent-core/runtime/policy/block-remedy.ts +5 -3
  151. package/packages/piagent-core/runtime/registration/context-commands.ts +1 -1
  152. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +7 -7
  153. package/packages/piagent-core/runtime/registration/policy-tools.ts +2 -2
  154. package/packages/piagent-core/runtime/registration/session-commands.ts +11 -26
  155. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +1 -1
  156. package/packages/piagent-core/runtime/session/system-prompt.ts +6 -7
  157. package/packages/piagent-core/runtime/workflows/webui-runtime-command.ts +6 -6
  158. package/packages/piagent-core/runtime/workflows/webui-workflow.ts +6 -11
  159. package/packages/piagent-core/security/sensitive-text.js +9 -0
  160. package/packages/piagent-core/skills/piagent-ops/SKILL.md +8 -10
  161. package/packages/piagent-core/skills/test-audit/SKILL.md +101 -0
  162. package/packages/piagent-core/subagents/piagent-planner.md +1 -1
  163. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-DGk34zJT.js → MarkdownMessage-Dd9wPk-v.js} +1 -1
  164. package/packages/piagent-webui/dist/client/assets/index-7I-50Q2U.js +228 -0
  165. package/packages/piagent-webui/dist/client/assets/{index-DVahUVWy.css → index-DgSmcnP8.css} +1 -1
  166. package/packages/piagent-webui/dist/client/index.html +2 -2
  167. package/packages/piagent-webui/extension/piagent-webui.ts +11 -11
  168. package/packages/piagent-webui/extension/session-stream-adapter.ts +3 -1
  169. package/packages/piagent-webui/extension/terminal-session-adapter.ts +6 -1
  170. package/packages/piagent-webui/gateway/company-relay.ts +308 -0
  171. package/packages/piagent-webui/gateway/control-socket.ts +39 -12
  172. package/packages/piagent-webui/gateway/gateway-service.ts +109 -28
  173. package/packages/piagent-webui/gateway/gateway-session-stream.ts +58 -2
  174. package/packages/piagent-webui/gateway/managed-gateway.mjs +41 -0
  175. package/packages/piagent-webui/gateway/managed-launch.ts +145 -0
  176. package/packages/piagent-webui/gateway/managed-projection.ts +20 -0
  177. package/packages/piagent-webui/gateway/pi-host.ts +22 -4
  178. package/packages/piagent-webui/gateway/runtime-session-controls.ts +5 -2
  179. package/packages/piagent-webui/gateway/session-approval-authority.ts +28 -0
  180. package/packages/piagent-webui/gateway/session-catalog.ts +11 -3
  181. package/packages/piagent-webui/gateway/session-command-controller.ts +8 -2
  182. package/packages/piagent-webui/gateway/session-file-facts.ts +25 -0
  183. package/packages/piagent-webui/gateway/session-inspection-registry.ts +42 -12
  184. package/packages/piagent-webui/gateway/session-list-cache.ts +68 -0
  185. package/packages/piagent-webui/gateway/session-runtime-ownership.ts +8 -1
  186. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +20 -27
  187. package/packages/piagent-webui/ownership/managed-terminal-lease.ts +27 -0
  188. package/packages/piagent-webui/ownership/profile-state.ts +2 -0
  189. package/packages/piagent-webui/ownership/session-lease-store.ts +22 -1
  190. package/packages/piagent-webui/server/approval-projection.ts +9 -0
  191. package/packages/piagent-webui/server/core-inspection-provider.ts +4 -9
  192. package/packages/piagent-webui/server/loopback-server.ts +37 -1
  193. package/packages/piagent-webui/server/message-stop-reason.ts +11 -0
  194. package/packages/piagent-webui/server/tool-call-summary.ts +185 -0
  195. package/packages/piagent-webui/server/transcript-projection.ts +86 -3
  196. package/packs/engineering-base/pack.json +4 -0
  197. package/schemas/piagent-webui/runtime-command-v1.schema.json +1 -2
  198. package/schemas/piagent-webui/session-catalog-v1.schema.json +8 -0
  199. package/schemas/piagent-webui/transcript-v1.schema.json +94 -1
  200. package/scripts/build-docs-site.mjs +23 -12
  201. package/scripts/check-public-wording.mjs +5 -6
  202. package/scripts/check-runtime-advisories.mjs +23 -6
  203. package/scripts/claude-model-additions.mjs +33 -0
  204. package/scripts/configure-model-scope.sh +36 -8
  205. package/scripts/configure-subagents.sh +1 -1
  206. package/scripts/explain-command.mjs +5 -6
  207. package/scripts/install-global.sh +2 -2
  208. package/scripts/model-route-evaluation-core.ts +1 -0
  209. package/scripts/model-scope-prune.mjs +75 -0
  210. package/scripts/phase-tools-evaluation.mjs +9 -4
  211. package/scripts/pi-model-route.mjs +1 -1
  212. package/scripts/piagent-cli.mjs +51 -2
  213. package/scripts/piagent-dashboard.mjs +27 -4
  214. package/scripts/piagent-installations.mjs +26 -0
  215. package/scripts/piagent-studio.mjs +155 -0
  216. package/scripts/runtime-advisory-exceptions.json +29 -0
  217. package/scripts/setup.sh +2 -2
  218. package/scripts/team-doctor.sh +20 -1
  219. package/scripts/typescript-loader.mjs +6 -0
  220. package/scripts/verify-local.sh +5 -5
  221. package/scripts/verify-release-identity.mjs +1 -1
  222. package/templates/global/settings.json +8 -2
  223. package/templates/project/.pi/project-context.md +3 -3
  224. package/templates/project/AGENTS.md +4 -5
  225. package/docs/piagent-core-reasoning-research-2026-09-06.md +0 -225
  226. package/docs/piagent-core-research-sources-2026-09-06.json +0 -416
  227. package/packages/piagent-webui/dist/client/assets/index-DiKRmCEP.js +0 -176
@@ -580,11 +580,9 @@ operator diagnostics or recovery tools.
580
580
  | `piagent_exec_policy_check` | Explain the shell-policy verdict already enforced by the hook. |
581
581
  | `piagent_context_budget` | Diagnose candidate context files against hard caps. |
582
582
  | `piagent_tool_policy_check` | Diagnose tool capability registration. |
583
- | `piagent_task_gate_check` | Diagnose missing final proof during recovery. |
584
583
  | `piagent_memory_status` | Project memory policy/files/rules. |
585
584
  | `piagent_memory_search` | Keyword search `.pi/memory` markdown. |
586
585
  | `piagent_memory_note` | Append explicit durable memory note. |
587
- | `piagent_memory_citation_record` | Record memory evidence in task contract. |
588
586
  | `piagent_context_index_status` | Inspect the compact advisory project context index. |
589
587
  | `piagent_context_index_search` | Search context-index nodes before broad re-scouting. |
590
588
  | `piagent_context_index_record` | Record cited project/profile/tech/task context after onboarding or approved handoff. |
@@ -593,11 +591,11 @@ operator diagnostics or recovery tools.
593
591
  | `piagent_profile_tech_options` | Return select-style tech options for a profile family. |
594
592
  | `piagent_profile_tech_apply` | Apply profile + selected role tech stack and Context7 placeholders. |
595
593
  | `piagent_profile_tech_context_record` | Record a concise Context7 evidence snapshot for a selected tech. |
596
- | `piagent_task_start` | Create Task Implementation Contract. |
597
- | `piagent_task_progress` | Complete the normal review step or explicit custom/high-risk checkpoints. |
598
- | `piagent_context_record` | Recovery fallback for context manifest evidence. |
599
- | `piagent_verify_record` | Recovery fallback for an exact observed Pi bash result bound to the current tree. |
600
- | `piagent_trace_record` | Recovery/high-risk fallback for handoff or blocker state. |
594
+ | `piagent_document_read` | Read a document from the project or a granted `additionalReadRoots` directory (read-only). |
595
+ | `piagent_source_checkout` | Prepare an external Git repository for read-only inspection in this session. |
596
+ | `piagent_project_onboarding_record` | Record `.pi/project-context.md` after the agent has read the project. |
597
+
598
+ Retired in 1.9.0 with the task contract: `piagent_task_start`, `piagent_task_progress`, `piagent_task_gate_check`, `piagent_context_record`, `piagent_verify_record`, `piagent_trace_record` and `piagent_memory_citation_record`.
601
599
 
602
600
  ## Core capabilities
603
601
 
@@ -100,7 +100,6 @@ Mode hiện tại:
100
100
  | `piagent_memory_status` | Xem memory config/files/rules. |
101
101
  | `piagent_memory_note` | Ghi durable note khi user explicit ask. Có redaction cho token/key/connection-string phổ biến. |
102
102
  | `piagent_memory_search` | Keyword-search memory markdown. |
103
- | `piagent_memory_citation_record` | Ghi memory file đã ảnh hưởng task contract. |
104
103
  | `piagent_context_index_status` | Kiểm tra `.pi/context-index.json` có tồn tại/fresh/có citation không. |
105
104
  | `piagent_context_index_search` | Tìm node/edge/citation trong context index trước khi scout rộng. |
106
105
  | `piagent_context_index_record` | Ghi compact context graph sau onboarding hoặc approved handoff; không ghi transcript thô. |
@@ -111,11 +110,12 @@ Mode hiện tại:
111
110
 
112
111
  ```text
113
112
  /login
114
- /onboard
115
- /onboard run
113
+ /profile setup
116
114
  /memory
117
115
  ```
118
116
 
117
+ Rồi nhờ agent onboard project bằng lời thường (từ bản 1.9.0 không còn `/onboard`).
118
+
119
119
  `/memory-policy` vẫn là alias để xem cùng runtime status.
120
120
 
121
121
  ### Ghi nhớ explicit
@@ -12,9 +12,11 @@ chỉ hoạt động khi operator chọn mode tương ứng; `/model`, CLI `--mo
12
12
  ## Capability routing trước task
13
13
 
14
14
  Piagent có contract `low | medium | high | ultra`, tách khỏi tên model cụ thể.
15
- Mapping đánh giá OpenAI hiện tại là Luna/medium, Terra/medium, Sol/high và
16
- Sol/xhigh; authenticated catalog phải có đúng model/effort, nếu không decision
17
- trả `unavailable` thay vì substitute.
15
+ Mapping v2 hiện tại là GPT-6 Luna/medium, Sol/medium, Sol/high và
16
+ Astra/xhigh cho bốn tier `low | medium | high | ultra`. Mapping v1 của họ 5.6
17
+ chỉ dùng để đọc lại corpus benchmark lịch sử. Authenticated catalog phải có
18
+ đúng model/effort; khi GPT-6 chưa được cấp, router ghi rõ fallback 5.6 tương
19
+ ứng, và trả `unavailable` nếu cả hai lựa chọn đều vắng mặt.
18
20
 
19
21
  ```text
20
22
  PIAGENT_PARENT_ROUTING=off|shadow|recommend|auto
@@ -100,26 +102,31 @@ off, minimal, low, medium, high, xhigh, max
100
102
  Không phải model nào cũng hỗ trợ mọi level. Pi sẽ clamp theo capability của model. Cách chọn:
101
103
 
102
104
  ```bash
103
- pi --model openai-codex/gpt-5.6-sol:high
105
+ pi --model openai-codex/gpt-6-sol:high
104
106
  pi --model anthropic/claude-sonnet-5:xhigh
105
107
  pi --thinking medium
106
108
  ```
107
109
 
108
110
  ## Current latest-family catalog
109
111
 
110
- Đừng giới hạn vào vài ví dụ. Sau `pi update --models`, kiểm tra catalog local bằng `piagent-models`. Ở release hiện tại, các family/presets chính cần nhớ:
112
+ Đừng giới hạn vào vài ví dụ. Sau khi nâng Pi host, kiểm tra catalog đã đăng nhập bằng `piagent-models`. Có tên model trong SDK không đồng nghĩa tài khoản đã được cấp quyền dùng. Các tier dưới đây dựa trên [hướng dẫn chọn model](https://developers.openai.com/api/docs/guides/model-selection) và [catalog chính thức](https://developers.openai.com/api/docs/models), chưa phải kết quả benchmark Piagent–Codex của phiên bản này.
111
113
 
112
114
  ### Họ model OpenAI Codex
113
115
 
114
116
  | Model | Role gợi ý | Khi dùng |
115
117
  |---|---|---|
118
+ | `openai-codex/gpt-6-luna` | efficient | task rõ phạm vi, khối lượng lớn; tier low của router ở `medium` effort |
119
+ | `openai-codex/gpt-6-sol` | balanced coding | công việc hằng ngày; mặc định phiên mới ở `high` effort, tier medium ở `medium` |
120
+ | `openai-codex/gpt-6-astra` | frontier | task rộng, mơ hồ, nhiều bước; tier ultra ở `xhigh` |
116
121
  | `openai-codex/gpt-5.3-codex-spark` | fast scout | hỏi nhanh, thao tác nhỏ, chi phí thấp |
117
- | `openai-codex/gpt-5.4-mini` | fast/cheap | scout nhẹ, docs, simple fix |
118
- | `openai-codex/gpt-5.4` | balanced | task bình thường |
119
122
  | `openai-codex/gpt-5.5` | balanced/hard | model thế hệ trước vẫn được hỗ trợ khi có trong authenticated catalog |
120
- | `openai-codex/gpt-5.6-luna` | cost-sensitive/high-volume | workload nhanh, nhiều lượt, ưu tiên latency và chi phí |
121
- | `openai-codex/gpt-5.6-terra` | balanced | công việc hằng ngày cần cân bằng capability, speed và cost |
122
- | `openai-codex/gpt-5.6-sol` | frontier/quality-first | task phức tạp, long-horizon hoặc cần chất lượng cao nhất |
123
+ | `openai-codex/gpt-5.6-luna` | legacy fallback low | dùng khi GPT-6 Luna chưa có trong authenticated catalog |
124
+ | `openai-codex/gpt-5.6-terra` | legacy fallback medium | dùng khi GPT-6 Sol chưa có trong authenticated catalog |
125
+ | `openai-codex/gpt-5.6-sol` | legacy fallback high/ultra | giữ phiên cũ và benchmark lịch sử; dùng khi GPT-6 Sol/Astra chưa có |
126
+
127
+ `gpt-5.4` và `gpt-5.4-mini` không còn trong catalog Codex đã đăng nhập (kiểm tra ngày 2026-10-01) nên đã bỏ khỏi preset; settings cũ còn ghi chúng chỉ sinh cảnh báo `No models match pattern` khi mở Pi. `piagent-doctor` liệt kê những mẫu không còn khớp model nào Pi biết; `piagent-model-scope --prune` chỉ xoá đúng những mẫu đó và giữ nguyên phần còn lại (thêm `--dry-run` để xem trước). Mẫu của provider chỉ đang đăng xuất vẫn được giữ.
128
+
129
+ Pi 0.87.1 khai báo cả ba GPT-6 model trên đường `openai-codex` và `openai`. Catalog Codex của Pi hiện khai báo cửa sổ context 272.000 token; tài liệu API công bố 1,05 triệu token. Hãy dùng giới hạn do host/provider của phiên thực tế cung cấp, không lấy giới hạn API để giả định cho đăng nhập Codex. Astra không hỗ trợ thinking `off`; Sol và Luna có hỗ trợ. Router chỉ chọn model/effort khớp đúng catalog đã đăng nhập, ghi `legacy-model-fallback` khi phải chọn 5.6, và vẫn giữ nguyên model người dùng pin rõ ràng.
123
130
 
124
131
  ### Họ model Claude (Anthropic)
125
132
 
@@ -145,11 +152,9 @@ available nào trong authenticated provider catalog.
145
152
 
146
153
  | Preset | Model OpenAI Codex | Model Claude (Anthropic) | Khi dùng |
147
154
  |---|---|---|---|
148
- | Fast scout | `openai-codex/gpt-5.4-mini:low` | `anthropic/claude-haiku-4-5:low` | đọc nhanh, hỏi đáp, grep/scout nhẹ |
149
- | Balanced implement | `openai-codex/gpt-5.6-terra:medium` | `anthropic/claude-sonnet-5:medium` | task source bình thường |
150
- | Cost-sensitive volume | `openai-codex/gpt-5.6-luna:medium` | `anthropic/claude-haiku-4-5:low` | workload nhanh, nhiều lượt; đo quality gate trước khi promote |
151
- | Balanced implement | `openai-codex/gpt-5.6-terra:high` hoặc `openai-codex/gpt-5.5:high` | `anthropic/claude-sonnet-5:high` | task source hằng ngày, cân bằng capability/cost |
152
- | Frontier/quality-first | `openai-codex/gpt-5.6-sol:high` | `anthropic/claude-opus-4-7:xhigh` hoặc `anthropic/claude-opus-4-8:xhigh` | architecture, long-horizon, high-risk review |
155
+ | Focused/volume | `openai-codex/gpt-6-luna:medium` | `anthropic/claude-haiku-4-5:low` | task nhỏ, rõ phạm vi và có cách kiểm tra |
156
+ | Balanced implement | `openai-codex/gpt-6-sol:medium` hoặc `:high` | `anthropic/claude-sonnet-5:high` | task source bình thường |
157
+ | Frontier/quality-first | `openai-codex/gpt-6-astra:xhigh` | `anthropic/claude-opus-4-8:xhigh` | task rộng, mơ hồ, nhiều bước |
153
158
 
154
159
  Tên model có thể đổi theo Pi model catalog. Khi không chắc, ưu tiên `/model` hoặc `pi --list-models`.
155
160
 
@@ -158,7 +163,7 @@ Tên model có thể đổi theo Pi model catalog. Khi không chắc, ưu tiên
158
163
  Global setup mặc định:
159
164
 
160
165
  ```bash
161
- piagent-model-scope --preset full --default-model openai-codex/gpt-5.6-sol:high
166
+ piagent-model-scope --preset full --default-model openai-codex/gpt-6-sol:high
162
167
  ```
163
168
 
164
169
  Scope này ghi vào settings:
@@ -179,7 +184,7 @@ Shift+Tab
179
184
  Nếu muốn đặt default khác:
180
185
 
181
186
  ```bash
182
- piagent-model-scope --preset full --default-model openai-codex/gpt-5.6-sol:high
187
+ piagent-model-scope --preset full --default-model openai-codex/gpt-6-sol:high
183
188
  piagent-model-scope --preset full --default-model anthropic/claude-sonnet-5:xhigh
184
189
  ```
185
190
 
@@ -16,7 +16,7 @@ Chọn provider theo danh sách Pi hiển thị. Sau đó kiểm tra:
16
16
 
17
17
  ```text
18
18
  /model
19
- /model-options
19
+ /piagent-status
20
20
  ```
21
21
 
22
22
  Hoặc:
@@ -18,13 +18,13 @@ Support matrix release hiện tại: macOS Apple Silicon + Bash và Linux x64 +
18
18
 
19
19
  ```bash
20
20
  node --version # >= 22.19.0
21
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.86.1
22
- npm install -g --ignore-scripts @piagent/platform@1.7.1
21
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
22
+ npm install -g --ignore-scripts @piagent/platform@1.9.0
23
23
  piagent-install --stable --dry-run
24
24
  piagent-install --stable
25
25
  ```
26
26
 
27
- 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.7.1`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
27
+ 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.9.0`. Máy cá nhân có thể dùng `git:github.com/Vt-mmm/piagent` để theo latest.
28
28
 
29
29
  Nếu đang ở source checkout của platform, dùng helper theo channel để preview trước khi đổi:
30
30
 
@@ -38,7 +38,7 @@ bash scripts/install-global.sh --stable
38
38
  Full update phải đồng bộ exact Pi host trước, rồi npm-global helper và Pi package matching:
39
39
 
40
40
  ```bash
41
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.86.1
41
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
42
42
  npm install -g --ignore-scripts @piagent/platform@X.Y.Z
43
43
  piagent-install --stable --dry-run
44
44
  piagent-install --stable
@@ -99,8 +99,8 @@ install package once
99
99
  ### Cài Pi và package platform
100
100
 
101
101
  ```bash
102
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.86.1
103
- npm install -g --ignore-scripts @piagent/platform@1.7.1
102
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
103
+ npm install -g --ignore-scripts @piagent/platform@1.9.0
104
104
  piagent-install --stable --dry-run
105
105
  piagent-install --stable
106
106
  ```
@@ -205,21 +205,23 @@ Gợi ý:
205
205
  Sau `/login` và `/model`, chạy:
206
206
 
207
207
  ```text
208
- /commands
209
208
  /mcp
210
209
  /subagents-doctor
211
- /onboard
212
- /onboard run
210
+ /profile setup
213
211
  /memory
214
212
  ```
215
213
 
216
- `/onboard` mở menu/status runtime. `/onboard run` sẽ:
214
+ Từ bản 1.9.0 không còn `/onboard`. Nhờ agent onboard bằng lời thường:
215
+
216
+ ```text
217
+ Đọc project này (chỉ đọc) và ghi lại project context.
218
+ ```
219
+
220
+ Agent sẽ:
217
221
 
218
222
  1. đọc repo theo context budget;
219
- 2. detect profile phù hợp;
220
- 3. mở select-style profile/tech setup;
221
- 4. hỏi user trước khi apply nếu workflow chạy qua tool write;
222
- 5. ghi project profile, tech stack và context.
223
+ 2. đề xuất profile phù hợp (`/profile setup` để chọn profile/tech bằng select);
224
+ 3. ghi `.pi/project-context.md` và `.pi/context-index.json` bằng tool onboarding của Piagent.
223
225
 
224
226
  File chính được tạo/cập nhật:
225
227
 
@@ -235,7 +237,7 @@ File chính được tạo/cập nhật:
235
237
  .pi/memory/MEMORY.md
236
238
  ```
237
239
 
238
- Nếu `.pi/project-context.md` còn `Generated: not yet`, hoặc `/context index` báo index đang pending/stale, không nên chạy `/workflow task` implementation lớn. Chạy lại `/onboard run` trước.
240
+ Nếu `.pi/project-context.md` còn `Generated: not yet`, hoặc `/context index` báo index đang pending/stale, nên nhờ agent onboard lại trước khi giao việc implement lớn.
239
241
 
240
242
  ### Đổi profile sau này
241
243
 
@@ -283,7 +285,7 @@ Không phải daily default. Dùng khi muốn tạo sẵn `.pi` files cho projec
283
285
  bash /path/to/piagent/scripts/setup.sh /path/to/project \
284
286
  --project-only \
285
287
  --profile auto \
286
- --package-source git:github.com/Vt-mmm/piagent@v1.7.1 \
288
+ --package-source git:github.com/Vt-mmm/piagent@v1.9.0 \
287
289
  --mcp-preset core \
288
290
  --subagents-preset safe
289
291
  ```
@@ -306,45 +308,41 @@ bash /path/to/piagent/scripts/configure-subagents.sh --preset safe
306
308
 
307
309
  ## 4. Daily task workflow
308
310
 
311
+ Từ bản 1.9.0, mọi việc được yêu cầu bằng lời thường; không còn `/workflow`,
312
+ `/task`, `/scout`, `/fresh` và không có task contract. Nói rõ ý định (chỉ đọc,
313
+ chỉ lập kế hoạch, hay cho sửa) ngay trong câu yêu cầu.
314
+
309
315
  ### Requirement chưa rõ
310
316
 
311
317
  ```text
312
- /workflow discuss Cải tiến workflow onboarding cho team mới. Chưa implement, chỉ hỏi phần thiếu và đề xuất plan.
318
+ Cải tiến onboarding cho team mới. Chưa implement, chỉ hỏi phần còn thiếu và đề xuất plan.
313
319
  ```
314
320
 
315
321
  ### Cần plan trước
316
322
 
317
323
  ```text
318
- /workflow plan Implement header sale menu hover stabilization. Include scope, files, verify commands, and risks.
324
+ Lập plan cho header sale menu hover stabilization: scope, file, lệnh verify và rủi ro. Chưa sửa code.
319
325
  ```
320
326
 
321
327
  ### Task rõ, cho implement
322
328
 
323
329
  ```text
324
- /workflow task Implement header sale menu hover stabilization. Add component tests and run relevant verify.
330
+ Implement header sale menu hover stabilization. Thêm component test và chạy verify liên quan.
325
331
  ```
326
332
 
327
333
  ### Scout/audit read-only
328
334
 
329
335
  ```text
330
- /workflow scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
336
+ Scout payment FE mapping vs BE contract. Backend read-only. Không sửa source.
331
337
  ```
332
338
 
333
- Use `/workflow scout` cho payment/auth/data/contract mapping khi mục tiêu là chốt evidence trước, chưa sửa code.
339
+ Dùng yêu cầu scout cho payment/auth/data/contract mapping khi mục tiêu là chốt evidence trước, chưa sửa code. Muốn chắc chắn không có lệnh ghi nào chạy, đổi session sang `/permission read-only`.
334
340
 
335
341
  ### Task mới khi session đã nặng
336
342
 
337
- Nếu `/usage` cho thấy context cao, hoặc Pi báo context overflow, dùng fresh workflow. Đây là ba ví dụ thường dùng; `/fresh help` liệt kê đầy đủ catalog canonical:
338
-
339
- ```text
340
- /fresh scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
341
- /fresh task Implement <bounded task>.
342
- /fresh be-to-fe Implement FE support for <BE contract>. Backend read-only.
343
- ```
344
-
345
- Các command này tự mở session mới và replay prompt workflow ngắn. Anh không cần tự chạy `pi --name ...` rồi paste lại.
346
-
347
- Input guard của platform cũng tự collapse prompt có full `Mandatory flow` boilerplate. Quy tắc vận hành: user chỉ mô tả task; checklist nằm trong platform prompt/piagent tools.
343
+ Nếu `/usage` cho thấy context cao, hoặc Pi báo context overflow, mở session mới
344
+ bằng `/new` (hoặc `/compact`) rồi nói lại yêu cầu. Không cần paste checklist:
345
+ guard tự áp policy cho từng tool call.
348
346
 
349
347
  ### Gửi ảnh/screenshot trong chat
350
348
 
@@ -361,7 +359,7 @@ lưu screenshot vào `~/Documents/team-screenshots` rồi thêm folder đó vào
361
359
  Sau đó để nguyên path trong prompt:
362
360
 
363
361
  ```text
364
- /workflow scout Scout UI issue from screenshot ~/Documents/team-screenshots/screenshot.png
362
+ Scout lỗi UI trong ảnh ~/Documents/team-screenshots/screenshot.png. Chỉ đọc.
365
363
  ```
366
364
 
367
365
  Piagent guard sẽ xử lý trước khi model nhận input:
@@ -385,19 +383,19 @@ prompt.
385
383
 
386
384
  ```text
387
385
  /profile be-readonly-fe
388
- /workflow be-to-fe Implement frontend support from backend endpoint/spec <name>. Backend is read-only.
386
+ Implement frontend support from backend endpoint/spec <name>. Backend is read-only.
389
387
  ```
390
388
 
391
389
  ### Cải tiến platform
392
390
 
393
391
  ```text
394
- /workflow platform-improve Improve MCP setup docs and subagent command guidance for team usage.
392
+ Improve MCP setup docs and subagent command guidance for team usage.
395
393
  ```
396
394
 
397
395
  ### Review trước final
398
396
 
399
397
  ```text
400
- /workflow review current diff
398
+ Review diff hiện tại: correctness, test còn thiếu, scope drift. Chỉ đọc.
401
399
  ```
402
400
 
403
401
  ### Commit và pull request
@@ -405,11 +403,11 @@ prompt.
405
403
  Git trong Pi Agent là capability + guard, không có namespace `/git-*`. Khi muốn gom việc hiện tại:
406
404
 
407
405
  ```text
408
- /workflow commit docs: update onboarding notes
409
- /workflow pr Add guarded git workflow
406
+ Commit các file docs vừa sửa với message "docs: update onboarding notes". Không push.
407
+ Tạo draft PR cho branch này, title "Add guarded git notes".
410
408
  ```
411
409
 
412
- `/workflow commit` inspect status/diff, stage đúng scope, verify phù hợp, rồi commit local; không push. `/workflow pr` inspect branch/diff/commit rồi hỏi xác nhận trước khi `git push` hoặc tạo/cập nhật GitHub PR. Alias `/commit` và `/pr` vẫn chạy cho power user. Các lệnh stage rộng như `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` cũng phải qua confirmation.
410
+ Guard hỏi xác nhận trước khi `git push` hoặc tạo/cập nhật GitHub PR. Các lệnh stage rộng như `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` cũng phải qua confirmation.
413
411
 
414
412
  ### Preflight, live status và receipt
415
413
 
@@ -429,14 +427,9 @@ Read-only/plan/review không bao giờ hiện implementation authorization. Dòn
429
427
  `host execution is not a sandbox` là boundary thật: Piagent policy giảm lỗi thao
430
428
  tác nhưng không cô lập code khỏi account của operator.
431
429
 
432
- `/piagent-status` đọc Task Contract, checkpoint, trajectory, verifier, recovery,
433
- helper và resume state đã lưu, không hỏi model nhớ lại. Khi terminal, JSON detail
434
- có completion receipt: outcome, acceptance, changed-tree identity, exact verify,
435
- review/helper/recovery, remaining risk và handoff. Receipt chỉ gọi là complete
436
- khi hard completion gate trên working tree hiện tại pass, trace terminal là
437
- `completed`, và mọi acceptance criterion đều satisfied. Thiếu gate evidence phải
438
- fail closed thay vì suy đoán từ state cũ; evidence cùng runtime không được
439
- gọi là independent audit. Tắt từng lớp bằng `PIAGENT_SOLVER_MODE=off`,
430
+ `/piagent-status` đọc state đã lưu (profile, guard, runtime, model), không hỏi
431
+ model nhớ lại. Từ bản 1.9.0 session không còn Task Contract, checkpoint hay
432
+ completion receipt; bản ghi task của các bản trước chỉ còn để xem lịch sử. Tắt từng lớp bằng `PIAGENT_SOLVER_MODE=off`,
440
433
  `PIAGENT_PHASE_TOOLS=off`, `PIAGENT_AUTO_RECOVERY=off`, hoặc
441
434
  `PIAGENT_HELPERS_MODE=off`. Hai lớp semantic có kill switch độc lập:
442
435
  `PIAGENT_ACCEPTANCE_ASSURANCE=off` tắt assurance và semantic repair phụ thuộc,
@@ -447,12 +440,11 @@ giữ để có thể tạo attempt mới có provenance rõ ràng.
447
440
  `/piagent-inspector` là một namespace read-only, không sinh thêm command rời.
448
441
  Gõ không tham số để chọn `summary`, `files`, `commands`, `security`, `context`
449
442
  hoặc `toggle`. Panel bốn dòng tự hiện sát phía trên footer native từ lúc mở session:
450
- phase và việc hiện tại; task file/test, `+/-`, command pass/fail/block, safety và
443
+ việc hiện tại; file/test đã đổi, `+/-`, command pass/fail/block, safety và
451
444
  context budget. Nó dùng extension-status API nên không thay footer native của
452
- Pi và không thêm bước bắt buộc vào workflow. Dòng status dùng file task đã quan
453
- sát để phản hồi nhanh; view `files` tính exact snapshot delta. Task đụng file dirty từ trước được
454
- đánh dấu mixed baseline; token theo từng built-in tool luôn unavailable vì Pi
455
- chỉ cung cấp usage exact theo response/turn.
445
+ Pi và không thêm bước bắt buộc nào. Dòng status dùng working-tree status; token
446
+ theo từng built-in tool luôn unavailable vì Pi chỉ cung cấp usage exact theo
447
+ response/turn.
456
448
 
457
449
  Known unsupported/unpromoted surfaces của candidate hiện tại: parent routing
458
450
  đã có `off|shadow|recommend|auto`, nhưng extension `auto` fail-closed về
@@ -478,59 +470,42 @@ piagent-route --prompt-file /path/to/task.txt --execute --yes -- --approve
478
470
  Lệnh này dùng authenticated `pi --list-models`, không đọc credential store,
479
471
  không ghi raw task vào route sidecar, giữ hard pin, và từ chối task bị blocked.
480
472
 
481
- ## 5. Control flow của một task chuẩn
473
+ ## 5. Control flow của một lượt sửa code
482
474
 
483
- Một source-changing task nên đi qua:
475
+ Từ bản 1.9.0 một yêu cầu sửa code đi qua:
484
476
 
485
477
  ```text
486
- intake
487
- -> session name + profile/context
488
- -> session-bound task contract v2
489
- -> runtime-observed context manifest
490
- -> implementation
491
- -> baseline-aware changed files
492
- -> every exact verify command
493
- -> current-tree verify evidence from tool_result
494
- -> completion hook: trace + final gate
495
- -> immutable outcome / retry handoff
478
+ yêu cầu bằng lời thường
479
+ -> profile/context của project
480
+ -> agent đọc file đích và test gần nhất
481
+ -> sửa bằng read/edit/write/apply_patch/bash
482
+ (guard kiểm tra từng tool call: protected path, read-only path, quyền,
483
+ context budget, edit trên bản đọc cũ, xác nhận destructive/external)
484
+ -> chạy lệnh check của project
485
+ -> báo file đã đổi, kết quả verify, rủi ro còn lại
496
486
  ```
497
487
 
498
- Trong task nhỏ và rõ scope, runtime tạo contract trước model turn đầu tiên nên
499
- model không gọi management tool nào. Task rộng, high-risk hoặc scope mơ hồ mới
500
- fallback về một `piagent_task_start`. Các tool còn lại bên dưới là bề mặt
501
- operator/diagnostics/recovery, không phải checklist phải gọi mỗi task.
488
+ Không còn task contract, scope khai báo, work plan, completion gate hay receipt.
489
+ Trong khung công ty (`piagent studio`), các bước plan/check/review mỗi lượt do
490
+ Harness của team trong Studio quy định; xem [nghiệm thu local](managed-local-acceptance.md).
502
491
 
503
- Các Piagent tools:
492
+ Các Piagent tools còn lại là bề mặt operator/diagnostics, không phải checklist phải gọi mỗi lượt:
504
493
 
505
494
  | Tool | Vai trò |
506
495
  |---|---|
507
496
  | `piagent_context` | Đọc active profile, required context, verify commands, MCP/memory settings. |
508
497
  | `piagent_context_index_status/search/record` | Kiểm tra/tìm/ghi context index advisory có citation. |
509
- | `piagent_task_start` | Fallback intake cho task rộng/high-risk/mơ hồ; scope chỉ nhận project-relative path/glob. |
510
- | `piagent_task_progress` | Chuyển step trong work plan và ghi failure/ruled-out evidence. |
511
- | `piagent_context_record` | Recovery: bổ sung context manifest khi observer không đủ. |
512
498
  | `piagent_exec_policy_check` | Diagnostics: giải thích shell-policy verdict; runtime vẫn check mọi call. |
513
499
  | `piagent_context_budget` | Diagnostics: xem budget của file/context lớn. |
514
500
  | `piagent_tool_policy_check` | Diagnostics: xem capability verdict của tool/MCP. |
515
- | `piagent_verify_record` | Recovery: đối chiếu verify với bash result thật sau task start. |
516
- | `piagent_trace_record` | Recovery/high-risk: ghi outcome hoặc blocker thủ công. |
517
- | `piagent_task_gate_check` | Diagnostics/recovery: xem missing final proof. |
501
+ | `piagent_document_read` | Đọc tài liệu ngoài project trong `additionalReadRoots` (chỉ đọc). |
502
+ | `piagent_source_checkout` | Chuẩn bị repo ngoài để đọc (read-only cho session). |
503
+ | `piagent_project_onboarding_record` | Ghi `.pi/project-context.md` sau khi agent đọc project. |
518
504
  | `piagent_usage_snapshot` | Snapshot session/model/context. |
519
505
 
520
- Done đúng nghĩa:
521
-
522
- - task contract v2 gắn đúng session hiện tại;
523
- - có context manifest;
524
- - mọi verify command đã chạy thật và khớp `task.verifyCommands`;
525
- - changed files khác baseline, có evidence và nằm trong scope;
526
- - work plan không còn step pending/in-progress/failed;
527
- - trace outcome rõ;
528
- - final gate pass hoặc ghi rõ blocked/partial.
529
-
530
- Source task yêu cầu Git working tree và meaningful verifier ngay từ lúc start.
531
- Một session chỉ dùng cho một task. Retry mở session mới với cùng `taskId`; runtime
532
- giữ previous attempt evidence và từ chối vượt `maxAttempts`. Contract đã terminal
533
- không thể sửa thêm context/verify/trace để viết lại lịch sử.
506
+ Các tool `piagent_task_start`, `piagent_task_progress`, `piagent_context_record`,
507
+ `piagent_verify_record`, `piagent_trace_record` và `piagent_task_gate_check` đã bỏ
508
+ từ bản 1.9.0.
534
509
 
535
510
  ## 6. Guardrails cần hiểu
536
511
 
@@ -798,10 +773,9 @@ pi --continue
798
773
 
799
774
  Nếu `--continue` không đúng phiên cần làm, mở selector bằng `pi --resume`, chọn theo session name đã đặt. Khi resume đúng session cũ, tên session vẫn là tên đã set; nếu cần chỉnh lại cho khớp task nội bộ thì chạy `/name <new name>` ngay trước khi làm tiếp.
800
775
 
801
- Task Contract v2 map bằng `sessionId` và Pi custom trace, không dựa riêng vào tên.
802
- Đổi tên sau khi task bắt đầu sẽ cập nhật contract để Agent Watch/report dùng tên
803
- mới. Không fork/reuse một session terminal cho task khác; retry hoặc task mới mở
804
- session mới để usage/prompt/change evidence không bị trộn.
776
+ Agent Watch/report map session bằng `sessionId` và Pi custom trace, không dựa
777
+ riêng vào tên; đổi tên bằng `/name` sẽ được ghi nhận. Nên mở session mới cho việc
778
+ mới để usage/prompt/change evidence không bị trộn.
805
779
 
806
780
  ### Khi nào nên resume, continue, fork
807
781
 
@@ -944,7 +918,7 @@ Default safe config:
944
918
 
945
919
  ### Auto-delegation
946
920
 
947
- Với `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, `/workflow review`, parent agent tự suy luận và implement. Helper mặc định tắt. Khi operator bật rõ, runtime chỉ được dispatch một helper read-only, context fresh, nếu có ít nhất hai lane độc lập và projected net token saving từ 30% sau handoff/merge. Worker, retry, nested và parallel helper đều tắt. Alias cũ như `/task` giữ cùng policy.
921
+ Với mọi yêu cầu (implement, plan, review…), parent agent tự suy luận và implement. Helper mặc định tắt. Khi operator bật rõ, runtime được dispatch tối đa hai helper read-only, context fresh (không inherit history, handoff tối đa 2.048 token). Ước tính tiết kiệm token chỉ là telemetry. Worker, retry và nested helper đều tắt.
948
922
 
949
923
  Kiểm tra nhanh policy:
950
924
 
@@ -957,9 +931,10 @@ Không cần tự gọi `/run` cho task bình thường. Chỉ dùng `/run` khi
957
931
  Helper chỉ đủ điều kiện khi đồng thời:
958
932
 
959
933
  - operator đã opt-in;
960
- - có ít nhất hai workstream độc lập và helper không phụ thuộc output tiếp theo của parent;
961
- - context chuyển giao fresh, tối đa 2.048 token và không inherit history;
962
- - tổng token parent + helper + handoff + merge được dự báo thấp hơn solo ít nhất 30%.
934
+ - tổng số helper của phiên chưa quá 2 và helper chỉ đọc;
935
+ - context chuyển giao fresh, tối đa 2.048 token và không inherit history.
936
+
937
+ Dự báo tiết kiệm token vẫn được ghi để theo dõi nhưng không còn là điều kiện (bounded-delegation-v2).
963
938
 
964
939
  Không nên spawn khi:
965
940
 
@@ -1024,8 +999,8 @@ Watchdog là optional adversarial reviewer ở cuối turn, không bật mặc
1024
999
 
1025
1000
  | Command | Dùng để |
1026
1001
  |---|---|
1027
- | `npm install -g --ignore-scripts @piagent/platform@1.7.1` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
1028
- | `pi install git:github.com/Vt-mmm/piagent@v1.7.1` | Install pinned release cho reproducible team setup. |
1002
+ | `npm install -g --ignore-scripts @piagent/platform@1.9.0` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
1003
+ | `pi install git:github.com/Vt-mmm/piagent@v1.9.0` | Install pinned release cho reproducible team setup. |
1029
1004
  | `pi install git:github.com/Vt-mmm/piagent` | Install latest platform package cho máy cá nhân/sandbox. |
1030
1005
  | 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). |
1031
1006
  | 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. |
@@ -1072,17 +1047,13 @@ Watchdog là optional adversarial reviewer ở cuối turn, không bật mặc
1072
1047
  | `/model` / `Ctrl+L` | Chọn model. |
1073
1048
  | `Ctrl+P` | Cycle scoped models. |
1074
1049
  | `Shift+Tab` | Cycle thinking level. |
1075
- | `/commands` | Menu/help command runtime theo topic. |
1076
- | `/piagent-inspector` | Menu read-only cho task diff/file test/line, command, safety và context; `toggle` ẩn/hiện panel bốn dòng trong session. |
1077
- | `/workflow` | Menu task/scout/review/git/onboard workflow. |
1050
+ | `/piagent-inspector` | Menu read-only cho diff/file test/line, command, safety và context; `toggle` ẩn/hiện panel bốn dòng trong session. |
1078
1051
  | `/permission` | Menu permission status/read-only/workspace-write/full-access. |
1079
1052
  | `/permission status` | Xem permission profile hiện tại. |
1080
1053
  | `/permission read-only` | Chuyển session sang read-only. |
1081
1054
  | `/permission workspace-write` | Chuyển session sang write chuẩn. |
1082
1055
  | `/permission full-access` | Bật trusted full-access cho session hiện tại. |
1083
1056
  | `/permission full-access <task>` | Bật trusted full-access rồi gửi `<task>` cho agent làm tiếp. |
1084
- | `/onboard` | Menu/status onboarding runtime. |
1085
- | `/onboard run` | Onboard/read project lần đầu. |
1086
1057
  | `/context` | Menu context index/search/preflight/compact. |
1087
1058
  | `/context index` | Xem compact context index, không gọi model follow-up. |
1088
1059
  | `/context search <keyword>` | Tìm node/edge/citation trong context index. |
@@ -1100,25 +1071,13 @@ Watchdog là optional adversarial reviewer ở cuối turn, không bật mặc
1100
1071
  | `/usage` | Snapshot context/session. |
1101
1072
  | `/usage logs` | Xem capture output dài đã compact. |
1102
1073
  | `/name` | Đặt/đổi tên session theo task để report dễ map. |
1103
- | `/fresh` | Mở session mới cho mọi workflow canonical khi phiên hiện tại nặng; xem lựa chọn bằng `/fresh help`. |
1074
+ | `/new` | Pi native: mở session mới khi phiên hiện tại nặng. |
1104
1075
  | `/name <name>` | Đổi tên session cho resume/report. |
1105
1076
  | `/session` | Pi native session stats/info. |
1106
1077
  | `/mcp` / `/mcp tools` | Check MCP. |
1107
1078
  | `/subagents-doctor` | Check subagent setup. |
1108
1079
  | `/subagents-fleet` | Follow child sessions. |
1109
1080
  | `/subagent-cost` | Check subagent token/cost. |
1110
- | `/workflow discuss <request>` | Làm rõ, không sửa. |
1111
- | `/workflow plan <goal>` | Lập plan. |
1112
- | `/workflow scout <request>` | Scout/audit read-only. |
1113
- | `/fresh scout <request>` | Tự mở session mới rồi chạy scout workflow. |
1114
- | `/fresh task <request>` | Tự mở session mới rồi chạy task workflow. |
1115
- | `/fresh be-to-fe <request>` | Tự mở session mới rồi chạy BE-to-FE workflow. |
1116
- | `/workflow task <request>` | Implement task. |
1117
- | `/workflow be-to-fe <request>` | BE read-only, FE implementation. |
1118
- | `/workflow platform-improve <request>` | Cải tiến platform. |
1119
- | `/workflow review [scope]` | Review diff/source. |
1120
- | `/workflow commit [message/scope]` | Commit local qua workflow có guard. |
1121
- | `/workflow pr [title/request]` | Chuẩn bị PR, hỏi trước khi push/GitHub write. |
1122
1081
 
1123
1082
  ## 12. Troubleshooting
1124
1083
 
@@ -1137,7 +1096,7 @@ Mở lại Pi session sau khi install.
1137
1096
  Cài lại terminal helper đúng release rồi kiểm tra `PATH`:
1138
1097
 
1139
1098
  ```bash
1140
- npm install -g --ignore-scripts @piagent/platform@1.7.1
1099
+ npm install -g --ignore-scripts @piagent/platform@1.9.0
1141
1100
  command -v piagent-install
1142
1101
  ```
1143
1102
 
@@ -1222,21 +1181,17 @@ pi --session <session-id>
1222
1181
  pi --session /absolute/path/to/session.jsonl
1223
1182
  ```
1224
1183
 
1225
- ### Verify evidence không được nhận
1226
-
1227
- Nguyên nhân thường gặp:
1184
+ ### Lệnh/tool bị chặn
1228
1185
 
1229
- - agent ghi `piagent_verify_record` nhưng chưa chạy bash verify thật;
1230
- - command string không exact-match `task.verifyCommands`;
1231
- - verify chạy trước `task.createdAt`;
1232
- - verify chạy ở cwd khác;
1233
- - subagent chạy nhưng parent chưa thấy persisted ledger đúng cwd.
1186
+ Guard luôn ghi lý do khi chặn. Nguyên nhân thường gặp:
1234
1187
 
1235
- Fix:
1188
+ - đụng protected path (`.env`, `auth.json`, `.pi/piagent-state/**`…) hoặc read-only path của profile;
1189
+ - permission `read-only` (chặn ghi và shell) — đổi bằng `/permission`;
1190
+ - file quá lớn so với context budget;
1191
+ - file đã đổi từ lần đọc trước (`previously observed source snapshot is stale`) — đọc lại file một lần rồi sửa;
1192
+ - lệnh destructive/external cần xác nhận mà người vận hành chưa đồng ý.
1236
1193
 
1237
- ```text
1238
- Run the exact verify command from task.verifyCommands in the project cwd, then record verify evidence again.
1239
- ```
1194
+ Xem chi tiết bằng `/piagent-inspector security`, hoặc giải thích một lệnh shell trước khi chạy bằng `piagent-explain "<lệnh>"` từ terminal.
1240
1195
 
1241
1196
  ## 13. Không commit
1242
1197
 
@@ -92,13 +92,13 @@ Manifest data never executes code. Invalid paths, symbolic links, dependency cyc
92
92
 
93
93
  | Capability | Implementation |
94
94
  |---|---|
95
- | Project onboarding | `/onboard run` + `piagent_project_onboarding_record` |
95
+ | Project onboarding | plain request + `piagent_project_onboarding_record` |
96
96
  | Project context index | `/context` + `piagent_context_index_*` |
97
97
  | Profile switching | `/profile` + `piagent_profile_options` / `piagent_profile_apply` |
98
98
  | Explicit memory | `/memory` + `piagent_memory_*` |
99
- | Task lifecycle | `/workflow task` + task/context/verify/trace tools |
100
- | Platform workflow | `/workflow platform-improve` |
101
- | Backend-readonly to frontend | `/workflow be-to-fe` |
99
+ | Task lifecycle | retired in 1.9.0; turns are freeform |
100
+ | Platform workflow | plain request |
101
+ | Backend-readonly to frontend | `/profile be-readonly-fe` + plain request |
102
102
  | Source cache | `piagent-source-cache` + `piagent_source_checkout` |
103
103
  | Subagent roles | `piagent-scout`, `piagent-planner`, `piagent-worker`, `piagent-reviewer`, `piagent-oracle` |
104
104
  | Quality benchmark | `scripts/benchmark-runner.mjs` + `benchmark/benchmark-core.js`; legacy recorder: `scripts/quality-benchmark.sh` |