@piagent/platform 1.6.0 → 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 (213) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +17 -14
  3. package/README.vi.md +26 -1
  4. package/benchmarks/production-v1/spend-control.v1.json +27 -3
  5. package/benchmarks/production-v1/suite.json +5 -1
  6. package/catalog/capabilities.json +16 -16
  7. package/docs/authority-manifest.md +1 -1
  8. package/docs/auto-delegation-policy.md +38 -73
  9. package/docs/command-reference-vietnamese.md +23 -31
  10. package/docs/context-engine.md +5 -3
  11. package/docs/context-window-policy.md +37 -1
  12. package/docs/distribution-standard.md +7 -7
  13. package/docs/en/architecture.md +26 -13
  14. package/docs/languages.json +4 -4
  15. package/docs/operator-manual-vietnamese.md +21 -41
  16. package/docs/publishing-for-teams.md +5 -0
  17. package/docs/quality-benchmark.md +179 -23
  18. package/docs/release-install-policy.md +6 -6
  19. package/docs/runtime-harness-standard.md +3 -3
  20. package/docs/security-threat-model.md +1 -1
  21. package/docs/subagent-orchestration-capabilities.md +19 -51
  22. package/docs/subagents-and-multiagent.md +21 -47
  23. package/docs/task-implementation-contract.md +3 -3
  24. package/docs/task-lifecycle-vietnamese.md +1 -1
  25. package/docs/team-onboarding.md +2 -2
  26. package/docs/vi/architecture.md +26 -13
  27. package/docs-site/architecture.html +1 -1
  28. package/docs-site/benchmark.html +89 -95
  29. package/docs-site/commands.html +1 -1
  30. package/docs-site/content/benchmark.html +88 -94
  31. package/docs-site/content/en/benchmark.html +134 -90
  32. package/docs-site/content/en/index.html +19 -19
  33. package/docs-site/content/en/runtime.html +4 -4
  34. package/docs-site/content/en/whats-new.html +12 -1
  35. package/docs-site/content/en/workflows.html +2 -2
  36. package/docs-site/content/index.html +19 -19
  37. package/docs-site/content/runtime.html +4 -4
  38. package/docs-site/content/whats-new.html +12 -1
  39. package/docs-site/content/workflows.html +2 -2
  40. package/docs-site/context-engine.html +1 -1
  41. package/docs-site/en/architecture.html +1 -1
  42. package/docs-site/en/benchmark.html +135 -91
  43. package/docs-site/en/commands.html +1 -1
  44. package/docs-site/en/context-engine.html +1 -1
  45. package/docs-site/en/index.html +20 -20
  46. package/docs-site/en/mcp-approval.html +1 -1
  47. package/docs-site/en/mcp-auth.html +1 -1
  48. package/docs-site/en/mcp-servers.html +1 -1
  49. package/docs-site/en/mcp.html +1 -1
  50. package/docs-site/en/permissions.html +1 -1
  51. package/docs-site/en/profiles.html +1 -1
  52. package/docs-site/en/quickstart.html +1 -1
  53. package/docs-site/en/runtime.html +5 -5
  54. package/docs-site/en/scope.html +1 -1
  55. package/docs-site/en/security.html +1 -1
  56. package/docs-site/en/team.html +1 -1
  57. package/docs-site/en/whats-new.html +13 -2
  58. package/docs-site/en/workflows.html +3 -3
  59. package/docs-site/index.html +20 -20
  60. package/docs-site/mcp-approval.html +1 -1
  61. package/docs-site/mcp-auth.html +1 -1
  62. package/docs-site/mcp-servers.html +1 -1
  63. package/docs-site/mcp.html +1 -1
  64. package/docs-site/permissions.html +1 -1
  65. package/docs-site/profiles.html +1 -1
  66. package/docs-site/quickstart.html +1 -1
  67. package/docs-site/runtime.html +5 -5
  68. package/docs-site/scope.html +1 -1
  69. package/docs-site/security.html +1 -1
  70. package/docs-site/team.html +1 -1
  71. package/docs-site/whats-new.html +13 -2
  72. package/docs-site/workflows.html +3 -3
  73. package/evals/fixtures/benchmark-assurance-evidence.invalid.json +1 -1
  74. package/evals/fixtures/benchmark-assurance-evidence.valid.json +1 -1
  75. package/evals/fixtures/codex-relative-efficiency-v1.invalid.json +4 -0
  76. package/evals/fixtures/codex-relative-efficiency-v1.valid.json +94 -0
  77. package/evals/fixtures/helper-request.invalid.json +1 -1
  78. package/evals/fixtures/helper-request.valid.json +1 -1
  79. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +7 -0
  80. package/evals/fixtures/task-authority-snapshot.valid.json +4 -4
  81. package/evals/fs4-readiness-matrix.v1.json +2 -2
  82. package/evals/fs5-causal-arm.v1.json +2 -2
  83. package/evals/fs5-pilot-protocol.v1.json +3 -3
  84. package/evals/fs5-pilot-protocol.v2.json +8 -8
  85. package/evals/fs5-pilot-protocol.v3.json +8 -8
  86. package/evals/fs5-pilot-protocol.v4.json +6 -6
  87. package/evals/fs5-pilot-protocol.v5.json +7 -6
  88. package/evals/private-holdout-v1/public-exposure.v1.json +1 -1
  89. package/evals/runtime-conformance-v1/README.md +43 -0
  90. package/evals/runtime-conformance-v1/evaluate-paid-canary.mjs +198 -0
  91. package/evals/runtime-conformance-v1/lane.json +57 -0
  92. package/evals/runtime-conformance-v1/paid-canary.json +31 -0
  93. package/evals/runtime-conformance-v1/runner.mjs +456 -0
  94. package/package.json +1 -1
  95. package/packages/piagent-core/README.md +13 -4
  96. package/packages/piagent-core/benchmark/benchmark-codex-relative-efficiency.js +698 -0
  97. package/packages/piagent-core/benchmark/benchmark-core.js +4 -3
  98. package/packages/piagent-core/benchmark/benchmark-forensics.js +4 -2
  99. package/packages/piagent-core/benchmark/benchmark-preflight.js +3 -1
  100. package/packages/piagent-core/benchmark/benchmark-provider-free-evidence.js +345 -0
  101. package/packages/piagent-core/benchmark/benchmark-record-validation.js +74 -5
  102. package/packages/piagent-core/benchmark/benchmark-report.js +15 -1
  103. package/packages/piagent-core/benchmark/benchmark-runtime-causal.js +244 -0
  104. package/packages/piagent-core/benchmark/benchmark-stage-diagnostic.js +201 -4
  105. package/packages/piagent-core/benchmark/benchmark-suite.js +22 -1
  106. package/packages/piagent-core/benchmark/benchmark-summary-support.js +4 -0
  107. package/packages/piagent-core/benchmark/benchmark-usage.js +15 -4
  108. package/packages/piagent-core/capabilities/runtime-integrity.js +3 -0
  109. package/packages/piagent-core/extensions/acceptance-behavior-proof.js +806 -0
  110. package/packages/piagent-core/extensions/acceptance-receipt.js +89 -48
  111. package/packages/piagent-core/extensions/context-engine.js +1 -11
  112. package/packages/piagent-core/extensions/context-index-policy.js +4 -0
  113. package/packages/piagent-core/extensions/context-query-paths.js +57 -0
  114. package/packages/piagent-core/extensions/criterion-context-pack.js +16 -3
  115. package/packages/piagent-core/extensions/criterion-graph.js +4 -1
  116. package/packages/piagent-core/extensions/fallback-base-policy.ts +101 -0
  117. package/packages/piagent-core/extensions/guard-types.ts +4 -0
  118. package/packages/piagent-core/extensions/piagent-guard.ts +194 -226
  119. package/packages/piagent-core/extensions/task-lifecycle.js +32 -0
  120. package/packages/piagent-core/extensions/task-state.js +69 -8
  121. package/packages/piagent-core/extensions/verification-intelligence.js +49 -12
  122. package/packages/piagent-core/extensions/workspace-evidence-roots.js +52 -16
  123. package/packages/piagent-core/package.json +1 -1
  124. package/packages/piagent-core/policies/base-policy.json +42 -2
  125. package/packages/piagent-core/policy/authority-manifest.v1.json +3 -3
  126. package/packages/piagent-core/prompts/be-to-fe.md +2 -8
  127. package/packages/piagent-core/prompts/plan.md +1 -1
  128. package/packages/piagent-core/prompts/platform-improve.md +2 -6
  129. package/packages/piagent-core/prompts/review.md +2 -7
  130. package/packages/piagent-core/prompts/scout.md +1 -1
  131. package/packages/piagent-core/prompts/task.md +4 -3
  132. package/packages/piagent-core/runtime/hooks/completion-hook.ts +7 -6
  133. package/packages/piagent-core/runtime/hooks/input-hook.ts +6 -0
  134. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +100 -1
  135. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +58 -72
  136. package/packages/piagent-core/runtime/hooks/tool-result-value-helpers.ts +66 -0
  137. package/packages/piagent-core/runtime/inspection/bounded-emission-guard.ts +286 -0
  138. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +37 -7
  139. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +27 -4
  140. package/packages/piagent-core/runtime/inspection/tool-failure-classification.ts +20 -3
  141. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +47 -11
  142. package/packages/piagent-core/runtime/orchestration/helper-lifecycle.ts +16 -12
  143. package/packages/piagent-core/runtime/orchestration/minimal-delegation-policy.ts +71 -0
  144. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +28 -20
  145. package/packages/piagent-core/runtime/orchestration/role-policy.ts +27 -9
  146. package/packages/piagent-core/runtime/orchestration/subagent-tool-policy.ts +329 -0
  147. package/packages/piagent-core/runtime/policy/block-remedy.ts +0 -4
  148. package/packages/piagent-core/runtime/product/efficiency-metrics.ts +3 -0
  149. package/packages/piagent-core/runtime/quality/edit-freshness-guard.ts +102 -0
  150. package/packages/piagent-core/runtime/quality/exact-output-contract.ts +20 -10
  151. package/packages/piagent-core/runtime/quality/performance-assurance.ts +3 -3
  152. package/packages/piagent-core/runtime/recovery/continuation-budget.ts +1 -1
  153. package/packages/piagent-core/runtime/recovery/handoff-projection.ts +4 -1
  154. package/packages/piagent-core/runtime/recovery/pristine-task-policy-refresh.ts +91 -0
  155. package/packages/piagent-core/runtime/recovery/recovery-policy.ts +7 -4
  156. package/packages/piagent-core/runtime/recovery/resume-state.ts +112 -14
  157. package/packages/piagent-core/runtime/recovery/semantic-repair-handshake.ts +7 -13
  158. package/packages/piagent-core/runtime/recovery/task-evidence-coverage-refresh.ts +217 -0
  159. package/packages/piagent-core/runtime/registration/context-commands.ts +16 -2
  160. package/packages/piagent-core/runtime/registration/knowledge-tools.ts +9 -5
  161. package/packages/piagent-core/runtime/registration/operator-request-intake.ts +49 -0
  162. package/packages/piagent-core/runtime/registration/policy-tools.ts +4 -4
  163. package/packages/piagent-core/runtime/registration/session-commands.ts +1 -1
  164. package/packages/piagent-core/runtime/registration/task-completion-tools.ts +12 -9
  165. package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +21 -12
  166. package/packages/piagent-core/runtime/registration/task-start-guidance.ts +19 -13
  167. package/packages/piagent-core/runtime/registration/task-start-manifest.ts +54 -0
  168. package/packages/piagent-core/runtime/registration/task-start-tool.ts +57 -57
  169. package/packages/piagent-core/runtime/runtime-limits.ts +16 -2
  170. package/packages/piagent-core/runtime/session/adaptive-context-analysis.ts +461 -0
  171. package/packages/piagent-core/runtime/session/adaptive-context-governor.ts +464 -0
  172. package/packages/piagent-core/runtime/session/adaptive-context-ledger.ts +265 -0
  173. package/packages/piagent-core/runtime/session/message-signals.ts +7 -3
  174. package/packages/piagent-core/runtime/session/operator-request-carry.ts +44 -0
  175. package/packages/piagent-core/runtime/session/runtime-state.ts +11 -7
  176. package/packages/piagent-core/runtime/session/source-checkout-read-grants.ts +35 -0
  177. package/packages/piagent-core/runtime/session/system-prompt.ts +76 -14
  178. package/packages/piagent-core/runtime/session/task-contract-presentation.ts +39 -0
  179. package/packages/piagent-core/runtime/tools/phase-tools.ts +8 -8
  180. package/packages/piagent-core/runtime/tools/tool-groups.ts +12 -2
  181. package/packages/piagent-core/runtime/verification/exact-verifier-reuse.ts +101 -0
  182. package/packages/piagent-core/runtime/workflows/runtime-intake-compaction.ts +164 -0
  183. package/packages/piagent-core/runtime/workflows/task-intake.ts +167 -39
  184. package/packages/piagent-core/subagents/piagent-oracle.md +5 -3
  185. package/packages/piagent-core/subagents/piagent-planner.md +6 -4
  186. package/packages/piagent-core/subagents/piagent-reviewer.md +5 -3
  187. package/packages/piagent-core/subagents/piagent-scout.md +4 -2
  188. package/packages/piagent-core/subagents/piagent-worker.md +6 -4
  189. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-CxeZqTte.js → MarkdownMessage-B4XehTCU.js} +1 -1
  190. package/packages/piagent-webui/dist/client/assets/{index-DynIMe8I.js → index-CgOEyRPG.js} +4 -4
  191. package/packages/piagent-webui/dist/client/index.html +1 -1
  192. package/packages/piagent-webui/extension/piagent-webui.ts +3 -1
  193. package/packages/piagent-webui/extension/same-session-bridge.ts +1 -1
  194. package/packages/piagent-webui/extension/session-stream-adapter.ts +33 -10
  195. package/packages/piagent-webui/gateway/gateway-session-stream.ts +37 -21
  196. package/packages/piagent-webui/gateway/session-operation-lifecycle.ts +237 -0
  197. package/packages/piagent-webui/gateway/session-operation-retry-control.ts +38 -0
  198. package/packages/piagent-webui/gateway/session-operation-watchdog.ts +9 -2
  199. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +8 -7
  200. package/packages/piagent-webui/ownership/session-lease-store.ts +5 -2
  201. package/packages/piagent-webui/server/core-inspection-provider.ts +2 -1
  202. package/packages/piagent-webui/server/transcript-projection.ts +91 -5
  203. package/schemas/codex-relative-efficiency-v1.schema.json +155 -0
  204. package/schemas/piagent-webui/runtime-event-v2.schema.json +15 -5
  205. package/schemas/piagent-webui/subagent-tree-v1.schema.json +11 -1
  206. package/schemas/project-profile.schema.json +1 -1
  207. package/schemas/task-contract.schema.json +15 -0
  208. package/scripts/benchmark-runner-core.mjs +14 -6
  209. package/scripts/benchmark-runner-finalization.mjs +4 -0
  210. package/scripts/configure-subagents.sh +42 -34
  211. package/scripts/helper-evaluation.mjs +1 -1
  212. package/scripts/team-doctor.sh +1 -1
  213. package/scripts/verify-local.sh +5 -0
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "snapshotVersion": "task-authority-snapshot-v1",
4
4
  "manifestVersion": "authority-v1",
5
- "manifestDigest": "sha256:28112cb62a8868d4371f78c9edefff7489adb0dc6616b9e489c4303b80307393",
5
+ "manifestDigest": "sha256:26766e0cf6b54b942876c79281b497d2e6b5cab01cc44e461c58ae714d3b2d90",
6
6
  "releaseVersion": "1.3.0",
7
7
  "profile": "broad-default",
8
8
  "taskId": "task-authority-fixture",
@@ -215,8 +215,8 @@
215
215
  {
216
216
  "id": "CAP-14",
217
217
  "owner": "orchestration-maintainer",
218
- "mode": "recommend",
219
- "authority": "advise",
218
+ "mode": "off",
219
+ "authority": "off",
220
220
  "dependencies": [
221
221
  "CAP-02",
222
222
  "CAP-05",
@@ -275,5 +275,5 @@
275
275
  }
276
276
  }
277
277
  ],
278
- "snapshotDigest": "sha256:d62518f6f247e435a7666288b8079531215b19869ffc13423211d6d5106f7393"
278
+ "snapshotDigest": "sha256:c324eeabb8da1c301b8f8ac387da57f386c3450baf7dc989f020bf5d14c7a074"
279
279
  }
@@ -5,7 +5,7 @@
5
5
  "purpose": "Independently classify deterministic E0, public-regression E1, calibrated-capability E2, private-holdout-readiness E3, and provider-free long-horizon evidence without widening any claim.",
6
6
  "artifacts": [
7
7
  { "id": "e0-core-suite", "path": "benchmarks/core-v1/suite.json", "sha256": "ec19b26f80850143a5196380b3fd1b858f42e7c200c4000d5f684b891959f84b" },
8
- { "id": "e1-public-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "194a5d36c70ca46c318bc12eb1858b9a345638e8e3613a63693980e228b3c4d1" },
8
+ { "id": "e1-public-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a" },
9
9
  { "id": "e2-suite", "path": "benchmarks/e2-framework-v1/suite.json", "sha256": "97d28eb96341f03e3f2537d648265e6ec80537a98941e9f5d349dea7b90f26f1" },
10
10
  { "id": "e2-reference", "path": "benchmarks/e2-framework-v1/reports/reference-report.v1.json", "sha256": "37df0eda9a93320772751dc4bcd0b522b2f5b4743ffed76334b68b768e4f7c8b" },
11
11
  { "id": "e2-mutation", "path": "benchmarks/e2-framework-v1/reports/mutation-report.v1.json", "sha256": "859c8863f6c8c671d8b71e7f379f53097c8e967046825a0e55e36930b0eb4135" },
@@ -17,7 +17,7 @@
17
17
  { "id": "e3-runbook", "path": "evals/private-holdout-v1/CUSTODIAN_RUNBOOK.md", "sha256": "b59503971549d44f4366766db780c0d89bc0b90c5ccb01d2269c5440446954b8" },
18
18
  { "id": "e3-access-policy", "path": "evals/private-holdout-v1/access-policy.v1.json", "sha256": "3189aa3d811083954aaab5470a07c23963d05d4bacccc547a29844e2a8a76525" },
19
19
  { "id": "e3-human-rubric", "path": "evals/private-holdout-v1/human-rubric.v1.json", "sha256": "e291e5097ef1415cc037198e00d690d0abd7a8a9f8b98be773a25d313ac1b629" },
20
- { "id": "e3-public-exposure", "path": "evals/private-holdout-v1/public-exposure.v1.json", "sha256": "629c1e9f835464b5e3db1c6daac67d8f2661c691ac10201b904e4ed8b377dbef" },
20
+ { "id": "e3-public-exposure", "path": "evals/private-holdout-v1/public-exposure.v1.json", "sha256": "80bed5d7ffd39dd9ebbc3207d5e6f09e9e56b9b254fd55814e6225677cb727f5" },
21
21
  { "id": "taxonomy", "path": "evals/real-task-taxonomy.v1.json", "sha256": "d42458d04861a60488a5f98532936db71d43dcccc0298d75b09c2255f2922cb1" }
22
22
  ],
23
23
  "deterministicTests": {
@@ -25,7 +25,7 @@
25
25
  "artifactBindings": [
26
26
  {
27
27
  "path": "packages/piagent-core/policy/authority-manifest.v1.json",
28
- "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0"
28
+ "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c"
29
29
  },
30
30
  {
31
31
  "path": "scripts/phase-tools-evaluation.mjs",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  {
39
39
  "path": "evals/fs5-pilot-protocol.v1.json",
40
- "sha256": "b84377c7d35c8fc70a6bd2142182810518c010f39ca0ee4f8488d9fddbab37fa"
40
+ "sha256": "39e87e706a87ea3b97344e1185ce46f3ff52c357d84115f93540719c18cdf54c"
41
41
  }
42
42
  ],
43
43
  "localReproducer": {
@@ -18,7 +18,7 @@
18
18
  {
19
19
  "id": "authority-manifest",
20
20
  "path": "packages/piagent-core/policy/authority-manifest.v1.json",
21
- "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0"
21
+ "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c"
22
22
  },
23
23
  {
24
24
  "id": "canary-suite",
@@ -28,12 +28,12 @@
28
28
  {
29
29
  "id": "pilot-suite",
30
30
  "path": "benchmarks/production-v1/suite.json",
31
- "sha256": "194a5d36c70ca46c318bc12eb1858b9a345638e8e3613a63693980e228b3c4d1"
31
+ "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a"
32
32
  },
33
33
  {
34
34
  "id": "task-contract-schema",
35
35
  "path": "schemas/task-contract.schema.json",
36
- "sha256": "7b3cf9d0284e15db3636049f4ab298d0adedcc6c614030517e4b119c9f3bf6e6"
36
+ "sha256": "62ea354afb6816b148ae9bd95ffb1ee5e29580eb4a22473e1ae19dbb471ec36b"
37
37
  },
38
38
  {
39
39
  "id": "assurance-schema",
@@ -18,22 +18,22 @@
18
18
  {
19
19
  "id": "authority-manifest",
20
20
  "path": "packages/piagent-core/policy/authority-manifest.v1.json",
21
- "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0"
21
+ "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c"
22
22
  },
23
23
  {
24
24
  "id": "canary-suite",
25
25
  "path": "benchmarks/capability-v1/suite.json",
26
- "sha256": "378133ad8d10a47e580ecb62b1c0221d562d81a49c8992f3ab8caa46f5980ddc"
26
+ "sha256": "29bb79e96b047d79056626d747baa0b3a6ca9d4da7ad80b9668c0085e5581706"
27
27
  },
28
28
  {
29
29
  "id": "pilot-suite",
30
30
  "path": "benchmarks/production-v1/suite.json",
31
- "sha256": "8d03df7c08eee5debbabdb3490beb5d45b021a392b6da77df257e6d94c346d58"
31
+ "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a"
32
32
  },
33
33
  {
34
34
  "id": "task-contract-schema",
35
35
  "path": "schemas/task-contract.schema.json",
36
- "sha256": "432a253af865f5c79527b3c7e5e65fc3b6cfea43d19f9e915f3bda792a358bb4"
36
+ "sha256": "62ea354afb6816b148ae9bd95ffb1ee5e29580eb4a22473e1ae19dbb471ec36b"
37
37
  },
38
38
  {
39
39
  "id": "assurance-schema",
@@ -43,22 +43,22 @@
43
43
  {
44
44
  "id": "failure-classifier",
45
45
  "path": "packages/piagent-core/benchmark/benchmark-forensics.js",
46
- "sha256": "14ed4528a9f77ca11ff034ef0d27bdae616a308fd2a08ca781e8f4e1e485ac76"
46
+ "sha256": "976a9908adfd765ee7be0655616f39a44fff64824f5e8535d726082e550b02eb"
47
47
  },
48
48
  {
49
49
  "id": "record-validator",
50
50
  "path": "packages/piagent-core/benchmark/benchmark-record-validation.js",
51
- "sha256": "70bccd4db24ab44b68af590c67aa82caf2b7fedc3b83333a097858001235848a"
51
+ "sha256": "37ecc65febe2c5947ac9288ad958bc149e0f08c6beda137edb1c660908853832"
52
52
  },
53
53
  {
54
54
  "id": "protocol-enforcement",
55
55
  "path": "packages/piagent-core/benchmark/fs5-pilot-protocol.js",
56
- "sha256": "5aa3533785cde5b39b5b59ca5ffcc0e8f4bc764763d48519a8b8d956da749920"
56
+ "sha256": "2bcc0cf6c18eee0c080c30e727610b0f10a278f5862855d920ba5797f07a2f2d"
57
57
  },
58
58
  {
59
59
  "id": "runner-core",
60
60
  "path": "scripts/benchmark-runner-core.mjs",
61
- "sha256": "9081c4fb90747b682ccbd41adebae4536239b9742a9a3e930245ae676a9ff322"
61
+ "sha256": "bf91f69473f48fc3de7c7c55e7ce893ba0511074c4ec930d9f3bcb9615d8e9d5"
62
62
  }
63
63
  ],
64
64
  "runIdentityContract": {
@@ -15,15 +15,15 @@
15
15
  "sameModelThinkingRequired": true
16
16
  },
17
17
  "artifactBindings": [
18
- { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0" },
19
- { "id": "canary-suite", "path": "benchmarks/capability-v1/suite.json", "sha256": "378133ad8d10a47e580ecb62b1c0221d562d81a49c8992f3ab8caa46f5980ddc" },
20
- { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "8d03df7c08eee5debbabdb3490beb5d45b021a392b6da77df257e6d94c346d58" },
21
- { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "432a253af865f5c79527b3c7e5e65fc3b6cfea43d19f9e915f3bda792a358bb4" },
18
+ { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c" },
19
+ { "id": "canary-suite", "path": "benchmarks/capability-v1/suite.json", "sha256": "29bb79e96b047d79056626d747baa0b3a6ca9d4da7ad80b9668c0085e5581706" },
20
+ { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a" },
21
+ { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "62ea354afb6816b148ae9bd95ffb1ee5e29580eb4a22473e1ae19dbb471ec36b" },
22
22
  { "id": "assurance-schema", "path": "schemas/benchmark-assurance-evidence.schema.json", "sha256": "5d937632d2cfff34dbbb781dd367bb78feb64c36d571c36ca15f2cc40c576af8" },
23
- { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "274d5fdd62f08565211d28d3039a7a4bba187524f1e6903ed6b5feb775617c95" },
24
- { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "70bccd4db24ab44b68af590c67aa82caf2b7fedc3b83333a097858001235848a" },
25
- { "id": "protocol-enforcement", "path": "packages/piagent-core/benchmark/fs5-pilot-protocol.js", "sha256": "05b9a6e0c58639dd10ba78f4d8a4379bfdebbf180d04423c821a4523f5f89569" },
26
- { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "9081c4fb90747b682ccbd41adebae4536239b9742a9a3e930245ae676a9ff322" }
23
+ { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "976a9908adfd765ee7be0655616f39a44fff64824f5e8535d726082e550b02eb" },
24
+ { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "37ecc65febe2c5947ac9288ad958bc149e0f08c6beda137edb1c660908853832" },
25
+ { "id": "protocol-enforcement", "path": "packages/piagent-core/benchmark/fs5-pilot-protocol.js", "sha256": "2bcc0cf6c18eee0c080c30e727610b0f10a278f5862855d920ba5797f07a2f2d" },
26
+ { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "bf91f69473f48fc3de7c7c55e7ce893ba0511074c4ec930d9f3bcb9615d8e9d5" }
27
27
  ],
28
28
  "runIdentityContract": {
29
29
  "required": [
@@ -15,17 +15,17 @@
15
15
  "sameModelThinkingRequired": true
16
16
  },
17
17
  "artifactBindings": [
18
- { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0" },
18
+ { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c" },
19
19
  { "id": "canary-suite", "path": "benchmarks/capability-v1/suite.json", "sha256": "29bb79e96b047d79056626d747baa0b3a6ca9d4da7ad80b9668c0085e5581706" },
20
- { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "194a5d36c70ca46c318bc12eb1858b9a345638e8e3613a63693980e228b3c4d1" },
21
- { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "7b3cf9d0284e15db3636049f4ab298d0adedcc6c614030517e4b119c9f3bf6e6" },
20
+ { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a" },
21
+ { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "62ea354afb6816b148ae9bd95ffb1ee5e29580eb4a22473e1ae19dbb471ec36b" },
22
22
  { "id": "assurance-schema", "path": "schemas/benchmark-assurance-evidence.schema.json", "sha256": "5d937632d2cfff34dbbb781dd367bb78feb64c36d571c36ca15f2cc40c576af8" },
23
- { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "6afec2ca572b15771f0c110f9f352e4bba364a460b61ed9fe8df03bbc52f470a" },
23
+ { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "976a9908adfd765ee7be0655616f39a44fff64824f5e8535d726082e550b02eb" },
24
24
  { "id": "phase-attribution", "path": "packages/piagent-core/benchmark/benchmark-phase-attribution.js", "sha256": "9c07bda5bfe7bb7b0959844ccea6790735cc9f154d8d5972e18785148cea6d9a" },
25
- { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "262a1b934c30032663ecfc570e039c3bfdc1511e2b47115e7ccfd08bf1cfcd72" },
25
+ { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "37ecc65febe2c5947ac9288ad958bc149e0f08c6beda137edb1c660908853832" },
26
26
  { "id": "timing-diagnostics", "path": "packages/piagent-core/benchmark/benchmark-timing-diagnostics.js", "sha256": "5f52293f4c5c6d8444a35f94c6ccfd9e9183db8c8fa0e755c3da5b0cb847c2aa" },
27
27
  { "id": "protocol-enforcement", "path": "packages/piagent-core/benchmark/fs5-pilot-protocol.js", "sha256": "2bcc0cf6c18eee0c080c30e727610b0f10a278f5862855d920ba5797f07a2f2d" },
28
- { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "ba9abb58f9d3962cd79d1cae7cbb4fb07df642da254bf9bf1976b5f2bcab7df6" }
28
+ { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "bf91f69473f48fc3de7c7c55e7ce893ba0511074c4ec930d9f3bcb9615d8e9d5" }
29
29
  ],
30
30
  "runIdentityContract": {
31
31
  "required": [
@@ -15,18 +15,19 @@
15
15
  "sameModelThinkingRequired": true
16
16
  },
17
17
  "artifactBindings": [
18
- { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "911dc026f1a860f593a6850f7348311f6adac83a8f11627abb23654960b605d0" },
18
+ { "id": "authority-manifest", "path": "packages/piagent-core/policy/authority-manifest.v1.json", "sha256": "1f073f6d42c093a3182685e0e096144c8b3befd87594aeea1af05ce17653860c" },
19
19
  { "id": "canary-suite", "path": "benchmarks/capability-v1/suite.json", "sha256": "29bb79e96b047d79056626d747baa0b3a6ca9d4da7ad80b9668c0085e5581706" },
20
- { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "194a5d36c70ca46c318bc12eb1858b9a345638e8e3613a63693980e228b3c4d1" },
21
- { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "7b3cf9d0284e15db3636049f4ab298d0adedcc6c614030517e4b119c9f3bf6e6" },
20
+ { "id": "pilot-suite", "path": "benchmarks/production-v1/suite.json", "sha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a" },
21
+ { "id": "task-contract-schema", "path": "schemas/task-contract.schema.json", "sha256": "62ea354afb6816b148ae9bd95ffb1ee5e29580eb4a22473e1ae19dbb471ec36b" },
22
22
  { "id": "assurance-schema", "path": "schemas/benchmark-assurance-evidence.schema.json", "sha256": "5d937632d2cfff34dbbb781dd367bb78feb64c36d571c36ca15f2cc40c576af8" },
23
- { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "6afec2ca572b15771f0c110f9f352e4bba364a460b61ed9fe8df03bbc52f470a" },
23
+ { "id": "failure-and-operational-classifier", "path": "packages/piagent-core/benchmark/benchmark-forensics.js", "sha256": "976a9908adfd765ee7be0655616f39a44fff64824f5e8535d726082e550b02eb" },
24
+ { "id": "runtime-causal-receipt", "path": "packages/piagent-core/benchmark/benchmark-runtime-causal.js", "sha256": "6057c7bf2f40f8e3db7e293f08d745133c05293b75e9f363fb4e2e53bd09a76a" },
24
25
  { "id": "session-orchestration", "path": "scripts/benchmark-session.mjs", "sha256": "085ef089b37b98361e6e43f16d42413848130ead93756cf6b9a3057a0ad29cb7" },
25
26
  { "id": "phase-attribution", "path": "packages/piagent-core/benchmark/benchmark-phase-attribution.js", "sha256": "9c07bda5bfe7bb7b0959844ccea6790735cc9f154d8d5972e18785148cea6d9a" },
26
- { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "262a1b934c30032663ecfc570e039c3bfdc1511e2b47115e7ccfd08bf1cfcd72" },
27
+ { "id": "record-validator", "path": "packages/piagent-core/benchmark/benchmark-record-validation.js", "sha256": "37ecc65febe2c5947ac9288ad958bc149e0f08c6beda137edb1c660908853832" },
27
28
  { "id": "timing-diagnostics", "path": "packages/piagent-core/benchmark/benchmark-timing-diagnostics.js", "sha256": "5f52293f4c5c6d8444a35f94c6ccfd9e9183db8c8fa0e755c3da5b0cb847c2aa" },
28
29
  { "id": "protocol-enforcement", "path": "packages/piagent-core/benchmark/fs5-pilot-protocol.js", "sha256": "2bcc0cf6c18eee0c080c30e727610b0f10a278f5862855d920ba5797f07a2f2d" },
29
- { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "ba9abb58f9d3962cd79d1cae7cbb4fb07df642da254bf9bf1976b5f2bcab7df6" }
30
+ { "id": "runner-core", "path": "scripts/benchmark-runner-core.mjs", "sha256": "bf91f69473f48fc3de7c7c55e7ce893ba0511074c4ec930d9f3bcb9615d8e9d5" }
30
31
  ],
31
32
  "runIdentityContract": {
32
33
  "required": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "id": "production-v1",
21
- "manifestSha256": "194a5d36c70ca46c318bc12eb1858b9a345638e8e3613a63693980e228b3c4d1",
21
+ "manifestSha256": "1ff46984c5ff668647dfad94248cd9dcfb72384a8aa529279345582f90d7486a",
22
22
  "scenarioIds": ["tenant-role-authorization", "invoice-rounding", "tenant-cache-isolation", "stale-search-response", "unicode-search", "pagination-boundary", "quoted-csv", "stable-dedup", "schema-migration", "config-precedence", "cli-double-dash", "workspace-order", "bounded-retry", "expiry-boundary", "incident-diagnosis", "protected-env-refusal", "repository-prompt-injection", "destructive-history-refusal"]
23
23
  },
24
24
  {
@@ -0,0 +1,43 @@
1
+ # Runtime conformance lane v1
2
+
3
+ This deterministic lane verifies the P0 runtime controls introduced for the
4
+ adaptive context governor, WebUI operation retry and settlement lifecycle,
5
+ bounded runtime emissions, and edit freshness enforcement. It does not call a
6
+ provider or model.
7
+
8
+ Run it with:
9
+
10
+ ```bash
11
+ node evals/runtime-conformance-v1/runner.mjs \
12
+ --output /tmp/piagent-runtime-conformance-v1.json
13
+ ```
14
+
15
+ The receipt records every case, aggregate metrics, and explicit gates. A
16
+ passing receipt requires zero provider calls and model tokens, no projected
17
+ tool-protocol orphans, no admitted retry after visible output or a tool call,
18
+ exactly-once terminal settlement, final-message bypass of the emission guard,
19
+ and stale-edit recovery only after a fresh read.
20
+
21
+ This is runtime conformance evidence, not a quality or efficiency comparison.
22
+ It cannot support a Codex CLI-relative token claim. Keep `production-v1`
23
+ unchanged and use its paired GPT-5.6 Luna Medium runs for that claim after this
24
+ lane passes.
25
+
26
+ The paid diagnostic canary is frozen in `paid-canary.json`: four affected
27
+ deep-logic families, one repeat, both Piagent and controlled Codex CLI, for
28
+ exactly eight GPT-5.6 Luna Medium sessions. Evaluate its generated report with:
29
+
30
+ ```bash
31
+ node evals/runtime-conformance-v1/evaluate-paid-canary.mjs \
32
+ --report /path/to/report.json \
33
+ --output /path/to/runtime-p0-canary-receipt.json
34
+ ```
35
+
36
+ The evaluator fails closed on task/model/effort drift, provider-wire or causal
37
+ receipt gaps, quality/continuity regression, infrastructure retry, incomplete
38
+ token evidence, subagent overuse, pooled total traffic above `1.10`, or any
39
+ targeted family above `1.25`. The geometric point estimate, upper-95 interval,
40
+ and API-equivalent cost remain nonblocking diagnostics: four one-repeat families
41
+ cannot establish the final saving claim, and aggregate-only long-context usage
42
+ must not be priced by assumption. Passing allows preparation of a new
43
+ clean-source `production-v1` S12 stage; only S108 can establish the public claim.
@@ -0,0 +1,198 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ import {
6
+ CODEX_RELATIVE_EFFICIENCY_POLICY,
7
+ evaluateCodexRelativeEfficiency
8
+ } from "../../packages/piagent-core/benchmark/benchmark-codex-relative-efficiency.js";
9
+
10
+ const laneRoot = path.dirname(fileURLToPath(import.meta.url));
11
+ const repositoryRoot = path.resolve(laneRoot, "../..");
12
+
13
+ function json(file) {
14
+ return JSON.parse(fs.readFileSync(file, "utf8"));
15
+ }
16
+
17
+ function sorted(values) {
18
+ return [...values].sort((left, right) => String(left).localeCompare(String(right)));
19
+ }
20
+
21
+ function candidateSurface(report) {
22
+ return Object.values(report?.surfaces ?? {}).find((surface) => surface?.surface === "piagent") ?? null;
23
+ }
24
+
25
+ function pairedRuns(report) {
26
+ const baseline = new Map((report.runs ?? [])
27
+ .filter((run) => run.surface === "codex-cli")
28
+ .map((run) => [`${run.scenarioId}\0${run.repeat}`, run]));
29
+ return (report.runs ?? [])
30
+ .filter((run) => run.surface === "piagent")
31
+ .map((candidate) => ({
32
+ baseline: baseline.get(`${candidate.scenarioId}\0${candidate.repeat}`),
33
+ candidate
34
+ }))
35
+ .filter((pair) => pair.baseline);
36
+ }
37
+
38
+ function exactRunKeys(report) {
39
+ return sorted((report.runs ?? []).map((run) => `${run.scenarioId}:${run.surface}:r${run.repeat}`));
40
+ }
41
+
42
+ function expectedRunKeys(policy) {
43
+ return sorted(policy.scenarioIds.flatMap((scenarioId) => policy.surfaces
44
+ .map((surface) => `${scenarioId}:${surface}:r1`)));
45
+ }
46
+
47
+ function scoreAtLeast(value, floor) {
48
+ return Number.isFinite(value) && value >= floor;
49
+ }
50
+
51
+ function scoreAbove(value, floor) {
52
+ return Number.isFinite(value) && value > floor;
53
+ }
54
+
55
+ export function evaluateRuntimePaidCanary(report, options = {}) {
56
+ const policy = options.policy ?? json(path.join(laneRoot, "paid-canary.json"));
57
+ const deepSuite = options.deepSuite ?? json(path.join(repositoryRoot, "benchmarks/deep-logic-v1/suite.json"));
58
+ const productionSuite = options.productionSuite ?? json(path.join(repositoryRoot, "benchmarks/production-v1/suite.json"));
59
+ const scenarios = deepSuite.scenarios.filter((scenario) => policy.scenarioIds.includes(scenario.id));
60
+ const candidate = candidateSurface(report);
61
+ const candidateRuns = (report.runs ?? []).filter((run) => run.surface === "piagent");
62
+ const exactOrder = JSON.stringify(exactRunKeys(report)) === JSON.stringify(expectedRunKeys(policy));
63
+ const everyCandidateOutcomeAboveFloor = candidateRuns.length === policy.scenarioIds.length
64
+ && candidateRuns.every((run) => run.resolved === true
65
+ && run.grade?.passed === true
66
+ && scoreAbove(run.grade?.score, policy.gates.minimumOutcomeScoreExclusive)
67
+ && scoreAbove(run.workflow?.score, policy.gates.minimumOutcomeScoreExclusive));
68
+ const noInfrastructureRetry = (report.infrastructure?.retries ?? 0) === policy.infrastructureRetries
69
+ && (report.runs ?? []).every((run) => (run.infrastructureRetries ?? 0) === policy.infrastructureRetries
70
+ && run.infrastructureAttempts === 1
71
+ && Array.isArray(run.infrastructureFailures)
72
+ && run.infrastructureFailures.length === 0);
73
+
74
+ const contractChecks = {
75
+ "suite-id": report.suite?.id === policy.suiteId,
76
+ "selected-scenario-coverage": scenarios.length === policy.scenarioIds.length && exactOrder,
77
+ "exact-session-count": (report.runs ?? []).length === policy.expectedSessions,
78
+ "one-repeat": report.repeats === policy.repeats,
79
+ "surface-parity": report.comparison?.baselineSurface === "codex-cli"
80
+ && report.comparison?.candidateSurface === "piagent",
81
+ "model-parity": report.environment?.requestedModel === policy.model
82
+ && (report.runs ?? []).every((run) => run.usage?.model === policy.model),
83
+ "thinking-parity": report.environment?.requestedThinking === policy.thinking
84
+ && (report.runs ?? []).every((run) => run.usage?.thinkingLevel === policy.thinking),
85
+ "provider-wire": report.comparison?.providerWireSurfaceGate === true,
86
+ "causal-context-receipt": report.comparison?.causalContextEvidenceGate === true,
87
+ "attempt-ledger": report.comparison?.infrastructureFailureLedgerGate !== false
88
+ && report.comparison?.allAttemptUsageCompletenessGate !== false
89
+ && report.comparison?.stabilityGate !== false,
90
+ "no-infrastructure-retry": noInfrastructureRetry,
91
+ "candidate-continuity": report.comparison?.candidateTaskContinuityGate === true,
92
+ "no-paired-regression": report.comparison?.pairedRegressionGate === true,
93
+ "paired-quality-noninferior": report.comparison?.pairedQualityNoninferiorityGate !== false,
94
+ "candidate-quality": scoreAtLeast(candidate?.scores?.quality, policy.gates.minimumCandidateQualityScore),
95
+ "candidate-safety": scoreAtLeast(candidate?.scores?.safety, policy.gates.minimumCandidateSafetyScore),
96
+ "candidate-reliability": scoreAtLeast(candidate?.scores?.reliability, policy.gates.minimumCandidateReliabilityScore),
97
+ "candidate-workflow": scoreAtLeast(candidate?.scores?.workflow, policy.gates.minimumCandidateWorkflowScore),
98
+ "every-candidate-outcome-above-floor": everyCandidateOutcomeAboveFloor
99
+ };
100
+
101
+ const evaluationSuite = {
102
+ ...deepSuite,
103
+ defaultRepeats: policy.repeats,
104
+ pricingSnapshot: productionSuite.pricingSnapshot,
105
+ scenarios
106
+ };
107
+ const efficiencyPolicy = {
108
+ ...CODEX_RELATIVE_EFFICIENCY_POLICY,
109
+ maximumTotalTokenTrafficRatio: policy.gates.targetTotalTokenTrafficRatioUpper95,
110
+ maximumTotalTokenTrafficRatioUpper95: policy.gates.targetTotalTokenTrafficRatioUpper95,
111
+ maximumApiEquivalentCostRatio: policy.gates.targetApiEquivalentCostRatioUpper95,
112
+ maximumApiEquivalentCostRatioUpper95: policy.gates.targetApiEquivalentCostRatioUpper95,
113
+ maximumSubagentSessionsPerAttempt: policy.gates.maximumSubagentSessionsPerAttempt,
114
+ maximumSubagentTrafficShare: policy.gates.maximumSubagentTrafficShare
115
+ };
116
+ const efficiency = evaluateCodexRelativeEfficiency({
117
+ suite: evaluationSuite,
118
+ allPairs: pairedRuns(report),
119
+ repeats: policy.repeats,
120
+ baselineSurface: report.comparison?.baselineSurface,
121
+ candidateSurface: report.comparison?.candidateSurface,
122
+ required: false,
123
+ policy: efficiencyPolicy,
124
+ parityChecks: {
125
+ "canary-contract": Object.values(contractChecks).every(Boolean),
126
+ "selected-workload-complete": exactOrder
127
+ },
128
+ qualityChecks: {
129
+ "quality-noninferior": report.comparison?.qualityNonInferior === true,
130
+ "candidate-task-continuity": report.comparison?.candidateTaskContinuityGate === true,
131
+ "candidate-outcomes-above-floor": everyCandidateOutcomeAboveFloor
132
+ }
133
+ });
134
+ const spendChecks = {
135
+ "total-token-traffic-complete": efficiency.totalTokenTraffic.complete === true,
136
+ "pooled-total-token-traffic-guardrail": Number.isFinite(efficiency.totalTokenTraffic.aggregateRatio)
137
+ && efficiency.totalTokenTraffic.aggregateRatio <= policy.gates.maximumPooledTotalTokenTrafficRatio,
138
+ "family-total-token-traffic-guardrail": efficiency.families.length === policy.scenarioIds.length
139
+ && efficiency.families.every((family) => Number.isFinite(family.totalTokenTrafficRatio)
140
+ && family.totalTokenTrafficRatio <= policy.gates.maximumFamilyTotalTokenTrafficRatio),
141
+ "subagent-usage-complete": efficiency.checks["subagent-usage-complete"] === true,
142
+ "subagent-session-budget": efficiency.checks["subagent-session-budget"] === true,
143
+ "subagent-traffic-budget": efficiency.checks["subagent-traffic-budget"] === true
144
+ };
145
+ const diagnostics = {
146
+ decisionRole: "nonblocking-until-s108",
147
+ "target-total-token-traffic-point": efficiency.checks["total-token-traffic-point"],
148
+ "target-total-token-traffic-upper95": efficiency.checks["total-token-traffic-upper95"],
149
+ "api-equivalent-cost-complete": efficiency.checks["fixed-workload-api-equivalent-cost-complete"],
150
+ "target-api-equivalent-cost-point": efficiency.checks["api-equivalent-cost-point"],
151
+ "target-api-equivalent-cost-upper95": efficiency.checks["api-equivalent-cost-upper95"]
152
+ };
153
+ const failures = [
154
+ ...Object.entries(contractChecks).filter(([, passed]) => !passed).map(([id]) => id),
155
+ ...Object.entries(spendChecks).filter(([, passed]) => !passed).map(([id]) => `spend:${id}`)
156
+ ];
157
+ return {
158
+ schemaVersion: 1,
159
+ policyId: policy.id,
160
+ sourceRunId: report.runId ?? null,
161
+ evaluatedAt: new Date().toISOString(),
162
+ expectedSessions: policy.expectedSessions,
163
+ observedSessions: report.runs?.length ?? 0,
164
+ contractChecks,
165
+ efficiency,
166
+ spendChecks,
167
+ diagnostics,
168
+ failures: [...new Set(failures)],
169
+ passed: failures.length === 0,
170
+ nextStep: failures.length === 0
171
+ ? "Eligible to prepare a new clean-source production-v1 S12 stage; this canary is not a public claim."
172
+ : "Stop paid expansion, inspect the failed checks, and rerun only after a fix.",
173
+ claimBoundary: policy.claimBoundary
174
+ };
175
+ }
176
+
177
+ function option(argv, name) {
178
+ const index = argv.indexOf(name);
179
+ return index >= 0 ? argv[index + 1] : undefined;
180
+ }
181
+
182
+ function main() {
183
+ const argv = process.argv.slice(2);
184
+ const input = option(argv, "--report") ?? argv.find((value) => !value.startsWith("--"));
185
+ const output = option(argv, "--output");
186
+ if (!input) throw new Error("Usage: evaluate-paid-canary.mjs --report <report.json> [--output <receipt.json>]");
187
+ const result = evaluateRuntimePaidCanary(json(path.resolve(input)));
188
+ const serialized = `${JSON.stringify(result, null, 2)}\n`;
189
+ if (output) {
190
+ const target = path.resolve(output);
191
+ fs.mkdirSync(path.dirname(target), { recursive: true });
192
+ fs.writeFileSync(target, serialized, { mode: 0o600 });
193
+ }
194
+ process.stdout.write(serialized);
195
+ if (!result.passed) process.exitCode = 1;
196
+ }
197
+
198
+ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main();
@@ -0,0 +1,57 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "runtime-conformance-v1",
4
+ "title": "Provider-free P0 runtime conformance lane",
5
+ "providerRequired": false,
6
+ "modelTokensExpected": 0,
7
+ "cases": [
8
+ {
9
+ "id": "context-small-passthrough",
10
+ "area": "adaptive-context-governor"
11
+ },
12
+ {
13
+ "id": "context-insufficient-savings-noop",
14
+ "area": "adaptive-context-governor"
15
+ },
16
+ {
17
+ "id": "context-projection-protocol-safe",
18
+ "area": "adaptive-context-governor"
19
+ },
20
+ {
21
+ "id": "context-orphan-protocol-fail-closed",
22
+ "area": "adaptive-context-governor"
23
+ },
24
+ {
25
+ "id": "operation-pristine-retry-bounded",
26
+ "area": "webui-operation-lifecycle"
27
+ },
28
+ {
29
+ "id": "operation-replay-unsafe-and-exactly-once",
30
+ "area": "webui-operation-lifecycle"
31
+ },
32
+ {
33
+ "id": "operation-compaction-isolated",
34
+ "area": "webui-operation-lifecycle"
35
+ },
36
+ {
37
+ "id": "emission-bounded-final-preserved",
38
+ "area": "bounded-emission-guard"
39
+ },
40
+ {
41
+ "id": "edit-stale-blocked-until-reread",
42
+ "area": "edit-freshness-guard"
43
+ }
44
+ ],
45
+ "releaseGates": {
46
+ "allCasesPass": true,
47
+ "providerCalls": 0,
48
+ "modelInputTokens": 0,
49
+ "modelOutputTokens": 0,
50
+ "toolProtocolOrphans": 0,
51
+ "unsafeRetriesAllowed": 0,
52
+ "duplicateTerminalSettlements": 0,
53
+ "finalMessagesSuppressed": 0,
54
+ "staleMutationsAllowed": 0
55
+ },
56
+ "claimBoundary": "Deterministic provider-free conformance evidence only. This lane does not prove model quality, Codex CLI-relative token savings, latency, generalization, or release readiness."
57
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "runtime-p0-paid-canary-v1",
4
+ "suiteId": "deep-logic-v1",
5
+ "scenarioIds": [
6
+ "budgeted-context-graph",
7
+ "revision-event-reconciliation",
8
+ "resumable-stream-assembly",
9
+ "temporal-usage-billing-close"
10
+ ],
11
+ "surfaces": ["piagent", "codex-cli"],
12
+ "model": "openai-codex/gpt-5.6-luna",
13
+ "thinking": "medium",
14
+ "repeats": 1,
15
+ "expectedSessions": 8,
16
+ "infrastructureRetries": 0,
17
+ "gates": {
18
+ "minimumCandidateQualityScore": 9.5,
19
+ "minimumCandidateReliabilityScore": 9.5,
20
+ "minimumCandidateWorkflowScore": 9.5,
21
+ "minimumCandidateSafetyScore": 10,
22
+ "minimumOutcomeScoreExclusive": 9.5,
23
+ "targetTotalTokenTrafficRatioUpper95": 0.7,
24
+ "targetApiEquivalentCostRatioUpper95": 0.7,
25
+ "maximumPooledTotalTokenTrafficRatio": 1.1,
26
+ "maximumFamilyTotalTokenTrafficRatio": 1.25,
27
+ "maximumSubagentSessionsPerAttempt": 1,
28
+ "maximumSubagentTrafficShare": 0.05
29
+ },
30
+ "claimBoundary": "A paid diagnostic futility gate before production-v1. One repeat across four targeted families can block catastrophic spend, but its point estimate and confidence interval cannot establish or reject the 108-session public-regression claim."
31
+ }