@piagent/platform 1.5.5 → 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 (323) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/README.md +25 -21
  3. package/README.vi.md +34 -5
  4. package/adapters/web-frontend/profile.json +2 -4
  5. package/architecture/layers.json +18 -3
  6. package/benchmarks/deep-logic-v1/SPECIALIST_PROTOCOL.vi.md +122 -0
  7. package/benchmarks/deep-logic-v1/grade.mjs +272 -10
  8. package/benchmarks/deep-logic-v1/project/apps/admin/src/billing-summary.js +3 -0
  9. package/benchmarks/deep-logic-v1/project/benchmark-contract/public-smoke.test.js +166 -0
  10. package/benchmarks/deep-logic-v1/project/package.json +1 -1
  11. package/benchmarks/deep-logic-v1/project/packages/billing/src/close-period.js +3 -0
  12. package/benchmarks/deep-logic-v1/project/packages/billing/src/plan-timeline.js +3 -0
  13. package/benchmarks/deep-logic-v1/project/test/smoke.test.js +7 -1
  14. package/benchmarks/deep-logic-v1/prompts/budgeted-context-graph.md +2 -0
  15. package/benchmarks/deep-logic-v1/prompts/fair-dependency-scheduler.md +2 -0
  16. package/benchmarks/deep-logic-v1/prompts/layered-policy-resolution.md +2 -0
  17. package/benchmarks/deep-logic-v1/prompts/resumable-stream-assembly.md +3 -1
  18. package/benchmarks/deep-logic-v1/prompts/revision-event-reconciliation.md +2 -0
  19. package/benchmarks/deep-logic-v1/prompts/temporal-usage-billing-close.md +123 -0
  20. package/benchmarks/deep-logic-v1/prompts/transactional-config-merge.md +2 -0
  21. package/benchmarks/deep-logic-v1/suite.json +51 -3
  22. package/benchmarks/deep-logic-v1/variant.mjs +22 -1
  23. package/benchmarks/production-v1/spend-control.v1.json +92 -0
  24. package/benchmarks/production-v1/suite.json +46 -3
  25. package/catalog/capabilities.json +18 -18
  26. package/docs/authority-manifest.md +1 -1
  27. package/docs/auto-delegation-policy.md +38 -73
  28. package/docs/command-reference-vietnamese.md +27 -35
  29. package/docs/context-engine.md +12 -4
  30. package/docs/context-window-policy.md +37 -1
  31. package/docs/distribution-standard.md +7 -7
  32. package/docs/en/architecture.md +27 -13
  33. package/docs/languages.json +4 -4
  34. package/docs/model-options.md +8 -5
  35. package/docs/operator-manual-vietnamese.md +27 -45
  36. package/docs/project-adapters.md +2 -2
  37. package/docs/publishing-for-teams.md +10 -0
  38. package/docs/quality-benchmark.md +427 -62
  39. package/docs/release-install-policy.md +10 -9
  40. package/docs/runtime-harness-standard.md +3 -3
  41. package/docs/runtime-policy-design.md +4 -4
  42. package/docs/runtime-quality-baseline.md +13 -6
  43. package/docs/security-threat-model.md +2 -2
  44. package/docs/subagent-orchestration-capabilities.md +19 -51
  45. package/docs/subagents-and-multiagent.md +21 -47
  46. package/docs/task-implementation-contract.md +3 -3
  47. package/docs/task-lifecycle-vietnamese.md +3 -3
  48. package/docs/team-onboarding.md +2 -2
  49. package/docs/usage-observability.md +7 -2
  50. package/docs/vi/architecture.md +27 -13
  51. package/docs-site/architecture.html +1 -1
  52. package/docs-site/benchmark.html +89 -95
  53. package/docs-site/commands.html +1 -1
  54. package/docs-site/content/benchmark.html +88 -94
  55. package/docs-site/content/en/benchmark.html +134 -90
  56. package/docs-site/content/en/index.html +19 -19
  57. package/docs-site/content/en/runtime.html +4 -4
  58. package/docs-site/content/en/whats-new.html +12 -1
  59. package/docs-site/content/en/workflows.html +2 -2
  60. package/docs-site/content/index.html +19 -19
  61. package/docs-site/content/runtime.html +4 -4
  62. package/docs-site/content/whats-new.html +12 -1
  63. package/docs-site/content/workflows.html +2 -2
  64. package/docs-site/context-engine.html +1 -1
  65. package/docs-site/en/architecture.html +1 -1
  66. package/docs-site/en/benchmark.html +135 -91
  67. package/docs-site/en/commands.html +1 -1
  68. package/docs-site/en/context-engine.html +1 -1
  69. package/docs-site/en/index.html +20 -20
  70. package/docs-site/en/mcp-approval.html +1 -1
  71. package/docs-site/en/mcp-auth.html +1 -1
  72. package/docs-site/en/mcp-servers.html +1 -1
  73. package/docs-site/en/mcp.html +1 -1
  74. package/docs-site/en/permissions.html +1 -1
  75. package/docs-site/en/profiles.html +1 -1
  76. package/docs-site/en/quickstart.html +1 -1
  77. package/docs-site/en/runtime.html +5 -5
  78. package/docs-site/en/scope.html +1 -1
  79. package/docs-site/en/security.html +1 -1
  80. package/docs-site/en/team.html +1 -1
  81. package/docs-site/en/whats-new.html +13 -2
  82. package/docs-site/en/workflows.html +3 -3
  83. package/docs-site/index.html +20 -20
  84. package/docs-site/mcp-approval.html +1 -1
  85. package/docs-site/mcp-auth.html +1 -1
  86. package/docs-site/mcp-servers.html +1 -1
  87. package/docs-site/mcp.html +1 -1
  88. package/docs-site/permissions.html +1 -1
  89. package/docs-site/profiles.html +1 -1
  90. package/docs-site/quickstart.html +1 -1
  91. package/docs-site/runtime.html +5 -5
  92. package/docs-site/scope.html +1 -1
  93. package/docs-site/security.html +1 -1
  94. package/docs-site/team.html +1 -1
  95. package/docs-site/whats-new.html +13 -2
  96. package/docs-site/workflows.html +3 -3
  97. package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
  98. package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
  99. package/evals/fixtures/codex-relative-efficiency-v1.invalid.json +4 -0
  100. package/evals/fixtures/codex-relative-efficiency-v1.valid.json +94 -0
  101. package/evals/fixtures/helper-request.invalid.json +1 -1
  102. package/evals/fixtures/helper-request.valid.json +1 -1
  103. package/evals/fixtures/piagent-webui/session-live-state-v1.invalid.json +18 -0
  104. package/evals/fixtures/piagent-webui/session-live-state-v1.valid.json +27 -0
  105. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +7 -0
  106. package/evals/fixtures/task-authority-snapshot.valid.json +4 -4
  107. package/evals/fs4-readiness-matrix.v1.json +2 -2
  108. package/evals/fs5-causal-arm.v1.json +3 -3
  109. package/evals/fs5-pilot-protocol.v1.json +3 -3
  110. package/evals/fs5-pilot-protocol.v2.json +8 -8
  111. package/evals/fs5-pilot-protocol.v3.json +8 -8
  112. package/evals/fs5-pilot-protocol.v4.json +7 -6
  113. package/evals/fs5-pilot-protocol.v5.json +9 -7
  114. package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
  115. package/evals/runtime-conformance-v1/README.md +43 -0
  116. package/evals/runtime-conformance-v1/evaluate-paid-canary.mjs +198 -0
  117. package/evals/runtime-conformance-v1/lane.json +57 -0
  118. package/evals/runtime-conformance-v1/paid-canary.json +31 -0
  119. package/evals/runtime-conformance-v1/runner.mjs +456 -0
  120. package/package.json +3 -1
  121. package/packages/piagent-core/README.md +13 -4
  122. package/packages/piagent-core/benchmark/benchmark-assurance.js +4 -1
  123. package/packages/piagent-core/benchmark/benchmark-bootstrap.js +91 -9
  124. package/packages/piagent-core/benchmark/benchmark-claim-restrictions.js +38 -7
  125. package/packages/piagent-core/benchmark/benchmark-cli.js +7 -7
  126. package/packages/piagent-core/benchmark/benchmark-codex-relative-efficiency.js +698 -0
  127. package/packages/piagent-core/benchmark/benchmark-codex.js +3 -1
  128. package/packages/piagent-core/benchmark/benchmark-comparison.js +271 -2
  129. package/packages/piagent-core/benchmark/benchmark-core.js +736 -664
  130. package/packages/piagent-core/benchmark/benchmark-execution-guard.js +7 -5
  131. package/packages/piagent-core/benchmark/benchmark-forensics.js +441 -4
  132. package/packages/piagent-core/benchmark/benchmark-host-readiness.js +639 -0
  133. package/packages/piagent-core/benchmark/benchmark-matrix.js +22 -4
  134. package/packages/piagent-core/benchmark/benchmark-normalized-cost.js +317 -0
  135. package/packages/piagent-core/benchmark/benchmark-preflight.js +5 -1
  136. package/packages/piagent-core/benchmark/benchmark-process.js +6 -5
  137. package/packages/piagent-core/benchmark/benchmark-provider-free-evidence.js +345 -0
  138. package/packages/piagent-core/benchmark/benchmark-provider-wire.js +126 -0
  139. package/packages/piagent-core/benchmark/benchmark-record-validation.js +252 -0
  140. package/packages/piagent-core/benchmark/benchmark-report.js +130 -12
  141. package/packages/piagent-core/benchmark/benchmark-resume-recovery.js +14 -0
  142. package/packages/piagent-core/benchmark/benchmark-runner-policy.js +26 -0
  143. package/packages/piagent-core/benchmark/benchmark-runtime-causal.js +244 -0
  144. package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +979 -0
  145. package/packages/piagent-core/benchmark/benchmark-statistics.js +64 -0
  146. package/packages/piagent-core/benchmark/benchmark-stop-policy.js +8 -5
  147. package/packages/piagent-core/benchmark/benchmark-suite-identity.js +31 -0
  148. package/packages/piagent-core/benchmark/benchmark-suite-runtime.js +13 -9
  149. package/packages/piagent-core/benchmark/benchmark-suite.js +149 -2
  150. package/packages/piagent-core/benchmark/benchmark-summary-support.js +380 -0
  151. package/packages/piagent-core/benchmark/benchmark-timing-diagnostics.js +971 -0
  152. package/packages/piagent-core/benchmark/benchmark-usage.js +322 -0
  153. package/packages/piagent-core/benchmark/benchmark-workflow.js +166 -0
  154. package/packages/piagent-core/capabilities/runtime-integrity.js +3 -0
  155. package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +1080 -0
  156. package/packages/piagent-core/extensions/acceptance-behavior-proof.js +806 -0
  157. package/packages/piagent-core/extensions/acceptance-contract-semantics.js +83 -69
  158. package/packages/piagent-core/extensions/acceptance-error-classes.js +160 -0
  159. package/packages/piagent-core/extensions/acceptance-executable-evidence.js +12 -9
  160. package/packages/piagent-core/extensions/acceptance-receipt.js +123 -59
  161. package/packages/piagent-core/extensions/acceptance-state-machine-evidence.js +518 -0
  162. package/packages/piagent-core/extensions/acceptance-test-binding-evidence.js +60 -0
  163. package/packages/piagent-core/extensions/context-efficiency-metrics.js +302 -0
  164. package/packages/piagent-core/extensions/context-efficiency-report.js +167 -0
  165. package/packages/piagent-core/extensions/context-engine.js +149 -156
  166. package/packages/piagent-core/extensions/context-evidence.js +48 -0
  167. package/packages/piagent-core/extensions/context-import-links.js +296 -0
  168. package/packages/piagent-core/extensions/context-index-policy.js +4 -0
  169. package/packages/piagent-core/extensions/context-query-paths.js +57 -0
  170. package/packages/piagent-core/extensions/context-telemetry-integrity.js +65 -0
  171. package/packages/piagent-core/extensions/criterion-context-pack.js +435 -7
  172. package/packages/piagent-core/extensions/criterion-graph.js +82 -9
  173. package/packages/piagent-core/extensions/fallback-base-policy.ts +101 -0
  174. package/packages/piagent-core/extensions/guard-types.ts +6 -0
  175. package/packages/piagent-core/extensions/javascript-regex-evidence.js +32 -0
  176. package/packages/piagent-core/extensions/piagent-guard.ts +420 -260
  177. package/packages/piagent-core/extensions/task-contract-view.js +17 -3
  178. package/packages/piagent-core/extensions/task-lifecycle.js +39 -2
  179. package/packages/piagent-core/extensions/task-state.js +109 -142
  180. package/packages/piagent-core/extensions/verification-intelligence.js +52 -13
  181. package/packages/piagent-core/extensions/workspace-evidence-roots.js +193 -0
  182. package/packages/piagent-core/package.json +1 -1
  183. package/packages/piagent-core/policies/base-policy.json +44 -2
  184. package/packages/piagent-core/policy/authority-manifest.v1.json +3 -3
  185. package/packages/piagent-core/prompts/be-to-fe.md +2 -8
  186. package/packages/piagent-core/prompts/plan.md +1 -1
  187. package/packages/piagent-core/prompts/platform-improve.md +2 -6
  188. package/packages/piagent-core/prompts/review.md +2 -7
  189. package/packages/piagent-core/prompts/scout.md +1 -1
  190. package/packages/piagent-core/prompts/task.md +4 -3
  191. package/packages/piagent-core/runtime/context/context-delivery.ts +103 -0
  192. package/packages/piagent-core/runtime/context/context-delta-shadow.ts +53 -0
  193. package/packages/piagent-core/runtime/context/context-efficiency-format.ts +47 -0
  194. package/packages/piagent-core/runtime/context/context-evidence-qualification.ts +32 -0
  195. package/packages/piagent-core/runtime/context/prefix-telemetry.ts +47 -0
  196. package/packages/piagent-core/runtime/context/repository-memory-hints.ts +27 -0
  197. package/packages/piagent-core/runtime/hooks/agent-prompt-telemetry.ts +56 -0
  198. package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +162 -102
  199. package/packages/piagent-core/runtime/hooks/completion-hook.ts +12 -12
  200. package/packages/piagent-core/runtime/hooks/input-hook.ts +17 -1
  201. package/packages/piagent-core/runtime/hooks/session-hooks.ts +22 -2
  202. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +107 -3
  203. package/packages/piagent-core/runtime/hooks/tool-result-content-guards.ts +95 -0
  204. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +134 -166
  205. package/packages/piagent-core/runtime/hooks/tool-result-value-helpers.ts +66 -0
  206. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +4 -2
  207. package/packages/piagent-core/runtime/inspection/activity-recovery.ts +104 -0
  208. package/packages/piagent-core/runtime/inspection/bounded-emission-guard.ts +286 -0
  209. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +37 -7
  210. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +1 -1
  211. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +1 -1
  212. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +27 -4
  213. package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +70 -0
  214. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +73 -9
  215. package/packages/piagent-core/runtime/model/authenticated-catalog.ts +17 -9
  216. package/packages/piagent-core/runtime/model/openai-codex-reasoning.ts +83 -0
  217. package/packages/piagent-core/runtime/model/provider-wire-fingerprint.ts +238 -0
  218. package/packages/piagent-core/runtime/orchestration/helper-lifecycle.ts +16 -12
  219. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +71 -0
  220. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +28 -20
  221. package/packages/piagent-core/runtime/orchestration/role-policy.ts +27 -9
  222. package/packages/piagent-core/runtime/orchestration/subagent-tool-policy.ts +329 -0
  223. package/packages/piagent-core/runtime/policy/block-remedy.ts +0 -4
  224. package/packages/piagent-core/runtime/product/activity-inspector.ts +7 -2
  225. package/packages/piagent-core/runtime/product/efficiency-metrics.ts +7 -2
  226. package/packages/piagent-core/runtime/quality/edit-freshness-guard.ts +102 -0
  227. package/packages/piagent-core/runtime/quality/exact-output-contract.ts +22 -11
  228. package/packages/piagent-core/runtime/quality/performance-assurance-signals.ts +23 -0
  229. package/packages/piagent-core/runtime/quality/performance-assurance.ts +9 -5
  230. package/packages/piagent-core/runtime/recovery/continuation-budget.ts +1 -1
  231. package/packages/piagent-core/runtime/recovery/edit-recovery-context.ts +113 -0
  232. package/packages/piagent-core/runtime/recovery/edit-recovery-delivery.ts +42 -0
  233. package/packages/piagent-core/runtime/recovery/handoff-projection.ts +4 -1
  234. package/packages/piagent-core/runtime/recovery/pristine-task-policy-refresh.ts +91 -0
  235. package/packages/piagent-core/runtime/recovery/recovery-policy.ts +7 -4
  236. package/packages/piagent-core/runtime/recovery/resume-state.ts +112 -14
  237. package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +60 -13
  238. package/packages/piagent-core/runtime/recovery/semantic-repair-runtime.ts +55 -2
  239. package/packages/piagent-core/runtime/recovery/task-evidence-coverage-refresh.ts +217 -0
  240. package/packages/piagent-core/runtime/registration/context-commands.ts +82 -7
  241. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +9 -5
  242. package/packages/piagent-core/runtime/registration/operator-request-intake.ts +49 -0
  243. package/packages/piagent-core/runtime/registration/policy-tools.ts +50 -15
  244. package/packages/piagent-core/runtime/registration/session-commands.ts +1 -1
  245. package/packages/piagent-core/runtime/registration/task-completion-tools.ts +61 -25
  246. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +21 -12
  247. package/packages/piagent-core/runtime/registration/task-start-guidance.ts +169 -0
  248. package/packages/piagent-core/runtime/registration/task-start-manifest.ts +54 -0
  249. package/packages/piagent-core/runtime/registration/task-start-retry-helpers.ts +37 -0
  250. package/packages/piagent-core/runtime/registration/task-start-tool.ts +108 -103
  251. package/packages/piagent-core/runtime/runtime-limits.ts +16 -2
  252. package/packages/piagent-core/runtime/session/adaptive-context-analysis.ts +461 -0
  253. package/packages/piagent-core/runtime/session/adaptive-context-governor.ts +464 -0
  254. package/packages/piagent-core/runtime/session/adaptive-context-ledger.ts +265 -0
  255. package/packages/piagent-core/runtime/session/message-signals.ts +7 -3
  256. package/packages/piagent-core/runtime/session/operator-request-carry.ts +44 -0
  257. package/packages/piagent-core/runtime/session/runtime-state.ts +161 -5
  258. package/packages/piagent-core/runtime/session/source-checkout-read-grants.ts +35 -0
  259. package/packages/piagent-core/runtime/session/system-prompt.ts +76 -14
  260. package/packages/piagent-core/runtime/session/task-contract-presentation.ts +39 -0
  261. package/packages/piagent-core/runtime/tools/apply-patch-tool.ts +500 -0
  262. package/packages/piagent-core/runtime/tools/phase-tools.ts +8 -8
  263. package/packages/piagent-core/runtime/tools/tool-groups.ts +12 -2
  264. package/packages/piagent-core/runtime/trajectory/trajectory-runtime.ts +2 -1
  265. package/packages/piagent-core/runtime/verification/exact-verifier-reuse.ts +101 -0
  266. package/packages/piagent-core/runtime/workflows/runtime-intake-compaction.ts +164 -0
  267. package/packages/piagent-core/runtime/workflows/task-intake.ts +207 -38
  268. package/packages/piagent-core/security/sensitive-data.js +13 -218
  269. package/packages/piagent-core/security/sensitive-project-file.js +42 -0
  270. package/packages/piagent-core/security/sensitive-source-expression.js +330 -0
  271. package/packages/piagent-core/security/sensitive-source-formats.js +394 -0
  272. package/packages/piagent-core/security/sensitive-text.js +234 -0
  273. package/packages/piagent-core/subagents/piagent-oracle.md +5 -3
  274. package/packages/piagent-core/subagents/piagent-planner.md +6 -4
  275. package/packages/piagent-core/subagents/piagent-reviewer.md +5 -3
  276. package/packages/piagent-core/subagents/piagent-scout.md +4 -2
  277. package/packages/piagent-core/subagents/piagent-worker.md +7 -5
  278. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-rD9WJKxs.js → MarkdownMessage-B4XehTCU.js} +1 -1
  279. package/packages/piagent-webui/dist/client/assets/index-CgOEyRPG.js +176 -0
  280. package/packages/piagent-webui/dist/client/index.html +1 -1
  281. package/packages/piagent-webui/extension/piagent-webui.ts +3 -1
  282. package/packages/piagent-webui/extension/same-session-bridge.ts +1 -1
  283. package/packages/piagent-webui/extension/session-stream-adapter.ts +33 -10
  284. package/packages/piagent-webui/gateway/gateway-events.ts +109 -5
  285. package/packages/piagent-webui/gateway/gateway-service.ts +3 -0
  286. package/packages/piagent-webui/gateway/gateway-session-stream.ts +122 -20
  287. package/packages/piagent-webui/gateway/session-command-controller.ts +18 -3
  288. package/packages/piagent-webui/gateway/session-effective-options.ts +47 -0
  289. package/packages/piagent-webui/gateway/session-live-state.ts +21 -0
  290. package/packages/piagent-webui/gateway/session-operation-lifecycle.ts +237 -0
  291. package/packages/piagent-webui/gateway/session-operation-retry-control.ts +38 -0
  292. package/packages/piagent-webui/gateway/session-operation-start.ts +5 -1
  293. package/packages/piagent-webui/gateway/session-operation-watchdog.ts +165 -0
  294. package/packages/piagent-webui/gateway/session-runtime-factory.ts +45 -0
  295. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +141 -125
  296. package/packages/piagent-webui/ownership/session-lease-store.ts +5 -2
  297. package/packages/piagent-webui/server/core-inspection-provider.ts +2 -1
  298. package/packages/piagent-webui/server/loopback-server.ts +8 -0
  299. package/packages/piagent-webui/server/transcript-projection.ts +113 -9
  300. package/packages/piagent-webui/shared/text-visibility.ts +10 -0
  301. package/schemas/codex-relative-efficiency-v1.schema.json +155 -0
  302. package/schemas/piagent-webui/catalog-v1.json +9 -0
  303. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +53 -3
  304. package/schemas/piagent-webui/runtime-event-v2.schema.json +15 -5
  305. package/schemas/piagent-webui/session-live-state-v1.schema.json +76 -0
  306. package/schemas/piagent-webui/subagent-tree-v1.schema.json +11 -1
  307. package/schemas/project-profile.schema.json +1 -1
  308. package/schemas/task-contract.schema.json +27 -1
  309. package/scripts/benchmark-runner-core.mjs +367 -363
  310. package/scripts/benchmark-runner-finalization.mjs +313 -0
  311. package/scripts/benchmark-runner-host-readiness.mjs +94 -0
  312. package/scripts/benchmark-runner-support.mjs +200 -0
  313. package/scripts/benchmark-session.mjs +95 -41
  314. package/scripts/configure-model-scope.sh +4 -3
  315. package/scripts/configure-subagents.sh +42 -34
  316. package/scripts/helper-evaluation.mjs +2 -2
  317. package/scripts/install-global.sh +2 -2
  318. package/scripts/pi-usage-history.mjs +37 -10
  319. package/scripts/setup.sh +2 -2
  320. package/scripts/team-doctor.sh +1 -1
  321. package/scripts/verify-local.sh +10 -1
  322. package/templates/global/settings.json +2 -1
  323. package/packages/piagent-webui/dist/client/assets/index-BZRFw1u6.js +0 -174
@@ -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.5.5 | 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.5.5` | 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.5.5
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.5.5 (helper package version)
138
- tag: v1.5.5
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.5.5
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`.
@@ -385,9 +385,10 @@ Re-running the workflow from a branch instead skips publishing, because the publ
385
385
  category bands và 95% token-ratio confidence nên là model-quota gate có xác
386
386
  nhận riêng, không chạy ngầm trong CI. Không claim token/cost nếu report không
387
387
  cho phép `tokenClaimAllowed` hoặc `productionGate.passed` khác `true`.
388
- Zero-usage process failure có thể retry tối đa hai lần với backoff và phải xuất hiện trong
389
- infrastructure ledger; timeout hay task failure không được retry để né điểm
390
- reliability.
388
+ Release run yêu cầu zero infrastructure retry và zero unknown provider-attempt
389
+ usage. Diagnostic retry override phải xuất hiện trong infrastructure ledger
390
+ và làm production claim fail; timeout hay task failure không được retry để né
391
+ điểm reliability.
391
392
 
392
393
  3. Push the release-candidate branch, open a pull request to `main`, and wait for both Ubuntu/macOS verify jobs and both CodeQL matrix jobs to pass. Record the exact PR-head commit SHA that passed; do not merge it into the Vercel production branch yet, and do not tag a later unverified edit.
393
394
  4. Create an annotated, reviewed tag on that exact verified commit and push the tag. Pushing the tag starts `publish.yml`, which runs the full verify matrix as a dependency and only then publishes, so a failure on any supported runtime stops the release before it reaches the registry:
@@ -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
@@ -51,7 +51,7 @@ Profiles define:
51
51
  - `rootMarkers`
52
52
  - `protectedPaths`
53
53
  - `shellProtectedPaths` — shell-only deny list for bash/exec parsing.
54
- - `readOnlyPaths` — path tools may read, but write/edit and shell access are denied.
54
+ - `readOnlyPaths` — path tools may read, but `write`/`edit`/`apply_patch` and shell access are denied.
55
55
  - `requiredContext`
56
56
  - `verifyCommands`
57
57
  - `mcpCapabilities`
@@ -60,9 +60,9 @@ Profiles define:
60
60
 
61
61
  The same platform can operate as `web-frontend`, `backend-api`, `fullstack`, `be-readonly-fe`, `data`, `devops`, `docs`, `python`, `node-typescript`, or `mobile` by switching profile.
62
62
 
63
- `protectedPaths` blocks read/write path-tool access and is also used for shell matching when `shellProtectedPaths` is omitted. `readOnlyPaths` is for contracts such as `be-readonly-fe`: path tools may inspect these files with `read`, `grep`, `find`, and `ls`, but write/edit and shell access are blocked automatically.
63
+ `protectedPaths` blocks `read`/`write`/`edit`/`apply_patch` access and is also used for shell matching when `shellProtectedPaths` is omitted. `readOnlyPaths` is for contracts such as `be-readonly-fe`: path tools may inspect these files with `read`, `grep`, `find`, and `ls`, but `write`/`edit`/`apply_patch` and shell access are blocked automatically.
64
64
 
65
- `shellProtectedPaths` is intentionally shell-only. A path declared only there blocks `bash`/`exec` access, but does not block `read`, `write`, or `edit` path tools. `profile-doctor` and `team-doctor` warn on shell-only entries so older custom profiles can migrate write-sensitive paths to `protectedPaths` or `readOnlyPaths`.
65
+ `shellProtectedPaths` is intentionally shell-only. A path declared only there blocks `bash`/`exec` access, but does not block `read`, `write`, `edit`, or `apply_patch`. `profile-doctor` and `team-doctor` warn on shell-only entries so older custom profiles can migrate write-sensitive paths to `protectedPaths` or `readOnlyPaths`.
66
66
 
67
67
  ## Permission profiles
68
68
 
@@ -70,7 +70,7 @@ The runtime separates the active autonomy profile from the project profile:
70
70
 
71
71
  | Profile | Meaning |
72
72
  |---|---|
73
- | `read-only` | Allows source inspection through `read`, `grep`, `find`, `ls`, plus piagent state tools. Blocks shell, write/edit, and unknown non-piagent tools before execution. |
73
+ | `read-only` | Allows source inspection through `read`, `grep`, `find`, `ls`, plus piagent state tools. Blocks shell, `write`/`edit`/`apply_patch`, and unknown non-piagent tools before execution. |
74
74
  | `workspace-write` | Default governed implementation mode. Existing protected-path, shell, capability, context, verify, and final gates remain active. |
75
75
  | `trusted-full-access` | Trusted automation mode for known repos. It can relax tool-registry blocks and capability filesystem scopes inside the guard, but protected paths, secret redaction, capability-lock integrity, and destructive/external confirmation still apply. |
76
76
 
@@ -27,7 +27,7 @@ piagent_permission_status
27
27
 
28
28
  Runtime behavior:
29
29
 
30
- - `read-only` chặn shell, write/edit, và unknown non-piagent tools;
30
+ - `read-only` chặn shell, `write`/`edit`/`apply_patch`, và unknown non-piagent tools;
31
31
  - `workspace-write` là default cho implementation có guard;
32
32
  - `trusted-full-access` nới tool/scope autonomy trong môi trường trusted nhưng không tắt protected paths, redaction, capability lock, hoặc human gate cho destructive/external action.
33
33
  - `/permission full-access <task>` bật `trusted-full-access` cho session hiện tại rồi gửi phần task còn lại cho agent; `/permission status` hiển thị mode và boundary đang active. Alias `/full-access <task>` và `/permission-status` vẫn chạy.
@@ -45,7 +45,7 @@ Runtime behavior:
45
45
  - phân tích shell command trước khi chạy lệnh rủi ro;
46
46
  - block destructive patterns;
47
47
  - đệ quy vào shell wrapper phổ biến như `sudo`, `env`, `bash -c`, subshell, command substitution, và backtick;
48
- - check `shellProtectedPaths` cho bash, mặc định bảo vệ `.git`, `auth.json`, `.env`, `.env.*`; path chỉ nằm trong `shellProtectedPaths` là shell-only và không chặn write/edit;
48
+ - check `shellProtectedPaths` cho bash, mặc định bảo vệ `.git`, `auth.json`, `.env`, `.env.*`; path chỉ nằm trong `shellProtectedPaths` là shell-only và không chặn `write`/`edit`/`apply_patch`;
49
49
  - kiểm tra cả bare filename, partial glob (`*`, `?`, character class, brace), symbolic-link alias đã canonicalize, và redirect shell có hoặc không có khoảng trắng;
50
50
  - redact sensitive text trong text result và JSON-like result details trước khi output được trả về model; non-text media block được giữ nguyên;
51
51
  - cảnh báo broad command prefix như `bash`, `python`, `node`, `git`, `sudo`;
@@ -230,7 +230,13 @@ chỉ lưu histogram tên tool. Chỉ claim chất lượng/token/cost khi các
230
230
  - safety đạt `10/10` và các gate quality/reliability/workflow của suite pass;
231
231
  production yêu cầu điểm tổng hợp ít nhất `9.5/10`, mọi task và mọi
232
232
  category/profile/lifecycle/difficulty band lớn hơn `9.5`, quality không giảm,
233
- cùng paired usage đủ confidence.
233
+ cùng fixed-workload usage đủ confidence; production yêu cầu cận trên 95% của
234
+ primary fresh-token ratio `<=0.60`, exact accepted/failed-attempt usage và
235
+ complete evidence cho đủ 18/18 family, causal context receipt đầy đủ cho mọi
236
+ Piagent run, full suite và zero infrastructure retry/unknown usage. Tỷ lệ token
237
+ theo band/family, API-equivalent text-token cost và duration đều là diagnostic,
238
+ không chặn claim token-focused. Deep-logic vẫn là capability gate riêng với
239
+ token upper95 `<=0.80` và duration upper95 `<=1.10`.
234
240
 
235
241
  `piagent-benchmark <project> --record ...` vẫn route tới recorder cũ cho task
236
242
  project-specific, nhưng không thay thế automatic release benchmark.
@@ -238,10 +244,11 @@ project-specific, nhưng không thay thế automatic release benchmark.
238
244
  `core-v1` là smoke gate 24 session. Release/model claim diện rộng dùng
239
245
  `production-v1`: 18 scenario family x 3 generated variant x 2 surface = 108
240
246
  session, phủ sáu domain, nhiều profile và cold/steady lifecycle. Production gate
241
- chấm thêm từng category và cận trên 95% của paired token ratio; repeat được
247
+ chấm thêm từng category và cận trên 95% của fixed-workload family token ratio;
248
+ duration chỉ được report để chẩn đoán. Repeat được
242
249
  cluster theo scenario family nên không bị tính như bằng chứng độc lập. Runner
243
- chỉ retry lỗi process trước khi có usage, ghi retry vào ledger riêng; timeout và
244
- task failure vẫn được chấm reliability. Chi tiết và quy trình private held-out
250
+ không retry trong release run; override retry được ghi vào ledger riêng và làm
251
+ claim fail. Timeout và task failure vẫn được chấm reliability. Chi tiết và quy trình private held-out
245
252
  suite nằm trong `docs/quality-benchmark.md`.
246
253
 
247
254
  ## Runtime policy trong profile
@@ -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.5.5, 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
@@ -54,7 +54,7 @@ The final category is outside the containment capability of the Piagent guard. I
54
54
  | Malicious project profile or relaxed capability lock | Trust-aware profile loading, deterministic lock digest, base-policy/source integrity, protected self-state, and fail-closed verification | An already trusted malicious repository can execute code through mechanisms outside the guard. |
55
55
  | External GitHub/HTTP/MCP/provider mutation | Direct and proxied action classification plus explicit operator confirmation, including guarded shell carriers | Provider semantics and new tool schemas can change; new integrations require policy and regression review. |
56
56
  | Repository MCP direct tool loses server attribution | Guard and doctor share the merged MCP view. Both session-level and effective per-server `directTools` selections fail closed when `toolPrefix: "none"` removes server identity; approved direct tools remain usable with `server` or `short` prefixes | A future adapter naming mode or config layer must be added to the shared MCP resolver before rollout. |
57
- | Read-only subagent receives mutation-capable tools | Packaged read-only roles carry explicit `read`, `grep`, `find`, `ls` allowlists; CI checks every `acceptanceRole: read-only` manifest, while all shell/edit/write capability remains on the explicit writer role | User/project overrides and a compromised external subagent runtime can replace the packaged contract; inspect effective runtime configuration when accepting third-party roles. |
57
+ | Read-only subagent receives mutation-capable tools | Packaged read-only roles carry explicit `read`, `grep`, `find`, `ls` allowlists; CI checks every `acceptanceRole: read-only` manifest, while all shell, `edit`, `write`, and `apply_patch` capability remains on the explicit writer role | User/project overrides and a compromised external subagent runtime can replace the packaged contract; inspect effective runtime configuration when accepting third-party roles. |
58
58
  | Provider/model output or router attempts to widen solver/helper authority | Solver and model-route inputs are deterministic bounded facts; explicit model/thinking pins win; unknown provenance cannot enforce; exact authenticated catalog matching forbids silent substitution. RolePolicy and HelperRequest intersect parent scope/tools and never delegate approvals. Owner-only budgets enforce total/role/one-writer ceilings | Provider-backed execution remains external. Pi 0.84.1 extension `setModel` also updates user default state, so in-extension auto routing fails closed; only explicit prelaunch may enforce. Automatic workers and helper dispatch remain unpromoted pending controlled evidence. |
59
59
  | Corrupt, stale, symlinked, or partially written runtime sidecar | Closed validators, local-state canonicalization, atomic rename, bounded journals, task/session/tree identity, corrupt-state fail-closed behavior, and feature-off compatibility tests. Synthetic disk-full and permission-denied tests require no authoritative partial trajectory state | A process with the same OS account can still alter local state; application integrity is not OS isolation. Unexpected state must block mutation and route to doctor/handoff. |
60
60
  | Destructive local action | Exec-policy classification and explicit confirmation; protected paths remain denied in every permission profile. A target written as a command substitution is evaluated only where its body is one plain command with literal operands and a format this renderer reproduces exactly, and confirmed otherwise — a separator, a nested substitution, a redirection, a variable, quoting, an escape, a `printf` option, or a `printf` conversion whose result this does not reproduce (`*`, `%q`, `%b`, the numeric conversions, `%%`) all make the body unreadable here. A constant width or precision and format reuse are reproduced, so a target built from those is refused rather than confirmed, and the rendered output is read as a path candidate as well as the format's literal text and its arguments — a name assembled across a conversion (`.e%.1sv nv` is `.env`) appears in none of the pieces. Brace expansion, ranges included, is performed once per segment before anything reads it, so the rules, the legacy patterns, the nested-interpreter scan, the pipeline producers and the destructive checks all see the word list the shell would build rather than the text as typed; the expansion produces a token stream, so a command and its arguments assembled from one brace word (`{cat,.env}`) are read as both; quoting is tracked per character, so a word holding a quoted group beside an expanding one (`"{.env,}"{,}`) expands exactly as far as the shell expands it — and a target that is nothing but an unresolved parameter expansion is confirmed rather than permitted, since it can hold any value including root. The same holds for reads: a word that is only an unresolved parameter expansion is confirmed wherever the command opens files (`cat ${HOME:+.env}`), including across a pipe into an `xargs` that opens them (`echo $F \| xargs cat`), while a command substitution in that position is left to the nested scan that classifies the command inside it, and two expansions with nothing between them count as a name being assembled just as literal text beside one does. Brace expansion, parameter expansion and command substitution are performed once per segment, in the order a shell performs them, and every reader takes that one word list — so a name assembled by an expansion (`r$(printf %s m) -rf /`, `xa$(printf %s rgs)`, `$(printf %s ba)$(echo -n sh) -c '...'`) is the command it becomes rather than the text it was typed as. A name that still cannot be resolved is treated as an unknown command rather than a known-harmless one: it is enough to bring the destructive checks, the interpreter scan and the file-operand net into play, since `${X:+r}m -rf /` and `${X:+cat} ${X:+.env}` are those commands whenever the variable is set. Differential cases are generated rather than enumerated, over the cross product the defects live in — expansion form, position in the command, and reader — with each spelling placed in the command name, the operand, a flag's argument, a redirection target, a pipeline producer, an `xargs` consumer and an interpreter payload; the corpus fails if any generated spelling produced no word list, so a batch that dies early cannot pass as coverage, and it asserts in both directions so a check that answers for everything fails too | Confirmation is not isolation. A trusted process outside the observed tool path retains OS authority. A target produced by any other command is knowable only at run time, so it is gated by confirmation rather than refused. |
@@ -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
@@ -24,7 +24,7 @@ Agent Watch/report hien ten task ma operator da dat.
24
24
  | Mode | `changeMode` | `source-change` hoac `read-only`. |
25
25
  | Retry | `attempt`, `maxAttempts`, `previousAttempts` | Tran lay tu attempt dau, khong duoc nang o retry sau. |
26
26
  | Intent | `summary`, `riskLane`, `expectedOutput`, `acceptanceCriteria` | Chot truoc khi implementation. |
27
- | Scope | `scope`, `outOfScope`, `protectedPaths` | Direct write bi chan ngoai scope; final gate doi chieu Git. |
27
+ | Focus va bao ve | `scope`, `outOfScope`, `protectedPaths` | `scope` dinh huong retrieval/review; protected/read-only policy moi la bien ghi bat buoc. Final gate doi chieu Git va report moi file da doi. |
28
28
  | Context | `requiredContext`, `contextManifest`, `memoryCitations`, `mcpCapabilities` | Citation co path va reason. |
29
29
  | Verify | `verifyGroup`, `verifyCommands`, `verifyEvidence` | Moi command phai observed, exact-match va pass. |
30
30
  | Plan | `workPlan`, `reviewLenses`, `orchestration` | Toi da 12 step, dependency DAG, single writer. |
@@ -89,7 +89,7 @@ Vi vay:
89
89
  - file dirty truoc task nhung bi sua tiep se duoc tinh;
90
90
  - file da duoc sua roi revert ve baseline chi nam trong audit history, khong pass gate;
91
91
  - claim file khong co evidence bi tu choi;
92
- - thay doi ngoai `scope` bi tu choi;
92
+ - thay doi ngoai `scope` van duoc phep khi can de hoan thanh yeu cau; runtime ghi nhan day la focus expansion de review;
93
93
  - delete/missing co digest rieng;
94
94
  - staged rename ghi ca old path va new path.
95
95
 
@@ -137,7 +137,7 @@ nguyen grant cua project va chi re-pin core khi release moi khong mo rong quyen.
137
137
  | Lop | Enforcement |
138
138
  |---|---|
139
139
  | Prompt/workflow | Huong dan dung tool theo thu tu. |
140
- | Tool-call guard | Protected path, scope, read-only, destructive/external confirmation. |
140
+ | Tool-call guard | Protected/read-only path, opaque mutation target, destructive/external confirmation. Task `scope` khong chan ghi file. |
141
141
  | Tool-result observer | Changed-file va bash evidence tu su kien that. |
142
142
  | Persisted contract | Session binding, retry, plan, context, verify, trace. |
143
143
  | Completion hook | Chan completion claim khi gate chua pass. |
@@ -73,13 +73,13 @@ chuyen sang `execute` khi contract do runtime tao co bounded scope, exact
73
73
  verifier, acceptance receipt va mot step `single-writer` dang `in-progress` voi
74
74
  toan bo dependency da xong. Runtime ghi ro phase nao khong ton tai trong automatic
75
75
  plan neu can bo qua. Manual/high-risk task vao phase `plan` de doc, tim va cap
76
- nhat checkpoint; edit/write/bash ghi file van bi chan cho den khi plan/challenge
76
+ nhat checkpoint; `edit`/`write`/`apply_patch` va `bash` ghi file van bi chan cho den khi plan/challenge
77
77
  hoan tat va step `single-writer` thuc su dependency-ready.
78
78
 
79
79
  ### 3. Execute
80
80
 
81
81
  Truoc khi co task contract, project da onboard chi cho inspection co gioi han;
82
- write/edit va shell command that su ghi file bi chan. Sau khi task bat dau:
82
+ `write`/`edit`/`apply_patch` va shell command that su ghi file bi chan. Sau khi task bat dau:
83
83
 
84
84
  - phase `intake`, `scout` va `plan` chi cho discovery; `execute`/`repair` moi co
85
85
  mutation tools, con read-only task khong bao gio nhan quyen mutation;
@@ -105,7 +105,7 @@ Gate completed yeu cau dong thoi:
105
105
  - moi verify command co observed result `exitCode=0` va exact match;
106
106
  - work plan khong con `pending`, `in-progress` hoac `failed`;
107
107
  - declared changed files khop final digest sau baseline; file da revert khong tinh;
108
- - khong co file ngoai `scope`;
108
+ - moi file thay doi deu co evidence; file ngoai focus `scope` duoc report de review nhung khong block;
109
109
  - final trace la `completed`.
110
110
 
111
111
  `true`, `echo ok`, `npm test || true` hoac command gan giong khong thay the lenh
@@ -10,7 +10,7 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
10
10
  ```bash
11
11
  node --version # >= 22.19.0
12
12
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
13
- npm install -g --ignore-scripts @piagent/platform@1.5.5
13
+ npm install -g --ignore-scripts @piagent/platform@1.6.1
14
14
  piagent-install --stable
15
15
  cd /path/to/project
16
16
  pi
@@ -44,7 +44,7 @@ Mặc định team dùng stable helper:
44
44
  ```bash
45
45
  node --version # >= 22.19.0
46
46
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
47
- npm install -g --ignore-scripts @piagent/platform@1.5.5
47
+ npm install -g --ignore-scripts @piagent/platform@1.6.1
48
48
  piagent-install --stable --dry-run
49
49
  piagent-install --stable
50
50
  ```
@@ -57,6 +57,9 @@ piagent_context_preflight
57
57
  `contextWasteScore`: duplicate reads, duplicate output, tool-schema share,
58
58
  low-confidence retrieval, và active-tool excess. Score này phải đi cùng task
59
59
  gate/verify result; nó không tự kết luận model hoặc nhân viên làm tốt/xấu. Nếu
60
+ evidence của bất kỳ lane có trọng số nào chưa đầy đủ, score chính là `null` và
61
+ UI ghi `unavailable`; `contextWasteScoreEstimate` chỉ là chẩn đoán partial, không
62
+ được diễn giải thành “không có waste”. Nếu
60
63
  session có Task Contract, JSON detail còn có `taskEfficiency`: hashed
61
64
  session/task/run identity, solver route/mode/override, persisted phase duration,
62
65
  context/tool-group utilization, verify/repair/retry count, digest-only helper
@@ -169,8 +172,10 @@ Alias ngắn `/setname ABC-123 Short task name` vẫn chạy. Nếu tắt nhầm
169
172
 
170
173
  Task Contract v2 lưu cả `sessionId`, `sessionName`, `taskId` và `taskRunId`, nên
171
174
  Agent Watch/report có thể map usage vào đúng attempt kể cả session đã resume hoặc
172
- được đổi tên sau khi bắt đầu. Một session không được tái sử dụng cho task khác;
173
- retry dùng session mới và giữ liên kết qua cùng `taskId`.
175
+ được đổi tên sau khi bắt đầu. Người dùng có thể giao việc khác ngay trong cùng
176
+ session; runtime kết thúc partition cũ và tạo `taskRunId` mới thay vì khóa session
177
+ vào một workflow. Retry có thể dùng session mới và vẫn giữ liên kết qua cùng
178
+ `taskId`.
174
179
 
175
180
  Mặc định history mode **bao gồm subagent session files** vì đó là usage thật của máy. Dùng `--no-subagents` khi chỉ muốn parent/main sessions.
176
181
 
@@ -44,6 +44,7 @@ Rule máy đọc nằm tại `architecture/layers.json`; chạy `npm run archite
44
44
  | Security foundation | `packages/piagent-core/security/` | Sensitive-data primitive | Workflow behavior |
45
45
  | Benchmark | `packages/piagent-core/benchmark/`, `benchmarks/` | Suite validation, scoring, evidence | Runtime enforcement |
46
46
  | WebUI contracts | `packages/piagent-webui/contracts/` | Wire type dùng chung giữa browser và server | Mọi hành vi runtime; layer này không phụ thuộc gì |
47
+ | WebUI shared | `packages/piagent-webui/shared/` | Helper xác định, không có dependency, dùng chung cho browser, server và gateway | Browser state, transport, truy cập filesystem hoặc runtime policy |
47
48
  | WebUI client | `packages/piagent-webui/client/` | View trên browser, view model, UI preference | Server state, filesystem, Pi API |
48
49
  | WebUI server | `packages/piagent-webui/server/` | HTTP/WS endpoint, đọc session, dựng diff | Render phía browser; không được import client |
49
50
  | WebUI extension | `packages/piagent-webui/extension/` | Lệnh `/piagent-webui` chạy trong Pi | Wire type mà client cũng cần |
@@ -93,10 +94,23 @@ operator review.
93
94
  Hash chain của journal và acceptance receipt là operational evidence do cùng
94
95
  runtime tạo ra, không phải independent attestation hay một audit authority độc lập.
95
96
 
97
+ Gateway bind mỗi lần browser gửi vào đúng một operation lifecycle dùng chung
98
+ giữa stream và supervisor. Runtime chỉ cho tối đa một provider retry còn
99
+ pristine trong khoảng delay 8 giây, và từ chối replay sau khi đã có assistant
100
+ output nhìn thấy hoặc bất kỳ tool call nào. Compaction có phase riêng, terminal
101
+ settlement chỉ phát một lần và event đến muộn không thể đưa UI trở lại
102
+ `Working`. Bounded emission guard cục bộ bỏ activity/reviewer note lặp hoặc câu
103
+ filler; final assistant message luôn đi ngoài guard này.
104
+
105
+ Exact edit và local patch còn có thể bind vào full-file digest của lần read
106
+ thành công gần nhất trong cùng task run. Concurrent drift đã được chứng minh sẽ
107
+ block toàn bộ mutation trước hunk đầu tiên và yêu cầu một fresh read; file chưa
108
+ có snapshot vẫn dùng exact-anchor behavior bình thường của host.
109
+
96
110
  Recovery dựa trên classification và bị giới hạn xuyên suốt các task attempt.
97
- Chỉ failure thuộc source và nằm trong scope mới có tối đa một repair pass;
111
+ Chỉ failure có evidence chứng minh thuộc ownership của source mới có tối đa một repair pass;
98
112
  transient verifier/provider failure chỉ có tối đa một exact retry và không có
99
- source-mutation authority. Environment, permission, policy, scope và unknown
113
+ source-mutation authority. Environment, permission, protected-path policy và unknown
100
114
  failure luôn non-mutating. `PIAGENT_AUTO_RECOVERY=off` khôi phục ordinary P3
101
115
  handoff behavior mà không migrate state. Mọi final path ghi redacted Handoff v1
102
116
  projection từ operational truth. Khi resume, runtime bind task/session identity,
@@ -110,7 +124,7 @@ Semantic specialist review là đường CAP-13 riêng cho `strict-high-risk`, k
110
124
  phải parser-driven recovery áp dụng phổ quát. Nó bị pin vào một shared
111
125
  continuation, một current-tree diff, hai targeted read, đúng source/test path đủ
112
126
  điều kiện và configured verifier sau mọi mutation. Call bị deny, fail, no-op,
113
- stale, ngoài scope, unsupported hoặc hết budget sẽ khóa cơ hội và handoff.
127
+ stale, không xác định được target, unsupported hoặc hết budget sẽ khóa cơ hội và handoff.
114
128
  Broad-default observe/advise không schedule review này và không block tool call.
115
129
 
116
130
  Adaptive Context Planner chạy trước khi runtime auto inject context. Nó dùng
@@ -123,9 +137,9 @@ vào context.
123
137
 
124
138
  Task Contract v2 còn mang projection lập kế hoạch Criterion Graph v1 theo kiểu
125
139
  cộng thêm. Graph map đúng một lần từng criterion của operator sang planning kind
126
- đóng, target hint nằm trong scope, proof kind và dependency order. Graph không có
140
+ đóng, target hint theo initial focus, proof kind và dependency order. Graph không có
127
141
  state `satisfied`, nên không thể thay acceptance hay exact-verifier truth. Graph
128
- ưu tiên context liên quan trong scope trước observation cũ, giữ nguyên digest qua
142
+ ưu tiên context theo focus relevance trước observation cũ, giữ nguyên digest qua
129
143
  compaction/resume, không đổi tool schema và không tạo provider follow-up turn.
130
144
  `PIAGENT_INTELLIGENCE_ENGINE=off` chọn mechanical control cho causal test hoặc
131
145
  rollback khẩn cấp; task mới mặc định dùng criterion engine và pin mode/digest của
@@ -164,16 +178,16 @@ automatic dispatch của mọi capability bị chặn ở một đơn vị cho m
164
178
  interaction check này được bind vào snapshot và không đổi tool schema mà
165
179
  provider nhìn thấy.
166
180
 
167
- Helper do Piagent sở hữu dùng RolePolicy v1 và HelperRequest v1. Request bind
168
- hashed session/task identity, bounded objective, read/write scope, exact tool
181
+ Helper do Piagent sở hữu dùng RolePolicy v1 và HelperRequest v2. Request bind
182
+ hashed session/task identity, bounded objective, read-only scope, exact tool
169
183
  allowlist, authenticated model/effort source, context/time/call ceiling, output
170
184
  schema, stopping rule, approval restriction và deduplication key. Read-only role
171
- không thể nhận mutation tool. Worker default off và cần explicit single-writer
172
- lease. `PIAGENT_HELPERS_MODE=off|recommend|on` mặc định là `recommend`; `on` chỉ
173
- cho phép read-only dispatch qua provider adapter đã cài. CAP-14 chỉ cho tối đa
174
- một automatic helper dispatch cho mỗi task/run; lower-level owner budget vẫn
175
- giới hạn hai helper concurrent và ba explicit owned reservation tổng, deduplicate
176
- work tương đương, recover reservation hết hạn mà không tăng budget, và cancel
185
+ không thể nhận mutation tool và worker dispatch bị tắt.
186
+ `PIAGENT_HELPERS_MODE=off|recommend|on` mặc định là `off`; `on` là opt-in rõ ràng
187
+ nhưng runtime vẫn phải chứng minh hai lane độc lập và projected net token saving
188
+ từ 30%. CAP-14 cùng owner budget chặn tuyệt đối ở một helper read-only fresh tổng
189
+ và concurrent, 0 writer, 0 retry, 8 calls và tối đa 2.048 context token chuyển giao.
190
+ Failure/reservation hết hạn vẫn dùng hết slot duy nhất, và runtime cancel
177
191
  late work khi parent Task Contract terminal. Controller không claim quyền kiểm
178
192
  soát Pi session/account usage không liên quan và không đổi user-pinned parent
179
193
  model. Dispatch cưỡng chế time/call/token ceiling khi merge result: timeout,