pi-agent-browser-native 0.9.5 → 0.9.6

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 (380) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +3 -0
  3. package/dist/extensions/agent-browser/index.js +1214 -583
  4. package/dist/packaged/lib/browser-session-conversion.js +2810 -0
  5. package/dist/packaged/lib/config-policy.js +599 -0
  6. package/dist/packaged/lib/parsing.js +34 -0
  7. package/dist/packaged/lib/playbook.js +694 -0
  8. package/dist/packaged/lib/results/snapshot.js +2671 -0
  9. package/dist/packaged/lib/runtime.js +3027 -0
  10. package/docs/ARCHITECTURE.md +11 -1
  11. package/docs/CODE_QUALITY.md +11 -0
  12. package/docs/COMMAND_REFERENCE.md +2 -2
  13. package/docs/PERFORMANCE.md +243 -0
  14. package/docs/REFERENCE.md +3 -3
  15. package/docs/SESSION_STORAGE.md +11 -3
  16. package/docs/SUPPORT_MATRIX.md +8 -4
  17. package/docs/TOOL_CONTRACT.md +4 -4
  18. package/docs/performance/2026-10-12.json +7257 -0
  19. package/package.json +13 -2
  20. package/scripts/build.mjs +16 -5
  21. package/scripts/config.mjs +1 -1
  22. package/scripts/convert-browser-session.mjs +1 -1
  23. package/dist/extensions/agent-browser/lib/argv-descriptor.js +0 -123
  24. package/dist/extensions/agent-browser/lib/argv-grammar.js +0 -320
  25. package/dist/extensions/agent-browser/lib/bash-guard.js +0 -193
  26. package/dist/extensions/agent-browser/lib/batch-lifecycle.js +0 -131
  27. package/dist/extensions/agent-browser/lib/browser-execution-claim-codec.js +0 -61
  28. package/dist/extensions/agent-browser/lib/browser-execution-claim-storage.js +0 -232
  29. package/dist/extensions/agent-browser/lib/browser-execution-claims.js +0 -202
  30. package/dist/extensions/agent-browser/lib/browser-execution-identity.js +0 -77
  31. package/dist/extensions/agent-browser/lib/browser-journal-branch.js +0 -98
  32. package/dist/extensions/agent-browser/lib/browser-journal-contracts.js +0 -1
  33. package/dist/extensions/agent-browser/lib/browser-journal-projection.js +0 -221
  34. package/dist/extensions/agent-browser/lib/browser-journal-reader.js +0 -89
  35. package/dist/extensions/agent-browser/lib/browser-journal-replay.js +0 -246
  36. package/dist/extensions/agent-browser/lib/browser-journal.js +0 -148
  37. package/dist/extensions/agent-browser/lib/browser-legacy-pages.js +0 -220
  38. package/dist/extensions/agent-browser/lib/browser-legacy-projection.js +0 -282
  39. package/dist/extensions/agent-browser/lib/browser-legacy-types.js +0 -1
  40. package/dist/extensions/agent-browser/lib/browser-session-conversion-stream.js +0 -217
  41. package/dist/extensions/agent-browser/lib/browser-session-conversion.js +0 -126
  42. package/dist/extensions/agent-browser/lib/browser-transcript-contracts.js +0 -35
  43. package/dist/extensions/agent-browser/lib/browser-transcript-validation.js +0 -166
  44. package/dist/extensions/agent-browser/lib/browser-transcript.js +0 -189
  45. package/dist/extensions/agent-browser/lib/browser-value-parsing.js +0 -15
  46. package/dist/extensions/agent-browser/lib/command-capabilities.js +0 -340
  47. package/dist/extensions/agent-browser/lib/command-policy.js +0 -155
  48. package/dist/extensions/agent-browser/lib/command-taxonomy.js +0 -105
  49. package/dist/extensions/agent-browser/lib/config-policy.js +0 -450
  50. package/dist/extensions/agent-browser/lib/config-providers.js +0 -71
  51. package/dist/extensions/agent-browser/lib/config-validation.js +0 -231
  52. package/dist/extensions/agent-browser/lib/config.js +0 -69
  53. package/dist/extensions/agent-browser/lib/electron/cdp.js +0 -62
  54. package/dist/extensions/agent-browser/lib/electron/cleanup.js +0 -274
  55. package/dist/extensions/agent-browser/lib/electron/discovery-darwin.js +0 -109
  56. package/dist/extensions/agent-browser/lib/electron/discovery-desktop.js +0 -136
  57. package/dist/extensions/agent-browser/lib/electron/discovery-evidence.js +0 -90
  58. package/dist/extensions/agent-browser/lib/electron/discovery-linux.js +0 -93
  59. package/dist/extensions/agent-browser/lib/electron/discovery-packages.js +0 -162
  60. package/dist/extensions/agent-browser/lib/electron/discovery-types.js +0 -2
  61. package/dist/extensions/agent-browser/lib/electron/discovery.js +0 -217
  62. package/dist/extensions/agent-browser/lib/electron/launch-monitor.js +0 -102
  63. package/dist/extensions/agent-browser/lib/electron/launch-process.js +0 -209
  64. package/dist/extensions/agent-browser/lib/electron/launch-types.js +0 -2
  65. package/dist/extensions/agent-browser/lib/electron/launch.js +0 -340
  66. package/dist/extensions/agent-browser/lib/executable-path.js +0 -29
  67. package/dist/extensions/agent-browser/lib/execution-cwd.js +0 -67
  68. package/dist/extensions/agent-browser/lib/fs-utils.js +0 -10
  69. package/dist/extensions/agent-browser/lib/input-modes/electron.js +0 -201
  70. package/dist/extensions/agent-browser/lib/input-modes/job.js +0 -198
  71. package/dist/extensions/agent-browser/lib/input-modes/lookup-network-evidence.js +0 -116
  72. package/dist/extensions/agent-browser/lib/input-modes/lookup-plan.js +0 -132
  73. package/dist/extensions/agent-browser/lib/input-modes/lookup-redaction.js +0 -57
  74. package/dist/extensions/agent-browser/lib/input-modes/lookup-source-evidence.js +0 -151
  75. package/dist/extensions/agent-browser/lib/input-modes/lookup-workspace.js +0 -142
  76. package/dist/extensions/agent-browser/lib/input-modes/lookups.js +0 -84
  77. package/dist/extensions/agent-browser/lib/input-modes/params.js +0 -195
  78. package/dist/extensions/agent-browser/lib/input-modes/qa-analysis.js +0 -268
  79. package/dist/extensions/agent-browser/lib/input-modes/qa-presentation.js +0 -117
  80. package/dist/extensions/agent-browser/lib/input-modes/script-child.js +0 -396
  81. package/dist/extensions/agent-browser/lib/input-modes/script-protocol.js +0 -86
  82. package/dist/extensions/agent-browser/lib/input-modes/script-types.js +0 -1
  83. package/dist/extensions/agent-browser/lib/input-modes/script-validation.js +0 -60
  84. package/dist/extensions/agent-browser/lib/input-modes/script.js +0 -108
  85. package/dist/extensions/agent-browser/lib/input-modes/semantic-action.js +0 -243
  86. package/dist/extensions/agent-browser/lib/input-modes/shared.js +0 -48
  87. package/dist/extensions/agent-browser/lib/input-modes/types.js +0 -65
  88. package/dist/extensions/agent-browser/lib/json-schema.js +0 -65
  89. package/dist/extensions/agent-browser/lib/launch-scoped-flags.js +0 -212
  90. package/dist/extensions/agent-browser/lib/managed-session-policy-lock.js +0 -165
  91. package/dist/extensions/agent-browser/lib/managed-session-posix-storage.js +0 -58
  92. package/dist/extensions/agent-browser/lib/managed-session-project-identity.js +0 -244
  93. package/dist/extensions/agent-browser/lib/managed-session-restore-context.js +0 -84
  94. package/dist/extensions/agent-browser/lib/managed-session-restore-policy.js +0 -119
  95. package/dist/extensions/agent-browser/lib/managed-session-restore-state.js +0 -83
  96. package/dist/extensions/agent-browser/lib/managed-session-restore.js +0 -212
  97. package/dist/extensions/agent-browser/lib/managed-session-snapshot-records.js +0 -277
  98. package/dist/extensions/agent-browser/lib/managed-session-snapshots.js +0 -181
  99. package/dist/extensions/agent-browser/lib/managed-session-storage.js +0 -126
  100. package/dist/extensions/agent-browser/lib/native-confirmation.js +0 -140
  101. package/dist/extensions/agent-browser/lib/native-output.js +0 -81
  102. package/dist/extensions/agent-browser/lib/orchestration/batch-stdin.js +0 -182
  103. package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-merge.js +0 -30
  104. package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-paths.js +0 -188
  105. package/dist/extensions/agent-browser/lib/orchestration/browser-run/browser-observation-result.js +0 -82
  106. package/dist/extensions/agent-browser/lib/orchestration/browser-run/click-dispatch.js +0 -406
  107. package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostic-values.js +0 -31
  108. package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.js +0 -240
  109. package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-observation.js +0 -203
  110. package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-text-diagnostics.js +0 -109
  111. package/dist/extensions/agent-browser/lib/orchestration/browser-run/fill-diagnostics.js +0 -119
  112. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-action-recovery.js +0 -147
  113. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-actions.js +0 -144
  114. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-content.js +0 -123
  115. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-contracts.js +0 -1
  116. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-details.js +0 -156
  117. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-electron.js +0 -187
  118. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-evidence.js +0 -39
  119. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-missing-binary.js +0 -89
  120. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-recovery.js +0 -97
  121. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-redaction.js +0 -106
  122. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-timeout.js +0 -110
  123. package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result.js +0 -53
  124. package/dist/extensions/agent-browser/lib/orchestration/browser-run/index.js +0 -224
  125. package/dist/extensions/agent-browser/lib/orchestration/browser-run/interaction-diagnostics.js +0 -290
  126. package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-close.js +0 -167
  127. package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-inspection.js +0 -108
  128. package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-policy.js +0 -174
  129. package/dist/extensions/agent-browser/lib/orchestration/browser-run/native-helper-observation.js +0 -65
  130. package/dist/extensions/agent-browser/lib/orchestration/browser-run/observation-types.js +0 -1
  131. package/dist/extensions/agent-browser/lib/orchestration/browser-run/overlay-diagnostics.js +0 -120
  132. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/network-page-filter.js +0 -192
  133. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/scroll-shims.js +0 -225
  134. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter-data.js +0 -150
  135. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter.js +0 -174
  136. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-rendered-text.js +0 -147
  137. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/wait-timeouts.js +0 -145
  138. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-artifacts.js +0 -159
  139. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-command.js +0 -131
  140. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-contracts.js +0 -1
  141. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-daemon.js +0 -93
  142. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-failure.js +0 -42
  143. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-guards.js +0 -242
  144. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-input.js +0 -75
  145. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-observations.js +0 -92
  146. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-selection.js +0 -254
  147. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-state.js +0 -121
  148. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-refs.js +0 -130
  149. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-resources.js +0 -114
  150. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-semantic.js +0 -121
  151. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-session-plan.js +0 -222
  152. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-timeouts.js +0 -68
  153. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare.js +0 -202
  154. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-analysis.js +0 -191
  155. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-confirmation.js +0 -152
  156. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-diagnostics.js +0 -182
  157. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-electron.js +0 -150
  158. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-contracts.js +0 -1
  159. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase-contracts.js +0 -1
  160. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase.js +0 -115
  161. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle.js +0 -256
  162. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed-contracts.js +0 -1
  163. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed.js +0 -256
  164. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase-contracts.js +0 -1
  165. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase.js +0 -93
  166. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native.js +0 -113
  167. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation-contracts.js +0 -1
  168. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation.js +0 -316
  169. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-ownership.js +0 -28
  170. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase-contracts.js +0 -1
  171. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase.js +0 -142
  172. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation-contracts.js +0 -1
  173. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation.js +0 -333
  174. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase-contracts.js +0 -1
  175. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase.js +0 -71
  176. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication.js +0 -201
  177. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-receipts.js +0 -183
  178. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-refs.js +0 -200
  179. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-tabs.js +0 -142
  180. package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output.js +0 -25
  181. package/dist/extensions/agent-browser/lib/orchestration/browser-run/prompt-guards.js +0 -50
  182. package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-receipt-reconciliation.js +0 -198
  183. package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-contracts.js +0 -1
  184. package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-presentation.js +0 -154
  185. package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery.js +0 -80
  186. package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-capture.js +0 -14
  187. package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-observation.js +0 -206
  188. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-commands.js +0 -130
  189. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-electron.js +0 -212
  190. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-observations.js +0 -61
  191. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-outcomes.js +0 -187
  192. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-refs.js +0 -169
  193. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-tabs.js +0 -228
  194. package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state.js +0 -117
  195. package/dist/extensions/agent-browser/lib/orchestration/browser-run/text-visibility-diagnostics.js +0 -182
  196. package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-diagnostics.js +0 -256
  197. package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-progress.js +0 -108
  198. package/dist/extensions/agent-browser/lib/orchestration/browser-run/types.js +0 -1
  199. package/dist/extensions/agent-browser/lib/orchestration/code-artifact-observation.js +0 -39
  200. package/dist/extensions/agent-browser/lib/orchestration/code-image-observation.js +0 -119
  201. package/dist/extensions/agent-browser/lib/orchestration/electron-host/branch.js +0 -93
  202. package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup-result.js +0 -58
  203. package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup.js +0 -78
  204. package/dist/extensions/agent-browser/lib/orchestration/electron-host/contracts.js +0 -1
  205. package/dist/extensions/agent-browser/lib/orchestration/electron-host/discovery.js +0 -106
  206. package/dist/extensions/agent-browser/lib/orchestration/electron-host/index.js +0 -60
  207. package/dist/extensions/agent-browser/lib/orchestration/electron-host/policy.js +0 -86
  208. package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-collection.js +0 -68
  209. package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-data.js +0 -169
  210. package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-presentation.js +0 -182
  211. package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe.js +0 -161
  212. package/dist/extensions/agent-browser/lib/orchestration/electron-host/status.js +0 -167
  213. package/dist/extensions/agent-browser/lib/orchestration/execution-queue.js +0 -98
  214. package/dist/extensions/agent-browser/lib/orchestration/extension-artifact-preflight.js +0 -211
  215. package/dist/extensions/agent-browser/lib/orchestration/extension-artifacts.js +0 -23
  216. package/dist/extensions/agent-browser/lib/orchestration/extension-attachment-replay.js +0 -99
  217. package/dist/extensions/agent-browser/lib/orchestration/extension-branch-restore.js +0 -275
  218. package/dist/extensions/agent-browser/lib/orchestration/extension-code.js +0 -280
  219. package/dist/extensions/agent-browser/lib/orchestration/extension-command-admission.js +0 -303
  220. package/dist/extensions/agent-browser/lib/orchestration/extension-command-output.js +0 -36
  221. package/dist/extensions/agent-browser/lib/orchestration/extension-command-result.js +0 -335
  222. package/dist/extensions/agent-browser/lib/orchestration/extension-command-run.js +0 -227
  223. package/dist/extensions/agent-browser/lib/orchestration/extension-command-state.js +0 -1
  224. package/dist/extensions/agent-browser/lib/orchestration/extension-electron-ownership.js +0 -204
  225. package/dist/extensions/agent-browser/lib/orchestration/extension-execution-locks.js +0 -139
  226. package/dist/extensions/agent-browser/lib/orchestration/extension-execution-queue.js +0 -24
  227. package/dist/extensions/agent-browser/lib/orchestration/extension-host-coordination.js +0 -98
  228. package/dist/extensions/agent-browser/lib/orchestration/extension-host-run.js +0 -295
  229. package/dist/extensions/agent-browser/lib/orchestration/extension-intent-replay.js +0 -41
  230. package/dist/extensions/agent-browser/lib/orchestration/extension-invocation.js +0 -7
  231. package/dist/extensions/agent-browser/lib/orchestration/extension-lifecycle.js +0 -102
  232. package/dist/extensions/agent-browser/lib/orchestration/extension-managed-ownership.js +0 -133
  233. package/dist/extensions/agent-browser/lib/orchestration/extension-observation.js +0 -120
  234. package/dist/extensions/agent-browser/lib/orchestration/extension-prompt.js +0 -180
  235. package/dist/extensions/agent-browser/lib/orchestration/extension-recording.js +0 -290
  236. package/dist/extensions/agent-browser/lib/orchestration/extension-resource-contracts.js +0 -1
  237. package/dist/extensions/agent-browser/lib/orchestration/extension-resource-replay.js +0 -269
  238. package/dist/extensions/agent-browser/lib/orchestration/extension-result-state.js +0 -113
  239. package/dist/extensions/agent-browser/lib/orchestration/extension-runtime.js +0 -146
  240. package/dist/extensions/agent-browser/lib/orchestration/extension-script-leases.js +0 -58
  241. package/dist/extensions/agent-browser/lib/orchestration/extension-tool-boundary.js +0 -62
  242. package/dist/extensions/agent-browser/lib/orchestration/extension-version-check.js +0 -54
  243. package/dist/extensions/agent-browser/lib/orchestration/input-plan-types.js +0 -1
  244. package/dist/extensions/agent-browser/lib/orchestration/input-plan.js +0 -313
  245. package/dist/extensions/agent-browser/lib/orchestration/input-redaction.js +0 -62
  246. package/dist/extensions/agent-browser/lib/orchestration/native-config.js +0 -144
  247. package/dist/extensions/agent-browser/lib/orchestration/native-root-launch.js +0 -77
  248. package/dist/extensions/agent-browser/lib/orchestration/native-session-defaults.js +0 -231
  249. package/dist/extensions/agent-browser/lib/orchestration/operation-paths.js +0 -142
  250. package/dist/extensions/agent-browser/lib/orchestration/output-file.js +0 -276
  251. package/dist/extensions/agent-browser/lib/orchestration/script-mode.js +0 -220
  252. package/dist/extensions/agent-browser/lib/owned-managed-session-context.js +0 -55
  253. package/dist/extensions/agent-browser/lib/page-target-batch.js +0 -118
  254. package/dist/extensions/agent-browser/lib/page-target-guards.js +0 -50
  255. package/dist/extensions/agent-browser/lib/page-target-navigation.js +0 -104
  256. package/dist/extensions/agent-browser/lib/page-target-validation.js +0 -90
  257. package/dist/extensions/agent-browser/lib/parsing.js +0 -30
  258. package/dist/extensions/agent-browser/lib/pi-tool-rendering.js +0 -343
  259. package/dist/extensions/agent-browser/lib/playbook.js +0 -146
  260. package/dist/extensions/agent-browser/lib/process-child.js +0 -284
  261. package/dist/extensions/agent-browser/lib/process-environment.js +0 -48
  262. package/dist/extensions/agent-browser/lib/process-errors.js +0 -23
  263. package/dist/extensions/agent-browser/lib/process-identity.js +0 -127
  264. package/dist/extensions/agent-browser/lib/process-socket-storage.js +0 -256
  265. package/dist/extensions/agent-browser/lib/process-stdout.js +0 -74
  266. package/dist/extensions/agent-browser/lib/process.js +0 -216
  267. package/dist/extensions/agent-browser/lib/prompt-artifacts.js +0 -287
  268. package/dist/extensions/agent-browser/lib/prompt-policy.js +0 -54
  269. package/dist/extensions/agent-browser/lib/read-command.js +0 -41
  270. package/dist/extensions/agent-browser/lib/read-confirmation.js +0 -162
  271. package/dist/extensions/agent-browser/lib/recording-reservations.js +0 -208
  272. package/dist/extensions/agent-browser/lib/redaction-fields.js +0 -75
  273. package/dist/extensions/agent-browser/lib/redaction-json.js +0 -149
  274. package/dist/extensions/agent-browser/lib/redaction-url.js +0 -88
  275. package/dist/extensions/agent-browser/lib/results/action-contracts.js +0 -1
  276. package/dist/extensions/agent-browser/lib/results/action-recommendations.js +0 -38
  277. package/dist/extensions/agent-browser/lib/results/artifact-contracts.js +0 -1
  278. package/dist/extensions/agent-browser/lib/results/artifact-manifest-validation.js +0 -133
  279. package/dist/extensions/agent-browser/lib/results/artifact-manifest.js +0 -173
  280. package/dist/extensions/agent-browser/lib/results/artifact-recommendations.js +0 -73
  281. package/dist/extensions/agent-browser/lib/results/categories.js +0 -152
  282. package/dist/extensions/agent-browser/lib/results/confirmation.js +0 -75
  283. package/dist/extensions/agent-browser/lib/results/contracts.js +0 -1
  284. package/dist/extensions/agent-browser/lib/results/editable-ref-evidence.js +0 -99
  285. package/dist/extensions/agent-browser/lib/results/electron-recommendations.js +0 -83
  286. package/dist/extensions/agent-browser/lib/results/envelope-decoding.js +0 -48
  287. package/dist/extensions/agent-browser/lib/results/envelope.js +0 -198
  288. package/dist/extensions/agent-browser/lib/results/evidence-contracts.js +0 -1
  289. package/dist/extensions/agent-browser/lib/results/failure-recommendations.js +0 -180
  290. package/dist/extensions/agent-browser/lib/results/network-routes.js +0 -133
  291. package/dist/extensions/agent-browser/lib/results/network.js +0 -89
  292. package/dist/extensions/agent-browser/lib/results/next-actions.js +0 -111
  293. package/dist/extensions/agent-browser/lib/results/presentation/artifact-files.js +0 -320
  294. package/dist/extensions/agent-browser/lib/results/presentation/artifact-format.js +0 -138
  295. package/dist/extensions/agent-browser/lib/results/presentation/artifact-images.js +0 -113
  296. package/dist/extensions/agent-browser/lib/results/presentation/artifact-verification.js +0 -145
  297. package/dist/extensions/agent-browser/lib/results/presentation/artifacts.js +0 -165
  298. package/dist/extensions/agent-browser/lib/results/presentation/batch-contracts.js +0 -1
  299. package/dist/extensions/agent-browser/lib/results/presentation/batch-recording.js +0 -118
  300. package/dist/extensions/agent-browser/lib/results/presentation/batch-redaction.js +0 -68
  301. package/dist/extensions/agent-browser/lib/results/presentation/batch-rendering.js +0 -135
  302. package/dist/extensions/agent-browser/lib/results/presentation/batch-step.js +0 -227
  303. package/dist/extensions/agent-browser/lib/results/presentation/batch-summary.js +0 -91
  304. package/dist/extensions/agent-browser/lib/results/presentation/batch.js +0 -123
  305. package/dist/extensions/agent-browser/lib/results/presentation/browser-profile-recovery.js +0 -54
  306. package/dist/extensions/agent-browser/lib/results/presentation/command-presenters.js +0 -216
  307. package/dist/extensions/agent-browser/lib/results/presentation/common.js +0 -81
  308. package/dist/extensions/agent-browser/lib/results/presentation/content.js +0 -119
  309. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-a11y.js +0 -67
  310. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-health.js +0 -79
  311. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-identity.js +0 -199
  312. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-logs.js +0 -75
  313. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network-actions.js +0 -216
  314. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network.js +0 -124
  315. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-redaction.js +0 -64
  316. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-storage.js +0 -209
  317. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-stream.js +0 -69
  318. package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-summary.js +0 -222
  319. package/dist/extensions/agent-browser/lib/results/presentation/diagnostics.js +0 -124
  320. package/dist/extensions/agent-browser/lib/results/presentation/early-result.js +0 -70
  321. package/dist/extensions/agent-browser/lib/results/presentation/errors.js +0 -285
  322. package/dist/extensions/agent-browser/lib/results/presentation/input-contracts.js +0 -1
  323. package/dist/extensions/agent-browser/lib/results/presentation/large-output.js +0 -117
  324. package/dist/extensions/agent-browser/lib/results/presentation/navigation.js +0 -231
  325. package/dist/extensions/agent-browser/lib/results/presentation/notices.js +0 -75
  326. package/dist/extensions/agent-browser/lib/results/presentation/observation-contracts.js +0 -1
  327. package/dist/extensions/agent-browser/lib/results/presentation/observation-rendering.js +0 -127
  328. package/dist/extensions/agent-browser/lib/results/presentation/outcomes.js +0 -120
  329. package/dist/extensions/agent-browser/lib/results/presentation/output-completion.js +0 -77
  330. package/dist/extensions/agent-browser/lib/results/presentation/output-spill.js +0 -51
  331. package/dist/extensions/agent-browser/lib/results/presentation/registry.js +0 -145
  332. package/dist/extensions/agent-browser/lib/results/presentation/semantic-action.js +0 -104
  333. package/dist/extensions/agent-browser/lib/results/presentation/skills.js +0 -183
  334. package/dist/extensions/agent-browser/lib/results/presentation/source.js +0 -109
  335. package/dist/extensions/agent-browser/lib/results/presentation.js +0 -19
  336. package/dist/extensions/agent-browser/lib/results/recommendation-contracts.js +0 -1
  337. package/dist/extensions/agent-browser/lib/results/recording.js +0 -88
  338. package/dist/extensions/agent-browser/lib/results/recovery-actions.js +0 -118
  339. package/dist/extensions/agent-browser/lib/results/recovery-next-actions.js +0 -60
  340. package/dist/extensions/agent-browser/lib/results/selector-recovery-target.js +0 -83
  341. package/dist/extensions/agent-browser/lib/results/selector-recovery.js +0 -261
  342. package/dist/extensions/agent-browser/lib/results/snapshot-compact.js +0 -266
  343. package/dist/extensions/agent-browser/lib/results/snapshot-content.js +0 -32
  344. package/dist/extensions/agent-browser/lib/results/snapshot-high-value-controls.js +0 -240
  345. package/dist/extensions/agent-browser/lib/results/snapshot-refs.js +0 -103
  346. package/dist/extensions/agent-browser/lib/results/snapshot-segments.js +0 -383
  347. package/dist/extensions/agent-browser/lib/results/snapshot-spill.js +0 -53
  348. package/dist/extensions/agent-browser/lib/results/snapshot.js +0 -44
  349. package/dist/extensions/agent-browser/lib/results/text.js +0 -44
  350. package/dist/extensions/agent-browser/lib/runtime-args-validation.js +0 -133
  351. package/dist/extensions/agent-browser/lib/runtime-compatibility.js +0 -81
  352. package/dist/extensions/agent-browser/lib/runtime-contracts.js +0 -1
  353. package/dist/extensions/agent-browser/lib/runtime-redaction.js +0 -118
  354. package/dist/extensions/agent-browser/lib/runtime-replay-events.js +0 -144
  355. package/dist/extensions/agent-browser/lib/runtime-session-identity.js +0 -76
  356. package/dist/extensions/agent-browser/lib/runtime-session-plan.js +0 -114
  357. package/dist/extensions/agent-browser/lib/runtime-session-replay.js +0 -123
  358. package/dist/extensions/agent-browser/lib/runtime-tab-correction.js +0 -65
  359. package/dist/extensions/agent-browser/lib/runtime-timeouts.js +0 -28
  360. package/dist/extensions/agent-browser/lib/runtime.js +0 -163
  361. package/dist/extensions/agent-browser/lib/session-identity.js +0 -51
  362. package/dist/extensions/agent-browser/lib/session-page-observation.js +0 -357
  363. package/dist/extensions/agent-browser/lib/session-page-state.js +0 -353
  364. package/dist/extensions/agent-browser/lib/session-page-types.js +0 -1
  365. package/dist/extensions/agent-browser/lib/string-enum-schema.js +0 -8
  366. package/dist/extensions/agent-browser/lib/temp-artifact-budget.js +0 -81
  367. package/dist/extensions/agent-browser/lib/temp-mutation-queue.js +0 -7
  368. package/dist/extensions/agent-browser/lib/temp-root-ownership.js +0 -234
  369. package/dist/extensions/agent-browser/lib/temp-root.js +0 -211
  370. package/dist/extensions/agent-browser/lib/temp.js +0 -91
  371. package/dist/extensions/agent-browser/lib/tool-surface.js +0 -239
  372. package/dist/extensions/agent-browser/lib/upstream-version.js +0 -15
  373. package/dist/extensions/agent-browser/lib/web-search-providers.js +0 -193
  374. package/dist/extensions/agent-browser/lib/web-search-request.js +0 -102
  375. package/dist/extensions/agent-browser/lib/web-search-results.js +0 -281
  376. package/dist/extensions/agent-browser/lib/web-search-schema.js +0 -82
  377. package/dist/extensions/agent-browser/lib/web-search.js +0 -167
  378. package/dist/extensions/agent-browser/lib/webmcp-observation.js +0 -35
  379. package/dist/extensions/agent-browser/lib/windows-stock-launcher.js +0 -96
  380. package/dist/scripts/agent-browser-target.mjs +0 -23
@@ -16,6 +16,16 @@ The package install path is the primary product path. Local checkout development
16
16
 
17
17
  Runtime graphs that use Pi host APIs are statically imported through Pi's extension loader, which supplies the host-peer mapping. Native ESM lazy imports must not bypass that mapping: a runtime-only global package does not install its optional Pi peers. The browser runner and observation/image publication retain Pi's native image primitives without a package-owned resolver or bundled host.
18
18
 
19
+ The build keeps the complete emitted checkout tree, with its shared module-owned
20
+ process environment and temporary-artifact cleanup state. Only the canonical
21
+ `dist/extensions/agent-browser/index.js` is replaced by its bundle; the worker and
22
+ all emitted libraries remain untouched. Six private package-only helper bundles
23
+ live under `dist/packaged/lib/`: config policy, offline session conversion, parsing,
24
+ playbook, snapshot, and runtime. npm publishes those helpers, the canonical extension,
25
+ and the unchanged permissioned worker through exact `package.json` paths. CLI imports
26
+ use the private packaged helpers; package imports stay external, including optional
27
+ Pi peers. GitHub/source installs retain the same `prepare` build.
28
+
19
29
  ## Chosen shape
20
30
 
21
31
  ### Compact tools and native discovery
@@ -60,7 +70,7 @@ All participating Pi processes must restart with the updated package. The lock i
60
70
 
61
71
  `lib/browser-transcript.ts` defines one canonical `data.event` format and optional once-stored `data.snapshot`. Direct, advanced, code and Electron host operations record begin/finish receipts before dispatch and after observed effects, using outer tool-call ID plus inner index and a unique operation ID. The shared page reducer retains an inaccessible candidate during unresolved work and requires explicit reuse/replace/invalidate/unknown disposition. Ordinary results omit unchanged maps and unrelated artifact receipts; journal events carry redacted artifact-row changes in commit order. Final rendering queues actual spill writes and manifest publication, allowing unrelated small observations to finish while another namespace holds its artifact/lifecycle operation. `lib/orchestration/browser-run/artifact-merge.ts` preserves concurrent three-way manifest updates and recording lifecycle order. Native lifecycle evidence is retained before presentation/export. Failed begin blocks dispatch; failed finish stops dependent work and requires inspection without mutation replay. A named persistent journal requires actual publication even before Pi's first conversation. Disabled/no-file sessions use the native current in-memory ancestry for direct browser work without claiming durability; code still requires a published intent journal. Observation-only artifact receipts are optional without a published journal, so sessionless local results retain complete redacted private spills and selected files. Code lifecycle joins include outer finalization, and the shared generation guard keeps prior-branch observation spills process-private and prevents their artifact publication onto the new branch. JavaScript variables are never persisted.
62
72
 
63
- `lib/browser-journal.ts` token-projects published envelopes and ancestry through public Pi file/header/leaf APIs, loading only winning snapshot definitions. It captures the selected leaf before asynchronous reads and validates that same branch through public `getEntry()` ancestry on both hosts. Capture-local admission reuses a validated append-only prefix while checking endpoint identity/parent and new suffixes; publication/durability checks remain independent. Startup/tree restoration uses one queued captured replay for branch state and cleanup leases, with one per-session launch-configuration fold. Stock official 1.0.0 still eagerly loads native history before extension startup. Legacy adapters live only in `lib/browser-session-conversion.ts`, which publishes a validated stopped separate copy while retaining the source. Native generation checks use PID/start and socket identity, never saved URL or delta revision alone. Filtered/helper captures share this check. Small owner-qualified launch receipts retain observed restore-key provenance; restart verifies the current native generation and key before treating that provenance as live. Full storage, migration and consumer-memory boundaries are documented in [`SESSION_STORAGE.md`](SESSION_STORAGE.md).
73
+ `lib/browser-journal.ts` token-projects published envelopes and ancestry through public Pi file/header/leaf APIs, loading only winning snapshot definitions. It captures the selected leaf before asynchronous reads and validates that same branch through public `getEntry()` ancestry on both hosts. Capture-local admission reuses a validated append-only prefix while checking endpoint identity/parent and new suffixes; publication/durability checks remain independent. Startup/tree restoration uses one queued captured replay for branch state and cleanup leases, with one per-session launch-configuration fold. Stock official 1.0.0 still eagerly loads native history before extension startup. `lib/browser-legacy-projection.ts` and its shared field projection normalize historical receipts read-only into this same canonical reducer at the journal boundary. Normal resume keeps the original bytes and locator; mixed-format ancestry, confirmation settings/provenance and cleanup ownership remain branch-relative. Non-winning legacy maps are discarded after each receipt. Native event validation cannot downgrade to the legacy path. `lib/browser-session-conversion.ts` reuses that decoder only when an operator explicitly requests a validated stopped separate archive copy. Native generation checks use PID/start and socket identity, never saved URL or delta revision alone. Filtered/helper captures share this check. Small owner-qualified launch receipts retain observed restore-key provenance; restart verifies the current native generation and key before treating that provenance as live. Full storage, migration and consumer-memory boundaries are documented in [`SESSION_STORAGE.md`](SESSION_STORAGE.md).
64
74
 
65
75
  ### Canonical observations and image geometry
66
76
 
@@ -32,6 +32,12 @@ Review fixes before committing; dangerous fixes and suggestion fixes are not par
32
32
  `lint:fix`. Run formatting after reviewed lint fixes and rerun acceptance. Failures
33
33
  are never converted to success by these commands.
34
34
 
35
+ The default, quality, pre-pr, platform-target, and release facades run scope and
36
+ suppression-policy validation once through `lint`, before the corrected checker.
37
+ Standalone `quality:policy` and `quality:scope` remain available for focused
38
+ inspection and intentional scope regeneration; running them separately in the
39
+ facade would repeat the same validation without adding coverage.
40
+
35
41
  ### Test scheduling
36
42
 
37
43
  `npm test` builds once and prepares the corrected checker once, then runs
@@ -53,6 +59,11 @@ than rewriting this checkout's `dist/` while other files consume it.
53
59
  focused serial checker suite. The allowance-isolation mutation must fail in the
54
60
  parallel stage with its named `code-quality.test.ts` diagnostic.
55
61
 
62
+ The real prepare/pack fixture in `test/verify-package.test.ts` also runs a plain
63
+ Node child against emitted checkout modules. It verifies shared process-environment
64
+ session/namespace propagation and snapshot-spill cleanup through the imported temp
65
+ owner; source-loaded tests cannot detect bundles overwriting these shared modules.
66
+
56
67
  ## Language and role scope
57
68
 
58
69
  The root `.oxlintrc.json` enables type-aware rules and compiler diagnostics. The
@@ -567,7 +567,7 @@ Detailed receipt/live-browser fields and browser-independent native read/confirm
567
567
 
568
568
  #### Artifact retention and dogfood-heavy QA runs
569
569
 
570
- The wrapper's internal recent artifact view defaults to 100 metadata rows, configurable with `PI_AGENT_BROWSER_SESSION_ARTIFACT_MANIFEST_MAX_ENTRIES=<count>`. That cap bounds the current view, not append-only history. Journal events store row changes; `details.artifactManifest` contains changed or referenced receipts for this invocation rather than the unchanged history. Complete reference captures are likewise defined once, with small reuse/invalidation events. See [browser session storage and stopped-copy conversion](SESSION_STORAGE.md).
570
+ The wrapper's internal recent artifact view defaults to 100 metadata rows, configurable with `PI_AGENT_BROWSER_SESSION_ARTIFACT_MANIFEST_MAX_ENTRIES=<count>`. That cap bounds the current view, not append-only history. Journal events store row changes; `details.artifactManifest` contains changed or referenced receipts for this invocation rather than the unchanged history. Complete reference captures are likewise defined once, with small reuse/invalidation events. Historical browser journals resume automatically at the original path without rewriting history; the same ref and native-generation checks still apply. See [browser session storage](SESSION_STORAGE.md).
571
571
 
572
572
  This cap controls the internal recent view and summaries such as `Session artifacts: 42 live, 0 evicted (42/100 recent)`. It does not delete explicit files that upstream saved to paths you chose, such as screenshots, PDFs, downloads, traces, HAR files, or WebM recordings.
573
573
 
@@ -1129,7 +1129,7 @@ Other useful environment variables include `AGENT_BROWSER_DEFAULT_TIMEOUT`, `AGE
1129
1129
 
1130
1130
  <!-- agent-browser-playbook:end wrapper-tab-recovery -->
1131
1131
 
1132
- - Wrapper-spawned commands clamp `AGENT_BROWSER_DEFAULT_TIMEOUT` to the upstream documented 25-second default and use a 35-second child-process watchdog (`PI_AGENT_BROWSER_PROCESS_TIMEOUT_MS` overrides the default 35s budget; top-level `timeoutMs` overrides it per browser CLI call). Explicit `wait <ms>`, `wait --timeout <ms>`, and WebMCP `invoke` / `result --timeout <ms>` calls can exceed that default; when top-level `timeoutMs` is omitted, the wrapper derives a subprocess watchdog from the requested command duration plus a small grace window. Batch budgeting and timeout recovery read the same effective source as upstream: raw command strings when present, otherwise stdin rows. Dialog commands are additionally bounded to 5 seconds (`PI_AGENT_BROWSER_DIALOG_PROCESS_TIMEOUT_MS`), and click/tap/find refs or tokens plus `eval --stdin` snippets that look like alert/confirm/prompt/dialog triggers are bounded to 8 seconds (`PI_AGENT_BROWSER_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS`). A `session info` timeout returns only an exact-session `retry-session-info` status action, without page probes, liveness claims, or changes to existing page/ref state. When a browser-operation watchdog fires, `details.timeoutPartialProgress` may include a planned step list with `status: "unknown"` (including `generatedFrom` labels for generated QA rows). Current URLs and existing files do not establish which steps ran, failed, or remained pending. Multi-step timeouts offer `inspect-current-page-after-timeout` when the target is already verified, rather than guessing a retry position. A single read-only or idempotent step may offer a `retry-timeout-step` candidate with a one-row native batch (`args: ["batch"]` plus `stdin`); inspect the current state before retrying because its outcome is still unknown. If the target is unknown, standalone snapshots are removed and visible failure text plus `details.nextActions` show `verify-page-target-after-timeout`, including its session-scoped `batch --bail` args and short stdin for fail-fast `get url` then `snapshot -i`; dialog status/accept/dismiss actions remain allowed for blocking-dialog recovery. It also includes current page URL from best-effort session `get url`, followed by `get title` only after a URL is recovered (or a planned URL inferred from the step list when the session cannot answer), and declared artifact paths such as `screenshot`, `pdf`, `download`, or `wait --download` outputs with existence/state checks; the same evidence is appended under `Timeout partial progress` in visible text with URL/path redaction.
1132
+ - Wrapper-spawned commands clamp `AGENT_BROWSER_DEFAULT_TIMEOUT` to the upstream documented 25-second default and use a 35-second child-process watchdog (`PI_AGENT_BROWSER_PROCESS_TIMEOUT_MS` overrides the default 35s budget; top-level `timeoutMs` overrides it per browser CLI call). Explicit `wait <ms>`, `wait --timeout <ms>`, and WebMCP `invoke` / `result --timeout <ms>` calls can exceed that default; when top-level `timeoutMs` is omitted, the wrapper derives a subprocess watchdog from the requested command duration plus a small grace window. Batch budgeting and timeout recovery read the same effective source as upstream: raw command strings when present, otherwise stdin rows. Dialog commands are additionally bounded to 5 seconds (`PI_AGENT_BROWSER_DIALOG_PROCESS_TIMEOUT_MS`), and click/tap/find refs or tokens plus `eval --stdin` snippets that look like alert/confirm/prompt/dialog triggers are bounded to 8 seconds (`PI_AGENT_BROWSER_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS`). A `session info` timeout returns only an exact-session `retry-session-info` status action, without page probes, liveness claims, or changes to existing page/ref state. When a browser-operation watchdog fires, `details.timeoutPartialProgress` may include a planned step list with `status: "unknown"` (including `generatedFrom` labels for generated QA rows). Current URLs and existing files do not establish which steps ran, failed, or remained pending. Multi-step timeouts offer `inspect-current-page-after-timeout` when the target is already verified, rather than guessing a retry position. A single read-only or idempotent step may offer a `retry-timeout-step` candidate with a one-row native batch (`args: ["batch"]` plus `stdin`); inspect the current state before retrying because its outcome is still unknown. If the target is unknown, standalone snapshots are removed and visible failure text plus `details.nextActions` show `verify-page-target-after-timeout`, including its session-scoped `batch --bail` args and short stdin for fail-fast `get url` then `snapshot -i`; dialog status/accept/dismiss actions remain allowed for blocking-dialog recovery. It also includes current page URL from best-effort session `get url`, followed by `get title` only after a URL is recovered (or a planned URL inferred from the step list when the session cannot answer), and declared artifact paths such as `screenshot`, `pdf`, `download`, or `wait --download` outputs with existence/state checks. Independent artifact retry windows overlap (up to three checks per path, 25 ms apart), preserve plan order, and settle before page inspection; files finishing after their own window may remain missing. The same evidence is appended under `Timeout partial progress` in visible text with URL/path redaction.
1133
1133
  - Oversized snapshots and oversized generic outputs may be compacted in tool content, with the full redacted output written to a spill file path shown directly in the tool result. Recent artifact metadata is bounded by `PI_AGENT_BROWSER_SESSION_ARTIFACT_MANIFEST_MAX_ENTRIES` (default 100); persisted spill files have a separate `PI_AGENT_BROWSER_SESSION_ARTIFACT_MAX_BYTES` budget (default 32 MiB; `0` disables automatic eviction).
1134
1134
  - The wrapper keeps `--help` and `--version` stateless so they do not consume the implicit managed-session slot.
1135
1135
 
@@ -0,0 +1,243 @@
1
+ # Performance
2
+
3
+ The extension avoids redundant work while preserving native browser capabilities,
4
+ validation, redaction, page-target checks, transcript integrity, and cleanup
5
+ ownership. The largest improvements are in large-result processing and offline
6
+ journal conversion. Browser navigation and model latency remain outside those
7
+ CPU measurements.
8
+
9
+ ## Captured baseline and integrated result
10
+
11
+ The [retained measurement record](performance/2026-10-12.json) compares baseline
12
+ `41467b70d255c06f5ec5e226a1adec420f8bcf4b` with the integrated runtime, identified by
13
+ source and compiled-tree hashes. Measurements used Node 24.21.0 on macOS arm64,
14
+ Apple M5 Pro, 18 logical CPUs, and 64 GiB RAM. This was a shared host: recorded load
15
+ varied substantially. Paired order was baseline / optimized / optimized / baseline.
16
+
17
+ ### Fixed compiled-owner workloads
18
+
19
+ Each side has 14 measured samples per workload, after two warmups in each run.
20
+ Values are pooled medians in milliseconds; CPU is process user + system time.
21
+ Outputs, recovery metadata, ordering, UTF-8, discarded JSON grammar, and recording
22
+ replacement controls passed on both revisions.
23
+
24
+ | Workload | Wall before → after | CPU before → after | CPU reduction |
25
+ | ------------------------------------------------- | ------------------: | -----------------: | ------------: |
26
+ | Redact 1 MiB prose with embedded credentials | 33.05 → 20.43 | 37.82 → 23.82 | 37.0% |
27
+ | Summarize 20,000 snapshot refs | 8.49 → 1.23 | 12.68 → 2.74 | 78.4% |
28
+ | Project batch metadata with 10,000 discarded rows | 22.10 → 0.14 | 26.73 → 0.18 | 99.3% |
29
+ | Merge 10,000 artifact entries | 591.48 → 3.46 | 609.91 → 6.37 | 99.0% |
30
+ | Project 1,000 small journal records | 47.58 → 13.42 | 101.96 → 27.34 | 73.2% |
31
+
32
+ These are deliberate scaling fixtures, not estimates of every ordinary call.
33
+ For example, batch projection's median transient heap delta fell from 59.24 MiB to
34
+ 0.064 MiB, but that delta is not a retained-memory or allocation-total measurement.
35
+ Automatic GC and scheduling still produced wall-time outliers; the record retains
36
+ all samples rather than trimming them.
37
+
38
+ ### Actual native browser calls
39
+
40
+ The registered extension tools also ran against real agent-browser **0.38.1** and
41
+ headless Chrome for Testing **151.0.7922.77**, using deterministic loopback pages,
42
+ automatic per-root sessions, two warmups, and 30 measured calls per workload on
43
+ each revision. These source-loaded harness calls include native/browser subprocess
44
+ latency; they do not include Pi's model/provider turn or external-site latency.
45
+
46
+ | Warm native workload | Median wall ms before → after |
47
+ | ---------------------------- | ----------------------------: |
48
+ | Title read with current refs | 156.14 → 127.19 |
49
+ | Selector text read | 188.21 → 158.55 |
50
+ | Interactive snapshot | 229.03 → 211.23 |
51
+ | Two-row native getter batch | 187.07 → 157.04 |
52
+ | One-getter browser code cell | 185.03 → 154.88 |
53
+
54
+ Host noise matters: one snapshot run was slower, 239.08 versus 229.25 ms;
55
+ its other pair improved. These samples do not establish a universal browser
56
+ speedup. Instrumented fake-native controls provide stronger work-count evidence:
57
+ qualifying title/batch calls drop from four subprocesses to three; snapshot and
58
+ eval drop from six to five; ref text/fill drop from five to four. No-ref and
59
+ unrelated explicit-session controls keep their existing three subprocesses.
60
+ Within-revision run medians varied by up to about 40 ms, so differences beyond
61
+ the eliminated subprocess are not causally attributed here.
62
+
63
+ Fifteen fresh import/factory samples on each revision remained below the existing
64
+ 250 ms budget: baseline 54.91–57.14 ms, optimized 55.29–58.44 ms. Ranges overlap,
65
+ so no startup improvement is claimed. Both sides included optional search-tool
66
+ registration without a search call. This diagnostic uses the locked development
67
+ SDK snapshot; latest official/fork host qualification is a separate delivery gate.
68
+
69
+ ### Additional owner-boundary evidence
70
+
71
+ Independent timeout-artifact checks remove cumulative retry waits: 1,000 missing
72
+ paths took a median 50,700.11 → 59.54 ms, while one path stayed 50.58 → 50.66 ms.
73
+ Across three 1,000-path runs, median process-wide sampled peaks were 19.19 MB
74
+ heapUsed and 89.33 MB RSS, compared with 13.92 MB / 82.30 MB before (1 ms sampling). This exchanges modest linear transient memory for
75
+ overlapping independent timers; it does not infer completed native steps.
76
+
77
+ The distinct-session conversion comparison isolates branch retention: its
78
+ pre-retention converter has the baseline retention logic **with the new tokenizer**,
79
+ not the unchanged baseline commit. At 2,000 identities, median process-wide sampled
80
+ peak heapUsed fell from 96.16 to 31.35 MB (1 ms sampling). At 4,000 identities,
81
+ that pre-retention converter aborted with heap exhaustion (exit 134); the optimized
82
+ converter completed with exact source/checksum checks. Both used `--max-old-space-size=128`; the actual total V8 heap limit was
83
+ 335,544,320 bytes, not a 128 MiB process-memory cap.
84
+ The separate integrated compiled >1 GiB proof converted 1,612,280,613 source
85
+ bytes to 1,078,631,285 bytes, verifying 34,683 refs, 100 receipts, three branches,
86
+ and 4,001 distinct sessions. Its actual V8 heap limit was 335,544,320 bytes and
87
+ peak RSS was 375,568 KiB. This correctness proof is separate from the smaller
88
+ scaling comparison.
89
+
90
+ Synthetic macOS discovery fixtures removed 360 unnecessary payload filesystem
91
+ requests (601 → 241), with median CPU 19.86 → 10.27 ms. The strict quality-prefix
92
+ fixture reduced duplicate policy passes from three to one, with median wall time
93
+ 6,085.27 → 3,665.97 ms. That is the prefix, not the entire quality workflow. Raw
94
+ owner measurements and their fixture protocols are retained alongside the final
95
+ integrated profiles.
96
+
97
+ ## Reproduce the warm-path profile
98
+
99
+ Use the repository's Node and npm versions, install its locked dependencies, and
100
+ build the target first:
101
+
102
+ ```sh
103
+ npm ci --ignore-scripts
104
+ npm run build
105
+ npm run performance-profile -- --samples 7 > performance.json
106
+ ```
107
+
108
+ The profiler imports compiled production owners and checks independently specified
109
+ outputs. It runs two warmups and records every measured sample for five fixed
110
+ workloads: 1 MiB prose redaction, a 20,000-ref snapshot summary, metadata projection
111
+ of a batch containing 10,000 data rows, a 10,000-entry artifact manifest, and 1,000
112
+ small journal projections. It does not launch a browser, Pi, npm, or a subprocess.
113
+
114
+ To compare revisions, build each in its own worktree and use the **same profiler**
115
+ against both compiled trees. Alternate the order to reduce host-load bias:
116
+
117
+ ```sh
118
+ node --expose-gc scripts/profile-performance.mjs --root ../baseline --samples 7 > baseline-a.json
119
+ node --expose-gc scripts/profile-performance.mjs --root . --samples 7 > optimized-a.json
120
+ node --expose-gc scripts/profile-performance.mjs --root . --samples 7 > optimized-b.json
121
+ node --expose-gc scripts/profile-performance.mjs --root ../baseline --samples 7 > baseline-b.json
122
+ ```
123
+
124
+ Keep Node, fixtures, configuration, and hardware constant. Do not run broad tests
125
+ or builds alongside timing samples. Source, compiled-tree, lockfile, fixture, and
126
+ profiler hashes identify the actual inputs; a package version alone is not a
127
+ revision identifier.
128
+
129
+ Wall time excludes imports, fixture construction, explicit pre-sample GC, and
130
+ output assertions. CPU includes process user and system time during that interval.
131
+ Heap deltas are transient `heapUsed` differences with the output still alive—not
132
+ allocation totals, retained memory, or peaks. RSS is process-wide; the reported
133
+ high-water mark also includes setup. Shared-host load and automatic GC remain
134
+ sources of variation. There are no warm-path timing thresholds.
135
+
136
+ Entrypoint startup has a separate fresh-process profiler and its existing 250 ms
137
+ budget:
138
+
139
+ ```sh
140
+ npm run verify -- startup-profile --samples 3
141
+ ```
142
+
143
+ That measurement is extension import/factory time, not full Pi startup or browser
144
+ launch time. See [the proof contract](REFERENCE.md#proof-and-verification).
145
+
146
+ ## What changed
147
+
148
+ ### Results and command planning
149
+
150
+ - Embedded-JSON redaction searches for structured-value openers and copies ordinary
151
+ prose in slices rather than appending every character. Balanced-value parsing,
152
+ malformed-input handling, credential redaction, and unchanged output survive.
153
+ - Snapshot summaries count the existing refs without constructing and sorting a
154
+ complete ref list that the summary never uses.
155
+ - Compact batch metadata excludes `data` and `stdout` before recursive projection
156
+ and redaction. Required metadata, warnings, and exact recovery actions remain;
157
+ full result and replay ownership do not move into the compact observation.
158
+ - Artifact-manifest merging materializes recording candidates only when the entry
159
+ can supersede a recording. Ordinary image entries no longer copy a growing map
160
+ for a check that immediately returns empty. Recording identity and ordering stay
161
+ unchanged.
162
+ - Argv descriptors reuse their already-cleaned command tokens. Launch-flag checks
163
+ discover command position only for the special `wait --state` distinction;
164
+ native boolean and restore flag semantics remain intact.
165
+
166
+ ### Journal and artifact storage
167
+
168
+ Journal projection uses the installed streaming parser's raw tokenizer instead of
169
+ building a Node stream pipeline for each record. Fatal incremental UTF-8 decoding,
170
+ full JSON validation—including discarded values—and an explicit end-of-input
171
+ flush remain required. The parser is still loaded lazily.
172
+
173
+ Both offline converters retain a branch projection only until its last source
174
+ child consumes it. Linear histories no longer retain every historical state map;
175
+ real forks keep the independent state they need. Conversion still verifies the
176
+ unchanged source and publishes an exclusive separate copy, never rewriting the
177
+ original journal. The large-journal proof includes an individual string above
178
+ Node's string ceiling and 4,000 distinct session identities:
179
+
180
+ ```sh
181
+ npm run build
182
+ node --max-old-space-size=128 test/helpers/large-browser-journal.mjs
183
+ ```
184
+
185
+ The `128` setting limits V8 old space, not total V8 heap or process RSS. Report
186
+ those separately. See [session storage](SESSION_STORAGE.md#verification).
187
+
188
+ Artifact-retention scans overlap four independent file stats at a time, preserving
189
+ scan order before eviction. This does not change the secure socket-directory
190
+ traversal or its validation/error order.
191
+
192
+ ### Browser execution and timeout recovery
193
+
194
+ A daemon observation may be reused only within one locked call, for its exact
195
+ socket/namespace/session identity, before any intervening browser helper. It is
196
+ not a cross-call cache. Replacement and unknown-generation checks remain
197
+ fail-closed; capture still obtains its distinct post-operation generation receipt.
198
+ Calls with no redundant observation keep their existing probes.
199
+
200
+ Independent timeout-artifact retry windows now overlap. Each declared path still
201
+ gets up to three checks, 25 ms apart; results retain native plan order and page
202
+ inspection starts afterward. A file finishing after **its own** window may remain
203
+ missing. Existing files and recovered URLs remain current-state evidence, never
204
+ proof that a timed-out step executed. See
205
+ [the timeout contract](TOOL_CONTRACT.md#details).
206
+
207
+ ### Discovery, verification, and packages
208
+
209
+ macOS Electron discovery stops after a missing framework instead of also probing
210
+ its payload. Positive app verification and discovery order are unchanged.
211
+
212
+ The quality facade runs scope and suppression-policy validation once through
213
+ `lint`, rather than also repeating those checks as standalone steps. The same
214
+ strict checker, compiler, formatting, tests, mutation probes, and document checks
215
+ remain required.
216
+
217
+ The build retains the complete emitted checkout tree. npm selects the bundled
218
+ extension, unchanged permissioned code worker, and standalone helper bundles under
219
+ `dist/packaged/lib/`. Package-only helpers do not overwrite raw checkout modules:
220
+ that would split shared async-local process context and temporary-resource owners.
221
+ Pi peers stay external and host-provided; source installs keep the existing
222
+ `prepare` build. The package consumer checks execute config, offline conversion,
223
+ the permissioned worker, and real Pi SDK/CLI loading without optional host peers
224
+ installed in the consumer.
225
+
226
+ ## Preserved boundaries and rejected approaches
227
+
228
+ No cross-call config/secret/DOM cache, pooled JavaScript worker, new recipe layer,
229
+ or weaker validation gate was introduced. Fresh code globals, ordered secrets,
230
+ rate spacing, cancellation, shared locks, live page checks, redaction, and
231
+ branch-visible replay retain their existing owners.
232
+
233
+ Parallel socket-directory traversal was not adopted: candidate traversal and
234
+ native unknown-Dirent fallback behavior did not preserve the baseline's integrity
235
+ and failure-order controls. The original traversal remains. Helper bundles that
236
+ overwrite emitted checkout modules were also rejected and replaced with separate
237
+ package-only outputs. Smaller whitespace-only bundles did not demonstrate a
238
+ startup improvement beyond host noise.
239
+
240
+ These decisions bound the performance claims. Synthetic CPU/scaling improvements
241
+ are not an equivalent speedup for arbitrary browser workflows, external sites,
242
+ model responses, or installation time. Windows qualification remains subject to
243
+ the explicit owner waiver in [release guidance](RELEASE.md#current-0616-rollout-waiver).
package/docs/REFERENCE.md CHANGED
@@ -88,7 +88,7 @@ The result is optimized for agent work:
88
88
  | Page snapshots are too large or viewport-blind | Shows compact, main-content-first summaries, surfaces an `Omitted high-value controls` section (plus `details.data.highValueControlRefIds`) when dense pages or desktop host screens hide editables, named surfaces/tabs, primary action buttons, and high-signal named links such as repository results from the trimmed ref lists, supports wrapper-side `snapshot -i --search <text>` / `--filter role=<role>` to trim dense pages while preserving full `details.refSnapshot`, supports `snapshot --viewport` for scroll/viewport metadata, supports `snapshot --diff` for quick ref-map deltas versus the prior tracked snapshot, and stores full redacted output in spill files when needed | `extensions/agent-browser/lib/results/snapshot.ts`, `extensions/agent-browser/lib/orchestration/browser-run/prepare.ts`, `test/agent-browser.presentation.test.ts`, `test/agent-browser.extension-validation.test.ts` |
89
89
  | Screenshots/downloads get lost in text | Normalizes artifact paths, creates missing parent directories, leaves click/download execution to native download, and reports existence, size, cwd, session, and repair status | [`docs/COMMAND_REFERENCE.md`](COMMAND_REFERENCE.md#download-screenshot-and-pdf-files) |
90
90
  | Profile restores and tab drift confuse agents | Tracks managed sessions, keeps every upstream helper probe on the same idle-timeout launch configuration so the background browser is not restarted between a snapshot and action, retains native CDP target IDs so same-address tabs remain distinct after resume, re-selects target tabs after observed drift, live-verifies the active target and refreshes its title after successful tab selection or `tab close` (while retaining new blank tabs, deliberate `about:blank` selections, and post-close blank targets, including batch transitions), rehydrates branch-backed session state on Pi session-tree changes, and pins later commands only for sessions with drift/restored-session risk | generated tab-recovery notes below; `test/agent-browser.extension-tab-recovery.test.ts` (drift and about:blank recovery), `test/agent-browser.extension-tabs.test.ts` (post-close target), `test/agent-browser.extension-ref-guards.test.ts` (snapshot/action environment and session-tree rehydration), `test/agent-browser.resume-state-branch-replay.test.ts` (tab targets / branch replay), `test/agent-browser.resume-state-managed-lifecycle.test.ts` (persisted managed ownership), `test/agent-browser.resume-state-launch-policy.test.ts` (resumed launch configuration) |
91
- | Auth/profile workflows can leak secrets | Supports `auth save --password-stdin`, redacts sensitive args, SAML/OAuth-bearing URLs, stdout/stderr, details, and snapshot spills, and discards malformed oversized stdout instead of persisting a parse-failure spill | `test/agent-browser.extension-security-redaction.test.ts` |
91
+ | Auth/profile workflows can leak secrets | Supports `auth save --password-stdin`, redacts sensitive args, SAML/OAuth-bearing URLs, stdout/stderr, details, and snapshot spills, and discards malformed oversized stdout instead of persisting a parse-failure spill | `test/agent-browser.extension-security-redaction.test.ts`, `test/agent-browser.extension-artifacts-fallbacks.test.ts` |
92
92
  | Stateful cookies/storage/auth output bloats or leaks context | Presentation layer redacts `details.data` for cookies and credential-like storage values while keeping low-risk local QA values such as `theme: dark` readable; recursively scrubs other structured upstream JSON (network, diff, trace/profiler, stream, dashboard, chat, auth, dialog, frame, state, and similar) using sensitive key names plus string heuristics; masks sensitive argv flags and positionals, including raw batch rows and ordered code journals; scrubs secrets from failed batch step errors; and exposes a compact redacted `batch` matrix on top-level `details.data` | `extensions/agent-browser/lib/results/presentation.ts`, `extensions/agent-browser/lib/results/presentation/diagnostics.ts`, `extensions/agent-browser/lib/runtime.ts`, `test/agent-browser.presentation-diagnostics.test.ts` |
93
93
  | Stale `@eN` refs fail mysteriously | Defines full per-session refs once in the native journal, exposes them on dedicated captures, rejects mismatched URLs / unknown refs / unsafe `batch` stdin ordering before spawn, adds recovery guidance to rerun `snapshot -i` or use stable `find` locators | `extensions/agent-browser/index.ts`, `extensions/agent-browser/lib/session-page-state.ts`, `test/agent-browser.session-page-state.test.ts`, `test/agent-browser.results.test.ts`, `test/agent-browser.extension-ref-guards.test.ts`, `test/agent-browser.extension-semantic-recovery.test.ts` |
94
94
  | Agents need stable success/failure buckets | Exposes bounded `resultCategory`, `successCategory`, and `failureCategory` on tool `details` for branching without parsing prose; final results return native `isError` and a visible prose failure notice while preserving parseable caller-requested `--json` output. Native structured results expose the same bounded, redacted observations, not internal replay metadata | [`docs/TOOL_CONTRACT.md`](TOOL_CONTRACT.md#details), `extensions/agent-browser/lib/results/categories.ts`, `extensions/agent-browser/index.ts`, `extensions/agent-browser/lib/pi-tool-rendering.ts`, `test/agent-browser.results.test.ts`, `test/agent-browser.extension-validation.test.ts`, `test/agent-browser.pi-pipeline.test.ts` |
@@ -757,9 +757,9 @@ The upstream browser engine remains [`agent-browser`](https://agent-browser.dev/
757
757
 
758
758
  ## Automatic npm releases (maintainers)
759
759
 
760
- Follow the [shared release procedure](https://github.com/fitchmultz/.github#automatic-npm-releases): merge a reviewed PR into `main` with an intentional `package.json` version bump and a matching versioned `CHANGELOG.md` section. Automation never bumps versions, overwrites releases, or republishes an existing version. Once configured and enabled, it runs existing compatibility and native lifecycle checks, qualifies one candidate tarball, then waits for `fitchmultz` approval in the `npm` environment.
760
+ Follow the [shared release procedure](https://github.com/fitchmultz/.github#automatic-npm-releases): merge a reviewed PR into `main` with an intentional `package.json` version bump and a matching versioned `CHANGELOG.md` section. Automation never bumps versions, overwrites releases, or republishes an existing version. Once configured and enabled, it runs existing compatibility and native lifecycle checks, qualifies one candidate tarball, then publishes it without an approval step.
761
761
 
762
- Approve only after checking the exact source commit, version, downloaded candidate tarball and summary against [the existing release gates](RELEASE.md#pre-release-checks), including required lifecycle/live-site evidence, artifact checks and all three final reviewer approvals. Apply the documented Windows waiver without claiming a Windows or full composed-gate pass. Approval attests genuine satisfaction of those requirements; it does not create proof. Authenticated, model-backed and paid checks stay outside CI. Automated publication disables npm hooks to publish the already checked bytes; the manual publisher instructions and their gates remain valid.
762
+ Merging publishes, so before merging check the final PR head (up to date with `main`) and version against [the existing release gates](RELEASE.md#pre-release-checks), including required lifecycle/live-site evidence, artifact checks and all three final reviewer approvals. Apply the documented Windows waiver without claiming a Windows or full composed-gate pass. Merging attests genuine satisfaction of those requirements; it does not create proof. Authenticated, model-backed and paid checks stay outside CI. Automated publication disables npm hooks to publish the already checked bytes; the manual publisher instructions and their gates remain valid.
763
763
 
764
764
  Failed/unpublished candidates can retry daily at 12:17 UTC or via manual dispatch of `npm release` on `main`, without another bump. Set repository variable `NPM_RELEASE_ENABLED` to anything other than `true` to stop new release plans; cancel pending runs separately when needed. Workflow validation is not evidence of a completed real OIDC publication.
765
765
 
@@ -24,9 +24,17 @@ Required replay snapshots stay in retained journal ancestry, outside observation
24
24
 
25
25
  Startup and tree changes serialize branch restore with managed/artifact work, reusing one captured replay for state and cleanup-lease recovery. Launch configuration is folded once per session during that replay. Tree changes join code execution through its complete observation finalization before restoring branch-visible state. Interrupted results retain complete caller observations in process-private spills without publishing their artifact state onto the newly selected branch. Tree changes do not roll back the real browser; process-owned cleanup and recording facts remain separate. An ordinary fork has a new native Pi UUID and cannot acquire its parent's managed/Electron/script cleanup rights. Wrapper-owned begins retain their selected socket root and owner UUID even if the launch finish is lost; restart can inspect or clean that original identity without declaring the launch successful. Owned follow-ups, code and cleanup keep that root when process defaults change; unrelated caller sessions retain native routing.
26
26
 
27
- ## Converting a retained legacy journal
27
+ ## Resuming a retained legacy journal
28
28
 
29
- Legacy repeated maps/manifests and retired isolated-script leases are decoded only by the offline converter. Normal runtime replay requires the canonical event format and reports a conversion requirement rather than keeping a permanent second replay engine.
29
+ Ordinary resume and tree navigation automatically read historical browser tool results, repeated maps/manifests and retired isolated-script leases at the original native journal locator. Replay opens the journal read-only: it does not rewrite bytes, invoke a converter, or require a new conversation. Subsequent operations append canonical events through Pi as usual.
30
+
31
+ One shared legacy decoder normalizes each selected receipt into the same canonical event/reducer used by current journals and optional archive conversion. Mixed old/new branches preserve ancestry, interrupted outcomes, exact page URLs, explicit native confirmation settings (including `""`), compact pending/cleared provenance, artifacts and recorded cleanup owners. A legacy fork without an explicit original cleanup owner cannot acquire its parent's leases. Canonical event validation, committed-leaf/publication checks, native-generation ref guards and source identity checks remain in force; malformed native events cannot fall back to legacy decoding.
32
+
33
+ Legacy maps are materialized one receipt at a time and discarded after normalization; only winning snapshot definitions are retained for selected-branch replay. An individual selected legacy map still must fit the consumer's memory. Missing generation evidence, evicted files and unrecorded effects remain unknown; replay never repeats browser commands or invents native confirmation capabilities.
34
+
35
+ ## Optional separate-copy conversion
36
+
37
+ Conversion is an archive maintenance option, not a prerequisite for normal resume. Use it only when you explicitly want a distinct normalized copy.
30
38
 
31
39
  1. Stop or quiesce the exact writer through its owner. Do not convert an active journal or relaunch work merely to repair storage.
32
40
  2. Keep the original journal and choose a distinct private destination outside automatic session discovery.
@@ -51,7 +59,7 @@ Select the converted locator explicitly through the native session/worker owner.
51
59
 
52
60
  Focused storage tests exercise incident-sized refs, small-event growth, begin/finish append faults with actual dispatch counts, interruption, branch projections and native generation replacement. Existing tab/ref, confirmation, recording, artifact and lifecycle suites retain their behavior checks.
53
61
 
54
- After `npm run build`, the opt-in model-free proof runs a journal above 1 GiB, including an ignored individual string above Node's string ceiling and repeated legacy maps, through conversion and selected replay under a constrained V8 heap:
62
+ After `npm run build`, the opt-in model-free proof runs a journal above 1 GiB, including an ignored individual string above Node's string ceiling, repeated legacy maps, and 4,000 distinct session identities, through conversion and selected replay under a constrained V8 heap:
55
63
 
56
64
  ```sh
57
65
  node --max-old-space-size=128 test/helpers/large-browser-journal.mjs
@@ -93,10 +93,10 @@ Current summary:
93
93
  | RQ-0149 | Upstream 0.35.1 fixes snapshot-diff ref lifecycle, active-main-frame stream URL updates, and Windows ARM64 launcher selection without adding commands or flags. The wrapper preserves the 0.35.0 stable floor and accepts newer stable versions without version-specific shims. | [`docs/COMMAND_REFERENCE.md`](COMMAND_REFERENCE.md#upstream-0351-rebaseline), [`scripts/agent-browser-target.mjs`](../scripts/agent-browser-target.mjs), `test/agent-browser.upstream-version.test.ts`, `test/agent-browser.real-upstream-contract.test.ts` |
94
94
  | RQ-0150 | Upstream 0.35.2 hardens standalone dashboard origin access and fixes root remote CDP WebSocket query URLs. The wrapper parses `--allowed-origins` as a value and keeps explicit or implicit dashboard-start lifecycle calls sessionless; upstream owns origin validation, tokens, and the CDP fix. | [`docs/COMMAND_REFERENCE.md`](COMMAND_REFERENCE.md#upstream-0352-rebaseline), [`docs/TOOL_CONTRACT.md`](TOOL_CONTRACT.md#dashboard-reverse-proxy-origins), `test/agent-browser.runtime.test.ts` |
95
95
  | RQ-0151 | Upstream 0.36.0 adds experimental WebMCP page tools, default local-Chrome enablement with launch-scoped `--no-webmcp`, an opt-in MCP profile, and the `webmcp-gen` skill. The wrapper passes list/invoke/result/cancel through, preserves params/frame/detach/timeout arguments, derives watchdogs from effective direct/raw/stdin commands, keeps pending detached targets unverified, and restores batch target/ref state only after URL verification and a fresh snapshot, while keeping 0.35.0 as the stable floor. | [`docs/COMMAND_REFERENCE.md`](COMMAND_REFERENCE.md#upstream-0360-rebaseline), [`docs/TOOL_CONTRACT.md`](TOOL_CONTRACT.md#experimental-webmcp), `test/agent-browser.runtime.test.ts`, `test/agent-browser.wait-timeouts.test.ts`, `test/agent-browser.process.test.ts`, `test/agent-browser.page-target-validation.test.ts`, `test/agent-browser.extension-ref-guards.test.ts`, `test/agent-browser.real-upstream-contract.test.ts` |
96
- | RQ-0153 | Browser storage retains native JSONL authority, once-stored ancestral ref definitions, small correlated begin/finish events, explicit uncertainty/reuse and native-generation validation, invocation-only artifact receipts and ordered row changes. Failed persistence never retries effects; ordinary forks retain facts without acquiring parent cleanup rights. Read-only token replay and stopped separate-copy conversion preserve all ancestry, explicit observations and original audit bytes. | [`docs/SESSION_STORAGE.md`](SESSION_STORAGE.md), `lib/browser-transcript.ts`, `lib/browser-journal.ts`, `lib/browser-session-conversion.ts`, `test/agent-browser.storage-growth.test.ts`, `test/agent-browser.storage-recovery.test.ts`, existing script/ref/confirmation/Electron lifecycle tests |
96
+ | RQ-0153 | Browser storage retains native JSONL authority, once-stored ancestral ref definitions, small correlated begin/finish events, explicit uncertainty/reuse and native-generation validation, invocation-only artifact receipts and ordered row changes. Failed persistence never retries effects; ordinary forks retain facts without acquiring parent cleanup rights. Read-only token replay automatically normalizes historical receipts through the same canonical reducer at the unchanged locator/bytes, retaining mixed-format ancestry, confirmation settings/provenance and cleanup ownership. Optional stopped separate-copy conversion reuses that decoder. | [`docs/SESSION_STORAGE.md`](SESSION_STORAGE.md), `lib/browser-transcript.ts`, `lib/browser-journal.ts`, `lib/browser-session-conversion.ts`, `test/agent-browser.storage-growth.test.ts`, `test/agent-browser.storage-recovery.test.ts`, existing script/ref/confirmation/Electron lifecycle tests |
97
97
  | RQ-0152 | Agent feedback closes recovery and evidence gaps without a new runtime layer: unknown-target timeouts return a visibly executable `get url` → `snapshot -i` fail-fast action while dialog recovery remains allowed; successful tab creation/selection/close, including dispatched batch rows, live-verifies URL/fresh titles and retains new, selected, and post-close blank tabs; compacted direct or batched `outputPath` writes use only full command-redacted live wrapper spills and fail rather than save metadata; explicit URL reads/all-read batches avoid browser helpers and managed replacement, while proven native read confirmations preserve exact session routing and capability-gated browser independence; single session-info preflights distinguish daemon/browser/native/Pi ownership; native recording receipts expose capture versus encoded measurements and survive failure/timeout exports, with bounded identity-matched recovery and no file-only success; direct or batched first/fresh local headed launches expose an unverified `browserWindow` handoff while attachments do not; snapshot spills and SAML/OAuth URL values are redacted at model/persistence boundaries; unsupported direct/batch `scrollintoview text=...` fails before upstream false success with visible native recovery payloads while help passes through; and web search sends Exa primary/version guidance, removes exact normalized-URL duplicates without overfetch, and labels provider page dates without claiming crawl/version proof. | [`docs/TOOL_CONTRACT.md`](TOOL_CONTRACT.md), [`docs/COMMAND_REFERENCE.md`](COMMAND_REFERENCE.md), [`docs/ARCHITECTURE.md`](ARCHITECTURE.md), `test/agent-browser.extension-errors-artifacts.test.ts`, `test/agent-browser.extension-tabs.test.ts`, `test/agent-browser.extension-validation.test.ts`, `test/agent-browser.page-target-validation.test.ts`, `test/agent-browser.runtime.test.ts`, `test/agent-browser.snapshot-presentation.test.ts`, `test/agent-browser.web-search.test.ts`, `test/agent-browser.real-upstream-contract.test.ts` |
98
98
 
99
- Browser journal storage (RQ-0153) uses one canonical small event/reducer, once-stored complete captures and journal-ordered artifact changes. `test/agent-browser.storage-growth.test.ts` protects the incident-sized map and ordinary-code growth; `test/agent-browser.storage-recovery.test.ts` covers actual append-fault dispatch counts, concurrent publication during captured-branch replay, unpublished selected-leaf refusal, unknown prefixes, same-URL generation replacement, branch conversion and strict token validation. Existing tab/ref, read-confirmation, recording, artifact and Electron lifecycle suites retain their contracts. The opt-in `test/helpers/large-browser-journal.mjs` exercises a >1 GiB original with a giant ignored value under a constrained V8 heap; it reports actual RSS separately. Official and fork load/restart qualification remains independent, and stock official 1.0.0's native eager loader is not repaired by the extension alone. Conversion is offline and source-retaining; see [`SESSION_STORAGE.md`](SESSION_STORAGE.md).
99
+ Browser journal storage (RQ-0153) uses one canonical small event/reducer, once-stored complete captures and journal-ordered artifact changes. `test/agent-browser.storage-growth.test.ts` protects the incident-sized map and ordinary-code growth; `test/agent-browser.storage-recovery.test.ts` covers actual append-fault dispatch counts, concurrent publication during captured-branch replay, unpublished selected-leaf refusal, unknown prefixes, same-URL generation replacement, branch conversion and strict token validation. Existing tab/ref, read-confirmation, recording, artifact and Electron lifecycle suites retain their contracts. The opt-in `test/helpers/large-browser-journal.mjs` exercises a >1 GiB original with a giant ignored value under a constrained V8 heap; it reports actual RSS separately. Official and fork load/restart qualification remains independent, and stock official 1.0.0's native eager loader is not repaired by the extension alone. Ordinary legacy resume preserves the original locator and bytes; optional archive conversion is offline and source-retaining. The shared harness retains raw legacy fixtures so resume suites exercise runtime normalization, not pre-converted journals. See [`SESSION_STORAGE.md`](SESSION_STORAGE.md).
100
100
 
101
101
  QA truthfulness (#121, RQ-0145) is covered by the registered-tool controls in `test/agent-browser.extension-input-modes.test.ts` and the strict `contract suite matches QA non-pass after same-URL error-buffer rollover` case in `test/agent-browser.real-upstream-contract.test.ts`. The real fixture fills the native error FIFO with identical rows, then verifies that a new document actually throws again at the same URL and that QA is always non-pass. Matched rows fail as an unverified check, not an application-error assertion. Empty/cleared and explicit `checkErrors: false` controls preserve valid passes; the wrapper does not fix upstream `errors --clear` or accept a warning-only pass as resolution.
102
102
 
@@ -114,7 +114,7 @@ Upstream 0.38.1 observation and input compatibility is covered by `test/agent-br
114
114
 
115
115
  Upstream 0.37 recording compatibility uses one command-local path/URL reader around numeric `--fps` pairs; direct, raw-batch and stdin-batch preflight reject destination collisions before native dispatch. FPS-only calls keep the intended pinned tab, and FPS-only restarts keep refs. Every dispatched start still requires fresh refs to protect older supported natives. `test/agent-browser.artifact-diagnostics.test.ts`, `test/agent-browser.batch-fidelity.test.ts` and presentation tests cover these boundaries. The native contract also checks positive/absent WebMCP hints and first-load header inheritance/clearing without custom tab setup. Short/cold native Ubuntu captures can fail to encode; the FPS fixture explicitly logs 12-second captures and verifies output rather than treating an empty file as a frame.
116
116
 
117
- Artifact argv and timeout recovery (#119, RQ-0076) use native operand positions, retain literal global-looking tokens inside batch rows, and select raw batch commands instead of ignored stdin. Timeout observations retain current page and artifact existence evidence while all unacknowledged planned rows stay unknown; neither a matching URL nor an existing file proves execution. Multi-step timeouts offer inspection without inferring a failed/pending boundary. Executable retry candidates for a single retryable step preserve the original row in a one-row batch. Interleaved `wait --download` / `-d` timeout pairs keep the next retained path and its original index. Runtime, artifact-diagnostics, and timeout tests cover extraction, reservation, preparation, and presentation; `test/agent-browser.batch-fidelity.test.ts` adds real native saved-file, missing wait-download, reservation, and watchdog evidence under `npm run verify -- real-upstream`. Getter batching amortizes one extra ref-freshness snapshot per top-level call or batch when the existing checks apply. Direct `session info` timeouts stay status-only (`retry-session-info`), preserving page/ref/reopen state; cold-boundary and result tests cover this.
117
+ Artifact argv and timeout recovery (#119, RQ-0076) use native operand positions, retain literal global-looking tokens inside batch rows, and select raw batch commands instead of ignored stdin. Timeout observations retain current page and artifact existence evidence while all unacknowledged planned rows stay unknown; neither a matching URL nor an existing file proves execution. Independent artifact paths overlap their own three-check, 25 ms retry windows, preserve native row and JSON field order, and settle before page probes; late files may remain missing after their own window. Multi-step timeouts offer inspection without inferring a failed/pending boundary. Executable retry candidates for a single retryable step preserve the original row in a one-row batch. Interleaved `wait --download` / `-d` timeout pairs keep the next retained path and its original index. Runtime, artifact-diagnostics, and timeout tests cover extraction, reservation, preparation, and presentation; `test/agent-browser.batch-fidelity.test.ts` adds real native saved-file, missing wait-download, reservation, and watchdog evidence under `npm run verify -- real-upstream`. Getter batching amortizes one extra ref-freshness snapshot per top-level call or batch when the existing checks apply. Direct `session info` timeouts stay status-only (`retry-session-info`), preserving page/ref/reopen state; cold-boundary and result tests cover this.
118
118
 
119
119
  Cold URL reopen is covered by `test/agent-browser.cold-resume.test.ts`, the daemon/page-boundary regressions in `test/agent-browser.cold-boundaries-session-policy.test.ts`, `test/agent-browser.cold-boundaries-page-reopen.test.ts` and `test/agent-browser.cold-boundaries-command-classification.test.ts`, and the opt-in `contract suite matches cold URL reopen after quit` case in `test/agent-browser.real-upstream-contract.test.ts`. Deterministic boundary tests cover non-page prefixes, fragment routes, history commands, explicit destinations, transcript replay, unreached navigation and unchanged native batch/error order. `test/agent-browser.destination-cancel.test.ts` covers direct/native-batch new-window and URL-diff follow-ups, redirected/unknown targets (including blank redirects with a remembered duplicate tab), ordered ref invalidation, reached versus unreached rows, and cancellation before or after a cold-reopen attempt with replay and process cleanup. Release acceptance requires the first page operation after confirmed shutdown to observe the remembered non-root URL with both empty and origin storage, including after non-page calls and on hash-routed pages, before any explicit open, with refreshed refs. Focused native Mac evidence does not replace actual Ubuntu, real Pi lifecycle, checkout, live-site, or final release gates.
120
120
 
@@ -126,7 +126,7 @@ Lightpanda support preserves native command access rather than promising Chrome
126
126
 
127
127
  Confirmation-policy continuity uses existing canonical session page events, resolved before helpers. The focused native nextAction case proves exact denial, a useful confirmed audit followed immediately by title/body reads across resume, bare getter/PID continuity, and denied recording-restart sentinel/original-take preservation; the shared-defaults owner covers selected-string/empty/unset precedence, code/advanced routing, ordered pending-batch targets/replay with a gated URL helper, failed replacement cleanup/recovery, off-branch cleanup, close and identity isolation. Strict native guarded-control markers reuse the same transcript reducer with compact command/action provenance, not command replay; exact decisions avoid helper-slot replacement without claiming native ID validation or browser independence. Read-confirmation tests cover forged/foreign/first-nondecision controls, raw-argv-over-stdin decisions, later unknown-page checks, ordered confirmed batch effects, truthful requested/early-helper/post-command-helper pending copy, and completed click/tab/failed-inner/close reconciliation through real code intent/finish replay, cold-resume covers pending helper exposure/replay, and Electron host tests cover ambient/retained policy. Definite no-admission attempts restore prior policy while interrupted work retains intent. Pending close does not retire ownership or restore state. Native policy changes still restart normally; pending commands remain native-owned. Read-confirmation regressions also cover ordered confirmed snapshots, later pending/failed/invalidation rows, one-use freshness consumption through direct/code/batch resume, semantic role click/check/fill and unique role/label select after snapshot approval with unchanged payloads, absent/ambiguous select targets and drift, warm/no-resume direct and semantic select success on unchanged path/hash routes for caller-owned and freshly established wrapper-owned managed sessions versus refusal after a live-observed complete-URL change, including hash-only routes, without a gated-snapshot loop or changing ordinary fragment-insensitive ref/tab comparisons, plus live/resumed attachment retirement after confirmed close. Registered confirmation tests also cover direct/batch tab transport metadata, exact approval/denial, visible conditional continuation, malformed/mismatched extras and page/eval/HTTP provenance rejection; actual SDK/native proof uses the real authenticated-tab transport with a dummy loopback token. Presentation tests distinguish direct/nested pending snapshot controls from complete empty snapshots and preserve redacted recovery actions and explicit JSON. Click-dispatch owner tests and local native SDK proof cover timer cancellation, pending-safe marker/listener expiry without an extra helper, and native ref/XPath click dispatch when `evaluate` guards optional diagnostic probes. The patched recording-restart/navigation subcase has a separate test-only opt-in; stock upstream still runs the remaining confirmation checks. See [real upstream qualification](RELEASE.md#real-upstream-contract-validation).
128
128
 
129
- Shared native defaults are covered by `test/agent-browser.shared-defaults.test.ts`: environment/file/argv precedence, caller-owned reuse across independent Pi contexts, quit ownership, native helper idle settings, unchanged implicit cleanup, and an opt-in real local-profile fixture proving shared state and code follows the selected ordinary browser rather than a disposable isolated session. Code tests cover the fresh child language boundary and persistent browser behavior; the local Electron handoff regression in `test/agent-browser.extension-electron-host-lifecycle.test.ts` keeps generated launch ownership despite a native session environment default; native config validation uses upstream rather than a second schema. See [shared browser defaults](REFERENCE.md#shared-browser-defaults). These tests do not promise permanent third-party authentication.
129
+ Shared native defaults are covered by `test/agent-browser.shared-defaults.test.ts`: environment/file/argv precedence, caller-owned reuse across independent Pi contexts, quit ownership, native helper idle settings, unchanged implicit cleanup, and an opt-in real local-profile fixture proving shared state and code follows the selected ordinary browser rather than a disposable isolated session. Code tests cover the fresh child language boundary and persistent browser behavior; the local Electron handoff regression in `test/agent-browser.extension-electron-host-lifecycle.test.ts` keeps generated launch ownership despite a native session environment default; native config validation uses upstream rather than a second schema. See [shared browser defaults](REFERENCE.md#shared-browser-defaults). These tests do not promise permanent third-party authentication. Call-local daemon-observation regressions also require exact identity, one status probe before helper-free preparation, refusal of replaced or unknown generations, native confirmation handling, and a fresh post-capture receipt; observations are never cached across calls.
130
130
 
131
131
  Browser correctness regressions cover credential-bearing filtered network details/exports, native generated-Blob downloads with actual saved bytes, accessible-name click target identity and abstention, smooth CSS-container movement, and parseable early-result JSON. Native fixture coverage complements deterministic dispatch/cleanup and output-shape checks; release qualification remains separate.
132
132
 
@@ -142,6 +142,10 @@ Linux/macOS, declared Node floors, official/fork host identities, required consu
142
142
 
143
143
  ## Verification evidence
144
144
 
145
+ [Performance measurements](PERFORMANCE.md) document the measured result, journal,
146
+ execution, discovery, package, and verification changes. Their synthetic CPU and
147
+ scaling profiles remain separate from real-browser latency and host qualification.
148
+
145
149
  **0.38.1 PR evidence (2026-09-17, local macOS):** the full unit/fake suite passed 1,146 tests with 27 opt-in skips; the final review fixes then passed typecheck and 64 affected tests. Generated docs, live command-reference sampling, and the 132-file packaged Pi smoke passed. The real-upstream contract and 75 native batch/fidelity checks passed, as did all eight deterministic dogfood flows. Interactive compiled-checkout Pi smoke covered example.com and react.dev, delta/ref follow-ups, conditional screenshots, and a recording batch whose persisted result had two verified artifacts and no pending artifacts. Separate native probes confirmed helper-consumed WebMCP catalog updates remain visible. These checks do not qualify release-only platform/lifecycle gates; the hosted native-Windows result is recorded on the PR.
146
150
 
147
151
  Re-run the gates below before each release. Dated outcomes in this table are historical evidence for their named source/version, not qualification of the current Pi 1.0 implementation. The earlier 0.36.0 rebaseline passed local pre-PR, real-upstream and deterministic dogfood on 2026-09-01; the 0.35.0 floor was last validated locally on 2026-08-26. The historical 0.38.1 PR qualification used local macOS and the hosted native-Windows gate. Current explicit owner waivers take precedence; neither historical passes nor failures qualify the new candidate. Release-only cross-platform/model/lifecycle and publication gates remain separate.