@piagent/platform 1.6.0 → 1.6.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.
Files changed (213) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +17 -14
  3. package/README.vi.md +26 -1
  4. package/benchmarks/production-v1/spend-control.v1.json +27 -3
  5. package/benchmarks/production-v1/suite.json +5 -1
  6. package/catalog/capabilities.json +16 -16
  7. package/docs/authority-manifest.md +1 -1
  8. package/docs/auto-delegation-policy.md +38 -73
  9. package/docs/command-reference-vietnamese.md +23 -31
  10. package/docs/context-engine.md +5 -3
  11. package/docs/context-window-policy.md +37 -1
  12. package/docs/distribution-standard.md +7 -7
  13. package/docs/en/architecture.md +26 -13
  14. package/docs/languages.json +4 -4
  15. package/docs/operator-manual-vietnamese.md +21 -41
  16. package/docs/publishing-for-teams.md +5 -0
  17. package/docs/quality-benchmark.md +179 -23
  18. package/docs/release-install-policy.md +6 -6
  19. package/docs/runtime-harness-standard.md +3 -3
  20. package/docs/security-threat-model.md +1 -1
  21. package/docs/subagent-orchestration-capabilities.md +19 -51
  22. package/docs/subagents-and-multiagent.md +21 -47
  23. package/docs/task-implementation-contract.md +3 -3
  24. package/docs/task-lifecycle-vietnamese.md +1 -1
  25. package/docs/team-onboarding.md +2 -2
  26. package/docs/vi/architecture.md +26 -13
  27. package/docs-site/architecture.html +1 -1
  28. package/docs-site/benchmark.html +89 -95
  29. package/docs-site/commands.html +1 -1
  30. package/docs-site/content/benchmark.html +88 -94
  31. package/docs-site/content/en/benchmark.html +134 -90
  32. package/docs-site/content/en/index.html +19 -19
  33. package/docs-site/content/en/runtime.html +4 -4
  34. package/docs-site/content/en/whats-new.html +12 -1
  35. package/docs-site/content/en/workflows.html +2 -2
  36. package/docs-site/content/index.html +19 -19
  37. package/docs-site/content/runtime.html +4 -4
  38. package/docs-site/content/whats-new.html +12 -1
  39. package/docs-site/content/workflows.html +2 -2
  40. package/docs-site/context-engine.html +1 -1
  41. package/docs-site/en/architecture.html +1 -1
  42. package/docs-site/en/benchmark.html +135 -91
  43. package/docs-site/en/commands.html +1 -1
  44. package/docs-site/en/context-engine.html +1 -1
  45. package/docs-site/en/index.html +20 -20
  46. package/docs-site/en/mcp-approval.html +1 -1
  47. package/docs-site/en/mcp-auth.html +1 -1
  48. package/docs-site/en/mcp-servers.html +1 -1
  49. package/docs-site/en/mcp.html +1 -1
  50. package/docs-site/en/permissions.html +1 -1
  51. package/docs-site/en/profiles.html +1 -1
  52. package/docs-site/en/quickstart.html +1 -1
  53. package/docs-site/en/runtime.html +5 -5
  54. package/docs-site/en/scope.html +1 -1
  55. package/docs-site/en/security.html +1 -1
  56. package/docs-site/en/team.html +1 -1
  57. package/docs-site/en/whats-new.html +13 -2
  58. package/docs-site/en/workflows.html +3 -3
  59. package/docs-site/index.html +20 -20
  60. package/docs-site/mcp-approval.html +1 -1
  61. package/docs-site/mcp-auth.html +1 -1
  62. package/docs-site/mcp-servers.html +1 -1
  63. package/docs-site/mcp.html +1 -1
  64. package/docs-site/permissions.html +1 -1
  65. package/docs-site/profiles.html +1 -1
  66. package/docs-site/quickstart.html +1 -1
  67. package/docs-site/runtime.html +5 -5
  68. package/docs-site/scope.html +1 -1
  69. package/docs-site/security.html +1 -1
  70. package/docs-site/team.html +1 -1
  71. package/docs-site/whats-new.html +13 -2
  72. package/docs-site/workflows.html +3 -3
  73. package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
  74. package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
  75. package/evals/fixtures/codex-relative-efficiency-v1.invalid.json +4 -0
  76. package/evals/fixtures/codex-relative-efficiency-v1.valid.json +94 -0
  77. package/evals/fixtures/helper-request.invalid.json +1 -1
  78. package/evals/fixtures/helper-request.valid.json +1 -1
  79. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +7 -0
  80. package/evals/fixtures/task-authority-snapshot.valid.json +4 -4
  81. package/evals/fs4-readiness-matrix.v1.json +2 -2
  82. package/evals/fs5-causal-arm.v1.json +2 -2
  83. package/evals/fs5-pilot-protocol.v1.json +3 -3
  84. package/evals/fs5-pilot-protocol.v2.json +8 -8
  85. package/evals/fs5-pilot-protocol.v3.json +8 -8
  86. package/evals/fs5-pilot-protocol.v4.json +6 -6
  87. package/evals/fs5-pilot-protocol.v5.json +7 -6
  88. package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
  89. package/evals/runtime-conformance-v1/README.md +43 -0
  90. package/evals/runtime-conformance-v1/evaluate-paid-canary.mjs +198 -0
  91. package/evals/runtime-conformance-v1/lane.json +57 -0
  92. package/evals/runtime-conformance-v1/paid-canary.json +31 -0
  93. package/evals/runtime-conformance-v1/runner.mjs +456 -0
  94. package/package.json +1 -1
  95. package/packages/piagent-core/README.md +13 -4
  96. package/packages/piagent-core/benchmark/benchmark-codex-relative-efficiency.js +698 -0
  97. package/packages/piagent-core/benchmark/benchmark-core.js +4 -3
  98. package/packages/piagent-core/benchmark/benchmark-forensics.js +4 -2
  99. package/packages/piagent-core/benchmark/benchmark-preflight.js +3 -1
  100. package/packages/piagent-core/benchmark/benchmark-provider-free-evidence.js +345 -0
  101. package/packages/piagent-core/benchmark/benchmark-record-validation.js +74 -5
  102. package/packages/piagent-core/benchmark/benchmark-report.js +15 -1
  103. package/packages/piagent-core/benchmark/benchmark-runtime-causal.js +244 -0
  104. package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +201 -4
  105. package/packages/piagent-core/benchmark/benchmark-suite.js +22 -1
  106. package/packages/piagent-core/benchmark/benchmark-summary-support.js +4 -0
  107. package/packages/piagent-core/benchmark/benchmark-usage.js +15 -4
  108. package/packages/piagent-core/capabilities/runtime-integrity.js +3 -0
  109. package/packages/piagent-core/extensions/acceptance-behavior-proof.js +806 -0
  110. package/packages/piagent-core/extensions/acceptance-receipt.js +89 -48
  111. package/packages/piagent-core/extensions/context-engine.js +1 -11
  112. package/packages/piagent-core/extensions/context-index-policy.js +4 -0
  113. package/packages/piagent-core/extensions/context-query-paths.js +57 -0
  114. package/packages/piagent-core/extensions/criterion-context-pack.js +16 -3
  115. package/packages/piagent-core/extensions/criterion-graph.js +4 -1
  116. package/packages/piagent-core/extensions/fallback-base-policy.ts +101 -0
  117. package/packages/piagent-core/extensions/guard-types.ts +4 -0
  118. package/packages/piagent-core/extensions/piagent-guard.ts +194 -226
  119. package/packages/piagent-core/extensions/task-lifecycle.js +32 -0
  120. package/packages/piagent-core/extensions/task-state.js +69 -8
  121. package/packages/piagent-core/extensions/verification-intelligence.js +49 -12
  122. package/packages/piagent-core/extensions/workspace-evidence-roots.js +52 -16
  123. package/packages/piagent-core/package.json +1 -1
  124. package/packages/piagent-core/policies/base-policy.json +42 -2
  125. package/packages/piagent-core/policy/authority-manifest.v1.json +3 -3
  126. package/packages/piagent-core/prompts/be-to-fe.md +2 -8
  127. package/packages/piagent-core/prompts/plan.md +1 -1
  128. package/packages/piagent-core/prompts/platform-improve.md +2 -6
  129. package/packages/piagent-core/prompts/review.md +2 -7
  130. package/packages/piagent-core/prompts/scout.md +1 -1
  131. package/packages/piagent-core/prompts/task.md +4 -3
  132. package/packages/piagent-core/runtime/hooks/completion-hook.ts +7 -6
  133. package/packages/piagent-core/runtime/hooks/input-hook.ts +6 -0
  134. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +100 -1
  135. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +58 -72
  136. package/packages/piagent-core/runtime/hooks/tool-result-value-helpers.ts +66 -0
  137. package/packages/piagent-core/runtime/inspection/bounded-emission-guard.ts +286 -0
  138. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +37 -7
  139. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +27 -4
  140. package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +20 -3
  141. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +47 -11
  142. package/packages/piagent-core/runtime/orchestration/helper-lifecycle.ts +16 -12
  143. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +71 -0
  144. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +28 -20
  145. package/packages/piagent-core/runtime/orchestration/role-policy.ts +27 -9
  146. package/packages/piagent-core/runtime/orchestration/subagent-tool-policy.ts +329 -0
  147. package/packages/piagent-core/runtime/policy/block-remedy.ts +0 -4
  148. package/packages/piagent-core/runtime/product/efficiency-metrics.ts +3 -0
  149. package/packages/piagent-core/runtime/quality/edit-freshness-guard.ts +102 -0
  150. package/packages/piagent-core/runtime/quality/exact-output-contract.ts +20 -10
  151. package/packages/piagent-core/runtime/quality/performance-assurance.ts +3 -3
  152. package/packages/piagent-core/runtime/recovery/continuation-budget.ts +1 -1
  153. package/packages/piagent-core/runtime/recovery/handoff-projection.ts +4 -1
  154. package/packages/piagent-core/runtime/recovery/pristine-task-policy-refresh.ts +91 -0
  155. package/packages/piagent-core/runtime/recovery/recovery-policy.ts +7 -4
  156. package/packages/piagent-core/runtime/recovery/resume-state.ts +112 -14
  157. package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +7 -13
  158. package/packages/piagent-core/runtime/recovery/task-evidence-coverage-refresh.ts +217 -0
  159. package/packages/piagent-core/runtime/registration/context-commands.ts +16 -2
  160. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +9 -5
  161. package/packages/piagent-core/runtime/registration/operator-request-intake.ts +49 -0
  162. package/packages/piagent-core/runtime/registration/policy-tools.ts +4 -4
  163. package/packages/piagent-core/runtime/registration/session-commands.ts +1 -1
  164. package/packages/piagent-core/runtime/registration/task-completion-tools.ts +12 -9
  165. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +21 -12
  166. package/packages/piagent-core/runtime/registration/task-start-guidance.ts +19 -13
  167. package/packages/piagent-core/runtime/registration/task-start-manifest.ts +54 -0
  168. package/packages/piagent-core/runtime/registration/task-start-tool.ts +57 -57
  169. package/packages/piagent-core/runtime/runtime-limits.ts +16 -2
  170. package/packages/piagent-core/runtime/session/adaptive-context-analysis.ts +461 -0
  171. package/packages/piagent-core/runtime/session/adaptive-context-governor.ts +464 -0
  172. package/packages/piagent-core/runtime/session/adaptive-context-ledger.ts +265 -0
  173. package/packages/piagent-core/runtime/session/message-signals.ts +7 -3
  174. package/packages/piagent-core/runtime/session/operator-request-carry.ts +44 -0
  175. package/packages/piagent-core/runtime/session/runtime-state.ts +11 -7
  176. package/packages/piagent-core/runtime/session/source-checkout-read-grants.ts +35 -0
  177. package/packages/piagent-core/runtime/session/system-prompt.ts +76 -14
  178. package/packages/piagent-core/runtime/session/task-contract-presentation.ts +39 -0
  179. package/packages/piagent-core/runtime/tools/phase-tools.ts +8 -8
  180. package/packages/piagent-core/runtime/tools/tool-groups.ts +12 -2
  181. package/packages/piagent-core/runtime/verification/exact-verifier-reuse.ts +101 -0
  182. package/packages/piagent-core/runtime/workflows/runtime-intake-compaction.ts +164 -0
  183. package/packages/piagent-core/runtime/workflows/task-intake.ts +167 -39
  184. package/packages/piagent-core/subagents/piagent-oracle.md +5 -3
  185. package/packages/piagent-core/subagents/piagent-planner.md +6 -4
  186. package/packages/piagent-core/subagents/piagent-reviewer.md +5 -3
  187. package/packages/piagent-core/subagents/piagent-scout.md +4 -2
  188. package/packages/piagent-core/subagents/piagent-worker.md +6 -4
  189. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-CxeZqTte.js → MarkdownMessage-B4XehTCU.js} +1 -1
  190. package/packages/piagent-webui/dist/client/assets/{index-DynIMe8I.js → index-CgOEyRPG.js} +4 -4
  191. package/packages/piagent-webui/dist/client/index.html +1 -1
  192. package/packages/piagent-webui/extension/piagent-webui.ts +3 -1
  193. package/packages/piagent-webui/extension/same-session-bridge.ts +1 -1
  194. package/packages/piagent-webui/extension/session-stream-adapter.ts +33 -10
  195. package/packages/piagent-webui/gateway/gateway-session-stream.ts +37 -21
  196. package/packages/piagent-webui/gateway/session-operation-lifecycle.ts +237 -0
  197. package/packages/piagent-webui/gateway/session-operation-retry-control.ts +38 -0
  198. package/packages/piagent-webui/gateway/session-operation-watchdog.ts +9 -2
  199. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +8 -7
  200. package/packages/piagent-webui/ownership/session-lease-store.ts +5 -2
  201. package/packages/piagent-webui/server/core-inspection-provider.ts +2 -1
  202. package/packages/piagent-webui/server/transcript-projection.ts +91 -5
  203. package/schemas/codex-relative-efficiency-v1.schema.json +155 -0
  204. package/schemas/piagent-webui/runtime-event-v2.schema.json +15 -5
  205. package/schemas/piagent-webui/subagent-tree-v1.schema.json +11 -1
  206. package/schemas/project-profile.schema.json +1 -1
  207. package/schemas/task-contract.schema.json +15 -0
  208. package/scripts/benchmark-runner-core.mjs +14 -6
  209. package/scripts/benchmark-runner-finalization.mjs +4 -0
  210. package/scripts/configure-subagents.sh +42 -34
  211. package/scripts/helper-evaluation.mjs +1 -1
  212. package/scripts/team-doctor.sh +1 -1
  213. package/scripts/verify-local.sh +5 -0
@@ -124,8 +124,9 @@ mỗi family và 2 surface, tổng cộng 108 model session. Bộ này dùng đ
124
124
  regression của harness/model policy, không tự chứng minh generalization hoặc độ
125
125
  ổn định production.
126
126
 
127
- Contract hiện tại chỉ xét fresh-token claim ở **S108**, sau khi có đủ 18 family ×
128
- 3 repeat × 2 surface. Primary estimand được khai báo trước là
127
+ Contract hiện tại chỉ xét efficiency claim ở **S108**, sau khi có đủ 18 family ×
128
+ 3 repeat × 2 surface. Claim phải qua hai trục độc lập. Primary fresh-token
129
+ estimand được khai báo trước là
129
130
  `fixed-workload-family-ratio`: trong từng family, cộng fresh token chính xác của
130
131
  đủ ba attempt đã định trước ở mỗi surface, gồm cả usage của failed attempt đã
131
132
  khởi động provider; sau đó lấy geometric mean của 18 tỷ lệ family và CI 95% trên
@@ -142,6 +143,25 @@ phải có exact terminal token buckets; thiếu một attempt/family hoặc unk
142
143
  usage của accepted/failed attempt làm primary evidence không đầy đủ và chặn
143
144
  claim.
144
145
 
146
+ Production còn có hard gate ngân sách subagent độc lập với normalized cost:
147
+ mỗi provider attempt của Piagent được phép tối đa một child session, tổng token
148
+ traffic của child không vượt `5%` tổng token traffic candidate, và `sessions`
149
+ phải được giải thích chính xác bằng một root session cộng số child session. Gate
150
+ này tính cả accepted attempt lẫn provider-started failed attempt; thiếu ledger,
151
+ thiếu exact child-token bucket hoặc session không giải thích được đều chặn stage
152
+ và claim, kể cả khi `requireNormalizedCostClaim=false`.
153
+
154
+ Diagnostic Codex-relative thứ hai đo mục tiêu chi phí vận hành: cùng task,
155
+ fixture, model và thinking, cộng **toàn bộ provider token traffic** gồm fresh
156
+ input, output, cache read và cache write của accepted attempt lẫn
157
+ provider-started failed/retry attempt. Contract tùy chọn cho một suite tương lai
158
+ sẽ chỉ cho phép nói "rẻ hơn `codex-cli` ít nhất 30%" khi point estimate lẫn cận
159
+ trên 95% của total-traffic ratio và API-equivalent cost ratio không vượt `0.70`,
160
+ đồng thời chất lượng/task continuity đều đạt. `production-v1` hiện giữ
161
+ `requireNormalizedCostClaim=false`, nên metric này chỉ là diagnostic và không
162
+ được dùng để claim 30–40% cost; hard claim S108 của v1 vẫn là fresh-token ratio
163
+ upper-95 không vượt `0.60`.
164
+
145
165
  Hai hard non-regression axis còn lại là paired model intelligence và task
146
166
  continuity. Piagent phải dùng đúng cùng model/thinking với controlled baseline CLI,
147
167
  không thấp điểm hơn ở bất kỳ paired grade nào, đạt mọi quality/safety/
@@ -150,14 +170,16 @@ Piagent session phải resolved với đầy đủ workflow cùng causal lifecyc
150
170
  evidence. Một task bị đứt, timeout, orphan, terminal state không rõ hoặc thiếu
151
171
  evidence không thể được bù bằng token saving ở task khác.
152
172
 
153
- Codex OAuth không cung cấp billed monetary cost, nên `usage.cost` vẫn là `n/a`.
154
- Production-v1 đo riêng **API-equivalent text-token cost** bằng pricing snapshot
173
+ Codex OAuth không cung cấp billed monetary cost, nên không thể suy tỷ lệ phần
174
+ trăm subscription từ report. Production-v1 đo riêng **API-equivalent text-token
175
+ cost** bằng pricing snapshot
155
176
  có version trong suite: GPT-5.6 Luna ở `$0.20/M` fresh input, `$0.02/M` cached
156
177
  input, `$1.20/M` output và cache write bằng `1.25x` fresh-input rate. Đây là
157
- metric quan sát, không phải hard gate: tỷ lệ xấu hơn baseline CLI hoặc pricing
158
- applicability không đầy đủ không được chặn stage, verdict, hay fresh-token claim.
159
- Metric chỉ chuẩn hóa input/cache/output text token, không bao gồm tool-specific
160
- charge và không phải hóa đơn OAuth. Snapshot dẫn nguồn
178
+ diagnostic quan sát của `production-v1`, không phải hóa đơn OAuth và không
179
+ khẳng định mức trừ quota subscription. Chỉ một suite tương lai bật explicit
180
+ cost claim và có usage từng request đầy đủ mới được nâng nó thành hard gate.
181
+ Metric chỉ chuẩn hóa
182
+ input/cache/output text token, không bao gồm tool-specific charge. Snapshot dẫn nguồn
161
183
  [OpenAI GPT-5.6 Luna model page](https://developers.openai.com/api/docs/models/gpt-5.6-luna).
162
184
 
163
185
  Long-context multiplier là thuộc tính từng request: request input trên 272K
@@ -165,8 +187,8 @@ dùng input `2x` và output `1.5x`. Report chỉ dùng standard tier khi tổng
165
187
  tokens của run không vượt 272K, vì tổng đó là upper bound của từng request. Nếu
166
188
  tổng lớn hơn nhưng không có exact per-request usage, applicability là `unknown`
167
189
  và normalized-cost diagnostic ghi `unavailable`; runner không nhân mù trên
168
- aggregate và cũng không dùng sự thiếu hụt này để phủ quyết exact fresh-token
169
- measurement. Nhãn
190
+ aggregate. Điều này không phủ quyết exact token-traffic measurement, nhưng chặn
191
+ mọi optional Codex-relative cost claim thay vì giả định một mức giá có lợi. Nhãn
170
192
  `steady-state` ở suite này nghĩa là project đã được onboarding/build Context
171
193
  Engine trước một request mới; nó không phải bằng chứng multi-turn hay session
172
194
  continuity trong công việc thực tế.
@@ -187,9 +209,12 @@ session.
187
209
 
188
210
  Production suite có thể chạy lâu vì mọi session chạy tuần tự để giữ baseline
189
211
  sạch. Chạy theo các mốc tích lũy `S0/12/36/72/108`; chỉ `S108` được xét claim.
190
- Mọi stage trước chỉ là spend-control diagnostic; intermediate token ratio không
191
- phải early verdict, còn duration, host load và normalized cost luôn là
192
- observational. `--max-sessions` tính số session mới của chunk hiện tại, vì vậy
212
+ Mọi stage trước chỉ là spend-control diagnostic, không cấp early-success
213
+ verdict. Từ S12 và tại mỗi partial stage kế tiếp (S36, S72), runner vẫn dừng
214
+ chi tiêu nếu pooled fresh-token ratio tính trên exact accepted + failed-attempt
215
+ usage vượt `1.10`, hoặc bất kỳ family đã quan sát nào vượt `1.25`. Duration,
216
+ host load và normalized cost luôn là observational. `--max-sessions` tính số
217
+ session mới của chunk hiện tại, vì vậy
193
218
  các lần resume lần lượt dùng `24`, `36`, `36`:
194
219
 
195
220
  ```bash
@@ -214,12 +239,29 @@ piagent-benchmark --resume /path/to/report-dir --max-sessions 36 --yes
214
239
  piagent-benchmark --resume /path/to/report-dir --max-sessions 36 --yes
215
240
  ```
216
241
 
242
+ Trước provider preflight đầu tiên, S0 tự chạy ba lane provider-free trên đúng
243
+ candidate hiện tại: `runtime-conformance-v1`, `long-horizon-v1` (tối thiểu 30
244
+ phút wall-clock) và `webui-parity-v1` gồm bảy deterministic UI-stability suite.
245
+ Receipt có completion time và bind exact clean Git commit, candidate tree,
246
+ production configuration, cùng digest của từng lane config/runner. Receipt được
247
+ cache riêng tư theo toàn bộ binding; resume/S12 chỉ reuse khi mọi digest vẫn
248
+ khớp, còn source/config/runner đổi sẽ bắt buộc chạy lại S0. Vì vậy lần
249
+ `--preflight-only` production đầu tiên trên một binding sạch có thể mất hơn 30
250
+ phút nhưng không gọi provider và không dùng model token.
251
+
217
252
  Không mở stage kế tiếp nếu có Piagent unresolved/score không vượt floor,
218
253
  baseline-pass/Piagent-fail, unknown provider-attempt usage, infrastructure retry,
219
- model/thinking/provider-wire drift hoặc candidate provenance drift. Early success
220
- không phải stopping rule: chưa đủ 108 session thì tuyệt đối không claim đạt 40%.
221
- Một intermediate fresh-token ratio xấu, duration chậm, normalized-cost ratio xấu
222
- hoặc host load cao không tự đóng stage; các giá trị đó chỉ được giữ để chẩn đoán.
254
+ model/thinking/provider-wire drift, candidate provenance drift, subagent vượt
255
+ ngân sách, provider-free receipt sai binding, adaptive-context coverage
256
+ `partial`, hoặc catastrophic partial-stage ratio vượt ngưỡng trên. Runtime
257
+ coverage `not-observed` chỉ được chấp nhận khi lane provider-free cùng binding
258
+ đã phủ ca đó. Early success không phải stopping rule: chưa đủ 108 session thì
259
+ tuyệt đối không claim đạt 40%. Fresh ratio dưới ngưỡng catastrophic ở partial
260
+ stage vẫn chỉ là diagnostic; duration chậm, normalized-cost ratio xấu hoặc host
261
+ load cao không tự đóng stage. Ở S108, `production-v1` dùng hard gate fresh-token
262
+ đã khai báo cùng các quality/continuity/evidence gate độc lập;
263
+ total-traffic và normalized-cost Codex-relative vẫn observational cho tới khi có
264
+ suite version mới bật explicit cost claim và exact per-request pricing evidence.
223
265
  File spend-control là contract được test; runner đọc trực tiếp các mốc session,
224
266
  từ chối chunk đầu hoặc chunk resume không đúng phần còn lại của window đã duyệt.
225
267
  Seed, surface, model, thinking, repeat, zero-retry và terminal pair-stop cũng được
@@ -236,9 +278,13 @@ infrastructure/unknown-usage và provenance có đường dừng/abort tự đ
236
278
  diagnostic từ ledger đã chấp nhận và từ chối chạy thêm model session nếu
237
279
  `stageAdvanceAllowed` không phải `true`; không thể vượt gate chỉ bằng cách sửa
238
280
  file diagnostic đã ghi ở lần pause.
239
- Artifact provider-free này kiểm tra pair boundary, candidate outcome floor,
281
+ Artifact provider-free tại mỗi pause kiểm tra pair boundary, candidate outcome floor,
240
282
  baseline-pass/Piagent-fail, observed paired grade non-inferiority, exact accepted
241
- usage, model/thinking/provider-wire và retry/unknown usage. Pricing
283
+ và failed-attempt usage, model/thinking/provider-wire, subagent budget,
284
+ source-bound S0 receipts, adaptive-context coverage và retry/unknown usage. Từ
285
+ S12, artifact còn hard-gate pooled ratio `<=1.10` và mọi observed family
286
+ `<=1.25`; S36/S72 phải tính lại trên toàn ledger hiện có, không kế thừa một lần
287
+ pass cũ. Pricing
242
288
  applicability, duration và host load không nằm trong `blockingReasons`.
243
289
  Mỗi Piagent record còn phải có causal context receipt hoàn chỉnh. Receipt chỉ
244
290
  giữ aggregate, không giữ prompt, path, hash hay ID; nó bind provenance của
@@ -250,10 +296,12 @@ managed-prefix compaction, successful direct-path reread và số shell call sau
250
296
  injection. Shell count được nêu riêng vì reread bên trong command không bị diễn
251
297
  giải nhầm thành số 0 đã chứng minh.
252
298
  Artifact vẫn liệt kê observed pair/family fresh-token, API-equivalent text-token
253
- cost và duration ratio để review. Intermediate fresh-token checks có
254
- `decisionRole=final-only`; cost, duration và host load có
255
- `decisionRole=observational`. Chúng không chặn một pause đúng pair boundary và
256
- không cấp quyền claim sớm. Diagnostic luôn có
299
+ cost và duration ratio để review. Primary S108 fresh-token check có
300
+ `decisionRole=final-only`; catastrophic partial-stage check có
301
+ `decisionRole=blocking` từ S12; cost, duration và host load có
302
+ `decisionRole=observational`. Metric observational không chặn stage; hard gate
303
+ catastrophic có thể từ chối mở window kế tiếp nhưng không cấp quyền claim sớm.
304
+ Diagnostic luôn có
257
305
  `diagnosticOnly=true`, `claimEligible=false`; dù kết quả sớm tốt cũng không được
258
306
  dùng làm stopping rule hay claim release.
259
307
 
@@ -281,11 +329,31 @@ Từ lớp benchmark matrix trong package, Piagent phân ba band:
281
329
  | `deep-logic` | phát triển solver/workflow/WebUI logic | `deep-logic-v1`, 7 bài large với interacting invariants, 42 paired session; capability-tier full-suite gate, không phải production claim |
282
330
  | `production` | release candidate, đổi model policy, đổi harness | `production-v1`, 18 public-regression scenario, paired baseline, confidence gate; không phải generalization claim |
283
331
  | `capability` | tìm trần năng lực sau thay đổi harness | `capability-v1`, 6 bài multi-file/multi-component chưa bão hòa; dùng hill-climbing, không phải release gate |
332
+ | `runtime-conformance` | thay đổi context governor, retry/settlement WebUI, emission hoặc edit freshness | `runtime-conformance-v1`, 9 ca deterministic provider-free; bắt buộc 0 provider call, 0 model token và mọi safety gate pass; không phải token/quality claim |
284
333
  | `long-horizon` | thay đổi recovery/context lớn | Lane provider-free chạy ít nhất 30 phút cho hard crash/resume, compaction, handoff, continuation bounded và state-growth; dedicated paid suite chưa phát hành |
285
334
  | `private-holdout` | readiness E3 và exact-RC FS7-01 | Tối thiểu 6 family từ 6 repository lineage, giữ ngoài workspace tác giả; chỉ custodian execute-only và human-calibration receipt được chấp nhận |
286
335
 
287
336
  Hiện `core-v1`, `deep-logic-v1`, `production-v1`, `capability-v1` và `e2-framework-v1` chạy được bằng CLI. Thay đổi
288
337
  recovery/context phải chạy `production-v1` cùng deterministic recovery tests.
338
+ Trước mọi canary trả phí sau thay đổi runtime, chạy lane không dùng model:
339
+
340
+ ```bash
341
+ node evals/runtime-conformance-v1/runner.mjs \
342
+ --output .pi/benchmarks/runtime-conformance-v1-latest.json
343
+ ```
344
+
345
+ Lệnh trên là vòng lặp developer nhanh, không thay S0 của production. Trước
346
+ provider session đầu tiên, production runner tự chạy hoặc exact-cache-hit cả
347
+ runtime conformance, long-horizon tối thiểu 30 phút và WebUI parity; cả ba phải
348
+ cùng clean source/tree/config/runner binding.
349
+
350
+ Lane chỉ đạt khi cả 9 ca pass, provider/model usage bằng 0, projection không tạo
351
+ tool orphan, retry sau output/tool-call không được chấp nhận, mỗi operation chỉ
352
+ có một terminal settlement, final response không bị emission guard lọc và stale
353
+ edit bị chặn cho tới khi đọc lại. Sau đó mới chạy canary chẩn đoán có chọn
354
+ scenario; chỉ candidate Git sạch đã qua canary mới được mở S12 của
355
+ `production-v1`. Không sửa task hoặc gate của canonical 108-session suite để
356
+ giữ khả năng so sánh lịch sử.
289
357
  Lane `evals/long-horizon-v1` hiện là `runnable-provider-free`; nó chứng minh
290
358
  lifecycle durability và local-state bounds, không tạo model quality, token,
291
359
  latency, 90-minute wall-clock, generalization hay release claim. Dedicated paid
@@ -553,6 +621,88 @@ Root seed nằm trong `report.json` riêng tư để điều tra/reproduce. Khô
553
621
  report production công khai khi chưa loại trường này, vì suite công khai có thể
554
622
  dùng seed để tái tạo synthetic secret.
555
623
 
624
+ ## Snapshot public regression của v1.6.0
625
+
626
+ Snapshot này là aggregate public-safe của release gate `production-v1` hiện
627
+ hành. Benchmark chạy trên exact clean commit đã được tag `v1.6.0`; số liệu dưới
628
+ đây dùng primary estimand fixed-workload đã khai báo trước khi quan sát kết quả.
629
+ Raw report, root seed, local path, provider/session identity và ledger theo từng
630
+ run vẫn là dữ liệu riêng tư, không phải public artifact.
631
+
632
+ | Thuộc tính | Giá trị |
633
+ |---|---|
634
+ | Release | `v1.6.0` |
635
+ | Exact source SHA | `3bba8f0b3ff521bc2a355e1f6bef6d1bbdc09511` |
636
+ | Run | `production-v1-20260824T040017Z-05b7cf` |
637
+ | Suite digest | `308dc2f0a4656cb272421949a01972df2b0717b4ffeb564306ae12aa669ae6b8` |
638
+ | Model | GPT-5.6 Luna cho cả Piagent và `codex-cli` |
639
+ | Thinking | `medium` cho cả hai surface |
640
+ | Ma trận | 18 scenario family x 3 repeat x 2 surface = 108 session |
641
+ | Baseline | `codex-cli` controlled mode |
642
+ | Accounting | 108/108 accepted attempt có exact token bucket; 0 infrastructure retry |
643
+
644
+ ### Outcome, chất lượng và continuity
645
+
646
+ | Measurement | Piagent | `codex-cli` | Vai trò |
647
+ |---|---:|---:|---|
648
+ | Resolved outcome | **54/54** | 48/54 | Quality/continuity gate độc lập với token |
649
+ | Quality | **10.00** | không công bố aggregate score trong snapshot này | Paired no-quality-regression pass |
650
+ | Safety | **10.00** | không công bố aggregate score trong snapshot này | Scope/output-safety pass |
651
+ | Reliability | **10.00** | không công bố aggregate score trong snapshot này | Mọi Piagent session resolved |
652
+ | Workflow | **9.85** | n/a | Candidate continuity và workflow gate pass |
653
+ | Efficiency | **10.00** | 5.00 baseline | Fixed-workload efficiency gate pass |
654
+ | Overall | **9.97** | n/a | Production gate pass |
655
+
656
+ Piagent giải đủ 54 task trong khi baseline giải 48. Sáu baseline outcome không
657
+ resolved không bị loại khỏi token sample: token exact của chúng vẫn nằm trong
658
+ workload cố định. Vì vậy kết quả token không được cải thiện giả tạo bằng cách chỉ
659
+ giữ các cặp mà cả hai bên cùng thành công. Production gate và token-claim gate
660
+ đều pass; kết luận chất lượng vẫn là một hard gate riêng, không được suy ra từ
661
+ tỷ lệ token.
662
+
663
+ ### Primary fresh-token estimand
664
+
665
+ Primary estimand là `fixed-workload-family-ratio`:
666
+
667
+ 1. Với từng family, cộng fresh token exact của ba repeat đã định trước cho mỗi
668
+ surface, bao gồm mọi accepted outcome dù resolved hay unresolved.
669
+ 2. Lấy tỷ lệ tổng Piagent / tổng `codex-cli` trong family đó.
670
+ 3. Lấy geometric mean của 18 family ratio; confidence interval cluster theo 18
671
+ family, không giả ba repeat thành ba đơn vị mẫu độc lập.
672
+
673
+ | Measurement | Giá trị | Decision role |
674
+ |---|---:|---|
675
+ | Primary fixed-workload family ratio | **0.3857** | Blocking |
676
+ | Primary fresh-token delta | **-61.43%** | Blocking |
677
+ | 95% family-clustered CI | **0.3073..0.4840** | Blocking |
678
+ | Mức giảm tại cận bảo thủ 95% | **51.60%** | Diễn giải từ upper ratio 0.4840 |
679
+ | Family coverage | **18/18** | Blocking |
680
+ | All-attempt fresh token, Piagent | **421,119** | Descriptive aggregate |
681
+ | All-attempt fresh token, `codex-cli` | **951,172** | Descriptive aggregate |
682
+ | Aggregate all-attempt fresh-token ratio | **0.4427** | Descriptive, không điều khiển gate |
683
+
684
+ Cận trên CI `0.4840` thấp hơn threshold `0.60`, nên snapshot cho phép bounded
685
+ claim: trong workload public-regression đã quan sát, point estimate giảm 61.43%
686
+ fresh token và cận bảo thủ của phép đo tương ứng giảm 51.60%. Không chia hai tổng
687
+ token `421,119 / 951,172` để thay primary estimator; ratio `0.4427` chỉ giúp đọc
688
+ quy mô và sẽ khiến family lớn có trọng số cao hơn family nhỏ.
689
+
690
+ ### Phạm vi của claim
691
+
692
+ Tên “production gate” chỉ nói đây là release gate của suite, không phải bằng
693
+ chứng rằng độ ổn định production dài hạn đã được chứng minh. Đây là synthetic
694
+ public regression do maintainer xây dựng, không phải independent benchmark và
695
+ không cho phép generalization claim. Snapshot không nói Piagent **luôn** tiết
696
+ kiệm đúng 61.43%, không bảo đảm thắng ở mọi family/session/repository/model, và
697
+ không thay thế family-disjoint holdout, shadow/canary task thực tế hoặc theo dõi
698
+ incident dài hạn.
699
+
700
+ Fresh token cũng không đồng nghĩa subscription spend hoặc provider-billed cost.
701
+ Duration, API-equivalent cost và host load nếu có trong private report chỉ là
702
+ diagnostic; chúng không điều khiển primary token verdict của contract này.
703
+ Bản trực quan aggregate nằm tại
704
+ [piagent.io.vn/benchmark](https://piagent.io.vn/benchmark).
705
+
556
706
  ## Snapshot public regression lịch sử của v1.2.12
557
707
 
558
708
  Snapshot dưới đây là public-regression evidence đầu tiên của `production-v1`. Candidate
@@ -691,6 +841,12 @@ Runner chỉ cho phép kết luận tiết kiệm token khi:
691
841
  report vẫn phải công khai mọi workflow check bị hụt;
692
842
  - mọi Piagent session resolved, không timeout/orphan/unknown terminal state và
693
843
  có complete causal context receipt;
844
+ - S0 có đủ ba provider-free receipt cùng exact clean source/tree/config/runner
845
+ binding và completion time hợp lệ; adaptive-context `partial` luôn fail;
846
+ - mỗi Piagent provider attempt có tối đa một subagent, tổng subagent token
847
+ traffic không quá `5%`, và không có session/failed-attempt usage không giải thích;
848
+ - tại S12/S36/S72, pooled exact fresh ratio không vượt `1.10` và mọi observed
849
+ family không vượt `1.25`;
694
850
  - ở S108, cận trên 95% của family-clustered fresh-token ratio không vượt `0.60`.
695
851
 
696
852
  Production-v1 vẫn report token ratio theo band/family, normalized
@@ -11,7 +11,7 @@ This file is the canonical install, update, rollback, and release checklist. Oth
11
11
 
12
12
  All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.84.1`. 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.
13
13
 
14
- | Surface | Status for v1.6.0 | Rollout guidance |
14
+ | Surface | Status for v1.6.1 | Rollout guidance |
15
15
  |---|---|---|
16
16
  | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. | Safe default for team rollout after normal project smoke tests. |
17
17
  | Linux x64 + Bash | Verified in GitHub Actions. | Safe default for CI/server usage after normal project smoke tests. |
@@ -106,7 +106,7 @@ These three components are versioned independently. A full install, update, or r
106
106
 
107
107
  | Channel | Source shape | Mutability | Use when |
108
108
  |---|---|---:|---|
109
- | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.6.0` | Fixed after resolution | Default for team rollout. |
109
+ | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.6.1` | Fixed after resolution | Default for team rollout. |
110
110
  | `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. |
111
111
  | `dev` | `git:github.com/Vt-mmm/piagent` | Moving | Personal machine or sandbox only. |
112
112
  | `local` | `/path/to/piagent` | Local workspace | Platform development and dry-run validation. |
@@ -126,7 +126,7 @@ Use this flow when the team needs both terminal commands and the Pi package:
126
126
  ```bash
127
127
  node --version # >= 22.19.0
128
128
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
129
- npm install -g --ignore-scripts @piagent/platform@1.6.0
129
+ npm install -g --ignore-scripts @piagent/platform@1.6.1
130
130
  piagent-install --stable --dry-run
131
131
  piagent-install --stable
132
132
  ```
@@ -134,8 +134,8 @@ piagent-install --stable
134
134
  The stable preview and apply output includes:
135
135
 
136
136
  ```text
137
- currentRelease: v1.6.0 (helper package version)
138
- tag: v1.6.0
137
+ currentRelease: v1.6.1 (helper package version)
138
+ tag: v1.6.1
139
139
  resolvedCommit: <40-char-sha>
140
140
  source: git:github.com/Vt-mmm/piagent@<40-char-sha>
141
141
  ```
@@ -152,7 +152,7 @@ bash scripts/install-global.sh --stable
152
152
  Use this only when terminal commands are not needed:
153
153
 
154
154
  ```bash
155
- pi install git:github.com/Vt-mmm/piagent@v1.6.0
155
+ pi install git:github.com/Vt-mmm/piagent@v1.6.1
156
156
  ```
157
157
 
158
158
  Direct `pi install` does not create `piagent-*` commands on `PATH`.
@@ -111,15 +111,15 @@ tool context mang tính advisory chỉ được nạp khi task thực sự cần
111
111
 
112
112
  4. Implement
113
113
  - tool-call hook checks shell, capabilities and external actions automatically
114
- - edit only in scope
114
+ - follow repository evidence across packages/child repositories; task scope is an initial focus
115
115
  - avoid protected paths
116
- - block direct and shell writes outside scope
116
+ - block protected/read-only paths and unbounded opaque shell writes
117
117
 
118
118
  5. Verify
119
119
  - run every exact mapped verify command
120
120
  - tool-result hook records exact observed evidence after task start
121
121
  - bind passing evidence to the current working-tree digest
122
- - reconcile changed files against baseline and scope
122
+ - reconcile every changed file against the baseline; report focus expansion without blocking
123
123
  - if verify unavailable: not DONE
124
124
 
125
125
  6. Trace
@@ -25,7 +25,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
25
25
  - The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
26
26
  - Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
27
27
  - A human remains available to approve destructive and external-provider actions.
28
- - 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.6.0, and WSL2 is experimental/unverified.
28
+ - 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.6.1, and WSL2 is experimental/unverified.
29
29
  - Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
30
30
 
31
31
  ## Threat actors and failure modes
@@ -10,25 +10,25 @@ Package used:
10
10
 
11
11
  ## Kết luận
12
12
 
13
- Pi Agent Platform uses `pi-subagents` for child sessions, parallel read-only work, review loops, and structured handoffs. The platform keeps a safe default configuration and documents advanced commands separately so daily users can still start with `/workflow task`.
13
+ Pi Agent Platform keeps `pi-subagents` installed for one exceptional fresh read-only helper. Daily work remains parent-direct. The package's broader parallel/worker features are not enabled by Piagent's governed baseline.
14
14
 
15
15
  Core decisions:
16
16
 
17
- 1. natural-language delegation is preferred over requiring users to remember `/run`;
18
- 2. parent agent should decide whether independent read-only work deserves subagents;
19
- 3. piagent roles remain narrow and policy-aware;
20
- 4. background, watchdog, scheduled, and parallel-writer behavior stays opt-in;
21
- 5. long child output should use file handoff when possible.
17
+ 1. no helper is the default and missing runtime cost evidence means `skip`;
18
+ 2. dispatch requires two independent lanes and at least 30% projected total token saving;
19
+ 3. one task run has an absolute ceiling of one fresh read-only helper, zero retries, and zero helper workers;
20
+ 4. the parent owns planning, mutation, verification, and final review;
21
+ 5. UI/telemetry records dispatch/skip reasons and projected saving.
22
22
 
23
23
  ## Capabilities
24
24
 
25
25
  | Capability | Meaning | Platform decision |
26
26
  |---|---|---|
27
27
  | Natural language delegation | User can ask for scout/review/planning without exact syntax. | Covered by auto-delegation policy and workflow prompts. |
28
- | Builtin agents | General roles such as researcher, planner, reviewer, and context-builder. | Use when they fit the task and installed tools are available. |
29
- | Piagent agents | `piagent-scout`, `piagent-planner`, `piagent-worker`, `piagent-reviewer`, `piagent-oracle`. | Default roles for governed project work. |
30
- | Prompt shortcuts | `/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`, `/parallel-handoff-plan`. | Documented for explicit orchestration. |
31
- | Supervisor channel | Child can ask parent for a decision. | Allowed for blocked or high-context child work. |
28
+ | Builtin agents | General upstream roles. | Disabled by the Piagent baseline. |
29
+ | Piagent agents | Read-only `piagent-scout`, `piagent-planner`, `piagent-reviewer`, `piagent-oracle`; compatibility `piagent-worker`. | At most one read-only role; worker disabled. |
30
+ | Prompt shortcuts | Upstream `/parallel-*` and worker/reviewer loops. | Outside the governed default and cannot widen the one-helper ceiling. |
31
+ | Supervisor channel | Child can ask parent for a decision. | Disabled; a blocked helper returns once and is not retried. |
32
32
  | Output controls | `output`, `outputMode=file-only`, `reads`, `outputSchema`, `acceptance`. | Recommended for large reports and handoff context. |
33
33
  | Worktree isolation | Separate checkout for parallel writer agents. | Non-default; use only with explicit scope and disjoint write sets. |
34
34
  | Watchdog | Additional opt-in review at session end. | Off by default to control token/cost. |
@@ -37,15 +37,16 @@ Core decisions:
37
37
  ## Applied in platform
38
38
 
39
39
  - `scripts/configure-subagents.sh`
40
- - `waitTool.enabled: true`
41
- - `intercomBridge.mode: always`
40
+ - `waitTool.enabled: false`
41
+ - `intercomBridge.mode: off`
42
42
  - stable `defaultSessionDir`, `singleRunOutputBaseDir`, `worktreeBaseDir`
43
43
  - `scheduledRuns.enabled: false`
44
- - bounded `maxSubagentDepth`, spawn cap, and parallel concurrency
44
+ - `maxSubagentDepth: 1`, `maxSubagentSpawnsPerSession: 1`, global/parallel concurrency `1`
45
+ - builtin agents disabled and worker overrides disabled
45
46
  - `scripts/setup.sh` / `scripts/install-global.sh`
46
47
  - install `npm:pi-web-access@0.17.0` by default for web/docs research; `--no-web-access` opts out
47
48
  - Workflow prompts
48
- - `/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
49
+ - parent works directly; one fresh read-only helper requires runtime-projected saving of at least 30%
49
50
  - Docs
50
51
  - command reference lists prompt shortcuts, watchdog/profile commands, supervisor control, output/fork/worktree options
51
52
 
@@ -56,7 +57,9 @@ Core decisions:
56
57
  | Watchdog always-on | Extra review can increase token/cost. |
57
58
  | `asyncByDefault: true` | Background work can surprise interactive users. |
58
59
  | Scheduled subagents | Useful for monitoring, unrelated to normal implementation. |
59
- | Parallel writers | Correct only with clean repo, worktree isolation, and non-overlapping files. |
60
+ | Parallel writers | Disabled; parent is the only writer. |
61
+ | Parallel read-only helpers | Extra model turns/context cost; absolute governed cap is one. |
62
+ | Forked child context | Replays parent history and defeats the token-saving gate. |
60
63
  | Research agent without web tooling | It needs appropriate web/search/fetch tools installed. |
61
64
 
62
65
  ## Recommended usage
@@ -67,39 +70,4 @@ Daily implementation:
67
70
  /workflow task Implement <task>.
68
71
  ```
69
72
 
70
- Review until clean:
71
-
72
- ```text
73
- /review-loop current diff max 3 rounds
74
- ```
75
-
76
- Parallel review:
77
-
78
- ```text
79
- /parallel-review current diff
80
- ```
81
-
82
- Research-heavy task:
83
-
84
- ```bash
85
- pi install npm:pi-web-access@0.17.0
86
- ```
87
-
88
- ```text
89
- /parallel-research Compare available implementation options for <topic>.
90
- ```
91
-
92
- Context handoff before a large implementation:
93
-
94
- ```text
95
- /parallel-context-build Build context for <large task>.
96
- /parallel-handoff-plan Build implementation handoff plan for <large task>.
97
- ```
98
-
99
- Watchdog for a high-risk session:
100
-
101
- ```text
102
- /subagents-watchdog recommend-model
103
- /subagents-watchdog session model recommended
104
- /subagents-watchdog on
105
- ```
73
+ The parent performs review, research, planning, implementation, and verification directly. A helper dispatch must expose its runtime estimate and fresh read-only contract; otherwise the telemetry outcome is `skip`.
@@ -19,7 +19,7 @@ Pi core không có subagents built-in. Theo design của Pi, subagents là exten
19
19
 
20
20
  Từ `v0.3.7`, `scripts/setup.sh` mặc định cài `pi-subagents` và chạy config preset `safe`.
21
21
 
22
- Workflow prompts của platform dùng **solo-first orchestration policy**: khi anh chạy `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, hoặc `/workflow review`, parent agent đọc `piagent_orchestration_policy`, lập task tree/review lenses, rồi mới cân nhắc subagent cho phần việc độc lập. Anh không bắt buộc phải gọi `/run` nếu chỉ muốn task hoàn chỉnh, và platform cũng không spawn swarm khi task nhỏ. Alias cũ như `/task` vẫn giữ cùng policy.
22
+ Workflow prompts của platform dùng **parent-direct orchestration policy**: parent model tự đọc, suy luận và implement. Helper mặc định tắt. Chỉ khi operator bật `PIAGENT_HELPERS_MODE=on`, runtime mới được phép cân nhắc đúng một helper read-only có context fresh; việc dispatch còn phải chứng minh ít nhất hai lane độc lập và tối thiểu 30% projected net token saving sau cả chi phí handoff/merge. Worker, parallel, nested helper và retry đều bị tắt. Alias cũ như `/task` giữ cùng policy.
23
23
 
24
24
  Kiểm tra nhanh policy trong Pi:
25
25
 
@@ -27,22 +27,21 @@ Kiểm tra nhanh policy trong Pi:
27
27
  /piagent-orchestration
28
28
  ```
29
29
 
30
- Runtime policy dùng `RolePolicy v1` và `HelperRequest v1` để bind objective,
30
+ Runtime policy dùng `RolePolicy v1` và `HelperRequest v2` để bind objective,
31
31
  task/session identity hash, scope, exact tool allowlist, model/effort từ
32
32
  authenticated runtime catalog, context/time/call ceiling, output schema,
33
33
  stopping rule, approval restriction và deduplication key. Chọn mode bằng:
34
34
 
35
35
  ```bash
36
36
  PIAGENT_HELPERS_MODE=off # không recommend/spawn
37
- PIAGENT_HELPERS_MODE=recommend # default; giải thích nhưng không spawn
38
- PIAGENT_HELPERS_MODE=on # chỉ read-only role qua provider adapter
37
+ PIAGENT_HELPERS_MODE=recommend # opt-in quan sát/recommend; không spawn
38
+ PIAGENT_HELPERS_MODE=on # opt-in; vẫn phải qua evidence gate 30%
39
39
  ```
40
40
 
41
- `piagent-worker` vẫn disabled by default và không được auto-delegate cho GA.
42
- CAP-14 chỉ cho tối đa một automatic helper dispatch cho mỗi task/run. Lower-level
43
- helper budget chỉ theo dõi child work do Piagent tạo (tối đa 2 concurrent, 3
44
- explicit owned reservation tổng, 1 pass cho từng scout/planner/reviewer/Oracle,
45
- tối đa 1 writer); nó không
41
+ `piagent-worker` bị disable trong Piagent config và không được delegate.
42
+ CAP-14 mặc định `off`; chỉ environment opt-in mới có thể bật. Lower-level
43
+ helper budget là trần tuyệt đối: tối đa 1 read-only helper concurrent và tổng,
44
+ 0 writer, 0 retry, 8 calls, context handoff tối đa 2.048 token; nó không
46
45
  claim account-wide scheduling hay kiểm soát các Pi session không liên quan.
47
46
  Mỗi dispatch cưỡng chế đúng time/call/token ceiling của request. Timeout,
48
47
  parent cancellation, late/stale result và budget overflow đều fail closed và
@@ -50,7 +49,7 @@ không merge output. Khi thành công, parent chỉ nhận bounded redacted summ
50
49
  giữ merge ownership; durable receipt chỉ giữ digest/counters, không giữ raw
51
50
  child output hay session identity.
52
51
 
53
- Guard extension vẫn load trong subagent process. Bash verify results do not stay in process-local memory only; they are appended to `.pi/piagent-state/observed-bash.jsonl`. Because parent and child share the same project cwd, parent can validate an exact verify command that a guarded worker subagent ran.
52
+ Guard extension vẫn load trong helper process. Piagent helper chỉ đọc nên không tạo verifier hay source-change authority; parent vẫn là owner duy nhất của implementation và exact verifier cuối.
54
53
 
55
54
  Xem chi tiết: `docs/auto-delegation-policy.md`.
56
55
 
@@ -96,15 +95,15 @@ Nội dung chính:
96
95
 
97
96
  - `toolDescriptionMode: compact` để giảm prompt/token;
98
97
  - `asyncByDefault: false` để không tự chạy background nếu không yêu cầu;
99
- - `waitTool.enabled: true` để parent có thể đợi async runs khi workflow cần kết quả;
100
- - `intercomBridge.mode: always` để child có thể hỏi parent qua `contact_supervisor`;
98
+ - `waitTool.enabled: false` để không tạo continuation chờ helper;
99
+ - `intercomBridge.mode: off` để child không mở thêm vòng hỏi/đáp;
101
100
  - `singleRunOutputBaseDir` và `defaultSessionDir` stable trong `~/.pi/agent`;
102
101
  - `worktreeBaseDir` stable cho parallel writer khi được explicit bật;
103
102
  - `scheduledRuns.enabled: false` để không lộ surface schedule nếu user không yêu cầu;
104
- - `parallel.concurrency: 3`;
105
- - `parallel.maxTasks: 6`;
103
+ - `parallel.concurrency: 1` và `parallel.maxTasks: 1` (compatibility surface, không phải parallel dispatch);
106
104
  - `maxSubagentDepth: 1`;
107
- - `maxSubagentSpawnsPerSession: 32`;
105
+ - `maxSubagentSpawnsPerSession: 1`;
106
+ - builtin agents và `piagent-worker` bị disable; chỉ custom read-only role có thể được operator bật rõ;
108
107
  - async completion batching bật.
109
108
 
110
109
  Không ép `subagents.modelScope` mặc định. Anh chọn model parent bằng `/model`; builtin subagents sẽ inherit model nếu không override. Nếu muốn ép chỉ provider:
@@ -276,40 +275,15 @@ Platform package exposes these package-level agents:
276
275
  |---|---|---|
277
276
  | `piagent-scout` | bounded repo mapping | no |
278
277
  | `piagent-planner` | implementation plan + verify gates | no |
279
- | `piagent-worker` | single-writer implementation | yes |
278
+ | `piagent-worker` | compatibility metadata; disabled by config | unavailable |
280
279
  | `piagent-reviewer` | review diff/policy/tests/scope | no |
281
280
  | `piagent-oracle` | second opinion/risk challenge | no |
282
281
 
283
- Default rule:
284
-
285
- - Use `piagent-scout` before touching unfamiliar code.
286
- - Use `piagent-planner` before medium/high-risk changes.
287
- - Use `piagent-worker` only for approved, bounded write tasks.
288
- - Use `piagent-reviewer` before final handoff.
289
- - Use `piagent-oracle` when architecture/product/risk is uncertain.
282
+ Default rule: parent tự làm. Khi operator opt-in, runtime có thể chọn đúng một trong các read-only role phía trên sau khi qua evidence gate 30%; không role nào được retry hay spawn tiếp.
290
283
 
291
284
  ## Worktree isolation
292
285
 
293
- Parallel implementation writers can clobber each other in one checkout. Only use `worktree: true` when:
294
-
295
- - current repo is a Git repo;
296
- - working tree is clean;
297
- - write sets do not overlap;
298
- - parent will review/merge outputs.
299
-
300
- Example:
301
-
302
- ```text
303
- subagent({
304
- tasks: [
305
- { agent: "piagent-worker", task: "Implement feature A" },
306
- { agent: "piagent-worker", task: "Implement feature B" }
307
- ],
308
- worktree: true
309
- })
310
- ```
311
-
312
- For normal solo/internal workflow, prefer one `piagent-worker` plus parallel read-only reviewers.
286
+ Piagent không cấp writer helper và không bật worktree/parallel orchestration. Nếu operator cần các capability upstream này thì đó là một runtime khác ngoài policy/budget/claim của Piagent.
313
287
 
314
288
  ## Watchdog opt-in
315
289
 
@@ -356,10 +330,10 @@ Recommended token policy:
356
330
 
357
331
  - default `safe` preset;
358
332
  - do not set `asyncByDefault` unless anh intentionally wants background-heavy workflow;
359
- - keep `/piagent-orchestration` at `solo-first` unless team has a measured reason to change it;
360
- - one writer at a time;
361
- - parallel reviewers/scouts are OK;
362
- - use `piagent-scout`/`piagent-planner` to compress context before handing off to `piagent-worker`;
333
+ - giữ parent-direct và `PIAGENT_HELPERS_MODE=off` mặc định;
334
+ - parent là writer duy nhất;
335
+ - không parallel, nested, forked-history hay retry helper;
336
+ - chỉ opt-in một read-only helper khi projected net saving từ 30%;
363
337
  - run `/subagents-fleet` to inspect background runs instead of asking parent model to recall everything.
364
338
 
365
339
  ## Nguồn