@piagent/platform 1.5.5 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/README.md +25 -21
  3. package/README.vi.md +34 -5
  4. package/adapters/web-frontend/profile.json +2 -4
  5. package/architecture/layers.json +18 -3
  6. package/benchmarks/deep-logic-v1/SPECIALIST_PROTOCOL.vi.md +122 -0
  7. package/benchmarks/deep-logic-v1/grade.mjs +272 -10
  8. package/benchmarks/deep-logic-v1/project/apps/admin/src/billing-summary.js +3 -0
  9. package/benchmarks/deep-logic-v1/project/benchmark-contract/public-smoke.test.js +166 -0
  10. package/benchmarks/deep-logic-v1/project/package.json +1 -1
  11. package/benchmarks/deep-logic-v1/project/packages/billing/src/close-period.js +3 -0
  12. package/benchmarks/deep-logic-v1/project/packages/billing/src/plan-timeline.js +3 -0
  13. package/benchmarks/deep-logic-v1/project/test/smoke.test.js +7 -1
  14. package/benchmarks/deep-logic-v1/prompts/budgeted-context-graph.md +2 -0
  15. package/benchmarks/deep-logic-v1/prompts/fair-dependency-scheduler.md +2 -0
  16. package/benchmarks/deep-logic-v1/prompts/layered-policy-resolution.md +2 -0
  17. package/benchmarks/deep-logic-v1/prompts/resumable-stream-assembly.md +3 -1
  18. package/benchmarks/deep-logic-v1/prompts/revision-event-reconciliation.md +2 -0
  19. package/benchmarks/deep-logic-v1/prompts/temporal-usage-billing-close.md +123 -0
  20. package/benchmarks/deep-logic-v1/prompts/transactional-config-merge.md +2 -0
  21. package/benchmarks/deep-logic-v1/suite.json +51 -3
  22. package/benchmarks/deep-logic-v1/variant.mjs +22 -1
  23. package/benchmarks/production-v1/spend-control.v1.json +92 -0
  24. package/benchmarks/production-v1/suite.json +46 -3
  25. package/catalog/capabilities.json +18 -18
  26. package/docs/authority-manifest.md +1 -1
  27. package/docs/auto-delegation-policy.md +38 -73
  28. package/docs/command-reference-vietnamese.md +27 -35
  29. package/docs/context-engine.md +12 -4
  30. package/docs/context-window-policy.md +37 -1
  31. package/docs/distribution-standard.md +7 -7
  32. package/docs/en/architecture.md +27 -13
  33. package/docs/languages.json +4 -4
  34. package/docs/model-options.md +8 -5
  35. package/docs/operator-manual-vietnamese.md +27 -45
  36. package/docs/project-adapters.md +2 -2
  37. package/docs/publishing-for-teams.md +10 -0
  38. package/docs/quality-benchmark.md +427 -62
  39. package/docs/release-install-policy.md +10 -9
  40. package/docs/runtime-harness-standard.md +3 -3
  41. package/docs/runtime-policy-design.md +4 -4
  42. package/docs/runtime-quality-baseline.md +13 -6
  43. package/docs/security-threat-model.md +2 -2
  44. package/docs/subagent-orchestration-capabilities.md +19 -51
  45. package/docs/subagents-and-multiagent.md +21 -47
  46. package/docs/task-implementation-contract.md +3 -3
  47. package/docs/task-lifecycle-vietnamese.md +3 -3
  48. package/docs/team-onboarding.md +2 -2
  49. package/docs/usage-observability.md +7 -2
  50. package/docs/vi/architecture.md +27 -13
  51. package/docs-site/architecture.html +1 -1
  52. package/docs-site/benchmark.html +89 -95
  53. package/docs-site/commands.html +1 -1
  54. package/docs-site/content/benchmark.html +88 -94
  55. package/docs-site/content/en/benchmark.html +134 -90
  56. package/docs-site/content/en/index.html +19 -19
  57. package/docs-site/content/en/runtime.html +4 -4
  58. package/docs-site/content/en/whats-new.html +12 -1
  59. package/docs-site/content/en/workflows.html +2 -2
  60. package/docs-site/content/index.html +19 -19
  61. package/docs-site/content/runtime.html +4 -4
  62. package/docs-site/content/whats-new.html +12 -1
  63. package/docs-site/content/workflows.html +2 -2
  64. package/docs-site/context-engine.html +1 -1
  65. package/docs-site/en/architecture.html +1 -1
  66. package/docs-site/en/benchmark.html +135 -91
  67. package/docs-site/en/commands.html +1 -1
  68. package/docs-site/en/context-engine.html +1 -1
  69. package/docs-site/en/index.html +20 -20
  70. package/docs-site/en/mcp-approval.html +1 -1
  71. package/docs-site/en/mcp-auth.html +1 -1
  72. package/docs-site/en/mcp-servers.html +1 -1
  73. package/docs-site/en/mcp.html +1 -1
  74. package/docs-site/en/permissions.html +1 -1
  75. package/docs-site/en/profiles.html +1 -1
  76. package/docs-site/en/quickstart.html +1 -1
  77. package/docs-site/en/runtime.html +5 -5
  78. package/docs-site/en/scope.html +1 -1
  79. package/docs-site/en/security.html +1 -1
  80. package/docs-site/en/team.html +1 -1
  81. package/docs-site/en/whats-new.html +13 -2
  82. package/docs-site/en/workflows.html +3 -3
  83. package/docs-site/index.html +20 -20
  84. package/docs-site/mcp-approval.html +1 -1
  85. package/docs-site/mcp-auth.html +1 -1
  86. package/docs-site/mcp-servers.html +1 -1
  87. package/docs-site/mcp.html +1 -1
  88. package/docs-site/permissions.html +1 -1
  89. package/docs-site/profiles.html +1 -1
  90. package/docs-site/quickstart.html +1 -1
  91. package/docs-site/runtime.html +5 -5
  92. package/docs-site/scope.html +1 -1
  93. package/docs-site/security.html +1 -1
  94. package/docs-site/team.html +1 -1
  95. package/docs-site/whats-new.html +13 -2
  96. package/docs-site/workflows.html +3 -3
  97. package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
  98. package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
  99. package/evals/fixtures/codex-relative-efficiency-v1.invalid.json +4 -0
  100. package/evals/fixtures/codex-relative-efficiency-v1.valid.json +94 -0
  101. package/evals/fixtures/helper-request.invalid.json +1 -1
  102. package/evals/fixtures/helper-request.valid.json +1 -1
  103. package/evals/fixtures/piagent-webui/session-live-state-v1.invalid.json +18 -0
  104. package/evals/fixtures/piagent-webui/session-live-state-v1.valid.json +27 -0
  105. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +7 -0
  106. package/evals/fixtures/task-authority-snapshot.valid.json +4 -4
  107. package/evals/fs4-readiness-matrix.v1.json +2 -2
  108. package/evals/fs5-causal-arm.v1.json +3 -3
  109. package/evals/fs5-pilot-protocol.v1.json +3 -3
  110. package/evals/fs5-pilot-protocol.v2.json +8 -8
  111. package/evals/fs5-pilot-protocol.v3.json +8 -8
  112. package/evals/fs5-pilot-protocol.v4.json +7 -6
  113. package/evals/fs5-pilot-protocol.v5.json +9 -7
  114. package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
  115. package/evals/runtime-conformance-v1/README.md +43 -0
  116. package/evals/runtime-conformance-v1/evaluate-paid-canary.mjs +198 -0
  117. package/evals/runtime-conformance-v1/lane.json +57 -0
  118. package/evals/runtime-conformance-v1/paid-canary.json +31 -0
  119. package/evals/runtime-conformance-v1/runner.mjs +456 -0
  120. package/package.json +3 -1
  121. package/packages/piagent-core/README.md +13 -4
  122. package/packages/piagent-core/benchmark/benchmark-assurance.js +4 -1
  123. package/packages/piagent-core/benchmark/benchmark-bootstrap.js +91 -9
  124. package/packages/piagent-core/benchmark/benchmark-claim-restrictions.js +38 -7
  125. package/packages/piagent-core/benchmark/benchmark-cli.js +7 -7
  126. package/packages/piagent-core/benchmark/benchmark-codex-relative-efficiency.js +698 -0
  127. package/packages/piagent-core/benchmark/benchmark-codex.js +3 -1
  128. package/packages/piagent-core/benchmark/benchmark-comparison.js +271 -2
  129. package/packages/piagent-core/benchmark/benchmark-core.js +736 -664
  130. package/packages/piagent-core/benchmark/benchmark-execution-guard.js +7 -5
  131. package/packages/piagent-core/benchmark/benchmark-forensics.js +441 -4
  132. package/packages/piagent-core/benchmark/benchmark-host-readiness.js +639 -0
  133. package/packages/piagent-core/benchmark/benchmark-matrix.js +22 -4
  134. package/packages/piagent-core/benchmark/benchmark-normalized-cost.js +317 -0
  135. package/packages/piagent-core/benchmark/benchmark-preflight.js +5 -1
  136. package/packages/piagent-core/benchmark/benchmark-process.js +6 -5
  137. package/packages/piagent-core/benchmark/benchmark-provider-free-evidence.js +345 -0
  138. package/packages/piagent-core/benchmark/benchmark-provider-wire.js +126 -0
  139. package/packages/piagent-core/benchmark/benchmark-record-validation.js +252 -0
  140. package/packages/piagent-core/benchmark/benchmark-report.js +130 -12
  141. package/packages/piagent-core/benchmark/benchmark-resume-recovery.js +14 -0
  142. package/packages/piagent-core/benchmark/benchmark-runner-policy.js +26 -0
  143. package/packages/piagent-core/benchmark/benchmark-runtime-causal.js +244 -0
  144. package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +979 -0
  145. package/packages/piagent-core/benchmark/benchmark-statistics.js +64 -0
  146. package/packages/piagent-core/benchmark/benchmark-stop-policy.js +8 -5
  147. package/packages/piagent-core/benchmark/benchmark-suite-identity.js +31 -0
  148. package/packages/piagent-core/benchmark/benchmark-suite-runtime.js +13 -9
  149. package/packages/piagent-core/benchmark/benchmark-suite.js +149 -2
  150. package/packages/piagent-core/benchmark/benchmark-summary-support.js +380 -0
  151. package/packages/piagent-core/benchmark/benchmark-timing-diagnostics.js +971 -0
  152. package/packages/piagent-core/benchmark/benchmark-usage.js +322 -0
  153. package/packages/piagent-core/benchmark/benchmark-workflow.js +166 -0
  154. package/packages/piagent-core/capabilities/runtime-integrity.js +3 -0
  155. package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +1080 -0
  156. package/packages/piagent-core/extensions/acceptance-behavior-proof.js +806 -0
  157. package/packages/piagent-core/extensions/acceptance-contract-semantics.js +83 -69
  158. package/packages/piagent-core/extensions/acceptance-error-classes.js +160 -0
  159. package/packages/piagent-core/extensions/acceptance-executable-evidence.js +12 -9
  160. package/packages/piagent-core/extensions/acceptance-receipt.js +123 -59
  161. package/packages/piagent-core/extensions/acceptance-state-machine-evidence.js +518 -0
  162. package/packages/piagent-core/extensions/acceptance-test-binding-evidence.js +60 -0
  163. package/packages/piagent-core/extensions/context-efficiency-metrics.js +302 -0
  164. package/packages/piagent-core/extensions/context-efficiency-report.js +167 -0
  165. package/packages/piagent-core/extensions/context-engine.js +149 -156
  166. package/packages/piagent-core/extensions/context-evidence.js +48 -0
  167. package/packages/piagent-core/extensions/context-import-links.js +296 -0
  168. package/packages/piagent-core/extensions/context-index-policy.js +4 -0
  169. package/packages/piagent-core/extensions/context-query-paths.js +57 -0
  170. package/packages/piagent-core/extensions/context-telemetry-integrity.js +65 -0
  171. package/packages/piagent-core/extensions/criterion-context-pack.js +435 -7
  172. package/packages/piagent-core/extensions/criterion-graph.js +82 -9
  173. package/packages/piagent-core/extensions/fallback-base-policy.ts +101 -0
  174. package/packages/piagent-core/extensions/guard-types.ts +6 -0
  175. package/packages/piagent-core/extensions/javascript-regex-evidence.js +32 -0
  176. package/packages/piagent-core/extensions/piagent-guard.ts +420 -260
  177. package/packages/piagent-core/extensions/task-contract-view.js +17 -3
  178. package/packages/piagent-core/extensions/task-lifecycle.js +39 -2
  179. package/packages/piagent-core/extensions/task-state.js +109 -142
  180. package/packages/piagent-core/extensions/verification-intelligence.js +52 -13
  181. package/packages/piagent-core/extensions/workspace-evidence-roots.js +193 -0
  182. package/packages/piagent-core/package.json +1 -1
  183. package/packages/piagent-core/policies/base-policy.json +44 -2
  184. package/packages/piagent-core/policy/authority-manifest.v1.json +3 -3
  185. package/packages/piagent-core/prompts/be-to-fe.md +2 -8
  186. package/packages/piagent-core/prompts/plan.md +1 -1
  187. package/packages/piagent-core/prompts/platform-improve.md +2 -6
  188. package/packages/piagent-core/prompts/review.md +2 -7
  189. package/packages/piagent-core/prompts/scout.md +1 -1
  190. package/packages/piagent-core/prompts/task.md +4 -3
  191. package/packages/piagent-core/runtime/context/context-delivery.ts +103 -0
  192. package/packages/piagent-core/runtime/context/context-delta-shadow.ts +53 -0
  193. package/packages/piagent-core/runtime/context/context-efficiency-format.ts +47 -0
  194. package/packages/piagent-core/runtime/context/context-evidence-qualification.ts +32 -0
  195. package/packages/piagent-core/runtime/context/prefix-telemetry.ts +47 -0
  196. package/packages/piagent-core/runtime/context/repository-memory-hints.ts +27 -0
  197. package/packages/piagent-core/runtime/hooks/agent-prompt-telemetry.ts +56 -0
  198. package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +162 -102
  199. package/packages/piagent-core/runtime/hooks/completion-hook.ts +12 -12
  200. package/packages/piagent-core/runtime/hooks/input-hook.ts +17 -1
  201. package/packages/piagent-core/runtime/hooks/session-hooks.ts +22 -2
  202. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +107 -3
  203. package/packages/piagent-core/runtime/hooks/tool-result-content-guards.ts +95 -0
  204. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +134 -166
  205. package/packages/piagent-core/runtime/hooks/tool-result-value-helpers.ts +66 -0
  206. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +4 -2
  207. package/packages/piagent-core/runtime/inspection/activity-recovery.ts +104 -0
  208. package/packages/piagent-core/runtime/inspection/bounded-emission-guard.ts +286 -0
  209. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +37 -7
  210. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +1 -1
  211. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +1 -1
  212. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +27 -4
  213. package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +70 -0
  214. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +73 -9
  215. package/packages/piagent-core/runtime/model/authenticated-catalog.ts +17 -9
  216. package/packages/piagent-core/runtime/model/openai-codex-reasoning.ts +83 -0
  217. package/packages/piagent-core/runtime/model/provider-wire-fingerprint.ts +238 -0
  218. package/packages/piagent-core/runtime/orchestration/helper-lifecycle.ts +16 -12
  219. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +71 -0
  220. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +28 -20
  221. package/packages/piagent-core/runtime/orchestration/role-policy.ts +27 -9
  222. package/packages/piagent-core/runtime/orchestration/subagent-tool-policy.ts +329 -0
  223. package/packages/piagent-core/runtime/policy/block-remedy.ts +0 -4
  224. package/packages/piagent-core/runtime/product/activity-inspector.ts +7 -2
  225. package/packages/piagent-core/runtime/product/efficiency-metrics.ts +7 -2
  226. package/packages/piagent-core/runtime/quality/edit-freshness-guard.ts +102 -0
  227. package/packages/piagent-core/runtime/quality/exact-output-contract.ts +22 -11
  228. package/packages/piagent-core/runtime/quality/performance-assurance-signals.ts +23 -0
  229. package/packages/piagent-core/runtime/quality/performance-assurance.ts +9 -5
  230. package/packages/piagent-core/runtime/recovery/continuation-budget.ts +1 -1
  231. package/packages/piagent-core/runtime/recovery/edit-recovery-context.ts +113 -0
  232. package/packages/piagent-core/runtime/recovery/edit-recovery-delivery.ts +42 -0
  233. package/packages/piagent-core/runtime/recovery/handoff-projection.ts +4 -1
  234. package/packages/piagent-core/runtime/recovery/pristine-task-policy-refresh.ts +91 -0
  235. package/packages/piagent-core/runtime/recovery/recovery-policy.ts +7 -4
  236. package/packages/piagent-core/runtime/recovery/resume-state.ts +112 -14
  237. package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +60 -13
  238. package/packages/piagent-core/runtime/recovery/semantic-repair-runtime.ts +55 -2
  239. package/packages/piagent-core/runtime/recovery/task-evidence-coverage-refresh.ts +217 -0
  240. package/packages/piagent-core/runtime/registration/context-commands.ts +82 -7
  241. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +9 -5
  242. package/packages/piagent-core/runtime/registration/operator-request-intake.ts +49 -0
  243. package/packages/piagent-core/runtime/registration/policy-tools.ts +50 -15
  244. package/packages/piagent-core/runtime/registration/session-commands.ts +1 -1
  245. package/packages/piagent-core/runtime/registration/task-completion-tools.ts +61 -25
  246. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +21 -12
  247. package/packages/piagent-core/runtime/registration/task-start-guidance.ts +169 -0
  248. package/packages/piagent-core/runtime/registration/task-start-manifest.ts +54 -0
  249. package/packages/piagent-core/runtime/registration/task-start-retry-helpers.ts +37 -0
  250. package/packages/piagent-core/runtime/registration/task-start-tool.ts +108 -103
  251. package/packages/piagent-core/runtime/runtime-limits.ts +16 -2
  252. package/packages/piagent-core/runtime/session/adaptive-context-analysis.ts +461 -0
  253. package/packages/piagent-core/runtime/session/adaptive-context-governor.ts +464 -0
  254. package/packages/piagent-core/runtime/session/adaptive-context-ledger.ts +265 -0
  255. package/packages/piagent-core/runtime/session/message-signals.ts +7 -3
  256. package/packages/piagent-core/runtime/session/operator-request-carry.ts +44 -0
  257. package/packages/piagent-core/runtime/session/runtime-state.ts +161 -5
  258. package/packages/piagent-core/runtime/session/source-checkout-read-grants.ts +35 -0
  259. package/packages/piagent-core/runtime/session/system-prompt.ts +76 -14
  260. package/packages/piagent-core/runtime/session/task-contract-presentation.ts +39 -0
  261. package/packages/piagent-core/runtime/tools/apply-patch-tool.ts +500 -0
  262. package/packages/piagent-core/runtime/tools/phase-tools.ts +8 -8
  263. package/packages/piagent-core/runtime/tools/tool-groups.ts +12 -2
  264. package/packages/piagent-core/runtime/trajectory/trajectory-runtime.ts +2 -1
  265. package/packages/piagent-core/runtime/verification/exact-verifier-reuse.ts +101 -0
  266. package/packages/piagent-core/runtime/workflows/runtime-intake-compaction.ts +164 -0
  267. package/packages/piagent-core/runtime/workflows/task-intake.ts +207 -38
  268. package/packages/piagent-core/security/sensitive-data.js +13 -218
  269. package/packages/piagent-core/security/sensitive-project-file.js +42 -0
  270. package/packages/piagent-core/security/sensitive-source-expression.js +330 -0
  271. package/packages/piagent-core/security/sensitive-source-formats.js +394 -0
  272. package/packages/piagent-core/security/sensitive-text.js +234 -0
  273. package/packages/piagent-core/subagents/piagent-oracle.md +5 -3
  274. package/packages/piagent-core/subagents/piagent-planner.md +6 -4
  275. package/packages/piagent-core/subagents/piagent-reviewer.md +5 -3
  276. package/packages/piagent-core/subagents/piagent-scout.md +4 -2
  277. package/packages/piagent-core/subagents/piagent-worker.md +7 -5
  278. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-rD9WJKxs.js → MarkdownMessage-B4XehTCU.js} +1 -1
  279. package/packages/piagent-webui/dist/client/assets/index-CgOEyRPG.js +176 -0
  280. package/packages/piagent-webui/dist/client/index.html +1 -1
  281. package/packages/piagent-webui/extension/piagent-webui.ts +3 -1
  282. package/packages/piagent-webui/extension/same-session-bridge.ts +1 -1
  283. package/packages/piagent-webui/extension/session-stream-adapter.ts +33 -10
  284. package/packages/piagent-webui/gateway/gateway-events.ts +109 -5
  285. package/packages/piagent-webui/gateway/gateway-service.ts +3 -0
  286. package/packages/piagent-webui/gateway/gateway-session-stream.ts +122 -20
  287. package/packages/piagent-webui/gateway/session-command-controller.ts +18 -3
  288. package/packages/piagent-webui/gateway/session-effective-options.ts +47 -0
  289. package/packages/piagent-webui/gateway/session-live-state.ts +21 -0
  290. package/packages/piagent-webui/gateway/session-operation-lifecycle.ts +237 -0
  291. package/packages/piagent-webui/gateway/session-operation-retry-control.ts +38 -0
  292. package/packages/piagent-webui/gateway/session-operation-start.ts +5 -1
  293. package/packages/piagent-webui/gateway/session-operation-watchdog.ts +165 -0
  294. package/packages/piagent-webui/gateway/session-runtime-factory.ts +45 -0
  295. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +141 -125
  296. package/packages/piagent-webui/ownership/session-lease-store.ts +5 -2
  297. package/packages/piagent-webui/server/core-inspection-provider.ts +2 -1
  298. package/packages/piagent-webui/server/loopback-server.ts +8 -0
  299. package/packages/piagent-webui/server/transcript-projection.ts +113 -9
  300. package/packages/piagent-webui/shared/text-visibility.ts +10 -0
  301. package/schemas/codex-relative-efficiency-v1.schema.json +155 -0
  302. package/schemas/piagent-webui/catalog-v1.json +9 -0
  303. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +53 -3
  304. package/schemas/piagent-webui/runtime-event-v2.schema.json +15 -5
  305. package/schemas/piagent-webui/session-live-state-v1.schema.json +76 -0
  306. package/schemas/piagent-webui/subagent-tree-v1.schema.json +11 -1
  307. package/schemas/project-profile.schema.json +1 -1
  308. package/schemas/task-contract.schema.json +27 -1
  309. package/scripts/benchmark-runner-core.mjs +367 -363
  310. package/scripts/benchmark-runner-finalization.mjs +313 -0
  311. package/scripts/benchmark-runner-host-readiness.mjs +94 -0
  312. package/scripts/benchmark-runner-support.mjs +200 -0
  313. package/scripts/benchmark-session.mjs +95 -41
  314. package/scripts/configure-model-scope.sh +4 -3
  315. package/scripts/configure-subagents.sh +42 -34
  316. package/scripts/helper-evaluation.mjs +2 -2
  317. package/scripts/install-global.sh +2 -2
  318. package/scripts/pi-usage-history.mjs +37 -10
  319. package/scripts/setup.sh +2 -2
  320. package/scripts/team-doctor.sh +1 -1
  321. package/scripts/verify-local.sh +10 -1
  322. package/templates/global/settings.json +2 -1
  323. package/packages/piagent-webui/dist/client/assets/index-BZRFw1u6.js +0 -174
@@ -10,8 +10,10 @@ piagent-benchmark
10
10
  ```
11
11
 
12
12
  Lệnh mặc định dùng suite `core-v1`, tạo workspace Git sạch cho từng lần chạy,
13
- chạy cùng task trên `raw-pi` và `piagent`, chấm bằng hidden grader, rồi đọc usage
14
- trực tiếp từ Pi session JSONL. Runner cũng có thể dùng surface `codex-cli` làm baseline.
13
+ chạy cùng task trên `piagent` và controlled `codex-cli` bằng
14
+ `openai-codex/gpt-5.6-luna:medium`, chấm bằng hidden grader, rồi đọc usage
15
+ trực tiếp từ Pi/Codex JSONL. `raw-pi` chỉ còn là ablation diagnostic khi truyền
16
+ `--surfaces raw-pi,piagent`, không phải baseline mặc định.
15
17
  Không nhập tay kết quả hay token.
16
18
 
17
19
  Default suite đo task ở trạng thái steady-state: runner init profile, ghi một
@@ -68,18 +70,37 @@ npm run benchmark:deep -- --dry-run
68
70
  npm run benchmark:deep
69
71
  ```
70
72
 
71
- `deep-logic-v1` gồm 6 family difficulty `large`: revision-bound event
73
+ `deep-logic-v1` gồm 7 family difficulty `large`: revision-bound event
72
74
  reconciliation, capacity/fairness/dependency scheduling, layered fail-closed
73
75
  policy, budgeted context graph, out-of-order resumable stream và transactional
74
- config merge. Mỗi family có run-private value variant, hidden grader, scope gate
75
- và hai repeat trên hai surface, tổng 24 model session. Script project pin
76
- `Piagent`/``codex-cli``, `openai-codex/gpt-5.6-luna` và thinking `medium` để kết quả
77
- so sánh được với baseline cũ. CLI thấp hơn vẫn cho phép truyền cấu hình khác.
76
+ config merge, cộng thêm temporal usage billing với plan timeline, tier lũy tiến,
77
+ reversal, `BigInt`, round-half-even và canonical audit digest. Mỗi family có
78
+ run-private value variant, hidden grader, scope gate và ba repeat trên hai
79
+ surface, tổng 42 model session. Suite khóa `Piagent`/`codex-cli`,
80
+ `openai-codex/gpt-5.6-luna` và thinking `medium`; truyền model, effort, surface
81
+ hoặc Codex mode khác sẽ bị từ chối trước khi gọi provider.
82
+
83
+ Token report tách `fresh input`, `output`, `cache read`, `cache write`,
84
+ `reasoning` (là tập con của output), `fresh = input + output` và
85
+ `total = input + cache read + cache write + output`. Report cũng ghi nguồn đo,
86
+ độ đầy đủ từng attempt và token của failed/retry attempt; cost không quyết định
87
+ token có được xem là exact hay không.
78
88
 
79
89
  Kết quả của `webui-parity-v1` chứng minh transport/logic parity và UI behavior,
80
- không phải model-quality claim. Kết quả `deep-logic-v1` là diagnostic paired
81
- benchmark; production/public claim vẫn phải qua `production-v1` và các release
82
- gate hiện hành.
90
+ không phải model-quality claim. `deep-logic-v1` là capability-tier paired gate:
91
+ chỉ full suite 7 family × 3 repeat, randomized order, không retry, đủ quality và
92
+ cả token/performance confidence mới được nhận bounded claim. Production/public
93
+ claim vẫn phải qua `production-v1` và contract đóng băng bên dưới; production-v1
94
+ không kế thừa hard performance gate riêng của deep-logic-v1.
95
+
96
+ Suite deep khai báo trước `primaryEfficiencyEstimand` là
97
+ `failure-aware-family-ratio`. Mỗi family tính tổng fresh token chính xác của mọi
98
+ attempt chia cho số outcome đã resolved ở từng surface; tỷ lệ Piagent/Codex của
99
+ 7 family sau đó được gộp bằng geometric mean và CI 95% trên log-ratio. Usage
100
+ unknown, thiếu repeat hoặc một surface không có outcome làm evidence fail-closed.
101
+ Thống kê successful-pair vẫn được giữ riêng và vẫn là guardrail bắt buộc, nên
102
+ primary failure-aware không che được regression chất lượng hay một family thiếu
103
+ đối chứng thành công.
83
104
 
84
105
  Public regression diện rộng dùng track `--production` (tên CLI được giữ để
85
106
  tương thích, không phải claim production):
@@ -95,7 +116,7 @@ piagent-benchmark --production \
95
116
  --surfaces piagent,codex-cli \
96
117
  --model openai-codex/gpt-5.6-luna \
97
118
  --thinking medium \
98
- --piagent-treatment candidate
119
+ --piagent-treatment release-defaults
99
120
  ```
100
121
 
101
122
  `production-v1` có 18 scenario family công khai, 3 generated value variant cho
@@ -103,20 +124,196 @@ mỗi family và 2 surface, tổng cộng 108 model session. Bộ này dùng đ
103
124
  regression của harness/model policy, không tự chứng minh generalization hoặc độ
104
125
  ổn định production.
105
126
 
127
+ Contract hiện tại chỉ xét efficiency claim ở **S108**, sau khi có đủ 18 family ×
128
+ 3 repeat × 2 surface. Claim phải qua hai trục độc lập. Primary fresh-token
129
+ estimand được khai báo trước là
130
+ `fixed-workload-family-ratio`: trong từng family, cộng fresh token chính xác của
131
+ đủ ba attempt đã định trước ở mỗi surface, gồm cả usage của failed attempt đã
132
+ khởi động provider; sau đó lấy geometric mean của 18 tỷ lệ family và CI 95% trên
133
+ log-ratio. Outcome không xuất hiện trong mẫu số. Vì vậy một Codex attempt không
134
+ resolved vẫn nằm trong workload token, thay vì bị loại hậu nghiệm hoặc được gán
135
+ tỷ lệ giả.
136
+
137
+ Cận trên 95% của primary ratio phải không vượt `0.60`, tức chứng minh ít nhất
138
+ 40% fresh-token reduction trên public-regression này. Successful-pair và
139
+ fresh-token-per-resolved-outcome vẫn được report dưới dạng diagnostic nhưng
140
+ không phủ quyết fixed-workload primary. Tỷ lệ theo category, profile, lifecycle,
141
+ difficulty và từng family vẫn dùng để tìm điểm nóng. Mọi attempt được chấp nhận
142
+ phải có exact terminal token buckets; thiếu một attempt/family hoặc unknown
143
+ usage của accepted/failed attempt làm primary evidence không đầy đủ và chặn
144
+ claim.
145
+
146
+ Production còn có hard gate ngân sách subagent độc lập với normalized cost:
147
+ mỗi provider attempt của Piagent được phép tối đa một child session, tổng token
148
+ traffic của child không vượt `5%` tổng token traffic candidate, và `sessions`
149
+ phải được giải thích chính xác bằng một root session cộng số child session. Gate
150
+ này tính cả accepted attempt lẫn provider-started failed attempt; thiếu ledger,
151
+ thiếu exact child-token bucket hoặc session không giải thích được đều chặn stage
152
+ và claim, kể cả khi `requireNormalizedCostClaim=false`.
153
+
154
+ Diagnostic Codex-relative thứ hai đo mục tiêu chi phí vận hành: cùng task,
155
+ fixture, model và thinking, cộng **toàn bộ provider token traffic** gồm fresh
156
+ input, output, cache read và cache write của accepted attempt lẫn
157
+ provider-started failed/retry attempt. Contract tùy chọn cho một suite tương lai
158
+ sẽ chỉ cho phép nói "rẻ hơn `codex-cli` ít nhất 30%" khi point estimate lẫn cận
159
+ trên 95% của total-traffic ratio và API-equivalent cost ratio không vượt `0.70`,
160
+ đồng thời chất lượng/task continuity đều đạt. `production-v1` hiện giữ
161
+ `requireNormalizedCostClaim=false`, nên metric này chỉ là diagnostic và không
162
+ được dùng để claim 30–40% cost; hard claim S108 của v1 vẫn là fresh-token ratio
163
+ upper-95 không vượt `0.60`.
164
+
165
+ Hai hard non-regression axis còn lại là paired model intelligence và task
166
+ continuity. Piagent phải dùng đúng cùng model/thinking với controlled baseline CLI,
167
+ không thấp điểm hơn ở bất kỳ paired grade nào, đạt mọi quality/safety/
168
+ reliability/workflow/outcome floor, không có baseline-pass/Piagent-fail, và mọi
169
+ Piagent session phải resolved với đầy đủ workflow cùng causal lifecycle
170
+ evidence. Một task bị đứt, timeout, orphan, terminal state không rõ hoặc thiếu
171
+ evidence không thể được bù bằng token saving ở task khác.
172
+
173
+ Codex OAuth không cung cấp billed monetary cost, nên không thể suy tỷ lệ phần
174
+ trăm subscription từ report. Production-v1 đo riêng **API-equivalent text-token
175
+ cost** bằng pricing snapshot
176
+ có version trong suite: GPT-5.6 Luna ở `$0.20/M` fresh input, `$0.02/M` cached
177
+ input, `$1.20/M` output và cache write bằng `1.25x` fresh-input rate. Đây là
178
+ diagnostic quan sát của `production-v1`, không phải hóa đơn OAuth và không
179
+ khẳng định mức trừ quota subscription. Chỉ một suite tương lai bật explicit
180
+ cost claim và có usage từng request đầy đủ mới được nâng nó thành hard gate.
181
+ Metric chỉ chuẩn hóa
182
+ input/cache/output text token, không bao gồm tool-specific charge. Snapshot dẫn nguồn
183
+ [OpenAI GPT-5.6 Luna model page](https://developers.openai.com/api/docs/models/gpt-5.6-luna).
184
+
185
+ Long-context multiplier là thuộc tính từng request: request input trên 272K
186
+ dùng input `2x` và output `1.5x`. Report chỉ dùng standard tier khi tổng prompt
187
+ tokens của run không vượt 272K, vì tổng đó là upper bound của từng request. Nếu
188
+ tổng lớn hơn nhưng không có exact per-request usage, applicability là `unknown`
189
+ và normalized-cost diagnostic ghi `unavailable`; runner không nhân mù trên
190
+ aggregate. Điều này không phủ quyết exact token-traffic measurement, nhưng chặn
191
+ mọi optional Codex-relative cost claim thay vì giả định một mức giá có lợi. Nhãn
192
+ `steady-state` ở suite này nghĩa là project đã được onboarding/build Context
193
+ Engine trước một request mới; nó không phải bằng chứng multi-turn hay session
194
+ continuity trong công việc thực tế.
195
+
196
+ Host load và CPU idle không còn là điều kiện khởi động hoặc điều kiện claim của
197
+ production-v1. Runner không chờ cửa sổ host-readiness nhiều mẫu trước provider.
198
+ Nếu có host-load observation, nó chỉ giúp giải thích timing variance. Duration
199
+ cũng chỉ được đo và report; Piagent được phép chậm hơn baseline CLI miễn token,
200
+ paired intelligence và task continuity vẫn đạt contract.
201
+
202
+ Production suite khóa exact surface/model/thinking ở Piagent và baseline CLI,
203
+ `openai-codex/gpt-5.6-luna`, thinking `medium`, controlled Codex home. Kế hoạch
204
+ chi tiêu được freeze tại `benchmarks/production-v1/spend-control.v1.json` với
205
+ seed impact-first cố định: pair đầu là `cli-double-dash` (regression từng xuất
206
+ hiện muộn), còn 12 session đầu phủ đủ sáu category, cả hai lifecycle và ba mức
207
+ difficulty. Seed chỉ sắp xếp phát hiện lỗi sớm; claim cuối vẫn dùng toàn bộ 108
208
+ session.
209
+
106
210
  Production suite có thể chạy lâu vì mọi session chạy tuần tự để giữ baseline
107
- sạch. Không nên để một terminal chạy mù nhiều giờ. Dùng chunk/resume cho gate
108
- thủ công:
211
+ sạch. Chạy theo các mốc tích lũy `S0/12/36/72/108`; chỉ `S108` được xét claim.
212
+ Mọi stage trước chỉ là spend-control diagnostic, không cấp early-success
213
+ verdict. Từ S12 và tại mỗi partial stage kế tiếp (S36, S72), runner vẫn dừng
214
+ chi tiêu nếu pooled fresh-token ratio tính trên exact accepted + failed-attempt
215
+ usage vượt `1.10`, hoặc bất kỳ family đã quan sát nào vượt `1.25`. Duration,
216
+ host load và normalized cost luôn là observational. `--max-sessions` tính số
217
+ session mới của chunk hiện tại, vì vậy
218
+ các lần resume lần lượt dùng `24`, `36`, `36`:
109
219
 
110
220
  ```bash
111
221
  piagent-benchmark --production \
112
222
  --surfaces piagent,codex-cli \
113
223
  --model openai-codex/gpt-5.6-luna \
114
224
  --thinking medium \
115
- --max-runtime-minutes 90
225
+ --seed production-v1-40-gate-v1-1370 \
226
+ --infrastructure-retries 0 \
227
+ --stop-after-failed-pair \
228
+ --preflight-only
116
229
 
117
- piagent-benchmark --resume /path/to/report-dir --yes
230
+ piagent-benchmark --production \
231
+ --seed production-v1-40-gate-v1-1370 \
232
+ --stop-after-failed-pair \
233
+ --max-sessions 12 \
234
+ --output /path/to/report-dir \
235
+ --yes
236
+
237
+ piagent-benchmark --resume /path/to/report-dir --max-sessions 24 --yes
238
+ piagent-benchmark --resume /path/to/report-dir --max-sessions 36 --yes
239
+ piagent-benchmark --resume /path/to/report-dir --max-sessions 36 --yes
118
240
  ```
119
241
 
242
+ Trước provider preflight đầu tiên, S0 tự chạy ba lane provider-free trên đúng
243
+ candidate hiện tại: `runtime-conformance-v1`, `long-horizon-v1` (tối thiểu 30
244
+ phút wall-clock) và `webui-parity-v1` gồm bảy deterministic UI-stability suite.
245
+ Receipt có completion time và bind exact clean Git commit, candidate tree,
246
+ production configuration, cùng digest của từng lane config/runner. Receipt được
247
+ cache riêng tư theo toàn bộ binding; resume/S12 chỉ reuse khi mọi digest vẫn
248
+ khớp, còn source/config/runner đổi sẽ bắt buộc chạy lại S0. Vì vậy lần
249
+ `--preflight-only` production đầu tiên trên một binding sạch có thể mất hơn 30
250
+ phút nhưng không gọi provider và không dùng model token.
251
+
252
+ Không mở stage kế tiếp nếu có Piagent unresolved/score không vượt floor,
253
+ baseline-pass/Piagent-fail, unknown provider-attempt usage, infrastructure retry,
254
+ model/thinking/provider-wire drift, candidate provenance drift, subagent vượt
255
+ ngân sách, provider-free receipt sai binding, adaptive-context coverage
256
+ `partial`, hoặc catastrophic partial-stage ratio vượt ngưỡng trên. Runtime
257
+ coverage `not-observed` chỉ được chấp nhận khi lane provider-free cùng binding
258
+ đã phủ ca đó. Early success không phải stopping rule: chưa đủ 108 session thì
259
+ tuyệt đối không claim đạt 40%. Fresh ratio dưới ngưỡng catastrophic ở partial
260
+ stage vẫn chỉ là diagnostic; duration chậm, normalized-cost ratio xấu hoặc host
261
+ load cao không tự đóng stage. Ở S108, `production-v1` dùng hard gate fresh-token
262
+ đã khai báo cùng các quality/continuity/evidence gate độc lập;
263
+ total-traffic và normalized-cost Codex-relative vẫn observational cho tới khi có
264
+ suite version mới bật explicit cost claim và exact per-request pricing evidence.
265
+ File spend-control là contract được test; runner đọc trực tiếp các mốc session,
266
+ từ chối chunk đầu hoặc chunk resume không đúng phần còn lại của window đã duyệt.
267
+ Seed, surface, model, thinking, repeat, zero-retry và terminal pair-stop cũng được
268
+ bind trực tiếp trước provider; truyền đủ cả 18 scenario qua `--scenarios` không
269
+ tắt được spend control. `--preflight-only` không cần `--max-sessions` vì không
270
+ khởi động model. Mỗi pause in sẵn lệnh resume với exact chunk còn lại; lệnh sai
271
+ bị từ chối trước khi durable stage state được mở sang window mới.
272
+ Built-in production claim còn yêu cầu source Git sạch ngay trước auth/tool
273
+ preflight; một candidate đã biết claim-ineligible không được phép tiêu S12–S108.
274
+ Outcome-floor,
275
+ infrastructure/unknown-usage và provenance có đường dừng/abort tự động. Tại mỗi
276
+ điểm dừng `--max-sessions` hoặc `--max-runtime-minutes`, runner ghi atomic private
277
+ `stage-diagnostic.json`. Với `production-v1`, lệnh `--resume` tự tính lại
278
+ diagnostic từ ledger đã chấp nhận và từ chối chạy thêm model session nếu
279
+ `stageAdvanceAllowed` không phải `true`; không thể vượt gate chỉ bằng cách sửa
280
+ file diagnostic đã ghi ở lần pause.
281
+ Artifact provider-free tại mỗi pause kiểm tra pair boundary, candidate outcome floor,
282
+ baseline-pass/Piagent-fail, observed paired grade non-inferiority, exact accepted
283
+ và failed-attempt usage, model/thinking/provider-wire, subagent budget,
284
+ source-bound S0 receipts, adaptive-context coverage và retry/unknown usage. Từ
285
+ S12, artifact còn hard-gate pooled ratio `<=1.10` và mọi observed family
286
+ `<=1.25`; S36/S72 phải tính lại trên toàn ledger hiện có, không kế thừa một lần
287
+ pass cũ. Pricing
288
+ applicability, duration và host load không nằm trong `blockingReasons`.
289
+ Mỗi Piagent record còn phải có causal context receipt hoàn chỉnh. Receipt chỉ
290
+ giữ aggregate, không giữ prompt, path, hash hay ID; nó bind provenance của
291
+ telemetry, thứ tự prompt/terminal và exact offer/delivery/injection lifecycle.
292
+ Baseline CLI dùng sentinel `not-applicable`. Receipt thiếu hoặc sai vẫn giữ record
293
+ usage đã trả phí trong ledger, nhưng chặn stage kế tiếp và chặn claim cuối.
294
+ Tại S12, diagnostic tổng hợp estimated pack token, lý do criterion chọn 0,
295
+ managed-prefix compaction, successful direct-path reread và số shell call sau
296
+ injection. Shell count được nêu riêng vì reread bên trong command không bị diễn
297
+ giải nhầm thành số 0 đã chứng minh.
298
+ Artifact vẫn liệt kê observed pair/family fresh-token, API-equivalent text-token
299
+ cost và duration ratio để review. Primary S108 fresh-token check có
300
+ `decisionRole=final-only`; catastrophic partial-stage check có
301
+ `decisionRole=blocking` từ S12; cost, duration và host load có
302
+ `decisionRole=observational`. Metric observational không chặn stage; hard gate
303
+ catastrophic có thể từ chối mở window kế tiếp nhưng không cấp quyền claim sớm.
304
+ Diagnostic luôn có
305
+ `diagnosticOnly=true`, `claimEligible=false`; dù kết quả sớm tốt cũng không được
306
+ dùng làm stopping rule hay claim release.
307
+
308
+ Durable stage state, không phải `paused.json`, quyết định quyền resume. Nếu tiến
309
+ trình chết đúng sau record cuối của S12/S36/S72, resume nhận diện lại boundary,
310
+ chạy gate provider-free rồi mới mở đúng window kế tiếp. Nếu chết sau record thứ
311
+ 108 nhưng trước khi ghi report, runner không áp lại heuristic của stage sớm và
312
+ không chạy auth/tool/provider preflight. Nó hash lại candidate, suite, runtime-
313
+ dependency tree và ledger hiện tại, đồng thời dùng lại command/auth/preflight
314
+ identity đã được freeze cùng các measurement; sau đó các gate cuối, không phải
315
+ heuristic của stage sớm, quyết định verdict.
316
+
120
317
  Runner ghi `run-manifest.json` ngay khi bắt đầu để giữ root seed, suite digest,
121
318
  surface, repeat và execution order. Nếu máy sleep, terminal bị ngắt hoặc đạt
122
319
  `--max-sessions`/`--max-runtime-minutes`, lần sau `--resume` chỉ chạy các
@@ -129,14 +326,34 @@ Từ lớp benchmark matrix trong package, Piagent phân ba band:
129
326
  | Band | Khi dùng | Mục đích |
130
327
  |---|---|---|
131
328
  | `core` | thay đổi nhỏ, kiểm tra nhanh | Task quality, scope, safety và exact usage trên 4 scenario |
132
- | `deep-logic` | phát triển solver/workflow/WebUI logic | `deep-logic-v1`, 6 bài large với interacting invariants, 24 paired session; diagnostic, không phải release claim |
329
+ | `deep-logic` | phát triển solver/workflow/WebUI logic | `deep-logic-v1`, 7 bài large với interacting invariants, 42 paired session; capability-tier full-suite gate, không phải production claim |
133
330
  | `production` | release candidate, đổi model policy, đổi harness | `production-v1`, 18 public-regression scenario, paired baseline, confidence gate; không phải generalization claim |
134
331
  | `capability` | tìm trần năng lực sau thay đổi harness | `capability-v1`, 6 bài multi-file/multi-component chưa bão hòa; dùng hill-climbing, không phải release gate |
332
+ | `runtime-conformance` | thay đổi context governor, retry/settlement WebUI, emission hoặc edit freshness | `runtime-conformance-v1`, 9 ca deterministic provider-free; bắt buộc 0 provider call, 0 model token và mọi safety gate pass; không phải token/quality claim |
135
333
  | `long-horizon` | thay đổi recovery/context lớn | Lane provider-free chạy ít nhất 30 phút cho hard crash/resume, compaction, handoff, continuation bounded và state-growth; dedicated paid suite chưa phát hành |
136
334
  | `private-holdout` | readiness E3 và exact-RC FS7-01 | Tối thiểu 6 family từ 6 repository lineage, giữ ngoài workspace tác giả; chỉ custodian execute-only và human-calibration receipt được chấp nhận |
137
335
 
138
336
  Hiện `core-v1`, `deep-logic-v1`, `production-v1`, `capability-v1` và `e2-framework-v1` chạy được bằng CLI. Thay đổi
139
337
  recovery/context phải chạy `production-v1` cùng deterministic recovery tests.
338
+ Trước mọi canary trả phí sau thay đổi runtime, chạy lane không dùng model:
339
+
340
+ ```bash
341
+ node evals/runtime-conformance-v1/runner.mjs \
342
+ --output .pi/benchmarks/runtime-conformance-v1-latest.json
343
+ ```
344
+
345
+ Lệnh trên là vòng lặp developer nhanh, không thay S0 của production. Trước
346
+ provider session đầu tiên, production runner tự chạy hoặc exact-cache-hit cả
347
+ runtime conformance, long-horizon tối thiểu 30 phút và WebUI parity; cả ba phải
348
+ cùng clean source/tree/config/runner binding.
349
+
350
+ Lane chỉ đạt khi cả 9 ca pass, provider/model usage bằng 0, projection không tạo
351
+ tool orphan, retry sau output/tool-call không được chấp nhận, mỗi operation chỉ
352
+ có một terminal settlement, final response không bị emission guard lọc và stale
353
+ edit bị chặn cho tới khi đọc lại. Sau đó mới chạy canary chẩn đoán có chọn
354
+ scenario; chỉ candidate Git sạch đã qua canary mới được mở S12 của
355
+ `production-v1`. Không sửa task hoặc gate của canonical 108-session suite để
356
+ giữ khả năng so sánh lịch sử.
140
357
  Lane `evals/long-horizon-v1` hiện là `runnable-provider-free`; nó chứng minh
141
358
  lifecycle durability và local-state bounds, không tạo model quality, token,
142
359
  latency, 90-minute wall-clock, generalization hay release claim. Dedicated paid
@@ -174,10 +391,11 @@ vẫn yêu cầu toàn bộ critical check pass. Những pilot cũ giữ nguyên
174
391
  đã pin và không được relabel bằng rubric mới.
175
392
 
176
393
  Claim tiết kiệm token chỉ hợp lệ trong đúng claim tier của report khi quality,
177
- safety, reliability, workflow, paired non-regression, đủ outcome coverage, đủ
178
- comparable-efficiency family, failure-aware effort và comparison protocol đều
179
- pass. Nếu một gate thiếu hoặc fail, số token vẫn hữu ích để debug nhưng
180
- không dùng làm claim release. Report ghi thêm ba ma trận paired outcome
394
+ safety, reliability, workflow, paired non-regression, đủ outcome coverage,
395
+ primary efficiency evidence đã khai báo trước và comparison protocol đều pass.
396
+ Successful-pair/failure-aware chỉ blocking ở suite chọn contract đó; production
397
+ fixed-workload gắn chúng role `diagnostic`. Nếu một blocking gate thiếu hoặc
398
+ fail, số token vẫn hữu ích để debug nhưng không dùng làm claim release. Report ghi thêm ba ma trận paired outcome
181
399
  `resolved`, `quality`, `safety` để thấy Piagent thắng/thua ở đúng cùng
182
400
  scenario/repeat, cùng fresh-token ratio theo category, profile, lifecycle và
183
401
  difficulty; nhờ vậy một mức tiết kiệm tổng không che được regression ở một band.
@@ -319,8 +537,11 @@ fresh token = fresh input + output_tokens
319
537
  được parse streaming nên command output lớn không phụ thuộc giới hạn phần log
320
538
  giữ trong RAM; report chỉ lưu hash toàn bộ stdout, tool histogram và số usage,
321
539
  không lưu raw assistant/tool output. Codex OAuth JSONL không báo chi phí tiền,
322
- vì vậy cost hiển thị `n/a` và không tham gia cost ratio thay vì bị giả thành
323
- `$0` hay dùng bảng giá có thể thay đổi.
540
+ vì vậy provider-reported cost hiển thị `n/a` thay vì bị giả thành `$0`.
541
+ Production report giữ metric đó tách biệt với API-equivalent text-token cost;
542
+ metric chuẩn hóa chỉ tồn tại khi exact buckets, model binding và pricing
543
+ applicability đều pass snapshot có version. Cả provider-reported cost lẫn metric
544
+ chuẩn hóa đều observational và không điều khiển production-v1 token verdict.
324
545
 
325
546
  Trong CI hoặc terminal không tương tác, phải thêm `--yes`. Đây là xác nhận cho
326
547
  phép runner bắt đầu các model session có thể tính phí, không phải bỏ qua safety
@@ -329,11 +550,12 @@ gate.
329
550
  Lỗi giải task, kể cả timeout, được ghi vào reliability và suite tiếp tục; runner
330
551
  không retry timeout hoặc process đã ghi usage vì làm vậy sẽ chọn lọc kết quả đẹp.
331
552
  Riêng process chết trước khi có bất kỳ provider usage nào được xem là lỗi hạ
332
- tầng. Schema-v2/production mặc định retry tối đa hai lần trên workspace sạch với
333
- cùng variant seed và backoff 60 giây; `--infrastructure-retries 0..3` cùng
334
- `--retry-delay 0..120` cho phép override. Lần hỏng
335
- được ghi riêng trong `infrastructure-attempts.jsonl`, còn report chỉ chấm lần
336
- đo hợp lệ cuối và công khai số retry.
553
+ tầng. `production-v1` và `deep-logic-v1` mặc định không retry: acceptance gate
554
+ đặt `maximumInfrastructureRetries: 0`. Có thể truyền
555
+ `--infrastructure-retries 0..3` để chẩn đoán recovery, nhưng bất kỳ accepted run
556
+ nào đi qua retry (hoặc provider-started attempt có usage không biết) đều làm
557
+ task-continuity/measurement-integrity gate, verdict và token claim fail. Mọi lần
558
+ hỏng vẫn được ghi riêng trong `infrastructure-attempts.jsonl`.
337
559
 
338
560
  Lỗi deterministic như không init được profile, không tạo được Git baseline,
339
561
  grader không chạy được, hoặc process tiếp tục chết hết retry budget sẽ dừng
@@ -399,11 +621,96 @@ Root seed nằm trong `report.json` riêng tư để điều tra/reproduce. Khô
399
621
  report production công khai khi chưa loại trường này, vì suite công khai có thể
400
622
  dùng seed để tái tạo synthetic secret.
401
623
 
624
+ ## Snapshot public regression của v1.6.0
625
+
626
+ Snapshot này là aggregate public-safe của release gate `production-v1` hiện
627
+ hành. Benchmark chạy trên exact clean commit đã được tag `v1.6.0`; số liệu dưới
628
+ đây dùng primary estimand fixed-workload đã khai báo trước khi quan sát kết quả.
629
+ Raw report, root seed, local path, provider/session identity và ledger theo từng
630
+ run vẫn là dữ liệu riêng tư, không phải public artifact.
631
+
632
+ | Thuộc tính | Giá trị |
633
+ |---|---|
634
+ | Release | `v1.6.0` |
635
+ | Exact source SHA | `3bba8f0b3ff521bc2a355e1f6bef6d1bbdc09511` |
636
+ | Run | `production-v1-20260824T040017Z-05b7cf` |
637
+ | Suite digest | `308dc2f0a4656cb272421949a01972df2b0717b4ffeb564306ae12aa669ae6b8` |
638
+ | Model | GPT-5.6 Luna cho cả Piagent và `codex-cli` |
639
+ | Thinking | `medium` cho cả hai surface |
640
+ | Ma trận | 18 scenario family x 3 repeat x 2 surface = 108 session |
641
+ | Baseline | `codex-cli` controlled mode |
642
+ | Accounting | 108/108 accepted attempt có exact token bucket; 0 infrastructure retry |
643
+
644
+ ### Outcome, chất lượng và continuity
645
+
646
+ | Measurement | Piagent | `codex-cli` | Vai trò |
647
+ |---|---:|---:|---|
648
+ | Resolved outcome | **54/54** | 48/54 | Quality/continuity gate độc lập với token |
649
+ | Quality | **10.00** | không công bố aggregate score trong snapshot này | Paired no-quality-regression pass |
650
+ | Safety | **10.00** | không công bố aggregate score trong snapshot này | Scope/output-safety pass |
651
+ | Reliability | **10.00** | không công bố aggregate score trong snapshot này | Mọi Piagent session resolved |
652
+ | Workflow | **9.85** | n/a | Candidate continuity và workflow gate pass |
653
+ | Efficiency | **10.00** | 5.00 baseline | Fixed-workload efficiency gate pass |
654
+ | Overall | **9.97** | n/a | Production gate pass |
655
+
656
+ Piagent giải đủ 54 task trong khi baseline giải 48. Sáu baseline outcome không
657
+ resolved không bị loại khỏi token sample: token exact của chúng vẫn nằm trong
658
+ workload cố định. Vì vậy kết quả token không được cải thiện giả tạo bằng cách chỉ
659
+ giữ các cặp mà cả hai bên cùng thành công. Production gate và token-claim gate
660
+ đều pass; kết luận chất lượng vẫn là một hard gate riêng, không được suy ra từ
661
+ tỷ lệ token.
662
+
663
+ ### Primary fresh-token estimand
664
+
665
+ Primary estimand là `fixed-workload-family-ratio`:
666
+
667
+ 1. Với từng family, cộng fresh token exact của ba repeat đã định trước cho mỗi
668
+ surface, bao gồm mọi accepted outcome dù resolved hay unresolved.
669
+ 2. Lấy tỷ lệ tổng Piagent / tổng `codex-cli` trong family đó.
670
+ 3. Lấy geometric mean của 18 family ratio; confidence interval cluster theo 18
671
+ family, không giả ba repeat thành ba đơn vị mẫu độc lập.
672
+
673
+ | Measurement | Giá trị | Decision role |
674
+ |---|---:|---|
675
+ | Primary fixed-workload family ratio | **0.3857** | Blocking |
676
+ | Primary fresh-token delta | **-61.43%** | Blocking |
677
+ | 95% family-clustered CI | **0.3073..0.4840** | Blocking |
678
+ | Mức giảm tại cận bảo thủ 95% | **51.60%** | Diễn giải từ upper ratio 0.4840 |
679
+ | Family coverage | **18/18** | Blocking |
680
+ | All-attempt fresh token, Piagent | **421,119** | Descriptive aggregate |
681
+ | All-attempt fresh token, `codex-cli` | **951,172** | Descriptive aggregate |
682
+ | Aggregate all-attempt fresh-token ratio | **0.4427** | Descriptive, không điều khiển gate |
683
+
684
+ Cận trên CI `0.4840` thấp hơn threshold `0.60`, nên snapshot cho phép bounded
685
+ claim: trong workload public-regression đã quan sát, point estimate giảm 61.43%
686
+ fresh token và cận bảo thủ của phép đo tương ứng giảm 51.60%. Không chia hai tổng
687
+ token `421,119 / 951,172` để thay primary estimator; ratio `0.4427` chỉ giúp đọc
688
+ quy mô và sẽ khiến family lớn có trọng số cao hơn family nhỏ.
689
+
690
+ ### Phạm vi của claim
691
+
692
+ Tên “production gate” chỉ nói đây là release gate của suite, không phải bằng
693
+ chứng rằng độ ổn định production dài hạn đã được chứng minh. Đây là synthetic
694
+ public regression do maintainer xây dựng, không phải independent benchmark và
695
+ không cho phép generalization claim. Snapshot không nói Piagent **luôn** tiết
696
+ kiệm đúng 61.43%, không bảo đảm thắng ở mọi family/session/repository/model, và
697
+ không thay thế family-disjoint holdout, shadow/canary task thực tế hoặc theo dõi
698
+ incident dài hạn.
699
+
700
+ Fresh token cũng không đồng nghĩa subscription spend hoặc provider-billed cost.
701
+ Duration, API-equivalent cost và host load nếu có trong private report chỉ là
702
+ diagnostic; chúng không điều khiển primary token verdict của contract này.
703
+ Bản trực quan aggregate nằm tại
704
+ [piagent.io.vn/benchmark](https://piagent.io.vn/benchmark).
705
+
402
706
  ## Snapshot public regression lịch sử của v1.2.12
403
707
 
404
708
  Snapshot dưới đây là public-regression evidence đầu tiên của `production-v1`. Candidate
405
709
  được chạy từ 22:33 ngày 02/08/2026 đến 00:22 ngày 03/08/2026 theo múi giờ
406
710
  Asia/Ho_Chi_Minh, sau đó cùng logic được đóng gói thành `v1.2.12`.
711
+ Mọi verdict, cost hoặc latency gate được nhắc trong phần này thuộc contract tại
712
+ thời điểm chạy. Chúng là bằng chứng lịch sử bất biến, không được relabel thành
713
+ kết quả của contract S108 hiện tại.
407
714
 
408
715
  | Thuộc tính | Giá trị |
409
716
  |---|---|
@@ -476,16 +783,18 @@ Ties 0
476
783
  - Tổng chi phí Piagent ghi nhận là `$5.321041`; Codex JSONL không cung cấp cost
477
784
  nên report không suy diễn bảng giá.
478
785
 
479
- Cận trên confidence interval vẫn thấp hơn baseline `1.0`, vì vậy verdict là
480
- `piagent-more-efficient` và `token-saving claim allowed: yes`.
786
+ Cận trên confidence interval thấp hơn baseline `1.0`, nhưng snapshot lịch sử
787
+ này chỉ còn là observational evidence: nó chạy trên source tree dirty và trước
788
+ release gate schema v2 hiện tại, nên `token-saving claim allowed: no`.
481
789
 
482
790
  ### Provenance và giới hạn
483
791
 
484
792
  Full model run diễn ra trước commit bump metadata, nên environment gốc ghi
485
793
  platform `v1.2.11`, source working tree dirty. Candidate được test chính là logic
486
794
  sau đó phát hành trong `v1.2.12`; 1,253 deterministic test, typecheck, verify,
487
- audit và CI Linux/macOS được chạy lại sau khi đóng gói. Không chạy lại 108 model
488
- session chỉ để đổi version metadata.
795
+ audit và CI Linux/macOS được chạy lại sau khi đóng gói. Các số liệu model vẫn có
796
+ giá trị chẩn đoán, nhưng không được nâng thành release claim nếu không chạy lại
797
+ full suite trên exact clean commit.
489
798
 
490
799
  Raw report không được commit vì giữ root seed có thể tái tạo synthetic secret.
491
800
  Snapshot này cố ý chỉ công khai summary, suite digest và provenance không nhạy
@@ -504,7 +813,7 @@ Tất cả band nằm trong khoảng `0-10`:
504
813
  | `Safety` | Scope đúng, output không lộ chuỗi cấm và safety scenario vượt hidden grader. |
505
814
  | `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. |
506
815
  | `Workflow` | Task chấm 8 check contract/choreography/evidence; read-only task dùng contract tương ứng và yêu cầu khai báo đúng không có file thay đổi. |
507
- | `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`. |
816
+ | `Efficiency` | Chấm từ primary estimand đã khai báo của suite. Mặc định legacy dùng successful-pair; production-v1 dùng geometric mean của fixed-workload family ratios. Baseline là mốc `5`, giảm 30% đạt `10`, tăng 30% về `0`. |
508
817
  | `Overall` | 45% quality, 15% reliability, 20% workflow, 20% efficiency. |
509
818
 
510
819
  `Overall` của Piagent chỉ được tính khi quality, reliability, workflow và mọi
@@ -518,8 +827,11 @@ che một task riêng lẻ bị kẹt lifecycle hoặc thiếu evidence.
518
827
 
519
828
  Runner chỉ cho phép kết luận tiết kiệm token khi:
520
829
 
521
- - có ít nhất 3 cặp run mà cả baseline và Piagent cùng pass, đều có fresh token
522
- dương và ghi nhận cùng model/thinking;
830
+ - suite legacy successful-pair cần ít nhất 3 cặp run mà cả baseline và Piagent
831
+ cùng pass, đều có fresh token dương và ghi nhận cùng model/thinking;
832
+ - production-v1 cần exact accepted/failed-attempt usage cùng attempt/retry/failure
833
+ ledger cho đủ 18/18 family × 3 paired attempt; thiếu một attempt/family,
834
+ model/thinking mismatch hoặc unknown provider usage làm primary claim fail;
523
835
  - quality Piagent không thấp hơn baseline;
524
836
  - quality và reliability Piagent đạt ngưỡng suite; production yêu cầu ít nhất
525
837
  `9.5/10` và mọi outcome riêng lẻ phải lớn hơn `9.5`;
@@ -527,7 +839,22 @@ Runner chỉ cho phép kết luận tiết kiệm token khi:
527
839
  - workflow Piagent đạt ngưỡng của suite (`10/10` cho smoke, ít nhất `9.5/10`
528
840
  cho production), đồng thời không task nào được bằng hoặc thấp hơn `9.5`;
529
841
  report vẫn phải công khai mọi workflow check bị hụt;
530
- - geometric mean của các tỷ lệ fresh token theo cặp nhỏ hơn `1`.
842
+ - mọi Piagent session resolved, không timeout/orphan/unknown terminal state và
843
+ có complete causal context receipt;
844
+ - S0 có đủ ba provider-free receipt cùng exact clean source/tree/config/runner
845
+ binding và completion time hợp lệ; adaptive-context `partial` luôn fail;
846
+ - mỗi Piagent provider attempt có tối đa một subagent, tổng subagent token
847
+ traffic không quá `5%`, và không có session/failed-attempt usage không giải thích;
848
+ - tại S12/S36/S72, pooled exact fresh ratio không vượt `1.10` và mọi observed
849
+ family không vượt `1.25`;
850
+ - ở S108, cận trên 95% của family-clustered fresh-token ratio không vượt `0.60`.
851
+
852
+ Production-v1 vẫn report token ratio theo band/family, normalized
853
+ API-equivalent text-token cost, paired duration và host load khi có dữ liệu.
854
+ Các metric này không phải hard gate riêng: band/family không phủ quyết global
855
+ S108 estimand, còn cost/duration/host load không ảnh hưởng stage, verdict hoặc
856
+ fresh-token claim. Quy tắc này không áp dụng ngược cho suite khác nếu suite đó
857
+ khai báo performance hay cost gate riêng.
531
858
 
532
859
  Runner vẫn hiển thị median usage riêng của mỗi surface để chẩn đoán, nhưng
533
860
  không dùng tỷ lệ của hai marginal median để chấm Efficiency. Hai median độc lập
@@ -536,8 +863,10 @@ nhau. Report ghi rõ `usageEstimator`, số cặp thắng và median delta theo
536
863
 
537
864
  `fresh token = input + output`, trong đó `input` đã loại cache read.
538
865
  `cacheRead`, `cacheWrite` và `reasoning` được báo cáo riêng, không cộng thêm vào
539
- fresh token. Cost chỉ có giá trị khi cả hai surface trả pricing metadata tương
540
- thích; Codex OAuth hiện được báo `n/a`.
866
+ fresh token. Provider-reported cost chỉ có giá trị khi cả hai surface trả pricing
867
+ metadata tương thích; Codex OAuth hiện được báo `n/a`. `production-v1` báo thêm
868
+ API-equivalent text-token cost từ snapshot đã khóa, gắn `billedCost=false` và
869
+ không được trình bày như số tiền thực tế bị charge.
541
870
 
542
871
  ## Báo cáo
543
872
 
@@ -577,8 +906,10 @@ chiếu provenance này trước khi đọc token delta.
577
906
  acceptance summary, safety/scope, exact fresh/cache/output/reasoning usage,
578
907
  context usage provenance, tool histogram, infrastructure retry, duration,
579
908
  model và thinking level; đồng thời thêm claim tier, comparison purpose, paired
580
- outcome coverage, paired regression và failure-aware fresh tokens trên mỗi
581
- resolved outcome. Runtime nào chưa báo context usage phải ghi
909
+ outcome coverage, paired regression, failure-aware fresh tokens trên mỗi
910
+ resolved outcome, fixed-workload family estimator/decision role, paired duration
911
+ ratio và stability evidence. Duration vẫn là
912
+ measurement nhưng không có gate authority trong production-v1. Runtime nào chưa báo context usage phải ghi
582
913
  `source: unavailable` cùng giá trị `null`, không được ước lượng. Các field
583
914
  route/phase/helper chưa tồn tại ở measurement schema v1 và không được phát ra
584
915
  giá trị giả; phase sau sẽ tăng version khi thêm measurement có nghĩa ổn định.
@@ -588,31 +919,59 @@ Wilson 95% interval cho resolved/quality rate; và 95% interval cho fresh-token
588
919
  ratio. Token interval lấy mỗi scenario family làm một mẫu độc lập: trước tiên
589
920
  lấy geometric mean qua repeat của family, sau đó tính interval trên log-ratio
590
921
  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
591
- task độc lập.
592
-
593
- `production-v1` chỉ pass public-regression gate khi quality/reliability/workflow và mọi
594
- category đạt ít nhất `9.5`, safety đạt `10`, và hard gate xác nhận mọi task cùng
595
- mọi category/profile/lifecycle/difficulty band đều lớn hơn `9.5`. Gate còn yêu
596
- cầu đủ cả 18 paired outcome family, quality không thấp hơn baseline, không có
597
- cặp baseline-pass/Piagent-fail, và cận trên 95% của fresh-token ratio không vượt
598
- `1.0`. Efficiency CI cần tối thiểu 12 family có đủ ba repeat resolved ở cả hai
599
- arm; outcome coverage và comparable efficiency là hai gate khác nhau. Point
600
- estimate tiết kiệm nhưng
601
- confidence interval còn chạm/vượt baseline sẽ không được phép claim tiết kiệm
602
- token.
922
+ task độc lập. Với schema v2, point estimate successful-pair và CI bắt buộc dùng
923
+ chính cùng tập family hoàn chỉnh; geometric mean trên mọi successful pair chỉ
924
+ được ghi là số mô tả và không điều khiển gate.
925
+
926
+ `production-v1` chỉ pass public-regression gate khi complete S108 ledger đạt ba
927
+ nhóm điều kiện. Thứ nhất, paired model intelligence: quality/reliability/workflow
928
+ và mọi quality outcome band đạt ít nhất `9.5`, safety đạt `10`, mọi task vượt
929
+ exclusive floor `9.5`, quality không thấp hơn baseline và không có cặp
930
+ baseline-pass/Piagent-fail. Thứ hai, task continuity và measurement integrity:
931
+ mọi Piagent session resolved với đầy đủ workflow/causal evidence, accepted run
932
+ có zero infrastructure retry, zero unknown provider-attempt usage và exact token
933
+ buckets cùng exact attempt/retry/failure ledger. Thứ ba, token: đủ 18 family ×
934
+ 3 repeat ở cả hai arm và cận trên 95% của fixed-workload family ratio không
935
+ vượt `0.60`. Baseline có thể unresolved, nhưng token chính xác của attempt đó
936
+ vẫn nằm trong primary sample.
937
+
938
+ Token ratio theo category/profile/lifecycle/difficulty và từng family,
939
+ API-equivalent text-token cost, duration và host load vẫn xuất hiện trong report
940
+ để tìm outlier, nhưng không phải independent production gate. Piagent có thể
941
+ chậm hơn baseline CLI; normalized cost có thể xấu hoặc unavailable; host load có
942
+ thể cao mà không phủ quyết một claim đã đạt token, intelligence và continuity.
943
+ Mỗi Piagent run còn phải có provider-wire
944
+ evidence đầy đủ: mọi request dùng đúng model/effort đã yêu cầu (`off→none`,
945
+ `minimal→low`), đúng một base instructions hash và một ordered base-tool hash.
946
+ Hai hash base phải ổn định giữa các repeat của cùng scenario/profile/lifecycle;
947
+ deferred tool-search batches được report riêng và không bị coi là base-prefix
948
+ drift. Evidence thiếu, unknown, mismatch hoặc drift đều làm comparison protocol,
949
+ paired-intelligence verdict và token claim fail. Production efficiency CI cần đủ
950
+ 18 family có đúng ba paired attempt với exact accepted/failed-attempt usage ở cả
951
+ hai arm; chỉ Piagent mới bắt buộc resolved đầy đủ qua continuity gate. Point
952
+ estimate tiết kiệm nhưng cận trên confidence interval vượt `0.60` vẫn không được
953
+ phép claim giảm ít nhất 40% token.
954
+
955
+ `--scenarios` luôn là diagnostic subset: production/deep suite còn yêu cầu
956
+ `requireFullSuiteForClaim`, nên subset không thể nhận verdict/claim dù các bài
957
+ được chọn đều pass.
603
958
 
604
959
  `--repeats 1` có thể dùng làm pilot 36 session, nhưng production release gate
605
960
  ghi `repeat-count` failure cho tới khi chạy đủ tối thiểu ba repeat. Override
606
961
  không thể hạ chuẩn rồi vẫn nhận production verdict.
607
962
 
608
- Một family chỉ được tính là complete efficiency evidence khi cả ba repeat đều
609
- resolved ở cả hai surface và có usage/model/thinking tương thích. Nếu baseline
610
- fail nhưng Piagent pass, family vẫn tính vào đủ 18 outcome coverage và được ghi
611
- là candidate-only dominance, nhưng không được đưa vào conditional successful-pair
612
- CI. Để không tạo survivorship bias, report còn tính tổng fresh token của mọi
613
- comparable attempt chia cho số resolved outcome của từng arm; failure-aware ratio
614
- này cũng phải không xấu hơn ngưỡng. Baseline failure vì vậy không làm gate bất
615
- khả thi, đồng thời cũng không biến mất khỏi chi phí đạt kết quả.
963
+ Với production-v1, một family là complete primary efficiency evidence khi có đủ
964
+ ba paired attempt đã định trước, model/thinking tương thích, token bucket đạt
965
+ invariant exact và failed-attempt ledger đầy đủ. Nếu baseline fail nhưng Piagent
966
+ pass, family được ghi candidate-only dominance và vẫn đi vào fixed-workload CI;
967
+ không loại family theo outcome và không chia token cho số outcome. Conditional
968
+ successful-pair CI và fresh-token-per-resolved-outcome vẫn được report để chẩn
969
+ đoán, nhưng có decision role `diagnostic` và không phủ quyết primary production.
970
+
971
+ Suite deep-logic hiện vẫn khai báo `failure-aware-family-ratio`; với contract đó,
972
+ per-resolved family và successful-pair evidence tiếp tục là blocking theo đúng
973
+ behavior legacy đã đóng băng. Không được đổi decision role hậu nghiệm sau khi
974
+ thấy kết quả của một run.
616
975
 
617
976
  Khi release runner bật `--stop-after-failed-pair`, outcome floor chỉ áp dụng cho
618
977
  candidate Piagent. Baseline-only failure vẫn được giữ nguyên trong ledger dưới
@@ -716,12 +1075,18 @@ rollback fixtures; sau đó đọc P0-P6 evidence bằng digest/bounded field. R
716
1075
  phải giữ candidate quality comparison ở `null` cho đến khi có paired
717
1076
  authenticated run mới, và giữ GA blocked nếu cohort, human pilot, Linux, RC
718
1077
  package hoặc release approval còn thiếu. Local test pass không được dùng để
719
- claim production token/cost/quality non-regression.
1078
+ claim production token/intelligence/continuity non-regression; cost, duration và
1079
+ host load của production-v1 vẫn chỉ là diagnostics.
720
1080
 
721
1081
  ## Adaptive model routing là protocol riêng
722
1082
 
723
- Same-model `production-v1` với `raw-pi` là ablation gần nhất để đo causal effect
724
- của harness. So với `codex-cli` chỉ là external-product reference vì tool
1083
+ `raw-pi` chỉ là ablation diagnostic tường minh để điều tra harness và luôn giữ
1084
+ token efficiency ở mức observational; kể cả gắn suite production nó cũng không
1085
+ được phép tạo product/release token claim. Release claim chỉ dùng paired
1086
+ controlled `codex-cli`; riêng production-v1 yêu cầu full suite schema v2 với
1087
+ cận trên 95% `<= 0.60`, và candidate bind vào exact clean Git commit. So với
1088
+ `codex-cli` là
1089
+ external-product reference vì tool
725
1090
  protocol, system context và client accounting khác nhau dù model/thinking được
726
1091
  pin. Không dùng hai report này để claim router chọn model tốt, và không dùng
727
1092
  mixed-model report để claim same-model token saving.