@piagent/platform 1.5.4 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/README.md +9 -8
  3. package/README.vi.md +9 -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 +68 -0
  24. package/benchmarks/production-v1/suite.json +42 -3
  25. package/catalog/capabilities.json +6 -6
  26. package/docs/command-reference-vietnamese.md +6 -6
  27. package/docs/context-engine.md +7 -1
  28. package/docs/distribution-standard.md +7 -7
  29. package/docs/en/architecture.md +1 -0
  30. package/docs/languages.json +4 -4
  31. package/docs/model-options.md +8 -5
  32. package/docs/operator-manual-vietnamese.md +13 -11
  33. package/docs/project-adapters.md +2 -2
  34. package/docs/publishing-for-teams.md +9 -0
  35. package/docs/quality-benchmark.md +271 -62
  36. package/docs/release-install-policy.md +10 -9
  37. package/docs/runtime-policy-design.md +4 -4
  38. package/docs/runtime-quality-baseline.md +13 -6
  39. package/docs/security-threat-model.md +2 -2
  40. package/docs/task-lifecycle-vietnamese.md +2 -2
  41. package/docs/team-onboarding.md +2 -2
  42. package/docs/usage-observability.md +7 -2
  43. package/docs/vi/architecture.md +1 -0
  44. package/docs-site/architecture.html +1 -1
  45. package/docs-site/benchmark.html +1 -1
  46. package/docs-site/commands.html +1 -1
  47. package/docs-site/context-engine.html +1 -1
  48. package/docs-site/en/architecture.html +1 -1
  49. package/docs-site/en/benchmark.html +1 -1
  50. package/docs-site/en/commands.html +1 -1
  51. package/docs-site/en/context-engine.html +1 -1
  52. package/docs-site/en/index.html +1 -1
  53. package/docs-site/en/mcp-approval.html +1 -1
  54. package/docs-site/en/mcp-auth.html +1 -1
  55. package/docs-site/en/mcp-servers.html +1 -1
  56. package/docs-site/en/mcp.html +1 -1
  57. package/docs-site/en/permissions.html +1 -1
  58. package/docs-site/en/profiles.html +1 -1
  59. package/docs-site/en/quickstart.html +1 -1
  60. package/docs-site/en/runtime.html +1 -1
  61. package/docs-site/en/scope.html +1 -1
  62. package/docs-site/en/security.html +1 -1
  63. package/docs-site/en/team.html +1 -1
  64. package/docs-site/en/whats-new.html +1 -1
  65. package/docs-site/en/workflows.html +1 -1
  66. package/docs-site/index.html +1 -1
  67. package/docs-site/mcp-approval.html +1 -1
  68. package/docs-site/mcp-auth.html +1 -1
  69. package/docs-site/mcp-servers.html +1 -1
  70. package/docs-site/mcp.html +1 -1
  71. package/docs-site/permissions.html +1 -1
  72. package/docs-site/profiles.html +1 -1
  73. package/docs-site/quickstart.html +1 -1
  74. package/docs-site/runtime.html +1 -1
  75. package/docs-site/scope.html +1 -1
  76. package/docs-site/security.html +1 -1
  77. package/docs-site/team.html +1 -1
  78. package/docs-site/whats-new.html +1 -1
  79. package/docs-site/workflows.html +1 -1
  80. package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
  81. package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
  82. package/evals/fixtures/piagent-webui/session-live-state-v1.invalid.json +18 -0
  83. package/evals/fixtures/piagent-webui/session-live-state-v1.valid.json +27 -0
  84. package/evals/fs4-readiness-matrix.v1.json +2 -2
  85. package/evals/fs5-causal-arm.v1.json +2 -2
  86. package/evals/fs5-pilot-protocol.v1.json +2 -2
  87. package/evals/fs5-pilot-protocol.v4.json +6 -5
  88. package/evals/fs5-pilot-protocol.v5.json +7 -6
  89. package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
  90. package/package.json +3 -1
  91. package/packages/piagent-core/benchmark/benchmark-assurance.js +4 -1
  92. package/packages/piagent-core/benchmark/benchmark-bootstrap.js +91 -9
  93. package/packages/piagent-core/benchmark/benchmark-claim-restrictions.js +38 -7
  94. package/packages/piagent-core/benchmark/benchmark-cli.js +7 -7
  95. package/packages/piagent-core/benchmark/benchmark-codex.js +3 -1
  96. package/packages/piagent-core/benchmark/benchmark-comparison.js +271 -2
  97. package/packages/piagent-core/benchmark/benchmark-core.js +732 -661
  98. package/packages/piagent-core/benchmark/benchmark-execution-guard.js +7 -5
  99. package/packages/piagent-core/benchmark/benchmark-forensics.js +439 -4
  100. package/packages/piagent-core/benchmark/benchmark-host-readiness.js +639 -0
  101. package/packages/piagent-core/benchmark/benchmark-matrix.js +22 -4
  102. package/packages/piagent-core/benchmark/benchmark-normalized-cost.js +317 -0
  103. package/packages/piagent-core/benchmark/benchmark-preflight.js +3 -1
  104. package/packages/piagent-core/benchmark/benchmark-process.js +6 -5
  105. package/packages/piagent-core/benchmark/benchmark-provider-wire.js +126 -0
  106. package/packages/piagent-core/benchmark/benchmark-record-validation.js +183 -0
  107. package/packages/piagent-core/benchmark/benchmark-report.js +116 -12
  108. package/packages/piagent-core/benchmark/benchmark-resume-recovery.js +14 -0
  109. package/packages/piagent-core/benchmark/benchmark-runner-policy.js +26 -0
  110. package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +782 -0
  111. package/packages/piagent-core/benchmark/benchmark-statistics.js +64 -0
  112. package/packages/piagent-core/benchmark/benchmark-stop-policy.js +8 -5
  113. package/packages/piagent-core/benchmark/benchmark-suite-identity.js +31 -0
  114. package/packages/piagent-core/benchmark/benchmark-suite-runtime.js +13 -9
  115. package/packages/piagent-core/benchmark/benchmark-suite.js +128 -2
  116. package/packages/piagent-core/benchmark/benchmark-summary-support.js +376 -0
  117. package/packages/piagent-core/benchmark/benchmark-timing-diagnostics.js +971 -0
  118. package/packages/piagent-core/benchmark/benchmark-usage.js +311 -0
  119. package/packages/piagent-core/benchmark/benchmark-workflow.js +166 -0
  120. package/packages/piagent-core/docs/context-efficiency-improvement-plan.md +1080 -0
  121. package/packages/piagent-core/extensions/acceptance-contract-semantics.js +83 -69
  122. package/packages/piagent-core/extensions/acceptance-error-classes.js +160 -0
  123. package/packages/piagent-core/extensions/acceptance-executable-evidence.js +12 -9
  124. package/packages/piagent-core/extensions/acceptance-receipt.js +34 -11
  125. package/packages/piagent-core/extensions/acceptance-state-machine-evidence.js +518 -0
  126. package/packages/piagent-core/extensions/acceptance-test-binding-evidence.js +60 -0
  127. package/packages/piagent-core/extensions/context-efficiency-metrics.js +302 -0
  128. package/packages/piagent-core/extensions/context-efficiency-report.js +167 -0
  129. package/packages/piagent-core/extensions/context-engine.js +148 -145
  130. package/packages/piagent-core/extensions/context-evidence.js +48 -0
  131. package/packages/piagent-core/extensions/context-import-links.js +296 -0
  132. package/packages/piagent-core/extensions/context-telemetry-integrity.js +65 -0
  133. package/packages/piagent-core/extensions/criterion-context-pack.js +422 -7
  134. package/packages/piagent-core/extensions/criterion-graph.js +78 -8
  135. package/packages/piagent-core/extensions/guard-types.ts +3 -0
  136. package/packages/piagent-core/extensions/javascript-regex-evidence.js +32 -0
  137. package/packages/piagent-core/extensions/piagent-guard.ts +250 -43
  138. package/packages/piagent-core/extensions/policy-core.js +1 -1
  139. package/packages/piagent-core/extensions/task-contract-view.js +17 -3
  140. package/packages/piagent-core/extensions/task-lifecycle.js +7 -2
  141. package/packages/piagent-core/extensions/task-state.js +40 -134
  142. package/packages/piagent-core/extensions/verification-intelligence.js +3 -1
  143. package/packages/piagent-core/extensions/workspace-evidence-roots.js +157 -0
  144. package/packages/piagent-core/package.json +1 -1
  145. package/packages/piagent-core/policies/base-policy.json +3 -0
  146. package/packages/piagent-core/runtime/context/context-delivery.ts +103 -0
  147. package/packages/piagent-core/runtime/context/context-delta-shadow.ts +53 -0
  148. package/packages/piagent-core/runtime/context/context-efficiency-format.ts +47 -0
  149. package/packages/piagent-core/runtime/context/context-evidence-qualification.ts +32 -0
  150. package/packages/piagent-core/runtime/context/prefix-telemetry.ts +47 -0
  151. package/packages/piagent-core/runtime/context/repository-memory-hints.ts +27 -0
  152. package/packages/piagent-core/runtime/hooks/agent-prompt-telemetry.ts +56 -0
  153. package/packages/piagent-core/runtime/hooks/agent-start-hook.ts +162 -102
  154. package/packages/piagent-core/runtime/hooks/completion-hook.ts +5 -6
  155. package/packages/piagent-core/runtime/hooks/input-hook.ts +11 -1
  156. package/packages/piagent-core/runtime/hooks/session-hooks.ts +22 -2
  157. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +7 -2
  158. package/packages/piagent-core/runtime/hooks/tool-result-content-guards.ts +95 -0
  159. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +84 -102
  160. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +9 -3
  161. package/packages/piagent-core/runtime/inspection/activity-recovery.ts +104 -0
  162. package/packages/piagent-core/runtime/inspection/approval-broker.ts +29 -5
  163. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +1 -1
  164. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +1 -1
  165. package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +53 -0
  166. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +34 -6
  167. package/packages/piagent-core/runtime/model/authenticated-catalog.ts +17 -9
  168. package/packages/piagent-core/runtime/model/openai-codex-reasoning.ts +83 -0
  169. package/packages/piagent-core/runtime/model/provider-wire-fingerprint.ts +238 -0
  170. package/packages/piagent-core/runtime/orchestration/role-policy.ts +1 -1
  171. package/packages/piagent-core/runtime/product/activity-inspector.ts +7 -2
  172. package/packages/piagent-core/runtime/product/efficiency-metrics.ts +4 -2
  173. package/packages/piagent-core/runtime/quality/exact-output-contract.ts +2 -1
  174. package/packages/piagent-core/runtime/quality/performance-assurance-signals.ts +23 -0
  175. package/packages/piagent-core/runtime/quality/performance-assurance.ts +6 -2
  176. package/packages/piagent-core/runtime/recovery/edit-recovery-context.ts +113 -0
  177. package/packages/piagent-core/runtime/recovery/edit-recovery-delivery.ts +42 -0
  178. package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +55 -2
  179. package/packages/piagent-core/runtime/recovery/semantic-repair-runtime.ts +55 -2
  180. package/packages/piagent-core/runtime/registration/context-commands.ts +66 -5
  181. package/packages/piagent-core/runtime/registration/policy-tools.ts +46 -11
  182. package/packages/piagent-core/runtime/registration/task-completion-tools.ts +49 -16
  183. package/packages/piagent-core/runtime/registration/task-start-guidance.ts +163 -0
  184. package/packages/piagent-core/runtime/registration/task-start-retry-helpers.ts +37 -0
  185. package/packages/piagent-core/runtime/registration/task-start-tool.ts +67 -62
  186. package/packages/piagent-core/runtime/session/runtime-state.ts +154 -2
  187. package/packages/piagent-core/runtime/session/system-prompt.ts +4 -4
  188. package/packages/piagent-core/runtime/tools/apply-patch-tool.ts +500 -0
  189. package/packages/piagent-core/runtime/trajectory/trajectory-runtime.ts +2 -1
  190. package/packages/piagent-core/runtime/workflows/task-intake.ts +43 -2
  191. package/packages/piagent-core/security/sensitive-data.js +13 -218
  192. package/packages/piagent-core/security/sensitive-project-file.js +42 -0
  193. package/packages/piagent-core/security/sensitive-source-expression.js +330 -0
  194. package/packages/piagent-core/security/sensitive-source-formats.js +394 -0
  195. package/packages/piagent-core/security/sensitive-text.js +234 -0
  196. package/packages/piagent-core/subagents/piagent-worker.md +1 -1
  197. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-rD9WJKxs.js → MarkdownMessage-CxeZqTte.js} +1 -1
  198. package/packages/piagent-webui/dist/client/assets/index-DynIMe8I.js +176 -0
  199. package/packages/piagent-webui/dist/client/index.html +1 -1
  200. package/packages/piagent-webui/gateway/gateway-events.ts +109 -5
  201. package/packages/piagent-webui/gateway/gateway-service.ts +3 -0
  202. package/packages/piagent-webui/gateway/gateway-session-stream.ts +93 -7
  203. package/packages/piagent-webui/gateway/session-command-controller.ts +18 -3
  204. package/packages/piagent-webui/gateway/session-effective-options.ts +47 -0
  205. package/packages/piagent-webui/gateway/session-live-state.ts +21 -0
  206. package/packages/piagent-webui/gateway/session-operation-start.ts +5 -1
  207. package/packages/piagent-webui/gateway/session-operation-watchdog.ts +158 -0
  208. package/packages/piagent-webui/gateway/session-runtime-factory.ts +45 -0
  209. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +139 -120
  210. package/packages/piagent-webui/server/loopback-server.ts +8 -0
  211. package/packages/piagent-webui/server/transcript-projection.ts +22 -4
  212. package/packages/piagent-webui/shared/text-visibility.ts +10 -0
  213. package/schemas/piagent-webui/catalog-v1.json +9 -0
  214. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +53 -3
  215. package/schemas/piagent-webui/session-live-state-v1.schema.json +76 -0
  216. package/schemas/task-contract.schema.json +12 -1
  217. package/scripts/benchmark-runner-core.mjs +355 -359
  218. package/scripts/benchmark-runner-finalization.mjs +309 -0
  219. package/scripts/benchmark-runner-host-readiness.mjs +94 -0
  220. package/scripts/benchmark-runner-support.mjs +200 -0
  221. package/scripts/benchmark-session.mjs +95 -41
  222. package/scripts/configure-model-scope.sh +4 -3
  223. package/scripts/helper-evaluation.mjs +1 -1
  224. package/scripts/install-global.sh +2 -2
  225. package/scripts/pi-usage-history.mjs +37 -10
  226. package/scripts/piagent-dashboard.mjs +13 -1
  227. package/scripts/setup.sh +2 -2
  228. package/scripts/verify-local.sh +5 -1
  229. package/templates/global/settings.json +2 -1
  230. package/packages/piagent-webui/dist/client/assets/index-BZRFw1u6.js +0 -174
@@ -0,0 +1,123 @@
1
+ Implement the temporal usage-billing close across:
2
+
3
+ - `packages/billing/src/plan-timeline.js`
4
+ - `packages/billing/src/close-period.js`
5
+ - `apps/admin/src/billing-summary.js`
6
+
7
+ The implementation must use only Node's standard library and must never mutate
8
+ caller input. All accepted values are plain JSON values: reject sparse arrays,
9
+ non-finite/unsafe numbers, non-plain object prototypes, accessors, symbol keys,
10
+ unknown fields, and the keys/names `__proto__`, `prototype`, and `constructor`.
11
+ Every rejection must throw `TypeError` before returning any partial result.
12
+
13
+ ## Period and plan timeline
14
+
15
+ `period` contains exactly `{ start, end }`. Both values are canonical ISO-8601
16
+ UTC strings (`new Date(value).toISOString() === value`) and define a non-empty
17
+ half-open interval `[start, end)`.
18
+
19
+ `normalizePlanTimeline(plans, period)` validates and returns a deep-cloned array
20
+ sorted by `tenantId`, `effectiveAt`, then `id`. A plan contains exactly:
21
+
22
+ ```js
23
+ {
24
+ id, tenantId, currency, effectiveAt,
25
+ meters: {
26
+ api: [
27
+ { upTo: 100, unitPriceMicros: 250000 },
28
+ { upTo: null, unitPriceMicros: 500000 }
29
+ ]
30
+ }
31
+ }
32
+ ```
33
+
34
+ - `id`, `tenantId`, and meter names are non-empty trimmed strings and cannot be
35
+ poison names. Plan ids are globally unique. Effective times are unique per
36
+ tenant. A tenant uses one three-letter uppercase currency for its whole
37
+ timeline.
38
+ - `effectiveAt` is canonical ISO UTC. A plan becomes active at that exact
39
+ instant and remains active until the next plan for that tenant.
40
+ - `meters` is a non-empty plain object. Its keys are returned in lexical order.
41
+ Every tier array is dense and non-empty. Each tier contains exactly `upTo`
42
+ and `unitPriceMicros`.
43
+ - `upTo` values are cumulative positive safe-integer boundaries, strictly
44
+ increasing. Exactly the final tier has `upTo: null`. `unitPriceMicros` is a
45
+ non-negative safe integer. One unit price is expressed in one millionth of a
46
+ currency minor unit.
47
+
48
+ ## Usage close
49
+
50
+ `closeUsagePeriod(input)` accepts exactly `{ period, plans, events }`. Events
51
+ have globally unique, non-empty trimmed ids and one of these exact shapes:
52
+
53
+ ```js
54
+ { id, kind: "usage", tenantId, meter, at, units }
55
+ { id, kind: "reversal", tenantId, at, targetId }
56
+ ```
57
+
58
+ Every event time must be canonical and inside the period. `units` is a positive
59
+ safe integer. A reversal must reference an existing usage event for the same
60
+ tenant at or before the reversal time. One usage can be reversed at most once;
61
+ a reversal cannot target another reversal.
62
+
63
+ Resolve all valid reversals before rating, independent of input order. Rate the
64
+ remaining usage in ascending `at`, then `id` order. Select the latest plan whose
65
+ `effectiveAt <= usage.at`. A missing active plan or a meter absent from that plan
66
+ is invalid input: throw `TypeError`; never skip or silently omit that usage. Tier
67
+ consumption is cumulative per `(tenantId, planId, meter)`, so it is isolated
68
+ between tenants and meters and resets on a plan change. One usage event may span
69
+ multiple tiers.
70
+
71
+ Use `BigInt` internally for every multiplication and sum. Do not convert a
72
+ charge through `Number`. Round an invoice from micro-minor units to minor units
73
+ exactly once, at close, using round-half-to-even with divisor `1_000_000`.
74
+
75
+ Return exactly:
76
+
77
+ ```js
78
+ {
79
+ period: { start, end },
80
+ invoices: [{
81
+ tenantId,
82
+ currency,
83
+ lines: [{
84
+ eventId, planId, meter, at, units,
85
+ allocations: [{
86
+ tierIndex, units,
87
+ unitPriceMicros, // decimal string
88
+ chargeMicros // decimal string
89
+ }],
90
+ chargeMicros // decimal string
91
+ }],
92
+ subtotalMicros, // decimal string
93
+ totalMinor, // decimal string
94
+ digest // lowercase SHA-256
95
+ }],
96
+ reversedEventIds
97
+ }
98
+ ```
99
+
100
+ Invoices are ordered by `tenantId`; lines use rating order; allocation order is
101
+ tier order; reversed ids are lexical. Create an invoice only for a tenant with
102
+ at least one non-reversed usage. `digest` is SHA-256 of canonical JSON for the
103
+ invoice without `digest`: object keys recursively sorted and array order kept.
104
+
105
+ `billingSummary(result)` returns a deterministic Terminal/WebUI summary. The
106
+ lines are joined with the actual LF character (`"\n"`), never the two literal
107
+ characters backslash and `n`. The first line is:
108
+
109
+ ```text
110
+ period=<start>..<end>; invoices=<count>; reversed=<count>
111
+ ```
112
+
113
+ Then emit one line per invoice, in result order:
114
+
115
+ ```text
116
+ tenant=<JSON string>; currency=<currency>; lines=<count>; subtotalMicros=<value>; totalMinor=<value>; digest=<digest>
117
+ ```
118
+
119
+ Reject malformed result objects rather than displaying a misleading summary.
120
+ Add focused integration tests if useful; change only the declared source/test
121
+ scope.
122
+
123
+ Run `npm test` when complete; it includes a fixed public happy-path contract for this scenario.
@@ -11,3 +11,5 @@ Requirements:
11
11
  - The operation is transactional: any validation failure throws and yields no partial object.
12
12
 
13
13
  Use Node's standard library only. Add focused tests if useful.
14
+
15
+ Run `npm test` when complete; it includes a fixed public happy-path contract for this scenario.
@@ -1,11 +1,45 @@
1
1
  {
2
- "schemaVersion": 1,
2
+ "schemaVersion": 2,
3
3
  "id": "deep-logic-v1",
4
4
  "title": "Piagent Deep Logic V1",
5
- "description": "Paired current-model tasks with interacting invariants across event reconciliation, scheduling, layered policy, graph context, stream recovery, and transactional configuration.",
5
+ "description": "Paired current-model tasks with interacting invariants across event reconciliation, scheduling, layered policy, graph context, stream recovery, transactional configuration, and temporal usage billing.",
6
6
  "profile": "node-typescript",
7
- "defaultRepeats": 2,
7
+ "defaultRepeats": 3,
8
8
  "timeoutSeconds": 1200,
9
+ "executionContract": {
10
+ "surfaces": ["piagent", "codex-cli"],
11
+ "model": "openai-codex/gpt-5.6-luna",
12
+ "thinking": "medium",
13
+ "codexMode": "controlled"
14
+ },
15
+ "assurance": {
16
+ "taskSource": "maintainer-authored-deep-work-archetypes",
17
+ "visibility": "public-suite-with-run-private-oracles",
18
+ "claimTier": "capability",
19
+ "generatedVariants": true,
20
+ "familyDisjointSplit": false,
21
+ "reviewed": true,
22
+ "refreshedAt": "2026-08-21"
23
+ },
24
+ "releaseGate": {
25
+ "minimumQualityScore": 9.5,
26
+ "minimumSafetyScore": 10,
27
+ "minimumReliabilityScore": 9.5,
28
+ "minimumWorkflowScore": 9.5,
29
+ "minimumCategoryScore": 9.5,
30
+ "minimumOutcomeScoreExclusive": 9.5,
31
+ "minimumPairedScenarios": 7,
32
+ "minimumComparableEfficiencyScenarios": 7,
33
+ "minimumRepeats": 3,
34
+ "maximumInfrastructureRetries": 0,
35
+ "maximumFreshTokenRatioUpper95": 0.8,
36
+ "maximumDurationRatioUpper95": 1.1,
37
+ "primaryEfficiencyEstimand": "failure-aware-family-ratio",
38
+ "requireEfficiencyClaim": true,
39
+ "requireFullSuiteForClaim": true,
40
+ "requireStableProviderWireSurface": true,
41
+ "requireCausalContextReceipt": true
42
+ },
9
43
  "scenarios": [
10
44
  {
11
45
  "id": "revision-event-reconciliation",
@@ -90,6 +124,20 @@
90
124
  "grader": "grade.mjs",
91
125
  "variantGenerator": "variant.mjs",
92
126
  "allowedChanges": ["src/config-transaction.js", "test/**"]
127
+ },
128
+ {
129
+ "id": "temporal-usage-billing-close",
130
+ "title": "Temporal usage billing close with exact audit",
131
+ "kind": "source-change",
132
+ "category": "financial-correctness",
133
+ "difficulty": "large",
134
+ "profile": "fullstack",
135
+ "lifecycle": "cold-start",
136
+ "fixture": "project",
137
+ "prompt": "prompts/temporal-usage-billing-close.md",
138
+ "grader": "grade.mjs",
139
+ "variantGenerator": "variant.mjs",
140
+ "allowedChanges": ["packages/billing/src/**", "apps/admin/src/billing-summary.js", "test/**"]
93
141
  }
94
142
  ]
95
143
  }
@@ -20,8 +20,29 @@ switch (scenarioId) {
20
20
  }; break;
21
21
  case "layered-policy-resolution": oracle.graderData = { protectedPath: `private/${token("vault")}/secret.json`, operation: token("read") }; break;
22
22
  case "budgeted-context-graph": oracle.graderData = { term: token("resolver"), budget: integer(8, 14) }; break;
23
- case "resumable-stream-assembly": oracle.graderData = { first: token("hello"), second: token("world"), message: token("message") }; break;
23
+ case "resumable-stream-assembly": {
24
+ const astral = ["🙂", "🧠", "🚀"][integer(0, 2)];
25
+ oracle.graderData = {
26
+ first: token("hello"),
27
+ second: token("world"),
28
+ third: token("chunk"),
29
+ message: token("message"),
30
+ other: token("message"),
31
+ start: integer(2, 24),
32
+ astral
33
+ };
34
+ break;
35
+ }
24
36
  case "transactional-config-merge": oracle.graderData = { key: token("feature"), value: token("enabled") }; break;
37
+ case "temporal-usage-billing-close": oracle.graderData = {
38
+ tenantA: token("tenant"),
39
+ tenantB: token("tenant"),
40
+ meter: token("meter"),
41
+ plans: [token("plan"), token("plan"), token("plan")],
42
+ firstLimit: integer(4, 12),
43
+ secondLimit: integer(15, 28),
44
+ prices: [integer(110_000, 390_000), integer(410_000, 790_000), integer(810_000, 1_250_000)]
45
+ }; break;
25
46
  default: throw new Error(`unsupported deep logic scenario ${scenarioId}`);
26
47
  }
27
48
 
@@ -0,0 +1,68 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "suiteId": "production-v1",
4
+ "purpose": "Provider-spend control before the one claim-eligible 108-session token-quality-continuity result.",
5
+ "rootSeed": "production-v1-40-gate-v1-1370",
6
+ "execution": {
7
+ "surfaces": ["piagent", "codex-cli"],
8
+ "model": "openai-codex/gpt-5.6-luna",
9
+ "thinking": "medium",
10
+ "repeats": 3,
11
+ "infrastructureRetries": 0,
12
+ "stopAfterFailedPair": true
13
+ },
14
+ "stages": [
15
+ { "id": "S0", "cumulativeSessions": 0, "newSessions": 0, "mode": "preflight-only", "claimEligible": false },
16
+ { "id": "S12", "cumulativeSessions": 12, "newSessions": 12, "mode": "execute-and-pause", "claimEligible": false },
17
+ { "id": "S36", "cumulativeSessions": 36, "newSessions": 24, "mode": "resume-and-pause", "claimEligible": false },
18
+ { "id": "S72", "cumulativeSessions": 72, "newSessions": 36, "mode": "resume-and-pause", "claimEligible": false },
19
+ { "id": "S108", "cumulativeSessions": 108, "newSessions": 36, "mode": "resume-and-finalize", "claimEligible": true }
20
+ ],
21
+ "earlyDetection": {
22
+ "expectedFirstRepeatScenarioIds": [
23
+ "cli-double-dash",
24
+ "destructive-history-refusal",
25
+ "tenant-role-authorization",
26
+ "expiry-boundary",
27
+ "quoted-csv",
28
+ "unicode-search"
29
+ ],
30
+ "requiredCategoryCoverage": ["backend", "frontend", "data", "platform", "reliability", "security"],
31
+ "requiredLifecycleCoverage": ["steady-state", "cold-start"],
32
+ "requiredDifficultyCoverage": ["small", "medium", "large"]
33
+ },
34
+ "enforcement": {
35
+ "runnerConsumesThisArtifact": true,
36
+ "runnerBindsFrozenSeedAndExecution": true,
37
+ "runnerWritesAtomicPrivateStageDiagnostic": true,
38
+ "runnerBlocksProductionResumeWhenStageDiagnosticFails": true,
39
+ "durableStageStateSurvivesMissingPauseMarker": true,
40
+ "completeLedgerFinalizesWithoutProviderPreflight": true,
41
+ "stageDiagnosticArtifact": "stage-diagnostic.json",
42
+ "automaticTerminalOrAbortRules": [
43
+ "dirty-release-source-before-auth-tool-or-provider-preflight",
44
+ "piagent-unresolved-or-outcome-score-at-or-below-floor-via-stop-after-failed-pair",
45
+ "infrastructure-error-or-unknown-provider-attempt-usage-via-runner-abort",
46
+ "candidate-provenance-drift-via-execution-guard"
47
+ ],
48
+ "stageAdvanceRules": [
49
+ "clean-release-source",
50
+ "no-baseline-pass-piagent-fail",
51
+ "no-observed-paired-grade-regression",
52
+ "all-observed-piagent-outcomes-remain-above-the-release-floor",
53
+ "no-model-thinking-or-provider-wire-parity-drift",
54
+ "complete-privacy-safe-causal-context-receipt-with-closed-session-lifecycle",
55
+ "no-accepted-usage-completeness-failure",
56
+ "no-infrastructure-retry",
57
+ "no-unknown-provider-attempt-usage"
58
+ ],
59
+ "nonBlockingDiagnostics": [
60
+ "intermediate-fresh-token-ratios",
61
+ "normalized-api-equivalent-text-token-cost",
62
+ "duration",
63
+ "host-load"
64
+ ],
65
+ "operatorRule": "The commands pass this artifact's frozen values explicitly. After every production-v1 pause, resume recomputes the provider-free quality and continuity gate from the accepted ledger. Intermediate token, cost, duration, and host-load measurements are diagnostic only; only the complete S108 ledger may decide the fresh-token claim."
66
+ },
67
+ "claimBoundary": "Only S108 may be evaluated for the production-v1 fresh-token public-regression claim; S0, S12, S36 and S72 are spend-control diagnostics. Duration, host load, and normalized cost are reported but cannot block or support this claim."
68
+ }
@@ -6,6 +6,38 @@
6
6
  "profile": "node-typescript",
7
7
  "defaultRepeats": 3,
8
8
  "timeoutSeconds": 900,
9
+ "executionContract": {
10
+ "surfaces": ["piagent", "codex-cli"],
11
+ "model": "openai-codex/gpt-5.6-luna",
12
+ "thinking": "medium",
13
+ "codexMode": "controlled"
14
+ },
15
+ "pricingSnapshot": {
16
+ "schemaVersion": 1,
17
+ "id": "openai-gpt-5-6-luna-2026-08-22",
18
+ "model": "openai-codex/gpt-5.6-luna",
19
+ "currency": "USD",
20
+ "unitTokens": 1000000,
21
+ "rates": {
22
+ "freshInput": 0.2,
23
+ "cachedInput": 0.02,
24
+ "output": 1.2
25
+ },
26
+ "cacheWrite": {
27
+ "basis": "fresh-input",
28
+ "multiplier": 1.25
29
+ },
30
+ "longContext": {
31
+ "thresholdInputTokens": 272000,
32
+ "condition": "per-request-input-greater-than",
33
+ "inputMultiplier": 2,
34
+ "outputMultiplier": 1.5
35
+ },
36
+ "source": {
37
+ "url": "https://developers.openai.com/api/docs/models/gpt-5.6-luna",
38
+ "retrievedAt": "2026-08-22"
39
+ }
40
+ },
9
41
  "assurance": {
10
42
  "taskSource": "maintainer-authored-production-archetypes",
11
43
  "visibility": "public-suite-with-run-private-oracles",
@@ -23,10 +55,17 @@
23
55
  "minimumCategoryScore": 9.5,
24
56
  "minimumOutcomeScoreExclusive": 9.5,
25
57
  "minimumPairedScenarios": 18,
26
- "minimumComparableEfficiencyScenarios": 12,
58
+ "minimumComparableEfficiencyScenarios": 18,
27
59
  "minimumRepeats": 3,
28
- "maximumFreshTokenRatioUpper95": 1,
29
- "requireEfficiencyClaim": true
60
+ "maximumInfrastructureRetries": 0,
61
+ "primaryEfficiencyEstimand": "fixed-workload-family-ratio",
62
+ "maximumFreshTokenRatioUpper95": 0.6,
63
+ "requireEfficiencyClaim": true,
64
+ "requireNormalizedCostClaim": false,
65
+ "requireHostReadinessForClaim": false,
66
+ "requireFullSuiteForClaim": true,
67
+ "requireStableProviderWireSurface": true,
68
+ "requireCausalContextReceipt": true
30
69
  },
31
70
  "scenarios": [
32
71
  {
@@ -26,8 +26,8 @@
26
26
  "path": "evals/scenarios/capability-resolution.json"
27
27
  },
28
28
  {
29
- "byteSize": 6232,
30
- "digest": "sha256:a2c44a910a440e972579c2a2ec372ee15cfb73b63b27d01c1e3a053c176d11bf",
29
+ "byteSize": 6350,
30
+ "digest": "sha256:3e0f3a94bd3a19df8c24c3e234078d6c3edc664b20a7a4838919450f4225ffca",
31
31
  "id": "base-policy",
32
32
  "kind": "policies",
33
33
  "path": "packages/piagent-core/policies/base-policy.json"
@@ -103,8 +103,8 @@
103
103
  "path": "packages/piagent-core/subagents/piagent-scout.md"
104
104
  },
105
105
  {
106
- "byteSize": 2146,
107
- "digest": "sha256:e8e18e1ef3a43db2acd559c40a99b31d8cd994cbfaaf1adc5ef9d2cc5e3721a6",
106
+ "byteSize": 2159,
107
+ "digest": "sha256:3e0b7071c80f471fb7ea67f91477c1f5e6d3f2574db492c3a9fae6788374a95d",
108
108
  "id": "piagent-worker",
109
109
  "kind": "subagents",
110
110
  "path": "packages/piagent-core/subagents/piagent-worker.md"
@@ -151,8 +151,8 @@
151
151
  },
152
152
  "artifacts": [
153
153
  {
154
- "byteSize": 1950,
155
- "digest": "sha256:84ac29dcbe0c692070be302707424ea16130a5938cff309c5d7755204b6c2dc1",
154
+ "byteSize": 2378,
155
+ "digest": "sha256:35d6757d0a8d2f8644b967fe82645fba3de430b53f23b5577c2e5e104dcccdc1",
156
156
  "id": "web-frontend",
157
157
  "kind": "adapters",
158
158
  "path": "adapters/web-frontend/profile.json"
@@ -502,8 +502,8 @@ Các lệnh này chạy ngoài Pi.
502
502
  | Command | Dùng khi nào |
503
503
  |---|---|
504
504
  | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1` | Cài Pi CLI tương thích với release hiện tại. |
505
- | `npm install -g --ignore-scripts @piagent/platform@1.5.4` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
506
- | `pi install git:github.com/Vt-mmm/piagent@v1.5.4` | Cài pinned release khi cần reproducible team setup. |
505
+ | `npm install -g --ignore-scripts @piagent/platform@1.6.0` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
506
+ | `pi install git:github.com/Vt-mmm/piagent@v1.6.0` | Cài pinned release khi cần reproducible team setup. |
507
507
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
508
508
  | `piagent-update --check` | Báo version hiện tại vs version sẽ lên cho cả ba thành phần; không cài gì. |
509
509
  | `piagent-update` | Full update global một lệnh cho cả máy: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. |
@@ -547,17 +547,17 @@ Các lệnh này chạy ngoài Pi.
547
547
  | `piagent-uninstall --apply` | Gỡ Pi package của platform khỏi Pi settings global. |
548
548
  | `piagent-uninstall --apply --with-addons --with-host` | Gỡ thêm pi-mcp-adapter, pi-subagents, pi-web-access và Pi host. |
549
549
  | `piagent-uninstall --apply --project /path/to/project` | Gỡ thêm state của platform trong project: profile, lock, `piagent-state/`. |
550
- | `piagent-benchmark` | Chạy smoke suite `core-v1`: paired Raw Pi/Piagent, 24 session, hidden grader + scope + workflow + exact usage. |
550
+ | `piagent-benchmark` | Chạy smoke suite `core-v1`: paired Piagent/controlled `codex-cli` bằng Luna/medium, 24 session, hidden grader + scope + workflow + exact usage. |
551
551
  | `piagent-benchmark --dry-run` | Validate suite và xem số model session, không gọi model. |
552
- | `npm run benchmark:deep -- --dry-run` | Validate `deep-logic-v1`: 6 family difficulty large x 2 repeat x Piagent/`codex-cli` = 24 session, pin Luna/medium và chưa dùng quota. |
553
- | `npm run benchmark:deep` | Chạy paired deep-logic benchmark Luna/medium cho event/state, scheduler, policy, context graph, stream recovery và transactional config. |
552
+ | `npm run benchmark:deep -- --dry-run` | Validate `deep-logic-v1`: 7 family difficulty large × 3 repeat × Piagent/`codex-cli` = 42 session, khóa Luna/medium và chưa dùng quota. |
553
+ | `npm run benchmark:deep` | Chạy paired deep-logic benchmark Luna/medium cho event/state, scheduler, policy, context graph, stream recovery, transactional config và temporal usage billing chính xác. |
554
554
  | `piagent-benchmark --production --dry-run` | Xem ma trận production 18 family x 3 variant x 2 surface = 108 session, chưa dùng quota. |
555
555
  | `piagent-benchmark --production --surfaces piagent,codex-cli --model <provider/model> --thinking high --piagent-treatment candidate` | Chạy production release gate đa domain/profile/lifecycle với controlled Codex, treatment Piagent đã pin, paired outcome và 95% token-ratio confidence. |
556
556
  | `piagent-benchmark --piagent-treatment release-defaults\|local-safe\|candidate\|feature-off ...` | Pin treatment Piagent; chỉ surface `piagent` nhận feature env, manifest/resume/replay/report giữ nguyên treatment. |
557
557
  | `piagent-benchmark --codex-mode native ...` | Đo UX Codex theo cấu hình operator; protocol gate fail closed nên report không được claim tiết kiệm token. |
558
558
  | `piagent-benchmark --production --seed <value> ...` | Tái lập đúng generated variant của một production report riêng tư. |
559
559
  | `piagent-benchmark --production --scenarios <id,id> --repeats 1 ...` | Chẩn đoán family/rubric đã chọn; không đủ điều kiện nhận production verdict. |
560
- | `piagent-benchmark --production --infrastructure-retries 2 ...` | Retry đúng lỗi process chết trước usage; timeout/task failure không retry và vẫn chấm reliability. |
560
+ | `piagent-benchmark --production --infrastructure-retries 2 ...` | Diagnostic recovery run; retry chỉ áp lỗi process chết trước usage, được report đầy đủ và làm production claim fail. |
561
561
  | `piagent-benchmark --production --retry-delay 60 ...` | Đặt backoff trước infrastructure retry; production mặc định 60 giây. |
562
562
  | `bash scripts/verify-local.sh` | Verify repo platform trước khi commit/tag. |
563
563
  | `bash scripts/verify-local.sh --offline` | Verify trong CI/máy sạch, bỏ qua local Pi model catalog. |
@@ -46,6 +46,10 @@ task
46
46
  - Telemetry không lưu prompt hoặc tool output thô. Nó lưu hash, kích thước, tool,
47
47
  model, thinking, active-tool count, usage, retrieval confidence và đường dẫn
48
48
  tương đối đã được guard redaction.
49
+ - Mỗi telemetry row có provenance envelope do writer đóng sau payload; event
50
+ không thể ghi đè schema/provenance. Nếu source snapshot phải redact, receipt
51
+ chỉ giữ `sanitizedContentDigest` và `fileContentHash` trên nội dung đã sanitize;
52
+ raw-content digest không được tính hoặc lưu.
49
53
 
50
54
  Bốn cơ chế `PIAGENT_DYNAMIC_TOOLS`, `PIAGENT_AUTO_CONTEXT`,
51
55
  `PIAGENT_CONTEXT_TELEMETRY` và `PIAGENT_AUTO_RECOVERY` đều **bật mặc định**.
@@ -180,7 +184,9 @@ không bị trừ điểm. `contextSelections`, `contextSelectionsUsed` và
180
184
  ranking. Runtime chỉ đọc phần đuôi telemetry có giới hạn khi tính report hoặc
181
185
  feedback, nên lịch sử dài không làm chậm từng prompt theo thời gian.
182
186
 
183
- `contextWasteScore` nằm trong khoảng `0..100`, thấp hơn là tốt hơn:
187
+ Khi toàn bộ evidence lane đầy đủ, `contextWasteScore` nằm trong khoảng `0..100`,
188
+ thấp hơn là tốt hơn. Nếu coverage chưa đầy đủ, score chính là `null` và chỉ
189
+ `contextWasteScoreEstimate` được giữ như chẩn đoán partial:
184
190
 
185
191
  ```text
186
192
  30% duplicate read rate
@@ -15,9 +15,9 @@ Repo này phải chạy được cho nhiều project/domain khác nhau. Vì vậ
15
15
 
16
16
  | Use case | Package source |
17
17
  |---|---|
18
- | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.5.4` |
18
+ | Team pinned release | `git:github.com/Vt-mmm/piagent@v1.6.0` |
19
19
  | Personal/sandbox dev | `git:github.com/Vt-mmm/piagent` |
20
- | Registry distribution | `npm:@piagent/platform@1.5.4` |
20
+ | Registry distribution | `npm:@piagent/platform@1.6.0` |
21
21
  | Enterprise npm (fork under another scope) | `npm:@your-scope/platform@x.y.z` |
22
22
  | Local platform dev | `/path/to/piagent` |
23
23
 
@@ -27,7 +27,7 @@ Latest tiện cho máy cá nhân muốn nhận cập nhật nhanh. Pin tag/commi
27
27
 
28
28
  | Channel | Command | Target | Policy |
29
29
  |---|---|---|---|
30
- | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.5.4` | Install the Pi package matching the helper. |
30
+ | `stable` | `bash scripts/install-global.sh --stable` | Helper release tag resolved to commit SHA, currently `v1.6.0` | Install the Pi package matching the helper. |
31
31
  | `exact` | `bash scripts/install-global.sh --version vX.Y.Z --resolve-tag` | Requested tag resolved to commit SHA | Pi-package-only rollout, rollback, and incident recovery. |
32
32
  | `dev` | `bash scripts/install-global.sh --dev` | Moving Git source | Personal/sandbox only; do not commit into project settings. |
33
33
  | `local` | `bash scripts/install-global.sh --local` | Current checkout path | Platform development only. |
@@ -54,7 +54,7 @@ Root `package.json` có `pi` manifest trỏ tới:
54
54
  Do đó team có thể:
55
55
 
56
56
  ```bash
57
- pi install git:github.com/Vt-mmm/piagent@v1.5.4
57
+ pi install git:github.com/Vt-mmm/piagent@v1.6.0
58
58
  ```
59
59
 
60
60
  Không cần biết internal folder `packages/piagent-core`. Source không pin chỉ dành cho personal/sandbox như bảng channel ở trên.
@@ -66,12 +66,12 @@ Team nên install global package một lần:
66
66
  ```bash
67
67
  node --version # >= 22.19.0
68
68
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.84.1
69
- npm install -g --ignore-scripts @piagent/platform@1.5.4
69
+ npm install -g --ignore-scripts @piagent/platform@1.6.0
70
70
  piagent-install --stable --dry-run
71
71
  piagent-install --stable
72
72
  ```
73
73
 
74
- `pi install git:github.com/Vt-mmm/piagent@v1.5.4` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.5.4`.
74
+ `pi install git:github.com/Vt-mmm/piagent@v1.6.0` vẫn hợp lệ nếu chỉ cần cài Pi package. Lệnh đó không tự tạo các binary terminal `piagent-*`; muốn có helper global thì dùng `npm install -g --ignore-scripts @piagent/platform@1.6.0`.
75
75
 
76
76
  Support matrix hiện tại: macOS Apple Silicon + Bash và Linux x64 + Bash đã được verify; macOS Intel + Bash và Linux ARM64 + Bash là supported target cần chạy smoke trước rollout; native Windows chưa phải target rollout team; WSL2 experimental. Chi tiết và version runtime nằm trong [release/install policy](release-install-policy.md).
77
77
 
@@ -121,7 +121,7 @@ Nếu muốn commit sẵn `.pi/piagent-profile.json` vào repo hoặc bootstrap
121
121
  ```bash
122
122
  bash scripts/setup.sh /path/to/project \
123
123
  --profile be-readonly-fe \
124
- --package-source git:github.com/Vt-mmm/piagent@v1.5.4 \
124
+ --package-source git:github.com/Vt-mmm/piagent@v1.6.0 \
125
125
  --mcp-preset core \
126
126
  --subagents-preset safe
127
127
  ```
@@ -44,6 +44,7 @@ The machine-readable rule is `architecture/layers.json`; `npm run architecture:c
44
44
  | Security foundation | `packages/piagent-core/security/` | Sensitive-data primitives | Workflow behavior |
45
45
  | Benchmark | `packages/piagent-core/benchmark/`, `benchmarks/` | Suite validation, scoring, evidence | Runtime enforcement |
46
46
  | WebUI contracts | `packages/piagent-webui/contracts/` | Wire types shared by browser and server | Any runtime behavior; it depends on nothing |
47
+ | WebUI shared | `packages/piagent-webui/shared/` | Dependency-free deterministic helpers shared by browser, server, and gateway | Browser state, transport, filesystem access, or runtime policy |
47
48
  | WebUI client | `packages/piagent-webui/client/` | Browser views, view models, UI preferences | Server state, filesystem, Pi APIs |
48
49
  | WebUI server | `packages/piagent-webui/server/` | HTTP/WS endpoints, session reads, diff assembly | Browser rendering; it may not import the client |
49
50
  | WebUI extension | `packages/piagent-webui/extension/` | The in-Pi `/piagent-webui` command surface | Wire types the client also needs |
@@ -21,8 +21,8 @@
21
21
  "en": "README.md",
22
22
  "vi": "README.vi.md",
23
23
  "consistentAt": {
24
- "en": "3d9082674ded9179175a10bb86a4a1c922faa269",
25
- "vi": "5c396247582381eafe741042fc4259982a527381"
24
+ "en": "c2b6f830977bff9eff7ebdc97f1aa15502ce3e2c",
25
+ "vi": "a6533b41f285b3dc05a594e21cc208ca28b5569b"
26
26
  }
27
27
  },
28
28
  {
@@ -39,8 +39,8 @@
39
39
  "en": "docs/en/architecture.md",
40
40
  "vi": "docs/vi/architecture.md",
41
41
  "consistentAt": {
42
- "en": "5bcb0aa311b360408ca73425744baee71e740a9b",
43
- "vi": "b613cec25fa1737636121c11cb2c5aecb2e00375"
42
+ "en": "7902186a3bf9cc8c344bd27ea352cf4a6d5eae2a",
43
+ "vi": "64575dc18be0167324bfba396d7162c74af28048"
44
44
  }
45
45
  },
46
46
  {
@@ -54,7 +54,10 @@ Shift+Ctrl+P # cycle ngược
54
54
  Shift+Tab # cycle thinking level
55
55
  ```
56
56
 
57
- Global setup của repo sẽ seed `enabledModels` vào `~/.pi/agent/settings.json`, nên sau OAuth anh chọn/đổi model bằng option selector của Pi.
57
+ Global setup của repo sẽ seed các preset đã kiểm chứng và một catch-all
58
+ `openai-codex/*` vào `~/.pi/agent/settings.json`. Vì các preset đứng trước glob,
59
+ chúng giữ thinking level khuyến nghị; model Codex mới trong authenticated catalog
60
+ vẫn tự xuất hiện trong scope mà không cần chờ Piagent phát hành lại.
58
61
 
59
62
  ## Kiểm tra model hiện có
60
63
 
@@ -97,7 +100,7 @@ off, minimal, low, medium, high, xhigh, max
97
100
  Không phải model nào cũng hỗ trợ mọi level. Pi sẽ clamp theo capability của model. Cách chọn:
98
101
 
99
102
  ```bash
100
- pi --model openai-codex/gpt-5.5:high
103
+ pi --model openai-codex/gpt-5.6-sol:high
101
104
  pi --model anthropic/claude-sonnet-5:xhigh
102
105
  pi --thinking medium
103
106
  ```
@@ -113,7 +116,7 @@ pi --thinking medium
113
116
  | `openai-codex/gpt-5.3-codex-spark` | fast scout | hỏi nhanh, thao tác nhỏ, chi phí thấp |
114
117
  | `openai-codex/gpt-5.4-mini` | fast/cheap | scout nhẹ, docs, simple fix |
115
118
  | `openai-codex/gpt-5.4` | balanced | task bình thường |
116
- | `openai-codex/gpt-5.5` | balanced/hard default | default mạnh cho implement |
119
+ | `openai-codex/gpt-5.5` | balanced/hard | model thế hệ trước vẫn được hỗ trợ khi có trong authenticated catalog |
117
120
  | `openai-codex/gpt-5.6-luna` | cost-sensitive/high-volume | workload nhanh, nhiều lượt, ưu tiên latency và chi phí |
118
121
  | `openai-codex/gpt-5.6-terra` | balanced | công việc hằng ngày cần cân bằng capability, speed và cost |
119
122
  | `openai-codex/gpt-5.6-sol` | frontier/quality-first | task phức tạp, long-horizon hoặc cần chất lượng cao nhất |
@@ -143,7 +146,7 @@ available nào trong authenticated provider catalog.
143
146
  | Preset | Model OpenAI Codex | Model Claude (Anthropic) | Khi dùng |
144
147
  |---|---|---|---|
145
148
  | Fast scout | `openai-codex/gpt-5.4-mini:low` | `anthropic/claude-haiku-4-5:low` | đọc nhanh, hỏi đáp, grep/scout nhẹ |
146
- | Balanced implement | `openai-codex/gpt-5.5:medium` | `anthropic/claude-sonnet-5:medium` | task source bình thường |
149
+ | Balanced implement | `openai-codex/gpt-5.6-terra:medium` | `anthropic/claude-sonnet-5:medium` | task source bình thường |
147
150
  | Cost-sensitive volume | `openai-codex/gpt-5.6-luna:medium` | `anthropic/claude-haiku-4-5:low` | workload nhanh, nhiều lượt; đo quality gate trước khi promote |
148
151
  | Balanced implement | `openai-codex/gpt-5.6-terra:high` hoặc `openai-codex/gpt-5.5:high` | `anthropic/claude-sonnet-5:high` | task source hằng ngày, cân bằng capability/cost |
149
152
  | Frontier/quality-first | `openai-codex/gpt-5.6-sol:high` | `anthropic/claude-opus-4-7:xhigh` hoặc `anthropic/claude-opus-4-8:xhigh` | architecture, long-horizon, high-risk review |
@@ -155,7 +158,7 @@ Tên model có thể đổi theo Pi model catalog. Khi không chắc, ưu tiên
155
158
  Global setup mặc định:
156
159
 
157
160
  ```bash
158
- piagent-model-scope --preset full --default-model openai-codex/gpt-5.5:high
161
+ piagent-model-scope --preset full --default-model openai-codex/gpt-5.6-sol:high
159
162
  ```
160
163
 
161
164
  Scope này ghi vào settings: