@piagent/platform 1.7.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/AGENTS.md +7 -0
  2. package/CHANGELOG.md +113 -1
  3. package/README.md +45 -70
  4. package/README.vi.md +34 -61
  5. package/architecture/layers.json +16 -3
  6. package/catalog/capabilities.json +14 -7
  7. package/catalog/claude-model-additions.json +42 -0
  8. package/docs/auto-delegation-policy.md +2 -0
  9. package/docs/command-reference-vietnamese.md +69 -91
  10. package/docs/context-window-policy.md +5 -5
  11. package/docs/distribution-standard.md +16 -19
  12. package/docs/en/architecture.md +9 -1
  13. package/docs/herdr-workflow.md +2 -3
  14. package/docs/languages.json +4 -4
  15. package/docs/managed-local-acceptance.md +403 -0
  16. package/docs/mcp-and-tools.md +5 -7
  17. package/docs/memory-policy.md +3 -3
  18. package/docs/model-options.md +22 -17
  19. package/docs/oauth-providers.md +1 -1
  20. package/docs/operator-manual-vietnamese.md +85 -130
  21. package/docs/package-architecture-notes.md +4 -4
  22. package/docs/piagent-core-improvement-plan.md +3 -5
  23. package/docs/piagent-core-plan-checkpoint-2026-09-06.json +2 -13
  24. package/docs/piagent-runtime-benchmark-execution-plan.md +10 -8
  25. package/docs/project-adapters.md +3 -3
  26. package/docs/project-onboarding.md +15 -16
  27. package/docs/publishing-for-teams.md +3 -1
  28. package/docs/quality-benchmark.md +2 -0
  29. package/docs/quickstart-vietnamese.md +24 -25
  30. package/docs/release-install-policy.md +16 -11
  31. package/docs/research/harness-next-evidence-review.md +7 -7
  32. package/docs/runtime-harness-standard.md +2 -0
  33. package/docs/runtime-policy-design.md +2 -0
  34. package/docs/runtime-quality-baseline.md +2 -0
  35. package/docs/subagent-orchestration-capabilities.md +1 -1
  36. package/docs/subagents-and-multiagent.md +10 -8
  37. package/docs/task-implementation-contract.md +2 -0
  38. package/docs/task-lifecycle-vietnamese.md +2 -0
  39. package/docs/team-onboarding.md +33 -64
  40. package/docs/usage-observability.md +2 -2
  41. package/docs/vi/architecture.md +9 -1
  42. package/docs/workflow-recipes.md +6 -10
  43. package/docs-site/architecture.html +4 -3
  44. package/docs-site/assets/docs.css +80 -0
  45. package/docs-site/benchmark.html +7 -1
  46. package/docs-site/commands.html +37 -23
  47. package/docs-site/content/architecture.html +2 -2
  48. package/docs-site/content/benchmark.html +5 -0
  49. package/docs-site/content/commands.html +35 -22
  50. package/docs-site/content/ecosystem.html +144 -0
  51. package/docs-site/content/en/architecture.html +1 -1
  52. package/docs-site/content/en/benchmark.html +5 -0
  53. package/docs-site/content/en/commands.html +30 -13
  54. package/docs-site/content/en/ecosystem.html +144 -0
  55. package/docs-site/content/en/index.html +24 -9
  56. package/docs-site/content/en/quickstart.html +10 -12
  57. package/docs-site/content/en/runtime.html +1 -1
  58. package/docs-site/content/en/security.html +1 -1
  59. package/docs-site/content/en/team.html +2 -2
  60. package/docs-site/content/en/whats-new.html +89 -1
  61. package/docs-site/content/en/workflows.html +29 -31
  62. package/docs-site/content/index.html +24 -9
  63. package/docs-site/content/quickstart.html +10 -12
  64. package/docs-site/content/runtime.html +2 -2
  65. package/docs-site/content/security.html +2 -2
  66. package/docs-site/content/team.html +2 -2
  67. package/docs-site/content/whats-new.html +89 -1
  68. package/docs-site/content/workflows.html +36 -38
  69. package/docs-site/context-engine.html +2 -1
  70. package/docs-site/ecosystem.html +283 -0
  71. package/docs-site/en/architecture.html +3 -2
  72. package/docs-site/en/benchmark.html +7 -1
  73. package/docs-site/en/commands.html +32 -14
  74. package/docs-site/en/context-engine.html +2 -1
  75. package/docs-site/en/ecosystem.html +283 -0
  76. package/docs-site/en/index.html +30 -14
  77. package/docs-site/en/mcp-approval.html +2 -1
  78. package/docs-site/en/mcp-auth.html +2 -1
  79. package/docs-site/en/mcp-servers.html +2 -1
  80. package/docs-site/en/mcp.html +2 -1
  81. package/docs-site/en/permissions.html +2 -1
  82. package/docs-site/en/profiles.html +2 -1
  83. package/docs-site/en/quickstart.html +17 -18
  84. package/docs-site/en/runtime.html +3 -2
  85. package/docs-site/en/scope.html +2 -1
  86. package/docs-site/en/security.html +6 -5
  87. package/docs-site/en/team.html +4 -3
  88. package/docs-site/en/whats-new.html +97 -8
  89. package/docs-site/en/workflows.html +34 -35
  90. package/docs-site/index.html +30 -14
  91. package/docs-site/mcp-approval.html +2 -1
  92. package/docs-site/mcp-auth.html +2 -1
  93. package/docs-site/mcp-servers.html +2 -1
  94. package/docs-site/mcp.html +2 -1
  95. package/docs-site/permissions.html +2 -1
  96. package/docs-site/profiles.html +2 -1
  97. package/docs-site/quickstart.html +17 -18
  98. package/docs-site/runtime.html +4 -3
  99. package/docs-site/scope.html +2 -1
  100. package/docs-site/security.html +7 -6
  101. package/docs-site/team.html +4 -3
  102. package/docs-site/whats-new.html +97 -8
  103. package/docs-site/workflows.html +41 -42
  104. package/evals/fs5-causal-arm.v1.json +2 -2
  105. package/evals/private-holdout-v1/CURRENT_BOUNDARY.md +17 -0
  106. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  107. package/package.json +10 -9
  108. package/packages/piagent-core/README.md +15 -23
  109. package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +2 -0
  110. package/packages/piagent-core/extensions/experiment-loop-policy.ts +75 -0
  111. package/packages/piagent-core/extensions/local-state-path.js +15 -0
  112. package/packages/piagent-core/extensions/piagent-guard.ts +108 -960
  113. package/packages/piagent-core/extensions/policy-core.js +2 -2
  114. package/packages/piagent-core/extensions/source-checkout-paths.ts +54 -0
  115. package/packages/piagent-core/managed/broker-client.mjs +49 -0
  116. package/packages/piagent-core/managed/capabilities.mjs +28 -0
  117. package/packages/piagent-core/managed/compaction.mjs +63 -0
  118. package/packages/piagent-core/managed/doctor.mjs +107 -0
  119. package/packages/piagent-core/managed/native-catalog.mjs +42 -0
  120. package/packages/piagent-core/managed/patch-snapshot.mjs +48 -0
  121. package/packages/piagent-core/managed/repository-operation.mjs +84 -0
  122. package/packages/piagent-core/managed/request-stream.mjs +129 -0
  123. package/packages/piagent-core/managed/resource-loader.mjs +42 -0
  124. package/packages/piagent-core/managed/review-snapshot-worker.mjs +27 -0
  125. package/packages/piagent-core/managed/sandbox-diagnostic.mjs +12 -0
  126. package/packages/piagent-core/managed/search-fallback.mjs +93 -0
  127. package/packages/piagent-core/managed/session.mjs +472 -0
  128. package/packages/piagent-core/managed/store.d.mts +3 -0
  129. package/packages/piagent-core/managed/store.mjs +64 -0
  130. package/packages/piagent-core/managed/tool-boundary.mjs +243 -0
  131. package/packages/piagent-core/managed/tool-worker.mjs +36 -0
  132. package/packages/piagent-core/managed/toolchain.mjs +120 -0
  133. package/packages/piagent-core/managed/web-fetch.mjs +105 -0
  134. package/packages/piagent-core/managed/web-search.mjs +96 -0
  135. package/packages/piagent-core/managed/workflow.mjs +299 -0
  136. package/packages/piagent-core/package.json +3 -6
  137. package/packages/piagent-core/policies/base-policy.json +80 -26
  138. package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +3 -3
  139. package/packages/piagent-core/runtime/hooks/input-hook.ts +35 -196
  140. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -0
  141. package/packages/piagent-core/runtime/inspection/approval-broker.ts +9 -1
  142. package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +1 -1
  143. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +1 -1
  144. package/packages/piagent-core/runtime/managed-failure.d.mts +10 -0
  145. package/packages/piagent-core/runtime/managed-failure.mjs +164 -0
  146. package/packages/piagent-core/runtime/model/model-route-policy.ts +33 -13
  147. package/packages/piagent-core/runtime/model/model-route-types.ts +10 -6
  148. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +8 -29
  149. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +1 -1
  150. package/packages/piagent-core/runtime/policy/block-remedy.ts +5 -3
  151. package/packages/piagent-core/runtime/registration/context-commands.ts +1 -1
  152. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +7 -7
  153. package/packages/piagent-core/runtime/registration/policy-tools.ts +2 -2
  154. package/packages/piagent-core/runtime/registration/session-commands.ts +11 -26
  155. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +1 -1
  156. package/packages/piagent-core/runtime/session/system-prompt.ts +6 -7
  157. package/packages/piagent-core/runtime/workflows/webui-runtime-command.ts +6 -6
  158. package/packages/piagent-core/runtime/workflows/webui-workflow.ts +6 -11
  159. package/packages/piagent-core/security/sensitive-text.js +9 -0
  160. package/packages/piagent-core/skills/piagent-ops/SKILL.md +8 -10
  161. package/packages/piagent-core/skills/test-audit/SKILL.md +101 -0
  162. package/packages/piagent-core/subagents/piagent-planner.md +1 -1
  163. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-DGk34zJT.js → MarkdownMessage-Dd9wPk-v.js} +1 -1
  164. package/packages/piagent-webui/dist/client/assets/index-7I-50Q2U.js +228 -0
  165. package/packages/piagent-webui/dist/client/assets/{index-DVahUVWy.css → index-DgSmcnP8.css} +1 -1
  166. package/packages/piagent-webui/dist/client/index.html +2 -2
  167. package/packages/piagent-webui/extension/piagent-webui.ts +11 -11
  168. package/packages/piagent-webui/extension/session-stream-adapter.ts +3 -1
  169. package/packages/piagent-webui/extension/terminal-session-adapter.ts +6 -1
  170. package/packages/piagent-webui/gateway/company-relay.ts +308 -0
  171. package/packages/piagent-webui/gateway/control-socket.ts +39 -12
  172. package/packages/piagent-webui/gateway/gateway-service.ts +109 -28
  173. package/packages/piagent-webui/gateway/gateway-session-stream.ts +58 -2
  174. package/packages/piagent-webui/gateway/managed-gateway.mjs +41 -0
  175. package/packages/piagent-webui/gateway/managed-launch.ts +145 -0
  176. package/packages/piagent-webui/gateway/managed-projection.ts +20 -0
  177. package/packages/piagent-webui/gateway/pi-host.ts +22 -4
  178. package/packages/piagent-webui/gateway/runtime-session-controls.ts +5 -2
  179. package/packages/piagent-webui/gateway/session-approval-authority.ts +28 -0
  180. package/packages/piagent-webui/gateway/session-catalog.ts +11 -3
  181. package/packages/piagent-webui/gateway/session-command-controller.ts +8 -2
  182. package/packages/piagent-webui/gateway/session-file-facts.ts +25 -0
  183. package/packages/piagent-webui/gateway/session-inspection-registry.ts +42 -12
  184. package/packages/piagent-webui/gateway/session-list-cache.ts +68 -0
  185. package/packages/piagent-webui/gateway/session-runtime-ownership.ts +8 -1
  186. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +20 -27
  187. package/packages/piagent-webui/ownership/managed-terminal-lease.ts +27 -0
  188. package/packages/piagent-webui/ownership/profile-state.ts +2 -0
  189. package/packages/piagent-webui/ownership/session-lease-store.ts +22 -1
  190. package/packages/piagent-webui/server/approval-projection.ts +9 -0
  191. package/packages/piagent-webui/server/core-inspection-provider.ts +4 -9
  192. package/packages/piagent-webui/server/loopback-server.ts +37 -1
  193. package/packages/piagent-webui/server/message-stop-reason.ts +11 -0
  194. package/packages/piagent-webui/server/tool-call-summary.ts +185 -0
  195. package/packages/piagent-webui/server/transcript-projection.ts +86 -3
  196. package/packs/engineering-base/pack.json +4 -0
  197. package/schemas/piagent-webui/runtime-command-v1.schema.json +1 -2
  198. package/schemas/piagent-webui/session-catalog-v1.schema.json +8 -0
  199. package/schemas/piagent-webui/transcript-v1.schema.json +94 -1
  200. package/scripts/build-docs-site.mjs +23 -12
  201. package/scripts/check-public-wording.mjs +5 -6
  202. package/scripts/check-runtime-advisories.mjs +23 -6
  203. package/scripts/claude-model-additions.mjs +33 -0
  204. package/scripts/configure-model-scope.sh +36 -8
  205. package/scripts/configure-subagents.sh +1 -1
  206. package/scripts/explain-command.mjs +5 -6
  207. package/scripts/install-global.sh +2 -2
  208. package/scripts/model-route-evaluation-core.ts +1 -0
  209. package/scripts/model-scope-prune.mjs +75 -0
  210. package/scripts/phase-tools-evaluation.mjs +9 -4
  211. package/scripts/pi-model-route.mjs +1 -1
  212. package/scripts/piagent-cli.mjs +51 -2
  213. package/scripts/piagent-dashboard.mjs +27 -4
  214. package/scripts/piagent-installations.mjs +26 -0
  215. package/scripts/piagent-studio.mjs +155 -0
  216. package/scripts/runtime-advisory-exceptions.json +29 -0
  217. package/scripts/setup.sh +2 -2
  218. package/scripts/team-doctor.sh +20 -1
  219. package/scripts/typescript-loader.mjs +6 -0
  220. package/scripts/verify-local.sh +5 -5
  221. package/scripts/verify-release-identity.mjs +1 -1
  222. package/templates/global/settings.json +8 -2
  223. package/templates/project/.pi/project-context.md +3 -3
  224. package/templates/project/AGENTS.md +4 -5
  225. package/docs/piagent-core-reasoning-research-2026-09-06.md +0 -225
  226. package/docs/piagent-core-research-sources-2026-09-06.json +0 -416
  227. package/packages/piagent-webui/dist/client/assets/index-DiKRmCEP.js +0 -176
package/AGENTS.md CHANGED
@@ -29,3 +29,10 @@ This repository builds reusable Pi agent infrastructure for multiple projects an
29
29
  - Avoid hidden magic in prompts. If behavior must be enforced, put it in extension/tool-call guard.
30
30
  - Source code and identifiers: English.
31
31
  - Human-facing long-form docs may be Vietnamese; reusable workflow prompts and command names stay English.
32
+
33
+ ## Checks
34
+ ```
35
+ npm run typecheck
36
+ npm test
37
+ ```
38
+ Run the test files that cover a change first (`node --test tests/<name>.test.mjs`); `npm test` runs everything.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,118 @@ This file records release-facing changes for Pi Agent Platform. Copy the relevan
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## v1.9.0 - 2026-10-02
8
+
9
+ Freeform sessions and the managed team harness. This release retires the task
10
+ contract and the workflow commands; work is requested in plain language and the
11
+ guard checks every tool call.
12
+
13
+ ### Freeform sessions
14
+
15
+ - Retired the task contract: a session no longer creates a contract, declared scope, work plan, acceptance receipt, completion gate or recovery handoff, and no write waits for one. Task records written by earlier releases under `.pi/piagent-state/tasks` stay readable as history.
16
+ - Retired `/workflow`, `/fresh` (and `/fresh-*`), `/onboard`, `/onboard-project`, `/commands`, `/piagent-commands`, `/model-options`, `/profiles`, `/profile-tech` and the prompt-template aliases (`/task`, `/scout`, `/be-to-fe`, `/plan`, `/discuss`, `/review`, `/commit`, `/pr`, `/platform-improve`). Pi no longer loads `packages/piagent-core/prompts`. Project onboarding is a plain request recorded with `piagent_project_onboarding_record`.
17
+ - Retired the task-bound tools `piagent_task_start`, `piagent_task_progress`, `piagent_task_gate_check`, `piagent_context_record`, `piagent_verify_record`, `piagent_trace_record` and `piagent_memory_citation_record`; a tool group never re-activates them. `piagent_document_read` and `piagent_source_checkout` remain.
18
+ - The input hook passes text through unchanged: pasted checklists are no longer collapsed and long prompts are not stored in a task inbox.
19
+ - Delegation allows up to two fresh read-only helpers; token-saving estimates are telemetry, not an admission gate (bounded-delegation-v2).
20
+ - Kept for freeform turns: protected and read-only paths, permission profiles, the context budget for large files, confirmation for destructive and external-provider actions, and the stale read-to-edit check, which was keyed to the task run and now uses the session.
21
+
22
+ ### Managed team harness
23
+
24
+ - Added the managed harness for company sessions imported by Agent Watch (`piagent studio`, `--web`): Studio chooses the main, research and review routes; tools run in a sandboxed worker with per-run authority.
25
+ - Per-turn process from the team's Harness in Studio: plan, checks and review, each `suggest` or `require`, with bounded fix loops. A plan guard refuses edits (including shell edits) until a plan exists and reports `planSkipped` after three refused answers; invented tool names are counted.
26
+ - Process report v2 (`plan_skipped`, `unknown_tools`) is negotiated: Studio lists `process_versions`, Agent Watch advertises `process-v2`.
27
+ - Detached processes are stopped at turn end; stopping during a helper reports `aborted`/`managed-helper-cancelled` instead of a send failure.
28
+
29
+ ### Security and fixes
30
+
31
+ - The runtime dependency audit accepts three denial-of-service advisories in `brace-expansion` 5.0.9 (GHSA-q2hr-2g5m-vwhr, GHSA-qhr7-859c-m2p7, GHSA-6j4f-fj2g-mc7p) until 2026-10-31: every published Pi host, 1.0.0 included, pins that version through its npm-shrinkwrap, so no Piagent change can update it. The exceptions live in `scripts/runtime-advisory-exceptions.json`, apply only at the Pi host's own copy, print on every audit and end on their own; any other finding still blocks.
32
+ - Redacted Agent Studio credentials (`as_live_`, `as_device_`, `as_run_`). Write/edit previews and runtime command output are redacted before they are split or truncated, the gateway stream no longer flushes half a credential on a long line, and the client live file label recognises Studio tokens.
33
+ - A shell command can no longer create a new file in a shared source-checkout cache by spelling the path through an alias such as `/var` for `/private/var`.
34
+ - WebUI approvals: an allowed decision is now consumed by the guard, so the decision request receives its receipt and the approval leaves the queue. Before, every decision without a task stayed pending and could fill the broker.
35
+ - Removed the WebUI runtime actions that still sent `/commands` and `/onboard ...`; with those commands gone they would have reached the model as a message and started a paid turn. A test now ties every WebUI runtime action to a registered command.
36
+ - `piagent-explain` no longer lists task-contract, task-scope or lifecycle gates.
37
+ - The sandbox allows signals within the same sandbox, which fixes `grep` EPERM, timeouts and orphaned cancelled commands.
38
+ - The dashboard relay no longer freezes when `project.paths` exceeds the default control response limit.
39
+
40
+ ### Dashboard and company mode, from live runs
41
+
42
+ - A company turn now settles once, after its harness rounds (the check request, the review, the fixes). Before, the dashboard treated the turn as finished at the first answer: Stop disappeared, the later rounds were not streamed, and for a moment the turn read "no answer yet, press Continue".
43
+ - `run_with_network` works: the network sandbox now allows the system resolver socket, so an approved command can resolve host names. Before, every approved network command failed with `ENOTFOUND`. When an approved command still cannot reach the network, the agent is told the network is unreachable instead of being pointed back to `run_with_network`.
44
+ - The header and the Workspace panel show a review subagent while it runs ("Subagent 1/2"); its start and end now refresh the conversation.
45
+ - A company conversation opened while company mode is not running (after a restart, a crash or an update) says so and offers Reconnect in place. Reading still never starts company mode, since starting may ask for Keychain access.
46
+ - A conversation whose history cannot be read no longer shows the previous conversation's messages under its title.
47
+ - Approval cards: the network approval shows the exact command; task, tool-call and provider references are gone; paths inside the project are shown relative to it (the project folder reads "The whole project folder"); known reasons and consequences are shown in Vietnamese. The exec-policy reason now reads "Confirmation required: the command runs git push" instead of naming a "legacy policy pattern".
48
+ - An `apply_patch` step is shown as an edit of its files with the patch's diff, like `edit`, in the history and while it runs.
49
+
50
+ ### Many members at once, from a 20-developer run
51
+
52
+ - A company request that Studio refuses because every company model account that can serve the conversation is busy (`session_account_busy_retry_later`, `session_account_not_ready_retry_later`, `concurrency_limit`, `account_capacity_unavailable`, `request_rate_limit`) now waits in line and is asked again, for up to 20 minutes. These refusals come before any model is asked, so nothing is sent twice; a failure after admission is still never replayed. The wait is a step of the running turn in the dashboard ("Wait for a free company account") and the working line in the Terminal; Stop ends it. Before, the turn failed after Studio's 30-second wait.
53
+ - Dashboard commands are outdated only when their own conversation changed. Before, any change to any conversation made every other command stale, so with several conversations running a new conversation could fail with `session-revision-stale`. A failure to create a conversation is now shown as a sentence instead of a code. Stop no longer fails while the agent works through quick steps: a running turn changes its conversation after every step, so Stop is bound to the operation it names, not to the page's last read; if Stop still fails, the dashboard says so instead of doing nothing.
54
+ - A company request refused before the model did any work because the account's sign-in was being renewed (`upstream_auth_required`, `execution_precondition_failed`) is asked again up to three times, 3, 6 and 9 s apart; an account that really has to sign in again still says so.
55
+ - Opening a company conversation, starting a run and granting a subagent ask Studio again when it is too busy to answer in time (`serverUnavailable`), as does a request Studio could not check in time (`operation_unavailable`). Under load, most company conversations opened from the dashboard used to fail to open, and most required reviews ended as "review could not run". A review that still cannot run keeps its reason as a code in the conversation file.
56
+ - The dashboard stays fast with many conversations: listing them read every session file in full on every catalog (863 conversations: about 4 s each time, far more under load, so pages waited 30–40 s and timed out). Unchanged files now keep what was read before and only changed ones are read again, by Pi itself (44 ms instead of about 4 s).
57
+ - A member's session can read the skills Pi lists for it where they are installed (the package's and the user's); the guard used to refuse that read as "outside the project". Writes there stay refused.
58
+ - A new conversation whose creation takes longer than the dashboard's 30-second answer (the first one after the Gateway starts, a company runtime opening) is no longer reported as "could not be created" while it is created and runs: the page sends the same command again, which waits behind the create and returns its receipt, for up to two minutes; if it still has no answer it says the conversation may exist. Before, a member who believed the message was lost sent it again and two runs edited the same project.
59
+ - A dashboard message that stays unconfirmed is released after two minutes: its command now expires then, so it can no longer run, and the draft is kept to send again. Before, the composer stayed locked until the page was reloaded.
60
+ - Company sessions recover after the Mac sleeps: a run grant that lapsed under a request (Studio's clock catches up at once after a sleep, and grants last two minutes) is renewed and the request asked again, and an Agent Watch helper killed by a request that outlived the sleep is replaced when the next turn starts. Before, every company conversation failed with `invalid_run_grant` or "the Agent Watch helper stopped" until it was reopened.
61
+ - A request the model's provider declines under its usage policy (seen when a member asked to print an `.env` file encoded in base64) is reported as such, with its own dashboard copy ("ask in a different way"), instead of "the request could not be sent".
62
+ - An answer stream that ended with nothing in it ("stream ended without a stop reason") is reported as "the model returned no response" (`upstream_incomplete`) instead of "the request could not be sent"; it is not sent again, and "tiếp tục" continues. A company failure no code names keeps its own words, redacted, in the conversation file (not shown) so it can be told apart later.
63
+ - Two project folders with the same name (two clones of one repository) show where each one is in the new-conversation menu.
64
+ - A message sent right after Stop reaches the conversation on a busy machine. Every catalog the dashboard built opened and parsed every conversation file to learn its model and thinking level (929 files, 140 MB: about a second of blocked Gateway each time, 1–6 s under load); a Stop then took up to 50 s and the next messages stayed unconfirmed with the composer locked for minutes. A file's facts are now kept until its size, modification time or inode changes: catalogs take 0.1–0.5 s under the same load, and a stop-then-send probe that failed 3 of 4 times passes.
65
+ - A Gateway that is busy is no longer replaced by a second one. `piagent dashboard open` and the company launch took a Gateway that did not answer within 1.5 s for gone and started another; the new one took over the control socket while the first kept running unreachable, serving its pages and holding its conversations (three were found running at once). A Gateway that answers late is waited for (up to 30 s), only a socket nobody listens on is replaced, and an old Gateway that exits no longer removes the running one's socket.
66
+ - `piagent-doctor` lists `enabledModels` patterns that match no model Pi knows (Pi warns about each on every start), and `piagent-model-scope --prune` removes only those; patterns of a provider that is only signed out are kept.
67
+ - Public text names no other agent product or project; the wording check enforces it across docs, the docs site and the core package.
68
+
69
+ ### Experiment loops and test audits
70
+
71
+ - The guard covers experiment-loop tools that an optional Pi package can add. `run_experiment` runs its command through `bash -c` itself, so the guard checks that command like `bash` (protected paths, the exec policy, confirmations, read-only profiles). `log_experiment` commits every change when an idea is kept and erases every uncommitted change otherwise, outside the guard, so `init_experiment` and `log_experiment` run only on an `experiment/` branch or a linked worktree, and `init_experiment` only with nothing uncommitted outside `.auto/`. A loop config that moves the commands to another folder is refused. The dashboard shows an experiment run as the command it runs.
72
+ - New packaged skill `test-audit` (`/skill:test-audit`, also chosen by the model when it writes or changes tests): decide whether a new test earns its place, and find tests that cost more than they protect, with a read-only review table before any edit.
73
+
74
+ ### Guard cleanup
75
+
76
+ - Removed the guard code that only ran with a task contract: the completion hook, task change and verification recording, the task-bound branches of tool authorization (read-only task rules, opaque-shell rule, semantic repair, phase decisions, performance review), and the phase-tool, semantic-repair and independent-acceptance runtimes it created. The guard went from 4993 to 4139 lines; protected and read-only paths, permission profiles, the context budget, the stale-edit check and confirmations are unchanged.
77
+ - Reopening a session that ran a task before 1.9.0 no longer resumes, re-binds or warns about that task; its records stay as history.
78
+
79
+ ### Models
80
+
81
+ - Added reviewed Sonnet 5.5 metadata to explicit Claude/full model-scope setup on Pi 0.87.1: native 1M context, 128K output, adaptive thinking, no unsupported off/minimal modes or temperature override. Existing custom endpoints and model entries are preserved. This does not establish account entitlement.
82
+ - Included Sonnet 5.5 and Opus 5.5 in model selection presets. Agent Watch can supply the same model through a Studio key without changing personal authentication.
83
+
84
+ ### Tests and evidence
85
+
86
+ - Retired the test suites that only exercised the task contract (task lifecycle, acceptance gating, workflow dispatch and the scripted production journeys that asserted task records); they remain at commit 85f76db. Security assertions that used a task as setup were rewritten to run without one, and the reconnect, lost-receipt and single-turn HTTP/WebSocket journeys now run as freeform turns.
87
+ - The historical P3 phase-tool counterfactual reports `counterfactual-baseline-retired` instead of a ratio, because its baseline tools no longer exist.
88
+ - Benchmark and journey results published for earlier releases were measured with task contracts and are historical.
89
+ - Live verification on the installed release: 9 personal dashboard scenarios and 4 company scenarios (plan, checks and review; Stop during the review; a network install after approval; a message sent during a turn) pass; 27/27 browser tests.
90
+ - A busy test fixture that ignores SIGTERM now exits when its test runner is killed, instead of spinning a CPU core.
91
+ - Docs site: an Ecosystem page (Piagent, Agent Watch, Agent Studio), a 1.9.0 What's new with dashboard screenshots, and pages that still described the task contract updated. The screenshots are served by the site and not shipped in the npm package.
92
+
93
+ ### Install and update
94
+
95
+ ```sh
96
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
97
+ npm install -g --ignore-scripts @piagent/platform@1.9.0
98
+ piagent-install --stable
99
+ piagent-doctor --offline
100
+ ```
101
+
102
+
103
+ ## v1.8.0 - 2026-09-23
104
+
105
+ - Pinned Pi host and Pi AI to 0.87.1 so Codex-authenticated sessions and the WebUI can list GPT-6 Astra, Sol, and Luna. Pi's authenticated catalog remains the authority for availability and supported thinking levels.
106
+ - Added a new parent-routing map: Luna Medium for bounded work, Sol Medium/High for everyday and higher-risk work, and Astra Extra High for broad ambiguous work. Parent routing stays off by default; explicit model pins remain unchanged. If a GPT-6 target is unavailable, the router records a legacy 5.6 fallback instead of silently substituting it. The historical v1 mapping and benchmark corpus remain frozen.
107
+ - New setup and WebUI sessions prefer GPT-6 Sol High when authenticated. Existing sessions and explicit user settings are not rewritten by the package. Astra's unsupported `off` level is omitted from WebUI choices.
108
+ - Verified the release without paid provider turns; the prior 108-session comparison is historical evidence for v1.7.1, not a GPT-6 performance or token-saving claim.
109
+
110
+ ### Install and update
111
+
112
+ ```sh
113
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.87.1
114
+ npm install -g --ignore-scripts @piagent/platform@1.8.0
115
+ piagent-install --stable
116
+ piagent-doctor --offline
117
+ ```
118
+
7
119
  ## v1.7.1 - 2026-09-23
8
120
 
9
121
  The v1.7.0 tag was not published: both tag workflow attempts reached the
@@ -680,7 +792,7 @@ Four documents restated something the code already knew, and each had drifted. T
680
792
  and fail-closed shadow/recommend/auto modes. `piagent-route` provides the only
681
793
  explicit prelaunch enforcement path; extension auto does not mutate the Pi
682
794
  user default or switch models mid-conversation.
683
- - Added a bounded Windsurf-style retrieval route (read-only grep/find/read, up
795
+ - Added a bounded retrieval route (read-only grep/find/read, up
684
796
  to eight parallel searches and four rounds, recommendation-only), a 240-case
685
797
  offline routing gate, and a resume-locked 144-session static-versus-adaptive
686
798
  protocol dry-run. No authenticated benchmark is implied by these local gates.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [Tiếng Việt](README.vi.md)
4
4
 
5
- Reusable Pi package for project onboarding, profile-based coding workflows, guarded tool usage, multi-agent orchestration, MCP setup, memory policy, and task verification.
5
+ Reusable Pi package for freeform coding chat, guarded tools, project context and a managed main/research/review harness.
6
6
 
7
7
  Public docs: [piagent.io.vn](https://piagent.io.vn)
8
8
 
@@ -46,13 +46,11 @@ cd /path/to/project
46
46
  pi
47
47
  ```
48
48
 
49
- That is the daily flow. Pi onboards the project, selects an operating profile, uses the right tools, records task evidence, and hands off verified implementation work.
49
+ Send the request directly in plain language. Since 1.9.0 there is no `/task` or `/workflow` step, no task contract and no projected token-saving threshold.
50
50
 
51
- Running several agents side by side — one implementing, one reviewing read-only, one verifying — start `herdr` from the project instead of `pi` and open a Pi pane per role. Herdr orchestrates terminals and sessions; it is not a security boundary, so every gate still lives in the Pi extension and OAuth is still a `/login` inside Pi. See [Herdr workflow](docs/herdr-workflow.md).
51
+ For the local macOS team harness, import a managed key through Agent Watch and run `piagent studio` or `piagent studio --web`. Studio chooses the main/research/review routes; the member chooses thinking. Managed sessions have isolated tools and per-run authority. Personal sessions keep their own OAuth and model picker under `pi`.
52
52
 
53
- First run in a new project, type `/onboard` and choose the run action, or type `/onboard run`. It launches the bounded onboarding workflow, recommends a profile, explains the tradeoffs, asks before applying, then writes `.pi/piagent-profile.json`, its lock, `.pi/tech-stack.json`, `.pi/tech-context/*`, `.pi/project-context.md`, and `.pi/memory/*`.
54
-
55
- `/commands` lists everything else. For trusted local runs, `piagent-auto` wraps `pi --approve` and sets a permission profile for that run — it does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence. See the [command reference](docs/command-reference-vietnamese.md).
53
+ See [local acceptance and remaining release gates](docs/managed-local-acceptance.md). Existing direct CLI keys remain compatible and do not gain managed harness enforcement.
56
54
 
57
55
  ## Uninstall
58
56
 
@@ -69,12 +67,11 @@ Removal targets what is registered in Pi's settings rather than what the current
69
67
 
70
68
  ## What it provides
71
69
 
72
- - Global Pi package with workflow prompts, runtime commands, skills, guard extensions, and piagent subagents.
73
- - Runtime command menu via `/commands`.
74
- - Workflow launcher via `/workflow` for task, scout, BE-to-FE, review, git, and onboarding work.
75
- - Runtime onboarding via `/onboard`; `/onboard run` launches the first-read onboarding workflow.
70
+ - Global Pi package with runtime commands, skills, guard extensions, and piagent subagents.
71
+ - Freeform turns: a request in plain language is the whole interface. Scouting, planning, review, commits and pull requests are ordinary requests.
72
+ - Project onboarding on request: ask the agent to inspect the project read-only and record its context, and it writes `.pi/project-context.md`.
76
73
  - Runtime profile selection via `/profile`, plus select-style tech stack setup via `/profile setup` and `/profile tech`.
77
- - Runtime usage/session controls via `/usage` and `/fresh`, plus Pi native `/name` and `/session`.
74
+ - Runtime usage controls via `/usage`, plus Pi native `/name`, `/new` and `/session`.
78
75
  - Explicit project memory via `/memory` or `/memory-policy` and `piagent_memory_*` tools.
79
76
  - Local Context Engine controls via `/context`: incremental code index, hybrid search, token-budgeted packs, bounded current-turn source/test snapshots for automatic tasks, test impact, efficiency telemetry, and semantic compaction. Index storage is owner-only and securely purged when exclusion policy changes; manual packs remain advisory, while current-turn snapshots are freshness-checked and exact edits fail closed on a later mismatch.
80
77
  - MCP setup helpers for Context7, Chrome DevTools, GitHub, Playwright, and Figma.
@@ -87,17 +84,14 @@ Removal targets what is registered in Pi's settings rather than what the current
87
84
  - `piagent_exec_policy_check`
88
85
  - `piagent_context_budget`
89
86
  - `piagent_tool_policy_check`
90
- - `piagent_task_gate_check`
91
87
  - `piagent_usage_snapshot`
92
88
  - `piagent_context_preflight`
93
89
  - `piagent_orchestration_policy`
94
90
  - Context7-ready tech stack manifest and concise `.pi/tech-context/*` snapshots for selected profile roles.
95
- - Accident-brake guardrails for protected paths, destructive shell commands, task contracts, context manifests, observed verification evidence, and trace records.
96
- - Session-bound Task Contract v2: one Pi session per task, bounded retry history,
97
- Git baseline-aware changed files, scope enforcement, all-command verification,
98
- strict acceptance receipts, identity-bound journal checkpoints, and an
99
- immutable terminal outcome. These are same-runtime operational records, not
100
- independent attestation.
91
+ - Accident-brake guardrails for protected and read-only paths, destructive shell commands, external-provider actions, large-file edits, and edits made against a stale read.
92
+ - Task contracts and workflow commands were retired in 1.9.0: a session no longer
93
+ creates a contract, scope, acceptance receipt or final gate. Task records left
94
+ under `.pi/piagent-state/tasks` by earlier releases stay readable as history.
101
95
  - Adaptive context planning uses Pi-reported model/thinking/context facts to set
102
96
  a bounded context budget; cited repository-memory hints never replace current
103
97
  source reads. The parent model stays operator-pinned—there is no automatic
@@ -119,8 +113,8 @@ Removal targets what is registered in Pi's settings rather than what the current
119
113
  transactional-config, and exact temporal-billing invariants. It locks
120
114
  Piagent/`codex-cli` to Luna/medium and uses three repeats (42 paired sessions) with token, duration,
121
115
  full-suite, and zero-retry gates. A separate provider-free WebUI
122
- parity gate proves the 10 workflow and 32 runtime-control paths before any
123
- model quota is used.
116
+ parity gate proves the 31 runtime-control paths before any model quota is
117
+ used (workflow ingress was retired in 1.9.0).
124
118
  - The public `v1.6.0` production-v1 run
125
119
  `production-v1-20260824T040017Z-05b7cf`, on exact commit
126
120
  `3bba8f0b3ff521bc2a355e1f6bef6d1bbdc09511` with GPT-5.6 Luna Medium,
@@ -142,7 +136,7 @@ Project profiles can declare a runtime `permissionProfile`:
142
136
  | Profile | Use when | Guard behavior |
143
137
  |---|---|---|
144
138
  | `read-only` | Scout, audit, review | Allows `read`, `grep`, `find`, `ls`, and piagent state tools; blocks shell, `write`/`edit`/`apply_patch`, and unknown tools. |
145
- | `workspace-write` | Normal implementation | Default profile. Keeps current protected-path, shell, capability, task, and verify gates. |
139
+ | `workspace-write` | Normal implementation | Default profile. Keeps protected-path, read-only-path, shell and capability checks, and asks before destructive or external actions. |
146
140
  | `trusted-full-access` | Trusted local automation | Expands workspace tool/scope autonomy, but still enforces protected paths, secret redaction, capability lock integrity, and destructive/external confirmation. |
147
141
 
148
142
  For one run, set `PIAGENT_PERMISSION_PROFILE=read-only|workspace-write|trusted-full-access`, or use `piagent-auto --read-only`, `--workspace-write`, or `--full-access`.
@@ -162,7 +156,7 @@ Legacy aliases still work: `/permission-status`, `/read-only`, `/workspace-write
162
156
 
163
157
  ## Parent-direct orchestration
164
158
 
165
- The parent model owns reasoning, implementation, and verification. Helpers are off by default. With explicit opt-in, runtime may dispatch one fresh read-only helper only when it proves two independent lanes and at least 30% projected net token saving after handoff and merge. Workers, retries, nested helpers, and parallel helpers remain disabled.
159
+ The parent model owns reasoning, implementation, and verification. When helpers are enabled it may delegate up to two fresh read-only helpers, such as an independent research question or a review of its patch. Token-saving estimates are telemetry, not an admission requirement. Helpers never implement, inherit parent history, spawn nested helpers, or retry a deterministic failure.
166
160
 
167
161
  Inside Pi:
168
162
 
@@ -170,27 +164,14 @@ Inside Pi:
170
164
  /piagent-orchestration
171
165
  ```
172
166
 
173
- This shows the active mode, one-helper ceiling, review lenses, Field Guide path, writer policy, and dispatch/skip evidence without triggering a model follow-up.
174
-
175
- For bounded source work, runtime creates the session-bound contract before the
176
- model starts and injects its path scope plus concise verifier. Broad, high-risk,
177
- or ambiguous work falls back to one explicit `piagent_task_start`. A source task
178
- requires a Git working tree and a meaningful project verifier. Direct and shell
179
- writes are constrained to declared scope; final completion needs every planned
180
- verify command and changed-file evidence. Read-only scouts do not need a source
181
- verifier and must leave the working tree unchanged.
182
-
183
- The installed v1.7.1 policy treats incomplete acceptance proof as diagnostic:
184
- unproved criteria remain pending and completion carries no quality claim. Task
185
- contract, scope, current passing verification, and trace still gate completion.
186
- Select `acceptanceProofMode: "enforce"` in a reviewed package policy when every
187
- criterion must be proved before completion.
167
+ This shows the active mode, helper ceiling, review lenses, Field Guide path, writer policy, and dispatch/skip evidence without triggering a model follow-up.
188
168
 
189
- Routine evidence is runtime-managed: successful targeted reads, actual changes,
190
- exact verifier results, current-tree digest, trace and final gate are recorded
191
- from Pi lifecycle hooks. Automatic bounded tasks carry no Piagent management
192
- schema or lifecycle calls. Context/status/evidence/gate tools are diagnostic or
193
- recovery surfaces, not a checklist for every task.
169
+ Source work is freeform: the model reads, edits and runs the project's checks
170
+ directly, with no contract, declared scope or final gate. The guard still
171
+ enforces protected and read-only paths, the permission profile, the context
172
+ budget for large files and stale read-to-edit snapshots, and asks before
173
+ destructive or external actions. In the managed company harness the plan,
174
+ check and review steps per turn are set by the team's Harness in Studio.
194
175
 
195
176
  ## Profiles
196
177
 
@@ -228,28 +209,24 @@ Commands and lock format: [Capability packs](docs/capability-packs.md).
228
209
 
229
210
  ## Main workflows
230
211
 
231
- Everything below is typed inside a Pi session. `/commands` lists the full set; [command reference](docs/command-reference-vietnamese.md) explains each one. The recommended team surface is grouped by namespace so people do not need to remember many one-off commands.
212
+ Work is requested in plain language; the commands below are settings and read-only views typed inside a Pi session, and none of them starts a model turn. [Command reference](docs/command-reference-vietnamese.md) explains each one.
232
213
 
233
214
  | Command | Use when |
234
215
  |---|---|
235
- | `/workflow` | Open the workflow picker. |
236
- | `/workflow task <request>` | The requirement is clear enough to implement. |
237
- | `/workflow scout <request>` | Read-only investigation — payment, auth, data, or backend-contract mapping — before deciding whether to implement. |
238
- | `/workflow discuss <rough request>` | The requirement is not clear yet. |
239
- | `/workflow plan <goal>` | You want a plan before any edit. |
240
- | `/workflow review current diff` | Reviewing work already done. |
241
- | `/workflow commit <message>` | Governed local commit: inspect status and diff, stage only the intended files, run verification, commit. Never pushes. |
242
- | `/workflow pr <title>` | Governed pull request: confirms before any `git push` or GitHub write. Draft by default. |
243
- | `/workflow be-to-fe <request>` | Backend or spec is read-only and the implementation target is frontend. Pair with `/profile be-readonly-fe`. |
244
- | `/workflow platform-improve <request>` | Package-level work: setup, MCP, model scope, memory, runtime policy, prompts, skills, subagents. |
245
- | `/fresh <workflow> <request>` | The current session is already heavy. Opens a new governed session for any canonical workflow (`/fresh help` lists them) and replays the compact workflow prompt. |
246
- | `/piagent-inspector` | Open one read-only menu for task files and line diff, commands and failures, safety warnings, and context budget. A four-row panel is always shown beside Pi's native footer and can be hidden for the session with `toggle`. |
216
+ | `/profile` | Show or apply the project profile; `/profile setup` selects the tech for each role. |
217
+ | `/permission` | Show or switch the session permission profile. |
218
+ | `/context` | Context Engine index, search, packs, test impact and compaction. |
219
+ | `/usage` | Session, model, thinking and context usage; `/usage logs` shows compacted tool output. |
220
+ | `/memory` | Explicit project memory. |
221
+ | `/piagent-mcp` | MCP servers, scopes and approvals. |
222
+ | `/piagent-status` | Profile, guard, runtime and authenticated model state. |
223
+ | `/piagent-inspector` | One read-only menu for the session diff, commands and failures, safety warnings, and context budget. A four-row panel is always shown beside Pi's native footer and can be hidden for the session with `toggle`. |
247
224
 
248
- Short workflow aliases such as `/task`, `/scout`, `/be-to-fe`, `/commit`, and `/pr` still work for power users, but docs and onboarding teach `/workflow` as the default.
225
+ The workflow commands (`/workflow`, `/task`, `/scout`, `/fresh`, `/onboard`, `/commands`, `/model-options`) were retired in 1.9.0. Say what you want instead — "scout the payment flow read-only, do not edit", "review the current diff", "commit these two files". For a heavy session, start a new one with Pi's `/new`.
249
226
 
250
- Git stays a capability rather than a `/git-*` namespace, so natural language works too. Broad staging — `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` — requires confirmation, so unrelated or private files are not swept into a commit silently.
227
+ Git stays a capability rather than a `/git-*` namespace, so natural language works. `git push`, GitHub writes and publishing ask for confirmation first. Broad staging — `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` — requires confirmation, so unrelated or private files are not swept into a commit silently.
251
228
 
252
- Paste a screenshot path straight into a task and the guard attaches it as `[image1]` before the model sees the prompt: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, up to 4 images at 8 MB each. The target must be inside the project or a directory listed in `additionalReadRoots`; protected paths, paths outside the resolved filesystem read scope, symlink escapes, and extension-only fake images are refused. The guard also collapses pasted mandatory-flow boilerplate, so there is no need to paste a checklist into every task.
229
+ Paste a screenshot path straight into a task and the guard attaches it as `[image1]` before the model sees the prompt: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, up to 4 images at 8 MB each. The target must be inside the project or a directory listed in `additionalReadRoots`; protected paths, paths outside the resolved filesystem read scope, symlink escapes, and extension-only fake images are refused. Pasted text reaches the model as typed; there is no checklist to paste.
253
230
 
254
231
  Web research and image understanding remain separate capabilities. The pinned `pi-web-access` integration uses the authenticated `openai-codex` route first when it is available and keeps its automatic search fallback; it never copies provider credentials into project or browser state. Images are passed as native image input to the selected session model rather than through a Piagent-owned OCR service. The dashboard reports both effective facts under **Settings → Providers & models**: `Codex Web Search` when that route is ready, and `Codex Vision` only when the current Codex model advertises image input.
255
232
 
@@ -259,7 +236,7 @@ A spec that lives outside the project — the one just downloaded to `~/Download
259
236
 
260
237
  ## Model selection
261
238
 
262
- Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the scoped set, `Shift+Tab` to cycle thinking level where the model supports it. Type `/model-options` for the current Piagent model/thinking guidance. Global setup seeds `enabledModels`; see [Model options](docs/model-options.md) to inspect or re-apply it.
239
+ Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the scoped set, `Shift+Tab` to cycle thinking level where the model supports it. Global setup seeds `enabledModels`; see [Model options](docs/model-options.md) to inspect or re-apply it.
263
240
 
264
241
  ## MCP setup
265
242
 
@@ -277,9 +254,9 @@ Keep provider keys in environment variables, never in committed config. Switchin
277
254
 
278
255
  ## Subagents
279
256
 
280
- `piagent-setup` installs the optional `pi-subagents` compatibility runtime with a clamped `safe` preset. Daily tasks stay parent-direct; builtin agents and workers are disabled, and explicit helper mode still requires the measured 30% gate. The inspector states dispatch/skip reasons and projected saving.
257
+ `piagent-setup` installs the optional `pi-subagents` compatibility runtime with a clamped `safe` preset. Daily tasks stay parent-direct; builtin agents and workers are disabled, and helper mode allows up to two read-only helpers. The inspector states dispatch/skip reasons.
281
258
 
282
- `/subagents-doctor` runs a health check. See [Subagents and multi-agent](docs/subagents-and-multiagent.md) for the one read-only helper opt-in contract.
259
+ `/subagents-doctor` runs a health check. See [Subagents and multi-agent](docs/subagents-and-multiagent.md) for the read-only helper opt-in contract.
283
260
 
284
261
  ## Repository layout
285
262
 
@@ -292,7 +269,7 @@ piagent/
292
269
  ├─ evals/ governed evaluation scenarios
293
270
  ├─ packs/ versioned capability manifests and recipes
294
271
  ├─ packages/
295
- │ ├─ piagent-core/ Pi package: extensions, runtime, prompts, skills
272
+ │ ├─ piagent-core/ Pi package: extensions, runtime, skills, managed harness
296
273
  │ └─ piagent-webui/ dashboard: contracts, client, server, gateway, ownership
297
274
  ├─ schemas/ JSON schemas
298
275
  ├─ scripts/ setup, doctor, verification helpers
@@ -356,8 +333,8 @@ This repository intentionally excludes:
356
333
  - [Subagent orchestration capabilities](docs/subagent-orchestration-capabilities.md)
357
334
  - [Context-window policy](docs/context-window-policy.md)
358
335
  - [Memory policy](docs/memory-policy.md)
359
- - [Task lifecycle tiếng Việt](docs/task-lifecycle-vietnamese.md)
360
- - [Task implementation contract](docs/task-implementation-contract.md)
336
+ - [Task lifecycle tiếng Việt](docs/task-lifecycle-vietnamese.md) (historical, before 1.9.0)
337
+ - [Task implementation contract](docs/task-implementation-contract.md) (historical, before 1.9.0)
361
338
  - [Runtime quality baseline](docs/runtime-quality-baseline.md)
362
339
  - [Usage observability](docs/usage-observability.md)
363
340
  - [Model options](docs/model-options.md)
@@ -369,7 +346,7 @@ This repository intentionally excludes:
369
346
 
370
347
  ## Maturity
371
348
 
372
- The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.7.1` or a reviewed commit.
349
+ The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.9.0` or a reviewed commit.
373
350
 
374
351
  Ready for:
375
352
 
@@ -379,7 +356,7 @@ Ready for:
379
356
  - read-only scouting and planning;
380
357
  - backend-readonly/frontend-write workflows;
381
358
  - bounded subagent scouting, planning, implementation, and review;
382
- - runtime checks for exec policy, context budget, context preflight, tool policy, task gate, and usage snapshot;
359
+ - runtime checks for exec policy, context budget, context preflight, tool policy, and usage snapshot;
383
360
  - project-level quality/token/cost benchmarking.
384
361
 
385
362
  Application-level policy layer:
@@ -394,11 +371,9 @@ Application-level policy layer:
394
371
  - The ambiguous `source` field remains metadata for configured external providers and piagent tools, but is treated as a filesystem path for file-oriented tools and unknown/local tools; protected-path and read-scope checks then apply before execution.
395
372
  - Broad `grep`, `find`, and `ls` sweeps get result-filter backstops: protected file content lines or protected path metadata are redacted before the model sees output. Text tool results and JSON-like result details also pass through shared sensitive-data redaction; image, audio, and resource payloads are left intact.
396
373
  - The redaction release gate is a synthetic/internal benchmark for contextual recall, benign preservation, structured fields, and bounded large output. The public security threat model maps current assumptions, attack vectors, controls, and residual risks; it is not an independent audit. Stronger assurance still requires a broader OS/shell matrix, more parser fuzzing, continued symlink/path-traversal testing, third-party review, and an LTS/backport policy. Opaque entropy without a credential-bearing context and transformed output such as base64-encoded content remain outside the redaction guarantee.
397
- - Raw `bash` access to protected paths is blocked through shell operand extraction. The guard covers partial shell globs, bare filenames, canonical symbolic-link aliases, and attached input/output redirections. `.pi/piagent-state/**` and `.pi/piagent-profile.json` are self-protected; use `piagent_context` and piagent task tools instead.
374
+ - Raw `bash` access to protected paths is blocked through shell operand extraction. The guard covers partial shell globs, bare filenames, canonical symbolic-link aliases, and attached input/output redirections. `.pi/piagent-state/**` and `.pi/piagent-profile.json` are self-protected; use `piagent_context` and the piagent tools instead.
398
375
  - External writes launched through guarded shell tools are confirmation-gated as well as direct provider tools. This includes GitHub CLI write actions and non-read-only `curl`/`wget` forms, including common execution wrappers; known read/list/GET forms remain non-interactive.
399
- - Verify evidence is accepted only when it matches an observed Pi bash tool result after task start. The observed ledger is persisted under `.pi/piagent-state/observed-bash.jsonl`, so parent agents can validate bash results produced by guarded subagent processes.
400
- - Observed command identity is retained as a SHA-256 hash while sensitive command text is redacted at both the in-memory and persisted evidence boundaries.
401
- - Passing final gates require an observed exit `0` command that exactly matches one of the task/profile `verifyCommands`; ad-hoc commands such as `true`, `echo ok`, or `npm test || true` are advisory only.
376
+ - Observed bash results are persisted under `.pi/piagent-state/observed-bash.jsonl`, so parent agents can check results produced by guarded subagent processes. Command identity is kept as a SHA-256 hash while sensitive command text is redacted at both the in-memory and persisted boundaries.
402
377
  - Project memory files are private-by-default in generated projects; opt in to shared memory only after review/redaction.
403
378
  - It is not an OS sandbox or complete security boundary. It depends on the controlled tool paths and shell parsing that the platform observes, and it cannot stop another process with the same OS permissions from reading or writing outside the guard. For untrusted code, untrusted prompts, or adversarial workloads, run Pi inside an isolated container/VM with filesystem, process, network, and credential boundaries.
404
379
  - Release verification audits the small helper dependency tree separately from the exact Pi host and pinned optional add-ons at the high-severity gate. Upstream lower-severity findings are still reported and tracked; a green helper-only audit is not treated as proof that the deployed runtime tree is clean.
package/README.vi.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md)
4
4
 
5
- Pi Agent Platform là reusable Pi harness dành cho project onboarding, workflow theo profile, guarded tool usage, MCP, multi-agent orchestration, memory policy, Context Engine và task verification.
5
+ Pi Agent Platform cung cấp chat trực tiếp, công cụ có kiểm soát quyền, ngữ cảnh dự án và khung main/research/review cho tài khoản công ty.
6
6
 
7
7
  Tài liệu public: [piagent.io.vn](https://piagent.io.vn)
8
8
 
@@ -22,50 +22,17 @@ cd /path/to/project
22
22
  pi
23
23
  ```
24
24
 
25
- Trong session Pi đầu tiên của project, chạy `/onboard`. Hằng ngày, dùng `/workflow` để chọn luồng và `/usage` để xem session, model, thinking và token.
26
-
27
- ## Nguyên tắc vận hành
28
-
29
- - Mỗi task dùng một session có tên rõ ràng.
30
- - Slash command chỉ chạy handler đã đăng ký; agent không phải scout lại command.
31
- - Prompt hướng dẫn model, còn policy quan trọng được enforce tại runtime.
32
- - Permission `read-only` chỉ cho phép kiểm tra; shell và các tool ghi `write`/`edit`/`apply_patch` đều bị chặn.
33
- - MCP config không chứa token hoặc OAuth credential.
34
- - Task source-changing cần scope, verify evidence và final gate.
35
- - Local state nằm trong `.pi/piagent-state/`, có owner-only permission và bounded retention.
36
- - Project-specific business logic nằm trong project profile hoặc adapter, không đưa vào core.
37
-
38
- Task Contract v2 hiện gắn task/session/run identity với current-tree verification,
39
- acceptance receipt giữ nguyên tiêu chí chưa được chứng minh, hash-chained journal checkpoint, retry có giới hạn và
40
- terminal outcome bất biến. Đây là operational record do cùng runtime tạo ra,
41
- không phải independent attestation.
42
-
43
- Policy cài sẵn của v1.7.1 dùng chế độ diagnostic cho acceptance proof: tiêu chí
44
- chưa được chứng minh vẫn ở trạng thái pending và khi hoàn tất sẽ ghi rõ không có
45
- khẳng định chất lượng. Task contract, scope, bước verify đang pass và trace vẫn
46
- chặn hoàn tất nếu thiếu. Khi cần chứng minh mọi tiêu chí trước khi hoàn tất,
47
- chọn `acceptanceProofMode: "enforce"` trong package policy đã được review.
48
-
49
- Adaptive Context Planner dùng model, thinking và context usage do Pi báo để đặt
50
- budget có giới hạn; repository-memory hint luôn có citation và không thay thế
51
- việc đọc source hiện tại. Parent model vẫn do operator pin: baseline ổn định này
52
- chưa ship solver hoặc automatic parent routing. Host execution là mặc định; nếu
53
- yêu cầu isolation backend chưa có adapter, mutation bị block thay vì âm thầm
54
- fallback về host.
55
-
56
- ## Điều phối parent-direct
57
-
58
- Parent model tự sở hữu suy luận, implementation và verification. Helper mặc định
59
- tắt. Khi operator chủ động bật, runtime chỉ được dispatch tối đa một helper
60
- read-only dùng context fresh nếu chứng minh có hai lane độc lập và tổng token dự
61
- kiến sau handoff/merge giảm ít nhất 30%. Worker, retry, nested helper và parallel
62
- helper đều bị tắt.
63
-
64
- Trong Pi, `/piagent-orchestration` hiển thị mode hiện tại, trần một helper,
65
- review lens, writer policy và bằng chứng dispatch/skip mà không tạo model turn.
66
- `piagent-setup` chỉ cài `pi-subagents` như runtime tương thích tùy chọn với preset
67
- `safe` đã bị clamp; `/subagents-doctor` dùng để kiểm tra health. Chi tiết nằm tại
68
- [Subagents và multi-agent](docs/subagents-and-multiagent.md).
25
+ Nhập yêu cầu bằng lời thường trong Pi hoặc WebUI. Từ bản 1.9.0 không còn bước `/task` hay `/workflow`, không còn task contract và không còn ngưỡng tiết kiệm token.
26
+
27
+ ## Agent Watch Auto trên macOS
28
+
29
+ Admin cấu hình model cho main, khảo sát và review trong Studio. Thành viên nhập URL/key ở Watch, chọn Piagent rồi Import. Mở **Piagent công ty** từ Watch hoặc chạy `piagent studio`; thêm `--web` để mở dashboard. Người dùng chọn mức suy luận; context theo model thực tế. Phiên cá nhân tiếp tục dùng `pi` và chọn model/OAuth riêng.
30
+
31
+ Key công ty cần loại **Piagent công ty**. Key CLI trực tiếp cũ giữ nguyên; Studio có nút tạo key đi kèm dùng chung hạn mức. Không đổi tài khoản công ty sang cá nhân trong cùng hội thoại.
32
+
33
+ Main có tối đa hai trợ lý chỉ đọc; không sinh nhánh con tiếp. Review gắn với bản chụp patch và báo hết hiệu lực khi code đổi. UI hiển thị token từng trợ lý. Bản macOS managed dùng công cụ cách ly và quyền ngắn hạn theo lượt; chế độ cá nhân vẫn là thực thi trên host.
34
+
35
+ Bản local này chưa phải bản phát hành có Developer ID. [Trạng thái nghiệm thu](docs/managed-local-acceptance.md) phân biệt test nội bộ, gọi provider thật và phần còn thiếu.
69
36
 
70
37
  ## Web search và vision
71
38
 
@@ -87,27 +54,36 @@ trực tiếp vẫn nằm trong workspace của project thay vì bị nhét vào
87
54
  tiếp tục áp protected path, redaction, session binding và attachment ref dùng một
88
55
  lần.
89
56
 
90
- Session Hub cũng đưa các workflow Terminal lên UI: task, scout, BE → FE,
91
- discuss, plan, review, commit, PR, onboard và platform-improve. Màn hình New chat
92
- hiển thị preflight workflow/change mode/quyền trước khi gửi. Trong **Cài đặt →
93
- Điều khiển project**, operator có thể xem runtime/usage, onboarding/profile,
94
- Context Engine, memory và MCP governance mà không cần nhớ slash command. WebUI
95
- gửi đúng command vào Pi runtime; thao tác read-only được kiểm tra là 0 model
96
- token, còn thao tác ghi hoặc semantic compact bắt buộc xác nhận rõ ràng.
57
+ Màn hình New chat gửi đúng nội dung người dùng nhập; WebUI không còn bộ chọn
58
+ workflow. Trong **Cài đặt → Điều khiển project**, operator có thể xem
59
+ runtime/usage, profile, Context Engine, memory và MCP governance mà không cần nhớ
60
+ slash command. WebUI gửi đúng command vào Pi runtime; thao tác read-only được
61
+ kiểm tra là 0 model token, còn thao tác ghi hoặc semantic compact bắt buộc xác
62
+ nhận rõ ràng. Muốn onboard project, hãy nhờ agent trong chat đọc project (chỉ
63
+ đọc) và ghi lại context.
97
64
 
98
65
  ## Command chính
99
66
 
67
+ Công việc được yêu cầu bằng lời thường; các command dưới đây là thiết lập và màn
68
+ hình chỉ đọc, không command nào mở lượt model.
69
+
100
70
  | Command | Mục đích |
101
71
  |---|---|
102
- | `/workflow` | Chọn workflow task, scout, plan, review, commit, PR hoặc onboarding |
103
- | `/profile` | Xem hoặc đổi project profile |
72
+ | `/profile` | Xem hoặc đổi project profile; `/profile setup` chọn tech cho từng vai trò |
104
73
  | `/permission` | Đổi permission mode trong session |
105
74
  | `/context` | Xem Context Engine, index, retrieval và telemetry |
106
75
  | `/usage` | Xem session, model, thinking và context usage |
107
76
  | `/piagent-inspector` | Mở menu read-only để xem task diff, command fail/block, safety warning và context budget; panel bốn dòng tự hiện sát footer native, `toggle` để ẩn trong session |
108
77
  | Pi native `/name` | Đặt tên session; Piagent nhận rename event để map Agent Watch/report |
109
78
  | `/memory` | Xem hoặc cập nhật explicit project memory |
110
- | `/onboard` | Khởi tạo project profile và context |
79
+ | `/piagent-mcp` | Xem và quản lý MCP server, scope và phê duyệt |
80
+ | `/piagent-status` | Xem profile, guard, runtime và trạng thái model đã xác thực |
81
+
82
+ Các command workflow (`/workflow`, `/task`, `/scout`, `/fresh`, `/onboard`,
83
+ `/commands`, `/model-options`) đã bỏ từ bản 1.9.0. Hãy nói điều mình cần, ví dụ
84
+ "scout luồng thanh toán, chỉ đọc, không sửa", "review diff hiện tại", "commit hai
85
+ file này". Session đã nặng thì mở session mới bằng `/new` của Pi. `git push`,
86
+ thao tác ghi lên GitHub và publish đều hỏi xác nhận trước.
111
87
 
112
88
  ## Architecture
113
89
 
@@ -115,7 +91,7 @@ Code được quản lý theo các layer:
115
91
 
116
92
  1. Composition root đăng ký Pi extension.
117
93
  2. Runtime adapter xử lý Pi hook, command, tool và session UI.
118
- 3. Core service xử lý policy, task, context và state.
94
+ 3. Core service xử lý policy, context và state (bản ghi task cũ chỉ còn để đọc lịch sử).
119
95
  4. Integration quản lý MCP, capability và security primitive.
120
96
  5. CLI trong `scripts/` chỉ parse argument và gọi use case.
121
97
 
@@ -144,7 +120,7 @@ piagent/
144
120
  ├─ evals/ kịch bản đánh giá có governance
145
121
  ├─ packs/ capability manifest và recipe có version
146
122
  ├─ packages/
147
- │ ├─ piagent-core/ Pi package: extension, runtime, prompt, skill
123
+ │ ├─ piagent-core/ Pi package: extension, runtime, skill, managed harness
148
124
  │ └─ piagent-webui/ dashboard: contract, client, server, gateway, ownership
149
125
  ├─ schemas/ JSON schema
150
126
  ├─ scripts/ setup, doctor và helper kiểm tra
@@ -163,9 +139,6 @@ Adaptive model routing cho fresh task dùng `piagent-route --prompt "<task>" --j
163
139
  Chỉ `--execute --yes` mới mở provider-backed Pi process; `/model`/CLI pin luôn
164
140
  được giữ và extension không đổi model giữa conversation.
165
141
 
166
- Khi session đã nặng, `/fresh <workflow> <request>` mở session mới cho bất kỳ
167
- workflow canonical nào và replay prompt gọn; `/fresh help` liệt kê catalog hiện hành.
168
-
169
142
  ## Verification
170
143
 
171
144
  ```bash
@@ -202,7 +175,7 @@ Xem [bằng chứng benchmark](https://piagent.io.vn/benchmark) và
202
175
 
203
176
  Gate này chạy architecture check, test, typecheck, capability validation, runtime smoke và docs consistency trước khi release.
204
177
 
205
- Bản phát hành hiện tại là `v1.7.1`. Với team hoặc production, hãy pin tag này
178
+ Bản phát hành hiện tại là `v1.9.0`. Với team hoặc production, hãy pin tag này
206
179
  hoặc một commit đã review thay vì dựa vào nguồn package không cố định.
207
180
 
208
181
  ## Security