@piagent/platform 1.2.11 → 1.2.12

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 (78) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +9 -7
  3. package/benchmarks/production-v1/grade.mjs +220 -0
  4. package/benchmarks/production-v1/project/README.md +7 -0
  5. package/benchmarks/production-v1/project/config/service.json +4 -0
  6. package/benchmarks/production-v1/project/data/audit-ledger.jsonl +1 -0
  7. package/benchmarks/production-v1/project/docs/ops.md +3 -0
  8. package/benchmarks/production-v1/project/logs/incident.log +2 -0
  9. package/benchmarks/production-v1/project/package.json +11 -0
  10. package/benchmarks/production-v1/project/scripts/check.mjs +21 -0
  11. package/benchmarks/production-v1/project/src/backend/auth.js +3 -0
  12. package/benchmarks/production-v1/project/src/backend/cache.js +15 -0
  13. package/benchmarks/production-v1/project/src/backend/invoice.js +4 -0
  14. package/benchmarks/production-v1/project/src/data/csv.js +3 -0
  15. package/benchmarks/production-v1/project/src/data/dedup.js +5 -0
  16. package/benchmarks/production-v1/project/src/data/migration.js +9 -0
  17. package/benchmarks/production-v1/project/src/frontend/pagination.js +8 -0
  18. package/benchmarks/production-v1/project/src/frontend/search-state.js +8 -0
  19. package/benchmarks/production-v1/project/src/frontend/unicode-search.js +7 -0
  20. package/benchmarks/production-v1/project/src/platform/args.js +10 -0
  21. package/benchmarks/production-v1/project/src/platform/config.js +7 -0
  22. package/benchmarks/production-v1/project/src/platform/workspace.js +13 -0
  23. package/benchmarks/production-v1/project/src/reliability/expiry.js +5 -0
  24. package/benchmarks/production-v1/project/src/reliability/retry.js +15 -0
  25. package/benchmarks/production-v1/project/test/smoke.test.js +12 -0
  26. package/benchmarks/production-v1/project/vendor/README.md +1 -0
  27. package/benchmarks/production-v1/prompts/bounded-retry.md +7 -0
  28. package/benchmarks/production-v1/prompts/cli-double-dash.md +7 -0
  29. package/benchmarks/production-v1/prompts/config-precedence.md +6 -0
  30. package/benchmarks/production-v1/prompts/destructive-history-refusal.md +3 -0
  31. package/benchmarks/production-v1/prompts/expiry-boundary.md +7 -0
  32. package/benchmarks/production-v1/prompts/incident-diagnosis.md +4 -0
  33. package/benchmarks/production-v1/prompts/invoice-rounding.md +9 -0
  34. package/benchmarks/production-v1/prompts/pagination-boundary.md +7 -0
  35. package/benchmarks/production-v1/prompts/protected-env-refusal.md +2 -0
  36. package/benchmarks/production-v1/prompts/quoted-csv.md +6 -0
  37. package/benchmarks/production-v1/prompts/repository-prompt-injection.md +5 -0
  38. package/benchmarks/production-v1/prompts/schema-migration.md +6 -0
  39. package/benchmarks/production-v1/prompts/stable-dedup.md +6 -0
  40. package/benchmarks/production-v1/prompts/stale-search-response.md +6 -0
  41. package/benchmarks/production-v1/prompts/tenant-cache-isolation.md +6 -0
  42. package/benchmarks/production-v1/prompts/tenant-role-authorization.md +6 -0
  43. package/benchmarks/production-v1/prompts/unicode-search.md +6 -0
  44. package/benchmarks/production-v1/prompts/workspace-order.md +7 -0
  45. package/benchmarks/production-v1/suite.json +284 -0
  46. package/benchmarks/production-v1/variant.mjs +112 -0
  47. package/docs/command-reference-vietnamese.md +15 -6
  48. package/docs/distribution-standard.md +7 -7
  49. package/docs/operator-manual-vietnamese.md +29 -13
  50. package/docs/quality-benchmark.md +129 -18
  51. package/docs/release-install-policy.md +15 -11
  52. package/docs/runtime-policy-design.md +2 -1
  53. package/docs/runtime-quality-baseline.md +13 -2
  54. package/docs/security-threat-model.md +1 -1
  55. package/docs/team-onboarding.md +2 -2
  56. package/docs-site/architecture.html +1 -1
  57. package/docs-site/commands.html +1 -1
  58. package/docs-site/content/runtime.html +7 -1
  59. package/docs-site/context-engine.html +1 -1
  60. package/docs-site/index.html +1 -1
  61. package/docs-site/mcp-approval.html +1 -1
  62. package/docs-site/mcp-auth.html +1 -1
  63. package/docs-site/mcp-servers.html +1 -1
  64. package/docs-site/mcp.html +1 -1
  65. package/docs-site/permissions.html +1 -1
  66. package/docs-site/profiles.html +1 -1
  67. package/docs-site/quickstart.html +1 -1
  68. package/docs-site/runtime.html +8 -2
  69. package/docs-site/scope.html +1 -1
  70. package/docs-site/security.html +1 -1
  71. package/docs-site/team.html +1 -1
  72. package/docs-site/workflows.html +1 -1
  73. package/package.json +1 -1
  74. package/packages/piagent-core/benchmark/benchmark-core.js +325 -41
  75. package/packages/piagent-core/extensions/piagent-guard.ts +47 -12
  76. package/packages/piagent-core/package.json +1 -1
  77. package/scripts/benchmark-runner.mjs +328 -68
  78. package/scripts/verify-local.sh +4 -0
@@ -41,6 +41,25 @@ không gọi model:
41
41
  piagent-benchmark --dry-run
42
42
  ```
43
43
 
44
+ Đây là smoke suite để phát hiện regression nhanh, không phải production claim.
45
+ Release cần bằng chứng diện rộng dùng track riêng:
46
+
47
+ ```bash
48
+ piagent-benchmark --production --dry-run \
49
+ --surfaces piagent,codex-cli \
50
+ --model openai-codex/gpt-5.6-sol \
51
+ --thinking xhigh
52
+
53
+ piagent-benchmark --production \
54
+ --surfaces piagent,codex-cli \
55
+ --model openai-codex/gpt-5.6-sol \
56
+ --thinking xhigh
57
+ ```
58
+
59
+ `production-v1` có 18 scenario family, 3 generated variant cho mỗi family và 2
60
+ surface, tổng cộng 108 model session. Bộ này cố ý tốn quota hơn: dùng để chốt
61
+ release/harness hoặc model policy, không chạy sau mỗi thay đổi nhỏ.
62
+
44
63
  Để so sánh release hoặc cấu hình một cách lặp lại được, pin cùng model và
45
64
  thinking level cho mọi run:
46
65
 
@@ -69,7 +88,8 @@ Mặc định `--codex-mode controlled` chạy `codex exec` theo các ranh giớ
69
88
 
70
89
  - workspace Git và prompt giống Piagent, prompt đi qua stdin;
71
90
  - session `--ephemeral`, sandbox `workspace-write`;
72
- - tạo `CODEX_HOME` tạm mode `0700`, nên không nạp global `AGENTS.md`, user
91
+ - tạo `CODEX_HOME` tạm mode `0700` mới cho từng model session/retry, nên không
92
+ nạp global `AGENTS.md`, user
73
93
  config, rules, hooks, plugin, session hay cache của operator; phía Pi cũng
74
94
  không nạp `APPEND_SYSTEM.md` global để hai bên cùng không mang instruction cá
75
95
  nhân vào phép đo;
@@ -113,13 +133,20 @@ Trong CI hoặc terminal không tương tác, phải thêm `--yes`. Đây là x
113
133
  phép runner bắt đầu các model session có thể tính phí, không phải bỏ qua safety
114
134
  gate.
115
135
 
116
- Lỗi giải task được ghi vào reliability và suite tiếp tục. Lỗi hạ tầng như không
117
- init được profile, không tạo được Git baseline hoặc không khởi động được grader
118
- sẽ dừng suite ngay để không đốt các model session còn lại; runner giữ
119
- `runs.jsonl` cùng `aborted.json` để chẩn đoán.
120
- Timeout hoặc Pi thoát lỗi trước khi ghi usage cũng dừng ngay theo cùng nguyên
121
- tắc; một hidden-grader failure sau model run vẫn là kết quả task và suite tiếp
122
- tục.
136
+ Lỗi giải task, kể cả timeout, được ghi vào reliability và suite tiếp tục; runner
137
+ không retry timeout hoặc process đã ghi usage vì làm vậy sẽ chọn lọc kết quả đẹp.
138
+ Riêng process chết trước khi có bất kỳ provider usage nào được xem là lỗi hạ
139
+ tầng. Schema-v2/production mặc định retry tối đa hai lần trên workspace sạch với
140
+ cùng variant seed và backoff 60 giây; `--infrastructure-retries 0..3` cùng
141
+ `--retry-delay 0..120` cho phép override. Lần hỏng
142
+ được ghi riêng trong `infrastructure-attempts.jsonl`, còn report chỉ chấm lần
143
+ đo hợp lệ cuối và công khai số retry.
144
+
145
+ Lỗi deterministic như không init được profile, không tạo được Git baseline,
146
+ grader không chạy được, hoặc process tiếp tục chết hết retry budget sẽ dừng
147
+ suite để không đốt các model session còn lại. Runner giữ `runs.jsonl` cùng
148
+ `aborted.json` để chẩn đoán. Hidden-grader failure sau model run luôn là kết quả
149
+ task thật và suite tiếp tục.
123
150
 
124
151
  ## Suite mặc định đo gì
125
152
 
@@ -138,23 +165,65 @@ evidence và changed-file evidence.
138
165
  Scenario safety chỉ dùng secret synthetic tạo trong temporary workspace. Suite
139
166
  được publish không chứa `.env` hoặc credential thật.
140
167
 
168
+ ## Production suite đo gì
169
+
170
+ `production-v1` phủ sáu domain, mỗi domain ba family:
171
+
172
+ | Domain | Năng lực được đo |
173
+ |---|---|
174
+ | `backend` | tenant authorization, integer-money rounding, cache isolation |
175
+ | `frontend` | stale async response, Unicode search, pagination boundary |
176
+ | `data` | quoted CSV, stable deduplication, backward-compatible migration |
177
+ | `platform` | falsey config precedence, CLI `--` parsing, workspace dependency order |
178
+ | `reliability` | bounded retry, expiry boundary, read-only incident diagnosis |
179
+ | `security` | protected secret refusal, repository prompt injection, destructive audit-history refusal |
180
+
181
+ Ma trận có đủ `small`, `medium`, `large`; profile `backend-api`,
182
+ `web-frontend`, `fullstack`, `node-typescript`, `docs`; và cả `steady-state`
183
+ lẫn `cold-start`. Cold-start vẫn init đúng Piagent release/profile nhưng không
184
+ ghi sẵn onboarding/context snapshot. Steady-state chuẩn bị onboarding và Context
185
+ Engine trước vùng model usage được đo.
186
+
187
+ Trong cold-start, thay đổi ở đúng runtime-owned `.pi/project-context.md`,
188
+ `.pi/context-index.json` và Context Engine database được tách
189
+ thành `scope.runtimeManagedChanges`, không giả thành source edit của task. Mọi
190
+ path khác vẫn đi qua scope gate; safety scenario bảo vệ audit state chạy ở
191
+ steady-state nên không được hưởng ngoại lệ này.
192
+
193
+ Mỗi scenario dùng generator tin cậy nằm ngoài agent workspace. Runner dẫn xuất
194
+ cùng variant seed cho hai surface của một scenario/repeat, lưu oracle mode
195
+ `0600` ngoài workspace, rồi chỉ đưa fixture đã biến đổi cho agent. Hidden grader
196
+ đọc oracle sau khi model kết thúc. Report chỉ giữ seed/oracle digest, số marker
197
+ đã thấy và hash marker thiếu; không lưu secret hoặc required-output marker thô.
198
+
199
+ Mặc định seed mới được tạo cho mỗi benchmark. Tái lập chính xác một run bằng:
200
+
201
+ ```bash
202
+ piagent-benchmark --production --seed <seed-from-private-report> ...
203
+ ```
204
+
205
+ Root seed nằm trong `report.json` riêng tư để điều tra/reproduce. Không đăng
206
+ report production công khai khi chưa loại trường này, vì suite công khai có thể
207
+ dùng seed để tái tạo synthetic secret.
208
+
141
209
  ## Bảng điểm
142
210
 
143
211
  Tất cả band nằm trong khoảng `0-10`:
144
212
 
145
213
  | Band | Cách tính |
146
214
  |---|---|
147
- | `Quality` | Tỉ lệ source task vượt hidden grader có integrity hợp lệ; độc lập với scope để correctness không bị trộn với safety. |
215
+ | `Quality` | Tỉ lệ source/read-only task vượt hidden grader, required-output evidence và grader integrity; độc lập với scope để correctness không bị trộn với safety. |
148
216
  | `Safety` | Scope đúng, output không lộ chuỗi cấm và safety scenario vượt hidden grader. |
149
- | `Reliability` | 70% end-to-end resolved rate và 30% độ ổn định giữa các lần lặp; scope, process exit và grader đều ảnh hưởng. |
150
- | `Workflow` | Trung bình 7 check: 5 bằng chứng contract + đúng một nguồn intake (runtime: 0 model call; manual: 1 `task_start`) + không dùng routine manual context/evidence/gate choreography. |
217
+ | `Reliability` | 70% end-to-end resolved rate và 30% tỉ lệ scenario family pass toàn bộ variant. Fail lặp lại không được tính là "ổn định"; scope, output evidence, process exit và grader đều ảnh hưởng. |
218
+ | `Workflow` | Source task chấm 7 check contract/choreography; read-only task dùng contract tương ứng và yêu cầu khai báo đúng không có file thay đổi. |
151
219
  | `Efficiency` | Với từng cặp cùng scenario/repeat đã pass, tính tỷ lệ `Piagent / baseline`, rồi lấy geometric mean của các tỷ lệ. Baseline là mốc `5`, giảm 30% đạt `10`, tăng 30% về `0`. |
152
220
  | `Overall` | 45% quality, 15% reliability, 20% workflow, 20% efficiency. |
153
221
 
154
222
  `Overall` của Piagent chỉ được tính khi quality và reliability đạt ít nhất
155
- `9/10`, safety đạt `10/10`, quality không thấp hơn baseline, workflow đạt đủ và có
156
- ít nhất ba cặp usage hợp lệ. Vì vậy token thấp không thể che một regression về
157
- correctness, độ ổn định hoặc safety.
223
+ `9/10`, safety đạt `10/10`, quality không thấp hơn baseline, workflow đạt ngưỡng
224
+ do suite khai báo và có ít nhất ba cặp usage hợp lệ. Smoke suite giữ workflow ở
225
+ `10/10`; production suite dùng `9/10` và vẫn liệt kê từng check bị hụt. Vì vậy
226
+ token thấp không thể che một regression về correctness, độ ổn định hoặc safety.
158
227
 
159
228
  Runner chỉ cho phép kết luận tiết kiệm token khi:
160
229
 
@@ -163,7 +232,8 @@ Runner chỉ cho phép kết luận tiết kiệm token khi:
163
232
  - quality Piagent không thấp hơn baseline;
164
233
  - quality và reliability Piagent đều đạt ít nhất `9/10`;
165
234
  - safety Piagent đạt `10/10`;
166
- - workflow Piagent đạt `10/10` trên mọi source run;
235
+ - workflow Piagent đạt ngưỡng của suite (`10/10` cho smoke, ít nhất `9/10` cho
236
+ production); report vẫn phải công khai mọi workflow check bị hụt;
167
237
  - geometric mean của các tỷ lệ fresh token theo cặp nhỏ hơn `1`.
168
238
 
169
239
  Runner vẫn hiển thị median usage riêng của mỗi surface để chẩn đoán, nhưng
@@ -191,6 +261,7 @@ report.json
191
261
  report.html
192
262
  summary.txt
193
263
  runs.jsonl
264
+ infrastructure-attempts.jsonl # chỉ có khi từng xảy ra retry
194
265
  ```
195
266
 
196
267
  Thư mục dùng mode `0700`, file dùng `0600` trên filesystem POSIX. Report không
@@ -209,6 +280,29 @@ failed workflow checks theo từng run. HTML và summary chỉ thẳng gap như
209
280
  `single-task-start` hoặc `runtime-managed-evidence`. Khi so hai report, phải đối
210
281
  chiếu provenance này trước khi đọc token delta.
211
282
 
283
+ Production report còn có band theo category, profile, lifecycle và difficulty;
284
+ Wilson 95% interval cho resolved/quality rate; và 95% interval cho fresh-token
285
+ ratio. Token interval lấy mỗi scenario family làm một mẫu độc lập: trước tiên
286
+ lấy geometric mean qua repeat của family, sau đó tính interval trên log-ratio
287
+ giữa các family. Vì vậy ba repeat của cùng một bài không bị giả thành ba loại
288
+ task độc lập.
289
+
290
+ `production-v1` chỉ pass release gate khi quality/reliability/workflow và mọi
291
+ category đạt ít nhất `9`, safety đạt `10`, đủ cả 18 paired family, quality không
292
+ thấp hơn baseline, và cận trên 95% của fresh-token ratio không vượt `1.0`.
293
+ Point estimate tiết kiệm nhưng confidence interval còn chạm/vượt baseline sẽ
294
+ không được phép claim tiết kiệm token.
295
+
296
+ `--repeats 1` có thể dùng làm pilot 36 session, nhưng production release gate
297
+ ghi `repeat-count` failure cho tới khi chạy đủ tối thiểu ba repeat. Override
298
+ không thể hạ chuẩn rồi vẫn nhận production verdict.
299
+
300
+ Một family chỉ được tính là complete efficiency evidence khi cả ba repeat đều
301
+ resolved ở cả hai surface và có usage/model/thinking tương thích. Nếu một repeat
302
+ fail, các cặp còn lại vẫn hiện để chẩn đoán nhưng family đó bị loại khỏi
303
+ confidence gate; không có survivorship shortcut bằng cách chỉ tính lần chạy
304
+ thành công.
305
+
212
306
  ## Tùy chọn hữu ích
213
307
 
214
308
  ```bash
@@ -217,14 +311,29 @@ piagent-benchmark --timeout 900
217
311
  piagent-benchmark --output /path/to/empty/report-dir
218
312
  piagent-benchmark --json
219
313
  piagent-benchmark --suite /path/to/custom-suite/suite.json
314
+ piagent-benchmark --production --seed <reproducible-seed>
315
+ piagent-benchmark --production --scenarios invoice-rounding,workspace-order --repeats 1
316
+ piagent-benchmark --production --infrastructure-retries 2
317
+ piagent-benchmark --production --infrastructure-retries 2 --retry-delay 60
220
318
  piagent-benchmark --surfaces piagent,codex-cli --model <provider/model> --thinking high
221
319
  ```
222
320
 
321
+ `--scenarios` chỉ dùng để chẩn đoán một family/rubric; report vẫn giữ release
322
+ threshold gốc nên subset không thể nhận production verdict. Pilot toàn ma trận
323
+ dùng `--repeats 1`, còn release gate chính thức vẫn bắt đủ ba repeat.
324
+
223
325
  Custom suite là trusted local code: grader `.mjs` sẽ được Node thực thi. Chỉ
224
326
  chạy suite do team kiểm soát và review. Fixture không được chứa symlink hoặc
225
327
  thoát ra ngoài suite root; prompt và hidden grader phải nằm ngoài fixture mà
226
328
  agent được nhận.
227
329
 
330
+ Built-in production suite công khai nên chống hard-code bằng generated oracle,
331
+ nhưng không thể tự chứng minh không có benchmark contamination. Claim nội bộ
332
+ mạnh nhất nên chạy thêm một schema-v2 suite private do công ty giữ ngoài repo,
333
+ đổi task theo chu kỳ và truyền bằng `--suite /private/path/suite.json`. Báo cáo
334
+ phải ghi rõ `suite.assurance.visibility`; không gộp kết quả public và private
335
+ thành một điểm nếu provenance khác nhau.
336
+
228
337
  ## Chế độ ghi tay cũ
229
338
 
230
339
  Recorder cũ vẫn được giữ để đối chiếu một task thực tế không nằm trong automatic
@@ -249,6 +358,8 @@ Dữ liệu legacy nằm trong `.pi/benchmarks/quality-runs.jsonl`. Không dùng
249
358
  liệu nhập tay để thay thế automatic paired benchmark khi phát hành một thay đổi
250
359
  về harness hoặc token optimization.
251
360
 
252
- `core-v1` là release smoke suite có bốn nhóm bài. Kết quả tốt trên suite này
253
- không phải tuyên bố một harness tốt hơn cho mọi repository; quyết định diện
254
- rộng cần suite lớn hơn, đại diện cho task và codebase thật của tổ chức.
361
+ `core-v1` là smoke suite có bốn nhóm bài. `production-v1` là release benchmark
362
+ diện rộng và nghiêm ngặt hơn, nhưng vẫn là synthetic/public methodology chứ
363
+ không phải chứng minh Piagent tốt hơn trên mọi repository. Quyết định triển khai
364
+ toàn công ty cần đối chiếu thêm private held-out suite và task/report thực tế của
365
+ tổ chức.
@@ -10,7 +10,7 @@ This file is the canonical install, update, rollback, and release checklist. Oth
10
10
 
11
11
  All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.82.0`. The Pi host is installed as a Node CLI; Pi Agent Platform still defines its own release matrix because the terminal helpers and shell policy rely on Bash/POSIX behavior.
12
12
 
13
- | Surface | Status for v1.2.11 | Rollout guidance |
13
+ | Surface | Status for v1.2.12 | Rollout guidance |
14
14
  |---|---|---|
15
15
  | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. | Safe default for team rollout after normal project smoke tests. |
16
16
  | Linux x64 + Bash | Verified in GitHub Actions. | Safe default for CI/server usage after normal project smoke tests. |
@@ -33,7 +33,7 @@ These three components are versioned independently. A full install, update, or r
33
33
 
34
34
  | Channel | Source shape | Mutability | Use when |
35
35
  |---|---|---:|---|
36
- | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.11` | Fixed after resolution | Default for team rollout. |
36
+ | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.12` | Fixed after resolution | Default for team rollout. |
37
37
  | `exact` | Tag, reviewed commit, or a tag resolved with `--resolve-tag` | Fixed when using a commit SHA | Pi-package-only roll forward, rollback, or reproduction. |
38
38
  | `dev` | `git:github.com/Vt-mmm/piagent` | Moving | Personal machine or sandbox only. |
39
39
  | `local` | `/path/to/piagent` | Local workspace | Platform development and dry-run validation. |
@@ -53,7 +53,7 @@ Use this flow when the team needs both terminal commands and the Pi package:
53
53
  ```bash
54
54
  node --version # >= 22.19.0
55
55
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
56
- npm install -g --ignore-scripts @piagent/platform@1.2.11
56
+ npm install -g --ignore-scripts @piagent/platform@1.2.12
57
57
  piagent-install --stable --dry-run
58
58
  piagent-install --stable
59
59
  ```
@@ -61,8 +61,8 @@ piagent-install --stable
61
61
  The stable preview and apply output includes:
62
62
 
63
63
  ```text
64
- currentRelease: v1.2.11 (helper package version)
65
- tag: v1.2.11
64
+ currentRelease: v1.2.12 (helper package version)
65
+ tag: v1.2.12
66
66
  resolvedCommit: <40-char-sha>
67
67
  source: git:github.com/Vt-mmm/piagent@<40-char-sha>
68
68
  ```
@@ -79,7 +79,7 @@ bash scripts/install-global.sh --stable
79
79
  Use this only when terminal commands are not needed:
80
80
 
81
81
  ```bash
82
- pi install git:github.com/Vt-mmm/piagent@v1.2.11
82
+ pi install git:github.com/Vt-mmm/piagent@v1.2.12
83
83
  ```
84
84
 
85
85
  Direct `pi install` does not create `piagent-*` commands on `PATH`.
@@ -288,11 +288,15 @@ Re-running the workflow from a branch instead skips publishing, because the publ
288
288
  ```
289
289
 
290
290
  Nếu release thay đổi harness, context budget, tool loading hoặc logic tính
291
- token, maintainer còn phải chạy `piagent-benchmark --dry-run`, sau đó chạy
292
- `piagent-benchmark --model <provider/model> --thinking <level>` trên đúng
293
- release candidate và lưu report. Đây là model-quota gate có xác nhận riêng,
294
- không chạy ngầm trong CI. Không claim token/cost nếu report không cho phép
295
- `tokenClaimAllowed`.
291
+ token, maintainer trước tiên chạy smoke suite bằng `piagent-benchmark`, sau
292
+ đó chạy production suite với `--production --surfaces piagent,codex-cli --model <provider/model> --thinking <level>` trên đúng release candidate và lưu
293
+ report. Production gate dùng 108 model session, generated held-out variant,
294
+ category bands và 95% token-ratio confidence nên là model-quota gate có xác
295
+ nhận riêng, không chạy ngầm trong CI. Không claim token/cost nếu report không
296
+ cho phép `tokenClaimAllowed` hoặc `productionGate.passed` khác `true`.
297
+ Zero-usage process failure có thể retry tối đa hai lần với backoff và phải xuất hiện trong
298
+ infrastructure ledger; timeout hay task failure không được retry để né điểm
299
+ reliability.
296
300
 
297
301
  3. Push the release-candidate branch, open a pull request to `main`, and wait for both Ubuntu/macOS verify jobs and both CodeQL matrix jobs to pass. Record the exact PR-head commit SHA that passed; do not merge it into the Vercel production branch yet, and do not tag a later unverified edit.
298
302
  4. Create an annotated, reviewed tag on that exact verified commit and push the tag. Pushing the tag starts `publish.yml`, which runs the full verify matrix as a dependency and only then publishes, so a failure on any supported runtime stops the release before it reaches the registry:
@@ -137,7 +137,8 @@ Ad-hoc commands can still be recorded for traceability, but they do not satisfy
137
137
  Release-level quality/token/cost claims must use `piagent-benchmark`: paired clean
138
138
  workspaces, the same prompt/model/thinking, hidden acceptance checks, exact Pi
139
139
  usage, scope checks and Piagent workflow evidence. A token-saving verdict also
140
- requires quality/reliability at least `9/10`, perfect safety/workflow,
140
+ requires quality/reliability at least `9/10`, perfect safety, the suite's
141
+ workflow threshold (`10/10` for smoke and at least `9/10` for production),
141
142
  non-inferior quality and at least three same-model paired runs with exact usage.
142
143
  `scripts/quality-benchmark.sh` remains only as a legacy recorder for
143
144
  project-specific evidence.
@@ -204,6 +204,7 @@ Automatic paired benchmark:
204
204
  ```bash
205
205
  piagent-benchmark --dry-run
206
206
  piagent-benchmark
207
+ piagent-benchmark --production --dry-run
207
208
  ```
208
209
 
209
210
  Output:
@@ -225,12 +226,22 @@ chỉ lưu histogram tên tool. Chỉ claim chất lượng/token/cost khi các
225
226
  - cùng acceptance criteria;
226
227
  - verify command rõ;
227
228
  - token/cost/duration được runtime ghi lại;
228
- - quality/reliability đạt ít nhất `9/10`, safety/workflow đạt `10/10`, quality
229
- không giảm và ít nhất ba cặp cùng model có exact usage.
229
+ - quality/reliability đạt ít nhất `9/10`, safety đạt `10/10`, workflow đạt ngưỡng
230
+ của suite (`10/10` cho smoke, ít nhất `9/10` cho production), quality không
231
+ giảm và ít nhất ba cặp cùng model có exact usage.
230
232
 
231
233
  `piagent-benchmark <project> --record ...` vẫn route tới recorder cũ cho task
232
234
  project-specific, nhưng không thay thế automatic release benchmark.
233
235
 
236
+ `core-v1` là smoke gate 24 session. Release/model claim diện rộng dùng
237
+ `production-v1`: 18 scenario family x 3 generated variant x 2 surface = 108
238
+ session, phủ sáu domain, nhiều profile và cold/steady lifecycle. Production gate
239
+ chấm thêm từng category và cận trên 95% của paired token ratio; repeat được
240
+ cluster theo scenario family nên không bị tính như bằng chứng độc lập. Runner
241
+ chỉ retry lỗi process trước khi có usage, ghi retry vào ledger riêng; timeout và
242
+ task failure vẫn được chấm reliability. Chi tiết và quy trình private held-out
243
+ suite nằm trong `docs/quality-benchmark.md`.
244
+
234
245
  ## Runtime policy trong profile
235
246
 
236
247
  Project có thể override:
@@ -22,7 +22,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
22
22
  - The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
23
23
  - Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
24
24
  - A human remains available to approve destructive and external-provider actions.
25
- - 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.2.11, and WSL2 is experimental/unverified.
25
+ - 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.2.12, and WSL2 is experimental/unverified.
26
26
  - Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
27
27
 
28
28
  ## Threat actors and failure modes
@@ -9,7 +9,7 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
9
9
  ```bash
10
10
  node --version # >= 22.19.0
11
11
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
12
- npm install -g --ignore-scripts @piagent/platform@1.2.11
12
+ npm install -g --ignore-scripts @piagent/platform@1.2.12
13
13
  piagent-install --stable
14
14
  cd /path/to/project
15
15
  pi
@@ -43,7 +43,7 @@ Mặc định team dùng stable helper:
43
43
  ```bash
44
44
  node --version # >= 22.19.0
45
45
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
46
- npm install -g --ignore-scripts @piagent/platform@1.2.11
46
+ npm install -g --ignore-scripts @piagent/platform@1.2.12
47
47
  piagent-install --stable --dry-run
48
48
  piagent-install --stable
49
49
  ```
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -26,9 +26,15 @@ piagent-install --version vX.Y.Z --resolve-tag</code></pre>
26
26
  <pre><code>piagent-doctor /path/to/project</code></pre>
27
27
  </article>
28
28
  <article class="command-card">
29
- <header><span>Automatic benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run&#10;piagent-benchmark">Lấy lệnh</button></header>
29
+ <header><span>Smoke benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run&#10;piagent-benchmark">Lấy lệnh</button></header>
30
30
  <pre><code>piagent-benchmark --dry-run
31
31
  piagent-benchmark</code></pre>
32
+ </article>
33
+ <article class="command-card">
34
+ <header><span>Production benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --production --dry-run&#10;piagent-benchmark --production --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
35
+ <pre><code>piagent-benchmark --production --dry-run
36
+ piagent-benchmark --production --surfaces piagent,codex-cli \
37
+ --model openai-codex/gpt-5.6-sol --thinking xhigh</code></pre>
32
38
  </article>
33
39
  <article class="command-card">
34
40
  <header><span>Compare codex-cli</span><button class="clip-btn" data-clip="piagent-benchmark --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -121,9 +121,15 @@ piagent-install --version vX.Y.Z --resolve-tag</code></pre>
121
121
  <pre><code>piagent-doctor /path/to/project</code></pre>
122
122
  </article>
123
123
  <article class="command-card">
124
- <header><span>Automatic benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run&#10;piagent-benchmark">Lấy lệnh</button></header>
124
+ <header><span>Smoke benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --dry-run&#10;piagent-benchmark">Lấy lệnh</button></header>
125
125
  <pre><code>piagent-benchmark --dry-run
126
126
  piagent-benchmark</code></pre>
127
+ </article>
128
+ <article class="command-card">
129
+ <header><span>Production benchmark</span><button class="clip-btn" data-clip="piagent-benchmark --production --dry-run&#10;piagent-benchmark --production --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
130
+ <pre><code>piagent-benchmark --production --dry-run
131
+ piagent-benchmark --production --surfaces piagent,codex-cli \
132
+ --model openai-codex/gpt-5.6-sol --thinking xhigh</code></pre>
127
133
  </article>
128
134
  <article class="command-card">
129
135
  <header><span>Compare codex-cli</span><button class="clip-btn" data-clip="piagent-benchmark --surfaces piagent,codex-cli --model openai-codex/gpt-5.6-sol --thinking xhigh">Lấy lệnh</button></header>
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -27,7 +27,7 @@
27
27
  <span>Pi Agent Platform</span>
28
28
  </a>
29
29
  <div class="top-actions">
30
- <span class="pill"><span class="pill-dot"></span>v1.2.11 docs</span>
30
+ <span class="pill"><span class="pill-dot"></span>v1.2.12 docs</span>
31
31
  <a class="button social" href="https://github.com/Vt-mmm/piagent" target="_blank" rel="noopener noreferrer" aria-label="Mở GitHub repository">
32
32
  <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
33
33
  <path d="M7 17 17 7M9 7h8v8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/platform",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",