@piagent/platform 1.4.0 → 1.4.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 (100) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +8 -2
  3. package/README.vi.md +27 -0
  4. package/docs/command-reference-vietnamese.md +2 -2
  5. package/docs/distribution-standard.md +7 -7
  6. package/docs/en/architecture.md +13 -0
  7. package/docs/languages.json +20 -4
  8. package/docs/mcp-and-tools.md +112 -1
  9. package/docs/operator-manual-vietnamese.md +7 -7
  10. package/docs/publishing-for-teams.md +36 -0
  11. package/docs/release-install-policy.md +21 -8
  12. package/docs/runtime-harness-standard.md +1 -1
  13. package/docs/security-threat-model.md +1 -1
  14. package/docs/task-implementation-contract.md +11 -4
  15. package/docs/team-onboarding.md +2 -2
  16. package/docs/usage-observability.md +70 -0
  17. package/docs/vi/architecture.md +13 -0
  18. package/docs-site/architecture.html +5 -1
  19. package/docs-site/benchmark.html +5 -1
  20. package/docs-site/commands.html +5 -1
  21. package/docs-site/content/en/index.html +49 -0
  22. package/docs-site/content/en/runtime.html +13 -0
  23. package/docs-site/content/index.html +49 -0
  24. package/docs-site/content/runtime.html +28 -0
  25. package/docs-site/context-engine.html +5 -1
  26. package/docs-site/en/architecture.html +5 -1
  27. package/docs-site/en/benchmark.html +5 -1
  28. package/docs-site/en/commands.html +5 -1
  29. package/docs-site/en/context-engine.html +5 -1
  30. package/docs-site/en/index.html +54 -1
  31. package/docs-site/en/mcp-approval.html +5 -1
  32. package/docs-site/en/mcp-auth.html +5 -1
  33. package/docs-site/en/mcp-servers.html +5 -1
  34. package/docs-site/en/mcp.html +5 -1
  35. package/docs-site/en/permissions.html +5 -1
  36. package/docs-site/en/profiles.html +5 -1
  37. package/docs-site/en/quickstart.html +5 -1
  38. package/docs-site/en/runtime.html +18 -1
  39. package/docs-site/en/scope.html +5 -1
  40. package/docs-site/en/security.html +5 -1
  41. package/docs-site/en/team.html +5 -1
  42. package/docs-site/en/whats-new.html +5 -1
  43. package/docs-site/en/workflows.html +5 -1
  44. package/docs-site/index.html +54 -1
  45. package/docs-site/mcp-approval.html +5 -1
  46. package/docs-site/mcp-auth.html +5 -1
  47. package/docs-site/mcp-servers.html +5 -1
  48. package/docs-site/mcp.html +5 -1
  49. package/docs-site/permissions.html +5 -1
  50. package/docs-site/profiles.html +5 -1
  51. package/docs-site/quickstart.html +5 -1
  52. package/docs-site/runtime.html +33 -1
  53. package/docs-site/scope.html +5 -1
  54. package/docs-site/security.html +5 -1
  55. package/docs-site/team.html +5 -1
  56. package/docs-site/whats-new.html +5 -1
  57. package/docs-site/workflows.html +5 -1
  58. package/package.json +14 -2
  59. package/packages/piagent-core/README.md +3 -2
  60. package/packages/piagent-core/capabilities/capability-verification-cache.js +17 -7
  61. package/packages/piagent-core/capabilities/runtime-integrity.js +51 -4
  62. package/packages/piagent-core/extensions/piagent-guard.ts +18 -235
  63. package/packages/piagent-core/extensions/runtime-evidence.js +12 -1
  64. package/packages/piagent-core/extensions/shell-reach.ts +250 -0
  65. package/packages/piagent-core/mcp/mcp-command-actions.js +1 -1
  66. package/packages/piagent-core/mcp/mcp-server-catalog.js +135 -5
  67. package/packages/piagent-core/package.json +1 -1
  68. package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +9 -2
  69. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +25 -2
  70. package/packages/piagent-core/runtime/policy/block-remedy.ts +139 -0
  71. package/packages/piagent-core/runtime/registration/task-start-tool.ts +9 -13
  72. package/packages/piagent-core/runtime/session/token-economics.js +34 -0
  73. package/packages/piagent-core/runtime/tools/phase-tool-runtime.ts +2 -1
  74. package/packages/piagent-core/runtime/workflows/task-intake.ts +5 -0
  75. package/packages/piagent-core/security/sensitive-data.js +7 -0
  76. package/packages/piagent-webui/dist/client/assets/index-bu7XpD9Q.js +172 -0
  77. package/packages/piagent-webui/dist/client/index.html +1 -1
  78. package/packages/piagent-webui/extension/lifecycle-controller.ts +15 -0
  79. package/packages/piagent-webui/extension/piagent-webui.ts +4 -4
  80. package/packages/piagent-webui/extension/same-session-bridge.ts +3 -3
  81. package/packages/piagent-webui/gateway/extension-authority.ts +47 -0
  82. package/packages/piagent-webui/gateway/session-inspection-registry.ts +37 -2
  83. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +5 -1
  84. package/packages/piagent-webui/server/core-inspection-provider.ts +5 -5
  85. package/packages/piagent-webui/server/transcript-projection.ts +15 -0
  86. package/scripts/build-docs-site.mjs +21 -1
  87. package/scripts/explain-command.mjs +240 -0
  88. package/scripts/install-global.sh +104 -3
  89. package/scripts/mcp-manage.mjs +17 -4
  90. package/scripts/pi-session-stats.sh +10 -2
  91. package/scripts/piagent-cli.mjs +14 -1
  92. package/scripts/piagent-dashboard.mjs +55 -2
  93. package/scripts/setup.sh +69 -33
  94. package/scripts/traffic-snapshot.mjs +214 -0
  95. package/scripts/typescript-loader.mjs +20 -4
  96. package/scripts/uninstall-global.sh +53 -2
  97. package/scripts/update-global.mjs +33 -1
  98. package/scripts/verify-local.sh +4 -0
  99. package/scripts/verify-translation-pairing.mjs +121 -0
  100. package/packages/piagent-webui/dist/client/assets/index-DjMntaK5.js +0 -172
@@ -87,7 +87,7 @@ tool context mang tính advisory chỉ được nạp khi task thực sự cần
87
87
 
88
88
  ```text
89
89
  1. Intake
90
- - one Pi session per task
90
+ - one pending task per Pi session; terminal tasks remain immutable while the conversation may continue with a successor task
91
91
  - runtime auto-start for bounded source changes; manual fallback for broad/high-risk/ambiguous scope
92
92
  - source-change or read-only
93
93
  - risk lane
@@ -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.4.0, and WSL2 is experimental/unverified.
28
+ - Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.4.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
@@ -20,7 +20,7 @@ Agent Watch/report hien ten task ma operator da dat.
20
20
  | Nhom | Field | Quy tac |
21
21
  |---|---|---|
22
22
  | Schema | `schemaVersion` | Luon la `2`. |
23
- | Identity | `taskRunId`, `taskId`, `sessionId`, `sessionName`, `intakeMode` | Run ID/Task ID normalized; mot session chi co mot task; intake la `runtime` hoac `model`. |
23
+ | Identity | `taskRunId`, `taskId`, `sessionId`, `sessionName`, `intakeMode` | Run ID/Task ID normalized; mot session chi co mot task pending, nhung co the chua nhieu task terminal tuan tu; intake la `runtime` hoac `model`. |
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. |
@@ -32,6 +32,11 @@ Agent Watch/report hien ten task ma operator da dat.
32
32
  | Outcome | `trace`, `failedAt`, `failureReason`, `ruledOut` | Terminal contract immutable. |
33
33
  | Time | `createdAt`, `updatedAt` | Timestamp parseable, dung de sap xep/migration/report. |
34
34
 
35
+ `source-change` la mode co quyen thuc thi command cua project, khong phai loi
36
+ khai rang task bat buoc sua source. Yeu cau chi chay test/build/lint/typecheck
37
+ hoac package dry-run van dung mode nay va co the hoan tat voi working tree khong
38
+ doi. `read-only` danh cho inspection khong can shell execution.
39
+
35
40
  Template day du nam tai
36
41
  [`templates/project/.pi/task-contract.template.json`](../templates/project/.pi/task-contract.template.json).
37
42
  Schema chinh thuc nam tai
@@ -56,7 +61,7 @@ context/verify/trace/gate tools are recovery surfaces for custom/high-risk work.
56
61
 
57
62
  Task start tu choi khi:
58
63
 
59
- - session da thuoc task khac hoac task terminal;
64
+ - session dang co mot task pending khac;
60
65
  - cung `taskId` dang pending o session khac;
61
66
  - task da completed;
62
67
  - retry vuot `maxAttempts`;
@@ -111,8 +116,10 @@ failed step can note moi; step done/skipped khong duoc mo lai. Khi trace da
111
116
  terminal, cac tool progress/context/memory/verify/trace va project mutations deu
112
117
  bi chan cho session do.
113
118
 
114
- Retry chay o session moi. `previousAttempts` giu outcome, phase failure, reason,
115
- ruled-out hypothesis va timestamp de agent khong lap lai cach da that bai.
119
+ Retry co the chay tiep trong cung session sau khi attempt truoc da terminal.
120
+ `previousAttempts` giu outcome, phase failure, reason, ruled-out hypothesis va
121
+ timestamp de agent khong lap lai cach da that bai. Session binding luon tro den
122
+ task moi nhat; task terminal cu van immutable va con nguyen evidence.
116
123
 
117
124
  ## Migration v1 -> v2
118
125
 
@@ -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.4.0
13
+ npm install -g --ignore-scripts @piagent/platform@1.4.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.4.0
47
+ npm install -g --ignore-scripts @piagent/platform@1.4.1
48
48
  piagent-install --stable --dry-run
49
49
  piagent-install --stable
50
50
  ```
@@ -183,6 +183,76 @@ Format hỗ trợ:
183
183
  | CSV | `piagent-usage --history <project> --csv` |
184
184
  | Markdown | `piagent-usage --history <project> --markdown` |
185
185
 
186
+ ### Shape của `--json`
187
+
188
+ Table/CSV/Markdown chỉ in một phần report. `--json` trả nguyên object, gồm **6 key top-level**:
189
+
190
+ | Key | Nội dung |
191
+ |---|---|
192
+ | `generatedAt` | ISO timestamp lúc chạy lệnh. Dùng để so hai report với nhau. |
193
+ | `scope` | `projectPath` (null khi `--all-projects`), `allProjects`, `includeSubagents`, `sessionsDir`, `since`, `until`. Đây là bản ghi chính xác của filter đã áp — report không tự giải thích được nếu thiếu key này. |
194
+ | `totals` | `sessions` / `mainSessions` / `subagentSessions`, `messages` (`user`, `assistant`, `toolCalls`, `toolResults`, `total`), `promptChars`, và `tokens` (xem bảng "Cách đọc số"). |
195
+ | `projects` | Một dòng cho mỗi `cwd`, sort giảm dần theo `tokens.total`: `cwd`, `sessions`, `mainSessions`, `subagentSessions`, `tokens`, `cost`. |
196
+ | `tools` | `{ name, count }` cho mỗi tool đã gọi, sort giảm dần theo `count`. Đây là chỗ nhìn ra tool nào đang đốt tool-call budget. |
197
+ | `sessions` | Một dòng cho mỗi session, mới nhất trước: `id`, `name`, `cwd`, `file`, `isSubagent`, `provider`, `modelId`, `thinkingLevel`, `firstTimestamp`, `lastTimestamp`, `messages`, `tokens`. |
198
+
199
+ Mọi `Date` đều được serialize thành ISO string, nên output an toàn để `jq` hoặc
200
+ đẩy thẳng vào báo cáo.
201
+
202
+ ```bash
203
+ # Top 10 tool tốn nhiều call nhất trong 7 ngày, toàn máy
204
+ piagent-usage --history --all-projects --days 7 --json | jq '.tools[:10]'
205
+
206
+ # Cost theo từng project
207
+ piagent-usage --history --all-projects --days 7 --json | jq '.projects[] | {cwd, cost}'
208
+ ```
209
+
210
+ ## Đo lượt dùng từ bên ngoài
211
+
212
+ Ba kênh khác nhau, ba bộ đếm khác nhau — **không cộng vào nhau**:
213
+
214
+ | Kênh | Đếm gì | Lấy ở đâu |
215
+ |---|---|---|
216
+ | npm downloads | cài qua `npm install` | `api.npmjs.org/downloads/point/last-week/@piagent/platform` |
217
+ | GitHub clones | cài qua `pi install git:…` (mỗi lần là một `git clone`) | `gh api repos/<owner>/<repo>/traffic/clones` |
218
+ | Docs site | người đọc tài liệu | Vercel Web Analytics |
219
+
220
+ Đọc số npm cẩn thận: với package còn mới, mirror và scanner chiếm phần lớn.
221
+ Dấu hiệu nhận ra là **phân bổ đều giữa nhiều version**, kể cả prerelease cũ —
222
+ người thật dồn vào bản mới nhất, bot thì kéo tất.
223
+
224
+ ### Traffic GitHub chỉ sống 14 ngày
225
+
226
+ API traffic chỉ trả cửa sổ trượt 14 ngày và **xoá hẳn** phần cũ hơn: không có
227
+ endpoint nào lấy lại được. Workflow `traffic-snapshot` chạy hằng ngày và gộp
228
+ vào CSV cộng dồn trên nhánh `traffic-data`, nên lịch sử không mất. Khoảng trống
229
+ dài hơn 14 ngày là vĩnh viễn.
230
+
231
+ ```bash
232
+ # chạy tay, ghi vào ./traffic
233
+ TRAFFIC_TOKEN="$(gh auth token)" node scripts/traffic-snapshot.mjs --repository Vt-mmm/piagent
234
+ ```
235
+
236
+ Traffic endpoint đòi quyền **push** trên repo. Nếu `GITHUB_TOKEN` mặc định của
237
+ Actions không đủ, script sẽ báo `HTTP 403` kèm đúng cách sửa: tạo fine-grained
238
+ PAT có quyền `Administration: read` rồi lưu thành secret `TRAFFIC_TOKEN`.
239
+
240
+ ### Docs site
241
+
242
+ Site dùng **Vercel Web Analytics** — cookieless, không lưu định danh trên
243
+ trình duyệt, nên không cần banner đồng ý. Snippet nằm trong shell của
244
+ `build-docs-site.mjs` nên mọi trang và cả hai ngôn ngữ đều có; test chặn
245
+ trường hợp thêm trang mới mà quên.
246
+
247
+ Phải bật trong Vercel dashboard (**Analytics → Enable**) rồi deploy lại thì
248
+ route `/_vercel/insights/*` mới tồn tại. Trước đó request 404 và trang vẫn chạy
249
+ bình thường.
250
+
251
+ Runtime của piagent **không gửi gì ra ngoài**: `telemetry()` ghi local qua
252
+ `appendContextTelemetry(cwd, …)`, package không có `postinstall`. Đó là chủ ý —
253
+ một sản phẩm bán bằng lời hứa owner-only local state thì không nên có lệnh gọi
254
+ mạng ngầm.
255
+
186
256
  ## Cách đọc số
187
257
 
188
258
  | Field | Ý nghĩa |
@@ -43,9 +43,22 @@ Rule máy đọc nằm tại `architecture/layers.json`; chạy `npm run archite
43
43
  | Capabilities | `packages/piagent-core/capabilities/` | Profile resolution, pack validation, lock, source root | Pi session lifecycle |
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
+ | 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 client | `packages/piagent-webui/client/` | View trên browser, view model, UI preference | Server state, filesystem, Pi API |
48
+ | WebUI server | `packages/piagent-webui/server/` | HTTP/WS endpoint, đọc session, dựng diff | Render phía browser; không được import client |
49
+ | WebUI extension | `packages/piagent-webui/extension/` | Lệnh `/piagent-webui` chạy trong Pi | Wire type mà client cũng cần |
50
+ | WebUI gateway | `packages/piagent-webui/gateway/` | Tiến trình `piagent dashboard` độc lập, port và lifecycle | Feature logic thuộc về server |
51
+ | WebUI ownership | `packages/piagent-webui/ownership/` | Claim single-owner trên một session directory | Transport và render; layer này không phụ thuộc gì |
52
+ | WebUI build | `packages/piagent-webui/` (gốc package) | Bundle client và đóng gói asset được serve | Source của bất kỳ WebUI layer nào |
46
53
  | Entrypoints | `scripts/` | CLI argument và gọi use case | Domain logic trùng lặp |
47
54
  | Product assets | `prompts/`, `skills/`, `subagents/`, `adapters/`, `packs/`, `schemas/` | Declarative behavior và contract | Hidden runtime state |
48
55
 
56
+ Các layer WebUI là một trục dependency thứ hai, không phải nhánh của trục đầu. `contracts` và
57
+ `ownership` nằm dưới cùng và không import gì; `client` chỉ được với tới `contracts`, nên bundle
58
+ browser không bao giờ kéo theo code server hay Pi. `server`, `extension`, `gateway` với xuống
59
+ `runtime`/`core`/`security` — không bao giờ ngược lại, nên platform vẫn chạy headless khi không
60
+ có WebUI. `npm run architecture:check` enforce toàn bộ edge trên.
61
+
49
62
  Folder `extensions/` vẫn chứa một số service module do lịch sử. Tên folder này là legacy; chỉ `piagent-guard.ts` được Pi load như extension. Mỗi lần migrate phải tách theo một feature trọn vẹn và giữ compatibility cho đến khi migration hoàn tất.
50
63
 
51
64
  ## Luồng runtime
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/architecture" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/architecture" hreflang="en" lang="en">EN</a>
@@ -217,5 +217,9 @@
217
217
  <nav data-toc></nav>
218
218
  </aside>
219
219
  </div>
220
+ <script>
221
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
222
+ </script>
223
+ <script defer src="/_vercel/insights/script.js"></script>
220
224
  </body>
221
225
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/benchmark" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/benchmark" hreflang="en" lang="en">EN</a>
@@ -364,5 +364,9 @@
364
364
  <nav data-toc></nav>
365
365
  </aside>
366
366
  </div>
367
+ <script>
368
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
369
+ </script>
370
+ <script defer src="/_vercel/insights/script.js"></script>
367
371
  </body>
368
372
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/commands" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/commands" hreflang="en" lang="en">EN</a>
@@ -254,5 +254,9 @@
254
254
  <nav data-toc></nav>
255
255
  </aside>
256
256
  </div>
257
+ <script>
258
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
259
+ </script>
260
+ <script defer src="/_vercel/insights/script.js"></script>
257
261
  </body>
258
262
  </html>
@@ -18,6 +18,55 @@
18
18
  </div>
19
19
  </section>
20
20
 
21
+ <section class="section">
22
+ <p class="section-kicker">Production V1 · historical public regression evidence</p>
23
+ <h2 id="evidence">Measured, not asserted</h2>
24
+ <p class="section-lead">108 sessions on the same model and thinking level, graded automatically, against an isolated <code>codex-cli</code> surface. This is the production-v1 measurement; it is not a re-measurement of v1.4.0.</p>
25
+
26
+ <div class="benchmark-metrics" aria-label="Headline benchmark numbers">
27
+ <div class="benchmark-metric">
28
+ <span>Overall</span>
29
+ <strong>9.92 / 10</strong>
30
+ <small>Quality, Safety, Reliability all 10/10</small>
31
+ </div>
32
+ <div class="benchmark-metric">
33
+ <span>Tasks resolved</span>
34
+ <strong>54/54</strong>
35
+ <small>100% on both surfaces</small>
36
+ </div>
37
+ <div class="benchmark-metric">
38
+ <span>Fresh tokens</span>
39
+ <strong>-51.11%</strong>
40
+ <small>paired geometric mean, 47/54 pair wins</small>
41
+ </div>
42
+ <div class="benchmark-metric">
43
+ <span>Infrastructure</span>
44
+ <strong>0 retries</strong>
45
+ <small>108 valid runs</small>
46
+ </div>
47
+ </div>
48
+
49
+ <div class="benchmark-legend" aria-label="Chart legend">
50
+ <span><i class="piagent-swatch"></i>Piagent</span>
51
+ <span><i class="codex-swatch"></i>codex-cli</span>
52
+ </div>
53
+
54
+ <div class="benchmark-usage-chart" aria-label="Median fresh tokens per run: Piagent 7,368, codex-cli 18,476">
55
+ <div class="benchmark-usage-group">
56
+ <h3>Fresh tokens, median per run</h3>
57
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 39.88%"></i></div><strong>7,368</strong></div>
58
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>18,476</strong></div>
59
+ </div>
60
+ <div class="benchmark-usage-group">
61
+ <h3>Tool calls, median per run</h3>
62
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 62.5%"></i></div><strong>5</strong></div>
63
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>8</strong></div>
64
+ </div>
65
+ </div>
66
+
67
+ <p>The 95% confidence interval on the paired ratio is <strong>0.3809–0.6276</strong>; the upper bound stays below 1.0, so the token-saving claim holds. <a href="/en/benchmark">See the full configuration, every band score, and the raw tables</a>.</p>
68
+ </section>
69
+
21
70
  <section class="section">
22
71
  <h2 id="install">Install with two commands</h2>
23
72
  <p>Requires Node.js <span class="inline-code">&gt;=22.19.0</span>. Run these commands from the project you want to configure.</p>
@@ -20,6 +20,19 @@ piagent-benchmark --production --surfaces piagent,codex-cli \
20
20
  piagent-auto --full-access -p "Run the trusted local benchmark suite."</code></pre></article>
21
21
  <article class="command-card"><header><span>Capabilities</span><button class="clip-btn" data-clip="piagent-capabilities catalog --check&#10;piagent-capabilities doctor --profile .pi/piagent-profile.json">Copy</button></header><pre><code>piagent-capabilities catalog --check
22
22
  piagent-capabilities doctor --profile .pi/piagent-profile.json</code></pre></article>
23
+ <article class="command-card"><header><span>Session Hub</span><button class="clip-btn" data-clip="piagent dashboard&#10;piagent-webui --no-open">Copy</button></header><pre><code>piagent dashboard
24
+ piagent-webui --no-open</code></pre>
25
+ <p class="command-note">Aliases: <code>piagent-dashboard</code>, <code>piagent-webui</code> and <code>piagent-explain</code> also work as standalone binaries.</p></article>
26
+ <article class="command-card"><header><span>Explain a decision</span><button class="clip-btn" data-clip="piagent explain &#39;cat .env*&#39;&#10;piagent explain --scope">Copy</button></header><pre><code>piagent explain 'cat .env*'
27
+ piagent explain --scope</code></pre></article>
28
+ <article class="command-card"><header><span>Usage and tokens</span><button class="clip-btn" data-clip="piagent-usage .&#10;piagent-usage --history . --days 7">Copy</button></header><pre><code>piagent-usage .
29
+ piagent-usage --history . --days 7</code></pre></article>
30
+ <article class="command-card"><header><span>Models and routing</span><button class="clip-btn" data-clip="piagent-models&#10;piagent-model-scope&#10;piagent-route">Copy</button></header><pre><code>piagent-models
31
+ piagent-model-scope
32
+ piagent-route</code></pre></article>
33
+ <article class="command-card"><header><span>Subagents and migration</span><button class="clip-btn" data-clip="piagent-subagents --preset safe&#10;piagent-migrate . --apply&#10;piagent-import-instructions">Copy</button></header><pre><code>piagent-subagents --preset safe
34
+ piagent-migrate . --apply
35
+ piagent-import-instructions</code></pre></article>
23
36
  <article class="command-card"><header><span>Verification</span><button class="clip-btn" data-clip="npm run verify&#10;npm test&#10;npm run typecheck">Copy</button></header><pre><code>npm run verify
24
37
  npm test
25
38
  npm run typecheck</code></pre></article>
@@ -18,6 +18,55 @@
18
18
  </div>
19
19
  </section>
20
20
 
21
+ <section class="section">
22
+ <p class="section-kicker">Production V1 · historical public regression evidence</p>
23
+ <h2 id="bang-chung">Đo được, không phải nói suông</h2>
24
+ <p class="section-lead">108 session, cùng model và cùng thinking level, chấm tự động, so với surface <code>codex-cli</code> chạy cách ly. Đây là bằng chứng của bản đo production-v1, không phải phép đo lại của v1.4.0.</p>
25
+
26
+ <div class="benchmark-metrics" aria-label="Số liệu benchmark nổi bật">
27
+ <div class="benchmark-metric">
28
+ <span>Overall</span>
29
+ <strong>9,92 / 10</strong>
30
+ <small>Quality, Safety, Reliability đều 10/10</small>
31
+ </div>
32
+ <div class="benchmark-metric">
33
+ <span>Task resolved</span>
34
+ <strong>54/54</strong>
35
+ <small>100% cho cả hai surface</small>
36
+ </div>
37
+ <div class="benchmark-metric">
38
+ <span>Fresh token</span>
39
+ <strong>-51,11%</strong>
40
+ <small>paired geometric mean, 47/54 cặp thắng</small>
41
+ </div>
42
+ <div class="benchmark-metric">
43
+ <span>Infrastructure</span>
44
+ <strong>0 retry</strong>
45
+ <small>108 lần chạy hợp lệ</small>
46
+ </div>
47
+ </div>
48
+
49
+ <div class="benchmark-legend" aria-label="Chú thích biểu đồ">
50
+ <span><i class="piagent-swatch"></i>Piagent</span>
51
+ <span><i class="codex-swatch"></i>codex-cli</span>
52
+ </div>
53
+
54
+ <div class="benchmark-usage-chart" aria-label="Fresh token median mỗi run: Piagent 7.368, codex-cli 18.476">
55
+ <div class="benchmark-usage-group">
56
+ <h3>Fresh token, median mỗi run</h3>
57
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 39.88%"></i></div><strong>7.368</strong></div>
58
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>18.476</strong></div>
59
+ </div>
60
+ <div class="benchmark-usage-group">
61
+ <h3>Tool calls, median mỗi run</h3>
62
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 62.5%"></i></div><strong>5</strong></div>
63
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>8</strong></div>
64
+ </div>
65
+ </div>
66
+
67
+ <p>Khoảng tin cậy 95% của tỷ lệ ghép cặp là <strong>0,3809–0,6276</strong>; cận trên vẫn dưới 1,0 nên claim tiết kiệm token đứng vững. <a href="/benchmark">Xem đầy đủ cấu hình, từng band điểm và bảng số</a>.</p>
68
+ </section>
69
+
21
70
  <section class="section">
22
71
  <h2 id="cai-dat">Cài trong hai lệnh</h2>
23
72
  <p>Node.js <span class="inline-code">&gt;=22.19.0</span>. Chạy từ đúng project muốn set up.</p>
@@ -50,6 +50,34 @@ piagent-auto --full-access -p "Run the trusted local benchmark suite."</code></p
50
50
  <header><span>Capabilities</span><button class="clip-btn" data-clip="piagent-capabilities catalog --check&#10;piagent-capabilities doctor --profile .pi/piagent-profile.json">Lấy lệnh</button></header>
51
51
  <pre><code>piagent-capabilities catalog --check
52
52
  piagent-capabilities doctor --profile .pi/piagent-profile.json</code></pre>
53
+ </article>
54
+ <article class="command-card">
55
+ <header><span>Session Hub</span><button class="clip-btn" data-clip="piagent dashboard&#10;piagent-webui --no-open">Lấy lệnh</button></header>
56
+ <pre><code>piagent dashboard
57
+ piagent-webui --no-open</code></pre>
58
+ <p class="command-note">Bí danh: <code>piagent-dashboard</code>, <code>piagent-webui</code>, <code>piagent-explain</code> cũng chạy được như binary riêng.</p>
59
+ </article>
60
+ <article class="command-card">
61
+ <header><span>Giải thích quyết định</span><button class="clip-btn" data-clip="piagent explain &#39;cat .env*&#39;&#10;piagent explain --scope">Lấy lệnh</button></header>
62
+ <pre><code>piagent explain 'cat .env*'
63
+ piagent explain --scope</code></pre>
64
+ </article>
65
+ <article class="command-card">
66
+ <header><span>Usage và token</span><button class="clip-btn" data-clip="piagent-usage .&#10;piagent-usage --history . --days 7">Lấy lệnh</button></header>
67
+ <pre><code>piagent-usage .
68
+ piagent-usage --history . --days 7</code></pre>
69
+ </article>
70
+ <article class="command-card">
71
+ <header><span>Model và routing</span><button class="clip-btn" data-clip="piagent-models&#10;piagent-model-scope&#10;piagent-route">Lấy lệnh</button></header>
72
+ <pre><code>piagent-models
73
+ piagent-model-scope
74
+ piagent-route</code></pre>
75
+ </article>
76
+ <article class="command-card">
77
+ <header><span>Subagents và migration</span><button class="clip-btn" data-clip="piagent-subagents --preset safe&#10;piagent-migrate . --apply&#10;piagent-import-instructions">Lấy lệnh</button></header>
78
+ <pre><code>piagent-subagents --preset safe
79
+ piagent-migrate . --apply
80
+ piagent-import-instructions</code></pre>
53
81
  </article>
54
82
  <article class="command-card">
55
83
  <header><span>Verification</span><button class="clip-btn" data-clip="npm run verify&#10;npm test&#10;npm run typecheck">Lấy lệnh</button></header>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/context-engine" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/context-engine" hreflang="en" lang="en">EN</a>
@@ -184,5 +184,9 @@ piagent-context efficiency</code></pre>
184
184
  <nav data-toc></nav>
185
185
  </aside>
186
186
  </div>
187
+ <script>
188
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
189
+ </script>
190
+ <script defer src="/_vercel/insights/script.js"></script>
187
191
  </body>
188
192
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/architecture" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/architecture" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -181,5 +181,9 @@
181
181
  <nav data-toc></nav>
182
182
  </aside>
183
183
  </div>
184
+ <script>
185
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
186
+ </script>
187
+ <script defer src="/_vercel/insights/script.js"></script>
184
188
  </body>
185
189
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/benchmark" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/benchmark" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -314,5 +314,9 @@
314
314
  <nav data-toc></nav>
315
315
  </aside>
316
316
  </div>
317
+ <script>
318
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
319
+ </script>
320
+ <script defer src="/_vercel/insights/script.js"></script>
317
321
  </body>
318
322
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/commands" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/commands" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -206,5 +206,9 @@
206
206
  <nav data-toc></nav>
207
207
  </aside>
208
208
  </div>
209
+ <script>
210
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
211
+ </script>
212
+ <script defer src="/_vercel/insights/script.js"></script>
209
213
  </body>
210
214
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/context-engine" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/context-engine" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -160,5 +160,9 @@ piagent-context efficiency</code></pre></article>
160
160
  <nav data-toc></nav>
161
161
  </aside>
162
162
  </div>
163
+ <script>
164
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
165
+ </script>
166
+ <script defer src="/_vercel/insights/script.js"></script>
163
167
  </body>
164
168
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -111,6 +111,55 @@
111
111
  </div>
112
112
  </section>
113
113
 
114
+ <section class="section">
115
+ <p class="section-kicker">Production V1 · historical public regression evidence</p>
116
+ <h2 id="evidence">Measured, not asserted</h2>
117
+ <p class="section-lead">108 sessions on the same model and thinking level, graded automatically, against an isolated <code>codex-cli</code> surface. This is the production-v1 measurement; it is not a re-measurement of v1.4.0.</p>
118
+
119
+ <div class="benchmark-metrics" aria-label="Headline benchmark numbers">
120
+ <div class="benchmark-metric">
121
+ <span>Overall</span>
122
+ <strong>9.92 / 10</strong>
123
+ <small>Quality, Safety, Reliability all 10/10</small>
124
+ </div>
125
+ <div class="benchmark-metric">
126
+ <span>Tasks resolved</span>
127
+ <strong>54/54</strong>
128
+ <small>100% on both surfaces</small>
129
+ </div>
130
+ <div class="benchmark-metric">
131
+ <span>Fresh tokens</span>
132
+ <strong>-51.11%</strong>
133
+ <small>paired geometric mean, 47/54 pair wins</small>
134
+ </div>
135
+ <div class="benchmark-metric">
136
+ <span>Infrastructure</span>
137
+ <strong>0 retries</strong>
138
+ <small>108 valid runs</small>
139
+ </div>
140
+ </div>
141
+
142
+ <div class="benchmark-legend" aria-label="Chart legend">
143
+ <span><i class="piagent-swatch"></i>Piagent</span>
144
+ <span><i class="codex-swatch"></i>codex-cli</span>
145
+ </div>
146
+
147
+ <div class="benchmark-usage-chart" aria-label="Median fresh tokens per run: Piagent 7,368, codex-cli 18,476">
148
+ <div class="benchmark-usage-group">
149
+ <h3>Fresh tokens, median per run</h3>
150
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 39.88%"></i></div><strong>7,368</strong></div>
151
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>18,476</strong></div>
152
+ </div>
153
+ <div class="benchmark-usage-group">
154
+ <h3>Tool calls, median per run</h3>
155
+ <div class="benchmark-usage-row"><span>Piagent</span><div class="benchmark-track"><i class="piagent-bar" style="--bar-size: 62.5%"></i></div><strong>5</strong></div>
156
+ <div class="benchmark-usage-row"><span>codex-cli</span><div class="benchmark-track"><i class="codex-bar" style="--bar-size: 100%"></i></div><strong>8</strong></div>
157
+ </div>
158
+ </div>
159
+
160
+ <p>The 95% confidence interval on the paired ratio is <strong>0.3809–0.6276</strong>; the upper bound stays below 1.0, so the token-saving claim holds. <a href="/en/benchmark">See the full configuration, every band score, and the raw tables</a>.</p>
161
+ </section>
162
+
114
163
  <section class="section">
115
164
  <h2 id="install">Install with two commands</h2>
116
165
  <p>Requires Node.js <span class="inline-code">&gt;=22.19.0</span>. Run these commands from the project you want to configure.</p>
@@ -206,5 +255,9 @@ piagent-setup</code></pre>
206
255
  <nav data-toc></nav>
207
256
  </aside>
208
257
  </div>
258
+ <script>
259
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
260
+ </script>
261
+ <script defer src="/_vercel/insights/script.js"></script>
209
262
  </body>
210
263
  </html>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.4.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.4.1 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/mcp-approval" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/mcp-approval" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -204,5 +204,9 @@
204
204
  <nav data-toc></nav>
205
205
  </aside>
206
206
  </div>
207
+ <script>
208
+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
209
+ </script>
210
+ <script defer src="/_vercel/insights/script.js"></script>
207
211
  </body>
208
212
  </html>