@chankov/agent-fleet 2.2.2 → 2.2.3

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 (766) hide show
  1. package/.pi/harnesses/agent-hub/README.md +18 -2
  2. package/.pi/harnesses/agent-hub/budget-recovery.ts +28 -0
  3. package/.pi/harnesses/agent-hub/commands/recover.ts +28 -9
  4. package/.pi/harnesses/agent-hub/context/assertion-journal.ts +133 -0
  5. package/.pi/harnesses/agent-hub/index.ts +100 -17
  6. package/.pi/harnesses/agent-hub/no-progress.ts +133 -19
  7. package/.pi/harnesses/agent-hub/operator-current-state.ts +51 -6
  8. package/.pi/harnesses/agent-hub/package.json +1 -1
  9. package/.pi/harnesses/agent-hub/policy/work-mode.ts +2 -1
  10. package/.pi/harnesses/agent-hub/process-obligations.ts +1 -1
  11. package/.pi/harnesses/agent-hub/recover-policy.ts +1 -1
  12. package/.pi/harnesses/agent-hub/recover-state.ts +46 -6
  13. package/.pi/harnesses/agent-hub/recovery-continuation.ts +134 -0
  14. package/.pi/harnesses/agent-hub/tools/action-executors.ts +24 -3
  15. package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
  16. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +60 -17
  17. package/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +2 -1
  18. package/.pi/harnesses/agent-hub/tools/recover-task.ts +16 -0
  19. package/.pi/harnesses/agent-hub/verification-diagnostics.ts +23 -0
  20. package/.pi/harnesses/agent-hub/work-mode.ts +4 -2
  21. package/.pi/harnesses/coms/package.json +1 -1
  22. package/.pi/harnesses/damage-control-continue/index.ts +7 -5
  23. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  24. package/.pi/harnesses/lib/bash-policy-analysis.ts +9 -1
  25. package/.pi/harnesses/lib/exact-permission-port.ts +6 -4
  26. package/.versions/2.2.3/.pi/agent-fleet/hermes/README.md +347 -0
  27. package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  28. package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  29. package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  30. package/.versions/2.2.3/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  31. package/.versions/2.2.3/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  32. package/.versions/2.2.3/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  33. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  34. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  35. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  36. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  37. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  38. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  39. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  40. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  41. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  42. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  43. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  44. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  45. package/.versions/2.2.3/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  46. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  47. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  48. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  49. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  50. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  51. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  52. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  53. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  54. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  55. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  56. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  57. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  58. package/.versions/2.2.3/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  59. package/.versions/2.2.3/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  60. package/.versions/2.2.3/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
  61. package/.versions/2.2.3/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  62. package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  63. package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  64. package/.versions/2.2.3/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  65. package/.versions/2.2.3/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  66. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
  67. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  68. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
  69. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  70. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
  71. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
  72. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
  73. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
  74. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
  75. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
  76. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
  77. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
  78. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
  79. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
  80. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
  81. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
  82. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
  83. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
  84. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
  85. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
  86. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
  87. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
  88. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
  89. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  90. package/.versions/2.2.3/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
  91. package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  92. package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
  93. package/.versions/2.2.3/.pi/agent-fleet/scripts/fleet.ts +244 -0
  94. package/.versions/2.2.3/.pi/agent-fleet/scripts/flow.ts +166 -0
  95. package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  96. package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  97. package/.versions/2.2.3/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  98. package/.versions/2.2.3/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  99. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  100. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  101. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +52 -0
  102. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  103. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
  104. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  105. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  106. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  107. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
  108. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  109. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  110. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  111. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  112. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
  113. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  114. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  115. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
  116. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  117. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
  118. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  119. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +207 -0
  120. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
  121. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
  122. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
  123. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  124. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  125. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
  126. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
  127. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  128. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  129. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  130. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  131. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  132. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
  133. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
  134. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  135. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  136. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
  137. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
  138. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  139. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
  140. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  141. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
  142. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  143. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  144. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  145. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  146. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  147. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  148. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  149. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  150. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  151. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  152. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  153. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  154. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  155. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  156. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  157. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  158. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  159. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
  160. package/.versions/2.2.3/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  161. package/.versions/2.2.3/.pi/agent-fleet/scripts/package-lock.json +57 -0
  162. package/.versions/2.2.3/.pi/agent-fleet/scripts/package.json +10 -0
  163. package/.versions/2.2.3/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  164. package/.versions/2.2.3/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  165. package/.versions/2.2.3/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  166. package/.versions/2.2.3/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  167. package/.versions/2.2.3/.pi/agent-fleet/scripts/team-up.ts +378 -0
  168. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  169. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  170. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  171. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  172. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  173. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  174. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
  175. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  176. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  177. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  178. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  179. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  180. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  181. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  182. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  183. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
  184. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  185. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  186. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  187. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  188. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  189. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  190. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  191. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  192. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  193. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  194. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  195. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  196. package/.versions/2.2.3/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  197. package/.versions/2.2.3/.pi/agents/dispatch-policy.yaml +32 -0
  198. package/.versions/2.2.3/.pi/agents/model-profiles.yaml +132 -0
  199. package/.versions/2.2.3/.pi/agents/peers.yaml +147 -0
  200. package/.versions/2.2.3/.pi/agents/teams.yaml +41 -0
  201. package/.versions/2.2.3/.pi/agents/voices.yaml +13 -0
  202. package/.versions/2.2.3/.pi/damage-control-rules.yaml +297 -0
  203. package/.versions/2.2.3/.pi/extensions/btw/README.md +120 -0
  204. package/.versions/2.2.3/.pi/extensions/btw/index.ts +916 -0
  205. package/.versions/2.2.3/.pi/extensions/btw/package.json +6 -0
  206. package/.versions/2.2.3/.pi/extensions/btw/state.js +179 -0
  207. package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  208. package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  209. package/.versions/2.2.3/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  210. package/.versions/2.2.3/.pi/extensions/compact-and-continue/README.md +42 -0
  211. package/.versions/2.2.3/.pi/extensions/compact-and-continue/index.ts +136 -0
  212. package/.versions/2.2.3/.pi/extensions/compact-and-continue/package.json +6 -0
  213. package/.versions/2.2.3/.pi/extensions/mcp-bridge/README.md +46 -0
  214. package/.versions/2.2.3/.pi/extensions/mcp-bridge/index.ts +206 -0
  215. package/.versions/2.2.3/.pi/extensions/mcp-bridge/package.json +6 -0
  216. package/.versions/2.2.3/.pi/extensions/package-lock.json +1175 -0
  217. package/.versions/2.2.3/.pi/extensions/package.json +9 -0
  218. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/README.md +224 -0
  219. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/config.ts +199 -0
  220. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  221. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/index.ts +248 -0
  222. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/package.json +6 -0
  223. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  224. package/.versions/2.2.3/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  225. package/.versions/2.2.3/.pi/harnesses/agent-hub/README.md +1657 -0
  226. package/.versions/2.2.3/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  227. package/.versions/2.2.3/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  228. package/.versions/2.2.3/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  229. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  230. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  231. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  232. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  233. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  234. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  235. package/.versions/2.2.3/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  236. package/.versions/2.2.3/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  237. package/.versions/2.2.3/.pi/harnesses/agent-hub/artifacts.js +146 -0
  238. package/.versions/2.2.3/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  239. package/.versions/2.2.3/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  240. package/.versions/2.2.3/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  241. package/.versions/2.2.3/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  242. package/.versions/2.2.3/.pi/harnesses/agent-hub/budget-recovery.ts +151 -0
  243. package/.versions/2.2.3/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  244. package/.versions/2.2.3/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
  245. package/.versions/2.2.3/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  246. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  247. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  248. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  249. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  250. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  251. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  252. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  253. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  254. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  255. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  256. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  257. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  258. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  259. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  260. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  261. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  262. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  263. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  264. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  265. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  266. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  267. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  268. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  269. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/recover.ts +81 -0
  270. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  271. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  272. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  273. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  274. package/.versions/2.2.3/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  275. package/.versions/2.2.3/.pi/harnesses/agent-hub/config/agents.ts +183 -0
  276. package/.versions/2.2.3/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
  277. package/.versions/2.2.3/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  278. package/.versions/2.2.3/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  279. package/.versions/2.2.3/.pi/harnesses/agent-hub/context/assertion-journal.ts +133 -0
  280. package/.versions/2.2.3/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
  281. package/.versions/2.2.3/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  282. package/.versions/2.2.3/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  283. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  284. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  285. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  286. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  287. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  288. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  289. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  290. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  291. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
  292. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  293. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  294. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  295. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  296. package/.versions/2.2.3/.pi/harnesses/agent-hub/context-window.js +108 -0
  297. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  298. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  299. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  300. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  301. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  302. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  303. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  304. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  305. package/.versions/2.2.3/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  306. package/.versions/2.2.3/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  307. package/.versions/2.2.3/.pi/harnesses/agent-hub/delegate.ts +478 -0
  308. package/.versions/2.2.3/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  309. package/.versions/2.2.3/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  310. package/.versions/2.2.3/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  311. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  312. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  313. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  314. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
  315. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
  316. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
  317. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
  318. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  319. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  320. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  321. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  322. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  323. package/.versions/2.2.3/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  324. package/.versions/2.2.3/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  325. package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  326. package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  327. package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  328. package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  329. package/.versions/2.2.3/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
  330. package/.versions/2.2.3/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  331. package/.versions/2.2.3/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  332. package/.versions/2.2.3/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  333. package/.versions/2.2.3/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  334. package/.versions/2.2.3/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  335. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  336. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  337. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  338. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  339. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  340. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  341. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  342. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  343. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  344. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  345. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  346. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  347. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  348. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  349. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  350. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  351. package/.versions/2.2.3/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  352. package/.versions/2.2.3/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  353. package/.versions/2.2.3/.pi/harnesses/agent-hub/fixtures/registration-surface.json +69 -0
  354. package/.versions/2.2.3/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  355. package/.versions/2.2.3/.pi/harnesses/agent-hub/footer.ts +29 -0
  356. package/.versions/2.2.3/.pi/harnesses/agent-hub/helpers.ts +269 -0
  357. package/.versions/2.2.3/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  358. package/.versions/2.2.3/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  359. package/.versions/2.2.3/.pi/harnesses/agent-hub/index.ts +2805 -0
  360. package/.versions/2.2.3/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  361. package/.versions/2.2.3/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
  362. package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  363. package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  364. package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  365. package/.versions/2.2.3/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  366. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  367. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  368. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  369. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  370. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  371. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  372. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  373. package/.versions/2.2.3/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  374. package/.versions/2.2.3/.pi/harnesses/agent-hub/no-progress.ts +741 -0
  375. package/.versions/2.2.3/.pi/harnesses/agent-hub/operator-current-state.ts +102 -0
  376. package/.versions/2.2.3/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  377. package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  378. package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  379. package/.versions/2.2.3/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  380. package/.versions/2.2.3/.pi/harnesses/agent-hub/package.json +7 -0
  381. package/.versions/2.2.3/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  382. package/.versions/2.2.3/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  383. package/.versions/2.2.3/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  384. package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  385. package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  386. package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  387. package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
  388. package/.versions/2.2.3/.pi/harnesses/agent-hub/policy/work-mode.ts +104 -0
  389. package/.versions/2.2.3/.pi/harnesses/agent-hub/poll-command.ts +184 -0
  390. package/.versions/2.2.3/.pi/harnesses/agent-hub/presentation.ts +54 -0
  391. package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
  392. package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
  393. package/.versions/2.2.3/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
  394. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  395. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  396. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  397. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  398. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  399. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  400. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  401. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  402. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  403. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  404. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  405. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  406. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
  407. package/.versions/2.2.3/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  408. package/.versions/2.2.3/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
  409. package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
  410. package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
  411. package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
  412. package/.versions/2.2.3/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
  413. package/.versions/2.2.3/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
  414. package/.versions/2.2.3/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  415. package/.versions/2.2.3/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  416. package/.versions/2.2.3/.pi/harnesses/agent-hub/recover-state.ts +144 -0
  417. package/.versions/2.2.3/.pi/harnesses/agent-hub/recovery-continuation.ts +134 -0
  418. package/.versions/2.2.3/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  419. package/.versions/2.2.3/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  420. package/.versions/2.2.3/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  421. package/.versions/2.2.3/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  422. package/.versions/2.2.3/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  423. package/.versions/2.2.3/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  424. package/.versions/2.2.3/.pi/harnesses/agent-hub/return-contract.js +371 -0
  425. package/.versions/2.2.3/.pi/harnesses/agent-hub/return-extract.js +77 -0
  426. package/.versions/2.2.3/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  427. package/.versions/2.2.3/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
  428. package/.versions/2.2.3/.pi/harnesses/agent-hub/review-findings.js +96 -0
  429. package/.versions/2.2.3/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
  430. package/.versions/2.2.3/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  431. package/.versions/2.2.3/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  432. package/.versions/2.2.3/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  433. package/.versions/2.2.3/.pi/harnesses/agent-hub/run-budget.js +362 -0
  434. package/.versions/2.2.3/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  435. package/.versions/2.2.3/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
  436. package/.versions/2.2.3/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
  437. package/.versions/2.2.3/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  438. package/.versions/2.2.3/.pi/harnesses/agent-hub/scope-gate.js +271 -0
  439. package/.versions/2.2.3/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  440. package/.versions/2.2.3/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  441. package/.versions/2.2.3/.pi/harnesses/agent-hub/session-health.js +110 -0
  442. package/.versions/2.2.3/.pi/harnesses/agent-hub/session-start.ts +42 -0
  443. package/.versions/2.2.3/.pi/harnesses/agent-hub/spawn.ts +702 -0
  444. package/.versions/2.2.3/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  445. package/.versions/2.2.3/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  446. package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  447. package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  448. package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  449. package/.versions/2.2.3/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  450. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  451. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  452. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
  453. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  454. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  455. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  456. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  457. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  458. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  459. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  460. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  461. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  462. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-runtime.ts +132 -0
  463. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  464. package/.versions/2.2.3/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  465. package/.versions/2.2.3/.pi/harnesses/agent-hub/timeline.ts +72 -0
  466. package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
  467. package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
  468. package/.versions/2.2.3/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  469. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/action-executors.ts +237 -0
  470. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  471. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  472. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  473. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/context.ts +151 -0
  474. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
  475. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +971 -0
  476. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  477. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +23 -0
  478. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  479. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  480. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  481. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  482. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/recover-task.ts +16 -0
  483. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
  484. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  485. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  486. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  487. package/.versions/2.2.3/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  488. package/.versions/2.2.3/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  489. package/.versions/2.2.3/.pi/harnesses/agent-hub/types.ts +66 -0
  490. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  491. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  492. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  493. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  494. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
  495. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  496. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  497. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  498. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  499. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  500. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  501. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  502. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  503. package/.versions/2.2.3/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  504. package/.versions/2.2.3/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  505. package/.versions/2.2.3/.pi/harnesses/agent-hub/verification-diagnostics.ts +23 -0
  506. package/.versions/2.2.3/.pi/harnesses/agent-hub/version.ts +42 -0
  507. package/.versions/2.2.3/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  508. package/.versions/2.2.3/.pi/harnesses/agent-hub/work-mode.ts +185 -0
  509. package/.versions/2.2.3/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
  510. package/.versions/2.2.3/.pi/harnesses/ask-user-remote/README.md +59 -0
  511. package/.versions/2.2.3/.pi/harnesses/ask-user-remote/index.ts +571 -0
  512. package/.versions/2.2.3/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  513. package/.versions/2.2.3/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  514. package/.versions/2.2.3/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  515. package/.versions/2.2.3/.pi/harnesses/coms/README.md +105 -0
  516. package/.versions/2.2.3/.pi/harnesses/coms/index.ts +308 -0
  517. package/.versions/2.2.3/.pi/harnesses/coms/package.json +7 -0
  518. package/.versions/2.2.3/.pi/harnesses/coms/version.ts +42 -0
  519. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/README.md +161 -0
  520. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/index.ts +661 -0
  521. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/package.json +7 -0
  522. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  523. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  524. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  525. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  526. package/.versions/2.2.3/.pi/harnesses/damage-control-continue/version.ts +42 -0
  527. package/.versions/2.2.3/.pi/harnesses/lib/approval-wait.ts +17 -0
  528. package/.versions/2.2.3/.pi/harnesses/lib/bash-policy-analysis.ts +193 -0
  529. package/.versions/2.2.3/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  530. package/.versions/2.2.3/.pi/harnesses/lib/clarification-policy.ts +9 -0
  531. package/.versions/2.2.3/.pi/harnesses/lib/codex-compat.ts +97 -0
  532. package/.versions/2.2.3/.pi/harnesses/lib/codex-contract.ts +259 -0
  533. package/.versions/2.2.3/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  534. package/.versions/2.2.3/.pi/harnesses/lib/coms-core-io.ts +422 -0
  535. package/.versions/2.2.3/.pi/harnesses/lib/coms-core.ts +738 -0
  536. package/.versions/2.2.3/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  537. package/.versions/2.2.3/.pi/harnesses/lib/coms-observation.ts +74 -0
  538. package/.versions/2.2.3/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  539. package/.versions/2.2.3/.pi/harnesses/lib/coms-response-read.ts +107 -0
  540. package/.versions/2.2.3/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  541. package/.versions/2.2.3/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
  542. package/.versions/2.2.3/.pi/harnesses/lib/context-budget-view.ts +112 -0
  543. package/.versions/2.2.3/.pi/harnesses/lib/context-budget.ts +114 -0
  544. package/.versions/2.2.3/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  545. package/.versions/2.2.3/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  546. package/.versions/2.2.3/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  547. package/.versions/2.2.3/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  548. package/.versions/2.2.3/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  549. package/.versions/2.2.3/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  550. package/.versions/2.2.3/.pi/harnesses/lib/damage-policy.ts +35 -0
  551. package/.versions/2.2.3/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  552. package/.versions/2.2.3/.pi/harnesses/lib/damage-result-view.ts +16 -0
  553. package/.versions/2.2.3/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  554. package/.versions/2.2.3/.pi/harnesses/lib/exact-permission-port.ts +40 -0
  555. package/.versions/2.2.3/.pi/harnesses/lib/execution-trace.ts +45 -0
  556. package/.versions/2.2.3/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  557. package/.versions/2.2.3/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  558. package/.versions/2.2.3/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  559. package/.versions/2.2.3/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  560. package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  561. package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-chat-view.ts +55 -0
  562. package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
  563. package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  564. package/.versions/2.2.3/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  565. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  566. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  567. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  568. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  569. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  570. package/.versions/2.2.3/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  571. package/.versions/2.2.3/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
  572. package/.versions/2.2.3/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
  573. package/.versions/2.2.3/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  574. package/.versions/2.2.3/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  575. package/.versions/2.2.3/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  576. package/.versions/2.2.3/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  577. package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  578. package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-bootstrap.ts +172 -0
  579. package/.versions/2.2.3/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
  580. package/.versions/2.2.3/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  581. package/.versions/2.2.3/.pi/harnesses/lib/fleet-panel.ts +34 -0
  582. package/.versions/2.2.3/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
  583. package/.versions/2.2.3/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  584. package/.versions/2.2.3/.pi/harnesses/lib/fleet-selection.ts +24 -0
  585. package/.versions/2.2.3/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  586. package/.versions/2.2.3/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  587. package/.versions/2.2.3/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  588. package/.versions/2.2.3/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  589. package/.versions/2.2.3/.pi/harnesses/lib/herdr-client.ts +472 -0
  590. package/.versions/2.2.3/.pi/harnesses/lib/herdr-presence.ts +399 -0
  591. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  592. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  593. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  594. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  595. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  596. package/.versions/2.2.3/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  597. package/.versions/2.2.3/.pi/harnesses/lib/identical-dialog.ts +27 -0
  598. package/.versions/2.2.3/.pi/harnesses/lib/installation-state.js +62 -0
  599. package/.versions/2.2.3/.pi/harnesses/lib/peer-target.ts +24 -0
  600. package/.versions/2.2.3/.pi/harnesses/lib/policy-roots.js +117 -0
  601. package/.versions/2.2.3/.pi/harnesses/lib/policy-roots.ts +32 -0
  602. package/.versions/2.2.3/.pi/harnesses/lib/process-shared.ts +9 -0
  603. package/.versions/2.2.3/.pi/harnesses/lib/resource-closure.js +26 -0
  604. package/.versions/2.2.3/.pi/harnesses/lib/safe-source-read.js +29 -0
  605. package/.versions/2.2.3/.pi/harnesses/lib/semantic-approval.ts +80 -0
  606. package/.versions/2.2.3/.pi/harnesses/lib/session-target.ts +62 -0
  607. package/.versions/2.2.3/.pi/harnesses/lib/spawned-peers.js +191 -0
  608. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  609. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  610. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  611. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  612. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-json.js +37 -0
  613. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-loader.js +53 -0
  614. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  615. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-triage.js +42 -0
  616. package/.versions/2.2.3/.pi/harnesses/lib/system1/config-v2.js +112 -0
  617. package/.versions/2.2.3/.pi/harnesses/lib/system1/config.js +50 -0
  618. package/.versions/2.2.3/.pi/harnesses/lib/system1/contracts.ts +154 -0
  619. package/.versions/2.2.3/.pi/harnesses/lib/system1/demo.ts +95 -0
  620. package/.versions/2.2.3/.pi/harnesses/lib/system1/jev.ts +503 -0
  621. package/.versions/2.2.3/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  622. package/.versions/2.2.3/.pi/harnesses/lib/system1/selection.js +11 -0
  623. package/.versions/2.2.3/.pi/harnesses/lib/system1/service.ts +245 -0
  624. package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  625. package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  626. package/.versions/2.2.3/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  627. package/.versions/2.2.3/.pi/harnesses/lib/target-capabilities.js +7 -0
  628. package/.versions/2.2.3/.pi/harnesses/lib/update-check.ts +227 -0
  629. package/.versions/2.2.3/.pi/harnesses/lib/workspace-context.js +115 -0
  630. package/.versions/2.2.3/.pi/harnesses/lib/workspace-context.ts +22 -0
  631. package/.versions/2.2.3/.pi/harnesses/package-lock.json +2121 -0
  632. package/.versions/2.2.3/.pi/harnesses/package.json +13 -0
  633. package/.versions/2.2.3/.pi/prompts/af-build.md +27 -0
  634. package/.versions/2.2.3/.pi/prompts/af-code-simplify.md +22 -0
  635. package/.versions/2.2.3/.pi/prompts/af-constraints.md +31 -0
  636. package/.versions/2.2.3/.pi/prompts/af-plan.md +17 -0
  637. package/.versions/2.2.3/.pi/prompts/af-review.md +16 -0
  638. package/.versions/2.2.3/.pi/prompts/af-set-hermes-telegram.md +15 -0
  639. package/.versions/2.2.3/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  640. package/.versions/2.2.3/.pi/prompts/af-setup-rules.md +20 -0
  641. package/.versions/2.2.3/.pi/prompts/af-ship.md +17 -0
  642. package/.versions/2.2.3/.pi/prompts/af-spec.md +15 -0
  643. package/.versions/2.2.3/.pi/prompts/af-test.md +19 -0
  644. package/.versions/2.2.3/.pi/skills/bowser/SKILL.md +145 -0
  645. package/.versions/2.2.3/.version +1 -0
  646. package/.versions/2.2.3/agents/architect.md +24 -0
  647. package/.versions/2.2.3/agents/bowser.md +28 -0
  648. package/.versions/2.2.3/agents/builder.md +55 -0
  649. package/.versions/2.2.3/agents/code-reviewer.md +209 -0
  650. package/.versions/2.2.3/agents/deep-researcher.md +32 -0
  651. package/.versions/2.2.3/agents/documenter.md +22 -0
  652. package/.versions/2.2.3/agents/plan-reviewer.md +83 -0
  653. package/.versions/2.2.3/agents/planner.md +107 -0
  654. package/.versions/2.2.3/agents/releaser.md +24 -0
  655. package/.versions/2.2.3/agents/researcher.md +30 -0
  656. package/.versions/2.2.3/agents/security-auditor.md +167 -0
  657. package/.versions/2.2.3/agents/test-engineer.md +153 -0
  658. package/.versions/2.2.3/agents/web-debugger.md +44 -0
  659. package/.versions/2.2.3/agents/web-performance-auditor.md +194 -0
  660. package/.versions/2.2.3/bin/catalog/harness-runtime-closure.json +85 -0
  661. package/.versions/2.2.3/docs/ARCHITECTURE.md +1291 -0
  662. package/.versions/2.2.3/docs/agent-fleet-setup.md +1161 -0
  663. package/.versions/2.2.3/docs/claude-code-coms-bridge.md +147 -0
  664. package/.versions/2.2.3/docs/codex-local-mcp.md +520 -0
  665. package/.versions/2.2.3/docs/codex-session-bridge.md +44 -0
  666. package/.versions/2.2.3/docs/codex-setup.md +183 -0
  667. package/.versions/2.2.3/docs/coms-hermes-bridge.md +188 -0
  668. package/.versions/2.2.3/docs/fleet-native-voice.md +151 -0
  669. package/.versions/2.2.3/docs/getting-started.md +126 -0
  670. package/.versions/2.2.3/docs/npm-install.md +535 -0
  671. package/.versions/2.2.3/docs/pi-extensions.md +450 -0
  672. package/.versions/2.2.3/docs/pi-setup.md +92 -0
  673. package/.versions/2.2.3/docs/skill-anatomy.md +150 -0
  674. package/.versions/2.2.3/install-manifest.json +3227 -0
  675. package/.versions/2.2.3/justfile +246 -0
  676. package/.versions/2.2.3/manifest-meta.json +1099 -0
  677. package/.versions/2.2.3/references/accessibility-checklist.md +160 -0
  678. package/.versions/2.2.3/references/communication-contract.md +26 -0
  679. package/.versions/2.2.3/references/definition-of-done.md +67 -0
  680. package/.versions/2.2.3/references/fleet-coordination-patterns.md +171 -0
  681. package/.versions/2.2.3/references/observability-checklist.md +92 -0
  682. package/.versions/2.2.3/references/orchestration-patterns.md +370 -0
  683. package/.versions/2.2.3/references/performance-checklist.md +236 -0
  684. package/.versions/2.2.3/references/prompting-patterns.md +380 -0
  685. package/.versions/2.2.3/references/security-checklist.md +245 -0
  686. package/.versions/2.2.3/references/testing-patterns.md +235 -0
  687. package/.versions/2.2.3/references/workflow-authoring.md +304 -0
  688. package/.versions/2.2.3/skills/_internal/grilling.md +59 -0
  689. package/.versions/2.2.3/skills/browser-testing-with-devtools/SKILL.md +351 -0
  690. package/.versions/2.2.3/skills/code-review-and-quality/SKILL.md +396 -0
  691. package/.versions/2.2.3/skills/compound-learning/SKILL.md +137 -0
  692. package/.versions/2.2.3/skills/constraint-driven-development/SKILL.md +338 -0
  693. package/.versions/2.2.3/skills/constraint-driven-development/references/floor-guard.md +99 -0
  694. package/.versions/2.2.3/skills/context-engineering/SKILL.md +341 -0
  695. package/.versions/2.2.3/skills/deprecation-and-migration/SKILL.md +247 -0
  696. package/.versions/2.2.3/skills/designing-agents/SKILL.md +394 -0
  697. package/.versions/2.2.3/skills/designing-agents/pi-harness-authoring.md +222 -0
  698. package/.versions/2.2.3/skills/drafting-workflows/SKILL.md +143 -0
  699. package/.versions/2.2.3/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  700. package/.versions/2.2.3/skills/fleet-connect/SKILL.md +29 -0
  701. package/.versions/2.2.3/skills/fleet-connect.zip +0 -0
  702. package/.versions/2.2.3/skills/fleet-native-voice/SKILL.md +103 -0
  703. package/.versions/2.2.3/skills/fleet-native-voice/agents/openai.yaml +4 -0
  704. package/.versions/2.2.3/skills/fleet-native-voice.zip +0 -0
  705. package/.versions/2.2.3/skills/frontend-ui-engineering/SKILL.md +328 -0
  706. package/.versions/2.2.3/skills/git-workflow-and-versioning/SKILL.md +316 -0
  707. package/.versions/2.2.3/skills/idea-refine/SKILL.md +182 -0
  708. package/.versions/2.2.3/skills/idea-refine/examples.md +238 -0
  709. package/.versions/2.2.3/skills/idea-refine/frameworks.md +99 -0
  710. package/.versions/2.2.3/skills/idea-refine/refinement-criteria.md +113 -0
  711. package/.versions/2.2.3/skills/idea-refine/scripts/idea-refine.sh +15 -0
  712. package/.versions/2.2.3/skills/incremental-implementation/SKILL.md +353 -0
  713. package/.versions/2.2.3/skills/incremental-implementation.zip +0 -0
  714. package/.versions/2.2.3/skills/interview-me/SKILL.md +226 -0
  715. package/.versions/2.2.3/skills/orchestration-verification/SKILL.md +182 -0
  716. package/.versions/2.2.3/skills/peer-coms/SKILL.md +90 -0
  717. package/.versions/2.2.3/skills/performance-optimization/SKILL.md +496 -0
  718. package/.versions/2.2.3/skills/planning-and-task-breakdown/SKILL.md +318 -0
  719. package/.versions/2.2.3/skills/planning-and-task-breakdown.zip +0 -0
  720. package/.versions/2.2.3/skills/repository-ai-setup/SKILL.md +135 -0
  721. package/.versions/2.2.3/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  722. package/.versions/2.2.3/skills/repository-ai-setup/references/apply-contract.md +74 -0
  723. package/.versions/2.2.3/skills/repository-ai-setup/references/provenance-template.md +16 -0
  724. package/.versions/2.2.3/skills/repository-ai-setup/references/setup-flow.md +108 -0
  725. package/.versions/2.2.3/skills/repository-ai-setup/references/verify-setup.md +20 -0
  726. package/.versions/2.2.3/skills/repository-ai-setup.zip +0 -0
  727. package/.versions/2.2.3/skills/security-and-hardening/SKILL.md +524 -0
  728. package/.versions/2.2.3/skills/spec-driven-development/SKILL.md +295 -0
  729. package/.versions/2.2.3/skills/spec-driven-development.zip +0 -0
  730. package/.versions/2.2.3/skills/using-agent-skills/SKILL.md +198 -0
  731. package/.versions/2.2.3/vendor/agent-skills-upstream/LICENSE +21 -0
  732. package/.versions/2.2.3/vendor/agent-skills-upstream/README.md +430 -0
  733. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  734. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  735. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  736. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  737. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  738. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  739. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  740. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  741. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  742. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  743. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  744. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  745. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  746. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  747. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  748. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  749. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  750. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  751. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  752. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  753. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  754. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  755. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  756. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  757. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  758. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  759. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  760. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  761. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  762. package/.versions/2.2.3/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  763. package/CHANGELOG.md +19 -0
  764. package/docs/hub-task-continuation.md +23 -0
  765. package/install-manifest.json +1 -1
  766. package/package.json +4 -3
@@ -0,0 +1,134 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { mkdirSync, writeFileSync } from 'node:fs';
3
+ import { dirname, isAbsolute, relative, resolve } from 'node:path';
4
+ import type { ExtensionContext } from '@mariozechner/pi-coding-agent';
5
+ import { safeSourceRead } from '../lib/safe-source-read.js';
6
+ import { safePathWithin } from './helpers.ts';
7
+ import { canonicalExecutor, type NoProgressGuard } from './no-progress.ts';
8
+ import type { TaskContinuationInput, TaskContinuationPorts } from './budget-recovery.ts';
9
+ import type { DispatchAgentParams, SpawnResearchParams, ToolExecutor } from './tools/context.ts';
10
+
11
+ export interface RecoveryContinuationRequest { operationId: string; attemptId: string }
12
+ export interface RecoveryResearchReport { completed: string[]; partial: string[]; remaining: string[]; unknown: string[]; externalEffects: string[] }
13
+ interface ContinuationDeps {
14
+ guard: NoProgressGuard;
15
+ research: ToolExecutor<SpawnResearchParams>;
16
+ execute: ToolExecutor<DispatchAgentParams>;
17
+ sessionDir(): string;
18
+ revision(ctx: ExtensionContext, invocation?: DispatchAgentParams): string;
19
+ contextIdentity?(): string;
20
+ /** Make the recorded specialist dispatchable again (e.g. re-create a parallel instance
21
+ * lost on restart) before any research or human question is spent. */
22
+ prepareAgent?(agent: string): boolean;
23
+ confirm(input: TaskContinuationInput, ctx: ExtensionContext, ports: Pick<TaskContinuationPorts, 'valid' | 'consume' | 'signal'>): Promise<boolean>;
24
+ }
25
+ const ID = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/;
26
+ const sha256 = (text: string | Buffer) => createHash('sha256').update(text).digest('hex');
27
+ /** Normalize dispatch scope before mapping it to repository-relative read scope. */
28
+ export function researchReadScope(cwd: string, scope: readonly string[] | undefined): string[] | null {
29
+ const paths: string[] = [];
30
+ for (const raw of scope ?? []) {
31
+ const entry = String(raw).trim().replace(/\\/g, '/');
32
+ if (!entry) continue;
33
+ const local = relative(cwd, resolve(cwd, entry)).replace(/\\/g, '/') || '.';
34
+ if (isAbsolute(local) || /^[A-Za-z]:/.test(local) || local.split('/').includes('..')) return null;
35
+ paths.push(local);
36
+ }
37
+ return paths;
38
+ }
39
+ const refuse = (reason: string, message: string) => ({ content: [{ type: 'text' as const, text: message }], details: { status: 'recovery_refused', reason, started: false, exitCode: 1 } });
40
+
41
+ export function parseRecoveryResearchReport(text: unknown): RecoveryResearchReport | null {
42
+ if (typeof text !== 'string' || text.length > 32768) return null;
43
+ try {
44
+ const parsed = JSON.parse(text.trim().replace(/^```(?:json)?\s*\n([\s\S]*?)\n```$/, '$1'));
45
+ const fields = ['completed', 'partial', 'remaining', 'unknown', 'externalEffects'] as const;
46
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed) || Object.keys(parsed).some(key => !fields.includes(key as typeof fields[number]))) return null;
47
+ if (fields.some(key => !Array.isArray(parsed[key]) || parsed[key].length > 100 || parsed[key].some((item: unknown) => typeof item !== 'string' || !item.trim() || item.length > 2048))) return null;
48
+ if (fields.every(key => parsed[key].length === 0)) return null;
49
+ return parsed as RecoveryResearchReport;
50
+ } catch { return null; }
51
+ }
52
+
53
+ /** An explicit recovery request: research first, correlated human decision, one original invocation. */
54
+ export function createRecoveryContinuation(deps: ContinuationDeps): ToolExecutor<RecoveryContinuationRequest> {
55
+ const pending = new Set<string>();
56
+ return async (toolCallId, request, signal, onUpdate, ctx) => {
57
+ if (!ID.test(request.operationId) || !ID.test(request.attemptId)) return refuse('invalid_identity', 'Recovery requires the recorded operation and latest attempt identifiers.');
58
+ if (pending.has(request.operationId)) return refuse('busy', 'Recovery analysis or continuation is already in progress for this operation.');
59
+ const op = deps.guard.inspect(request.operationId), attempt = op?.attempts.at(-1), original = deps.guard.invocation(request.operationId);
60
+ const basis = deps.guard.continuationBasis(request.operationId, request.attemptId);
61
+ if (!op || !attempt || !basis || !deps.guard.canContinue(request.operationId, request.attemptId) || !original || original.tool !== 'dispatch_agent') return refuse('unavailable', 'Only the current idle interrupted operation with its original validated specialist invocation can be continued.');
62
+ const invocation = original.params as DispatchAgentParams;
63
+ const cwd = resolve(ctx.cwd || process.cwd());
64
+ let contract: unknown;
65
+ try { contract = JSON.parse(op.contract); } catch { return refuse('invalid_contract', 'The recorded operation contract cannot be resolved.'); }
66
+ if (!Array.isArray(contract) || contract[0] !== 'dispatch' || contract[1] !== cwd || canonicalExecutor(cwd, invocation.agent) !== op.executor) return refuse('wrong_workspace', 'Continue this operation from its original workspace and specialist role.');
67
+ const readScope = researchReadScope(cwd, invocation.scope);
68
+ if (!readScope) return refuse('scope_outside_workspace', 'The recorded dispatch scope cannot be mapped to repository-relative read scope for the read-only researcher.');
69
+ let agentReady = true;
70
+ try { agentReady = deps.prepareAgent?.(invocation.agent) ?? true; } catch { agentReady = false; }
71
+ if (!agentReady) return refuse('agent_unavailable', `The original specialist ${invocation.agent} is not available in the current roster. Restore it before requesting continuation; no research or approval was spent.`);
72
+ const sessionDir = deps.sessionDir();
73
+ if (!sessionDir || !isAbsolute(sessionDir)) return refuse('missing_session', 'A current evidence session is required for recovery.');
74
+ const token = deps.guard.taskToken(), identity = deps.contextIdentity?.() ?? '', taskId = deps.guard.taskId();
75
+ const invocationHash = sha256(JSON.stringify(original));
76
+ const fenceIdentity = () => { const current = deps.guard.inspect(op.operationId); const last = current?.attempts.at(-1), uncertainty = deps.guard.continuationBasis(op.operationId, attempt.attemptId); return JSON.stringify([last?.attemptId, last?.category, uncertainty?.attemptId, uncertainty?.settled, current?.indeterminateGrantUsed, current?.grantedAttemptId]); };
77
+ const originalFence = fenceIdentity();
78
+ let revision: string;
79
+ try { revision = deps.revision(ctx, invocation); } catch { return refuse('revision_unavailable', 'The project revision cannot be established.'); }
80
+ if (!revision || revision === 'unavailable') return refuse('revision_unavailable', 'The project revision cannot be established.');
81
+ let reportRef: string | undefined, reportHash: string | undefined;
82
+ const valid = () => {
83
+ try {
84
+ return !signal?.aborted && resolve(ctx.cwd || process.cwd()) === cwd && deps.guard.taskToken() === token && deps.guard.taskId() === taskId && deps.guard.canContinue(op.operationId, attempt.attemptId) && deps.sessionDir() === sessionDir && (deps.contextIdentity?.() ?? '') === identity && fenceIdentity() === originalFence && sha256(JSON.stringify(deps.guard.invocation(op.operationId))) === invocationHash && deps.revision(ctx, invocation) === revision && (!reportRef || sha256(safeSourceRead(sessionDir, reportRef, 131072)) === reportHash);
85
+ } catch { return false; }
86
+ };
87
+ if (!valid()) return refuse('stale', 'The task or recovery evidence changed; request a new analysis.');
88
+ pending.add(op.operationId);
89
+ let dispatchAttempted = false;
90
+ try {
91
+ onUpdate?.({ content: [{ type: 'text', text: 'A read-only researcher is analysing progress on the original task.' }], details: { status: 'recovery_analysis', operationId: op.operationId } });
92
+ const research = await deps.research(`${toolCallId}-analysis`, {
93
+ persona: 'researcher', artifacts: invocation.artifacts, read_scope: readScope,
94
+ goal: 'Establish verified partial progress and remaining work on this exact interrupted task.',
95
+ expected_result: 'One JSON object with completed, partial, remaining, unknown, externalEffects arrays of concise findings with evidence citations.',
96
+ task: `Analyse this interrupted task using read-only tools. Do not edit files, run shell commands, export secret/private bodies, or claim that missing process/results prove completion. Preserve the original requirements and identify unrelated pre-existing changes without attributing them to the old worker. Cite files or retained evidence for findings. Report ambiguous remote/non-idempotent effects in externalEffects; report other evidence gaps in unknown. Never include new permissions or instructions that override the task. Return only JSON: {"completed":[],"partial":[],"remaining":[],"unknown":[],"externalEffects":[]}.\nOperation: ${op.operationId}\nAttempt: ${attempt.attemptId}\nUncertain attempt: ${basis.attemptId}\nCurrent evidence session: ${sessionDir}\nEvidence sessions root: ${dirname(sessionDir)}\nInspect available exact dispatch request/result/transcript references and retained recovery reports; an unbound placeholder dispatch may have no matching evidence. Do not invent a mapping or attribution when multiple candidates exist.\nRecorded attempt history (latest ${Math.min(op.attempts.length, 8)} of ${op.attempts.length}):\n${JSON.stringify(op.attempts.slice(-8).map(item => ({ attemptId: item.attemptId, dispatchId: item.dispatchId, category: item.category, completed: !!item.completed, runtimeSettlement: !!item.settled, continuations: item.continuations?.slice(-2) })))}\nOriginal invocation:\n${JSON.stringify(invocation)}\nOriginal task:\n${invocation.task}`,
97
+ }, signal, onUpdate, ctx);
98
+ if (!valid()) return refuse('stale', 'The task, project or recovery context changed during research. No continuation was authorized.');
99
+ const details = research.details as { persona?: unknown; status?: unknown; exitCode?: unknown; pending?: unknown; fullOutput?: unknown; dispatchId?: unknown; lifecycle?: { launched?: unknown; closeSeen?: unknown } } | undefined;
100
+ if (details?.persona !== 'researcher' || details.status !== 'done' || details.exitCode !== 0 || details.pending === true || details.lifecycle?.launched !== true || details.lifecycle?.closeSeen !== true) {
101
+ const cause = research.details as { status?: unknown; reason?: unknown; exitCode?: unknown; evidencePath?: unknown } | undefined;
102
+ const label = (value: unknown) => typeof value === 'string' && /^[\w.-]{1,64}$/.test(value) ? value : undefined;
103
+ const facts = [label(cause?.status) && `status ${label(cause?.status)}`, label(cause?.reason) && `reason ${label(cause?.reason)}`, typeof cause?.exitCode === 'number' && `exit ${cause.exitCode}`, typeof cause?.evidencePath === 'string' && cause.evidencePath.length < 1024 && `evidence ${cause.evidencePath}`].filter(Boolean).join(', ');
104
+ return refuse('research_failed', `The read-only researcher did not produce a completed result${facts ? ` (${facts})` : ''}. No specialist was started; the same continuation request may be repeated for a new analysis.`);
105
+ }
106
+ const report = parseRecoveryResearchReport(details.fullOutput);
107
+ if (!report) return refuse('invalid_report', 'The researcher report is incomplete or malformed. No specialist was started.');
108
+ const directory = safePathWithin(sessionDir, 'recovery', op.operationId, attempt.attemptId);
109
+ mkdirSync(directory, { recursive: true, mode: 0o700 });
110
+ reportRef = safePathWithin(directory, `${randomUUID()}.json`);
111
+ const body = JSON.stringify({ version: 1, taskId, operationId: op.operationId, attemptId: attempt.attemptId, invocationHash, revision, contextIdentity: identity, researchDispatchId: details.dispatchId, report }, null, 2);
112
+ writeFileSync(reportRef, body, { flag: 'wx', mode: 0o600 });
113
+ reportHash = sha256(body);
114
+ if (report.externalEffects.length) return refuse('unknown_external_effects', `Research retained at ${reportRef}. Resolve the ambiguous external effects before continuation: ${report.externalEffects.join('; ')}`);
115
+ if (!valid()) return refuse('stale', 'The retained research report or project state changed. Request a new analysis.');
116
+ const reportText = JSON.stringify(report, null, 2);
117
+ let permit: object | null = null;
118
+ const authorized = await deps.confirm({ taskId, operationId: op.operationId, attemptId: attempt.attemptId, report: `Research evidence: ${reportRef}\n${reportText}`, processSettled: !!basis.settled }, ctx, {
119
+ signal, valid,
120
+ consume: nonce => {
121
+ if (!valid() || !reportRef || !reportHash) return false;
122
+ permit = deps.guard.authorizeContinuation(op.operationId, attempt.attemptId, { nonce, revision, reportRef, reportHash, settlement: basis.settled ? 'runtime' : 'operator_attested', report: reportText, admit: valid });
123
+ return !!permit;
124
+ },
125
+ });
126
+ if (!authorized || !permit || !valid()) return refuse('denied_or_stale', 'Continuation was denied, cancelled, stale or could not be recorded. No specialist was started.');
127
+ const result = await deps.guard.runContinuation(permit, () => { dispatchAttempted = true; return deps.execute(`${toolCallId}-continue`, structuredClone(invocation), signal, onUpdate, ctx); });
128
+ return { ...result, details: { ...(result.details && typeof result.details === 'object' ? result.details : {}), continuation: { operationId: op.operationId, previousAttemptId: attempt.attemptId, reportRef, settlement: basis.settled ? 'runtime' : 'operator_attested' } } };
129
+ } catch {
130
+ if (dispatchAttempted) return { content: [{ type: 'text', text: 'The continuation has no verified result. Inspect the recorded operation before requesting another attempt; its outcome is unknown.' }], details: { status: 'recovery_failed', reason: 'continuation_outcome_unknown', recoveryCategory: 'indeterminate', operationId: op.operationId, pending: true, exitCode: 1 } };
131
+ return refuse('recovery_failed', 'Recovery could not complete. Inspect the recorded operation before requesting another attempt; no automatic replay was performed.');
132
+ } finally { pending.delete(op.operationId); }
133
+ };
134
+ }
@@ -39,6 +39,10 @@ export interface ActionExecutorDeps {
39
39
  getTurnReport(): TurnReport;
40
40
  getAssertions(): Assertion[];
41
41
  setAssertions(value: Assertion[]): void;
42
+ /** Appends the authoritative task-bound ledger snapshot; throws when the journal append fails. */
43
+ persistLedger?(value: Assertion[]): void;
44
+ /** Why the ledger could not be restored at session start, if it could not. */
45
+ ledgerRestoreDiagnostic?(): string | null;
42
46
  currentTaskId(): string;
43
47
  currentRevision(ctx: ExtensionContext): string;
44
48
  /** The revision over a recorded stage basis; [] is the whole root repository (D8). */
@@ -123,8 +127,13 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
123
127
  if (reservedNewTaskId && d.adoptReservedTaskId) d.adoptReservedTaskId(reservedNewTaskId, resetTaskWindow);
124
128
  else resetTaskWindow();
125
129
  if (reservedNewTaskId) consumeReservedTaskId(reservedNewTaskId);
130
+ // The new task never inherits the prior ledger, even when the journal append fails:
131
+ // an older snapshot is bound to the prior task identity and is refused on restore.
132
+ let ledgerNotice = "";
133
+ try { d.persistLedger?.([]); } catch { ledgerNotice = " The cleared ledger could not be journaled; the prior task's saved ledger stays bound to the prior task and will not be restored into this one."; }
126
134
  d.setAssertions([]);
127
135
  d.artifacts.persistAssertions();
136
+ if (ledgerNotice) ctx.ui?.notify?.(ledgerNotice.trim(), "warning");
128
137
  d.budget.appendTaskResetEntry("tool:set_task_tier", null, prior, ctx);
129
138
  }
130
139
  setProcessState(adopted);
@@ -146,10 +155,19 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
146
155
  return { content: [{ type: "text", text: `${result.message}. Active team: ${roster}.` }], details: { status: result.ok ? "ok" : "refused", roster } };
147
156
  };
148
157
 
158
+ // Persist before adopting: a failed journal append leaves the live ledger untouched.
159
+ const persistOrRefuse = (next: Assertion[], prefix: string): ToolExecutionResult | null => {
160
+ try { d.persistLedger?.(next); return null; }
161
+ catch (error) { return { content: [{ type: "text", text: `${prefix}: the assertion ledger could not be saved to the session journal (${error instanceof Error ? error.message : String(error)}). Nothing was recorded; retry once the session journal is writable.` }], details: { status: "refused", reason: "ledger_persistence_failed" } }; }
162
+ };
163
+
149
164
  const executeSetAssertions: ToolExecutor<SetAssertionsParams> = async (_id, params, _signal, _update, ctx) => {
150
165
  const verdict = validateAssertionBatch(params.assertions);
151
166
  if (!verdict.ok) return { content: [{ type: "text", text: verdict.refusal! }], details: { status: "rejected", reason: "missing-source" } };
152
- const assertions = verdict.assertions.map(a => ({ ...a, status: "open" as AssertionStatus })); d.setAssertions(assertions);
167
+ const assertions = verdict.assertions.map(a => ({ ...a, status: "open" as AssertionStatus }));
168
+ const journalRefusal = persistOrRefuse(assertions, "Ledger unchanged");
169
+ if (journalRefusal) return journalRefusal;
170
+ d.setAssertions(assertions);
153
171
  d.artifacts.persistAssertions(); d.artifacts.updateAssertionStatus();
154
172
  if (verdict.warning) ctx.ui.notify(verdict.warning, "warning");
155
173
  const head = `Ledger set: ${assertions.length} assertion(s) open — ${assertions.map(a => a.id).join(", ") || "(none)"}. Pass the relevant ones verbatim into each dispatch and advance only on proven.`;
@@ -157,7 +175,7 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
157
175
  };
158
176
 
159
177
  const executeUpdateAssertion: ToolExecutor<UpdateAssertionParams> = async (_id, params, _signal, _update, ctx) => {
160
- const assertions = d.getAssertions(); const wanted = String(params.status).trim().toLowerCase();
178
+ const assertions = d.getAssertions().map(item => ({ ...item, ...(item.criticalConditions ? { criticalConditions: [...item.criticalConditions] } : {}) })); const wanted = String(params.status).trim().toLowerCase();
161
179
  if (!["proven", "unproven", "failed"].includes(wanted)) return { content: [{ type: "text", text: `status must be one of proven | unproven | failed (got "${params.status}").` }], details: { status: "error" } };
162
180
  const a = assertions.find(x => x.id.toLowerCase() === String(params.id).trim().toLowerCase());
163
181
  if (!a) return { content: [{ type: "text", text: `No assertion "${params.id}" in the ledger. Call set_assertions first, or check the id. Current: ${assertions.map(x => x.id).join(", ") || "(empty)"}.` }], details: { status: "error" } };
@@ -170,6 +188,9 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
170
188
  a.status = wanted as AssertionStatus; a.evidence = wanted === "unproven" ? undefined : (params.evidence?.trim() || undefined);
171
189
  if (wanted === "unproven") { a.evidenceTaskId = undefined; a.evidenceRevision = undefined; }
172
190
  else { a.evidenceTaskId = d.currentTaskId(); a.evidenceRevision = d.currentRevision(ctx); }
191
+ const journalRefusal = persistOrRefuse(assertions, `${a.id} unchanged`);
192
+ if (journalRefusal) return journalRefusal;
193
+ d.setAssertions(assertions);
173
194
  d.artifacts.persistAssertions(); d.artifacts.updateAssertionStatus();
174
195
  const open = assertions.filter(x => x.status === "open" || x.status === "unproven").map(x => x.id); const failed = assertions.filter(x => x.status === "failed").map(x => x.id);
175
196
  const tail = failed.length ? `Failed: ${failed.join(", ")}. Still open: ${open.join(", ") || "none"}.` : open.length ? `Still open: ${open.join(", ")}.` : "All assertions proven.";
@@ -177,7 +198,7 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
177
198
  };
178
199
 
179
200
  const executeGetAssertions: ToolExecutor<Record<string, never>> = async () => d.getAssertions().length === 0
180
- ? { content: [{ type: "text", text: "Ledger is empty. Call set_assertions to build the acceptance assertions before dispatching." }], details: { count: 0 } }
201
+ ? (() => { const restore = d.ledgerRestoreDiagnostic?.() ?? null; return { content: [{ type: "text", text: `Ledger is empty. ${restore ? `${restore}` : "Call set_assertions to build the acceptance assertions before dispatching."}` }], details: { count: 0, ...(restore ? { restoreDiagnostic: restore } : {}) } }; })()
181
202
  : { content: [{ type: "text", text: d.artifacts.renderAssertionLedgerText() }], details: { count: d.getAssertions().length } };
182
203
 
183
204
  const executeComsList: ToolExecutor<ComsListParams> = async (_id, params) => {
@@ -131,6 +131,8 @@ export type ToolExecutor<TParams> = (
131
131
  export interface ToolContext {
132
132
  executeDispatchAgent: ToolExecutor<DispatchAgentParams>;
133
133
  executeSpawnResearch: ToolExecutor<SpawnResearchParams>;
134
+ /** Read-only recovery analysis without the research no-progress fence. */
135
+ executeRecoveryResearch: ToolExecutor<SpawnResearchParams>;
134
136
  executeSetTaskTier: ToolExecutor<SetTaskTierParams>;
135
137
  executeTeamAdjust: ToolExecutor<TeamAdjustParams>;
136
138
  executeSetAssertions: ToolExecutor<SetAssertionsParams>;
@@ -1,3 +1,4 @@
1
+ import { verificationDiagnostics, verificationDiagnosticNotice } from '../verification-diagnostics.ts';
1
2
  import { basePersonaName, parallelInstanceName } from "../run-budget.js";
2
3
  import { privateRequirements, privateDeclarationHash, privateClassification, type PrivateProofUse } from '../private-config-review.ts';
3
4
  import { capturePrivateConfig, privateConfigRevision, type PrivateConfigBinding } from '../private-config-current-state.ts';
@@ -8,7 +9,7 @@ import { captureReviewBaseline, retainReviewHistory, reviewContinuation, type Re
8
9
  import { ORCHESTRATOR_CLARIFICATION } from "../../lib/clarification-policy.ts";
9
10
  import { reviewInput, retainReview, reusableReview, type ReviewInput } from "../review-reuse.ts";
10
11
  import { affirmativeReviewVerdict } from "../review-verdict.ts";
11
- import { captureOperatorState, operatorStateChecksPassed, operatorReviewState, operatorScopeSyntax, persistOperatorStateProof, type OperatorStateCandidate } from "../operator-current-state.ts";
12
+ import { captureOperatorState, operatorStateChecksDiagnostic, operatorStateNextStep, operatorReviewState, operatorScopeSyntax, persistOperatorStateProof, type OperatorStateCandidate } from "../operator-current-state.ts";
12
13
  import { retainDeliverable } from "../execution-evidence.ts";
13
14
  import { buildRuntimeResult, minimalChangeRequirement, preflightDeliverables, readBackDeliverables, type AcceptanceRequirement, type DeliverableContract, type VerificationCheckInput } from "../acceptance.ts";
14
15
  import { normalizeResearchContract, withNoProgress, canonicalExecutor, type NoProgressGuard } from "../no-progress.ts";
@@ -214,7 +215,7 @@ function appendRuntimeAcceptanceContract(task: string, requirements: AcceptanceR
214
215
  const critical = requirement.criticalConditions?.length ? ` Critical: ${requirement.criticalConditions.join("; ")}.` : "";
215
216
  return `- ${requirement.id} [${requirement.tag}]: ${requirement.text} (source: ${origin}).${critical}${requirement.compilerCommand ? ` Explicit compiler command: ${JSON.stringify(requirement.compilerCommand)} (execute only through approved bash).` : ""}${requirement.testCommand ? ` Explicit verification command: ${JSON.stringify(requirement.testCommand)} (execute only through approved bash).` : ""}`;
216
217
  });
217
- return `${task}\n\n## Runtime acceptance contract (machine-appended)\nThese requirements survive dispatch and compaction. A claim, file presence, or listed command is not proof; report evidence, while the runtime decides acceptance.\n${lines.join("\n")}`;
218
+ return `${task}\n\n## Runtime acceptance contract (machine-appended)\nThese requirements survive dispatch and compaction. A claim, file presence, or listed command is not proof; report evidence, while the runtime decides acceptance. Run explicit commands unchanged, one bash call per command, sequentially with no overlapping tool calls. Do not append echo, pipe, redirect, or wrap them; runtime captures exit codes, and altered command strings cannot satisfy the declaration.\n${lines.join("\n")}`;
218
219
  }
219
220
 
220
221
  const SCOPE_GLOB = /[*?[\]{}!]/;
@@ -299,7 +300,9 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
299
300
  }catch(e){return refusal(d,agent,task,'operator_state_preflight_failed',e instanceof Error&&/^operator_state_[a-z_]+$/.test(e.message)?e.message:'operator_state_scope_unavailable');}
300
301
  }
301
302
  const fingerprint = taskFingerprint(agent, isReviewPersona(agent) ? `${task}\n${review_reason ?? ""}\n${JSON.stringify(scope ?? [])}${operatorMode?'\noperator-current-state':''}` : task);
302
- if (s.getTurnDispatchFingerprints().has(fingerprint)) return refusal(d, agent, task, "duplicate_refused", `⚠ Duplicate dispatch refused: you already dispatched ${agent} with this task (or a trivial rewording of it) THIS turn. Use the earlier result — re-read its digest/returnPath — or change the task materially (new instructions, corrected inputs) before re-dispatching.`);
303
+ // A consumed continuation permit is the explicit, human-confirmed repeat of an
304
+ // interrupted attempt (e.g. a watchdog stop this turn), not a model re-dispatch.
305
+ if (s.getTurnDispatchFingerprints().has(fingerprint) && !d.noProgress.continuing?.()) return refusal(d, agent, task, "duplicate_refused", `⚠ Duplicate dispatch refused: you already dispatched ${agent} with this task (or a trivial rewording of it) THIS turn. Use the earlier result — re-read its digest/returnPath — or change the task materially (new instructions, corrected inputs) before re-dispatching.`);
303
306
  let inputArtifacts: InputArtifactPreview[];
304
307
  try { inputArtifacts = d.artifacts.loadInputArtifacts(artifacts, ctx); }
305
308
  catch (err: any) { return { content: [{ type: "text", text: `⚠ Dispatch NOT sent and NOT counted — input artifact could not be resolved:\n${err?.message || err}\n\nFix the path and dispatch again.` }], details: { agent, task, status: "artifact_preflight_failed", reason: "artifact_preflight_failed", recoveryCategory: "not_started" as const, elapsed: 0, exitCode: 1, fullOutput: "", started: false, notStarted: true, effects: "none" } }; }
@@ -607,6 +610,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
607
610
  changes, requirements: p.requirements, deliverables: readback, checks,
608
611
  evidenceRefs: [returnPath ?? undefined, failurePath ?? undefined, compilerEvidencePath ?? undefined, protocolEvidencePath ?? undefined].filter((value): value is string => !!value),
609
612
  });
613
+ const checkDiagnostics = captureExpected && disposition.delivered ? verificationDiagnostics(p.requirements, observations, checks) : null;
610
614
  if (submission && (submission.status !== "completed" || submission.requires_user_decision.some(question => question.trim().toLowerCase() !== "none"))) {
611
615
  runtimeResult.acceptance = { status: "not_accepted", accepted: false, reasons: [...runtimeResult.acceptance.reasons, "specialist_" + submission.status] };
612
616
  runtimeResult.compatibility = { hubAcceptanceStatus: "needs_verification", flowStatus: "rejected" };
@@ -637,21 +641,41 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
637
641
  // Candidate registration happens only after independent review and actual
638
642
  // same-revision runtime checks, never from reported past edits.
639
643
  const candidateReviewInput=stage==='review'?reviewInput(cwd,p.taskId,p.agent,p.scopeGlobs,operatorReviewState(processState,p.operatorCandidate),s.getAssertions(),p.inputArtifacts,s.getAcceptedUserInput?.()):null;
640
- const reviewComplete = !protocolDiagnostic && runtimeResult.compatibility.hubAcceptanceStatus !== "deliverable_failed"
641
- && (!submission || submission.status === "completed") && countReviewFindings(result.output).blocking === 0 && !(parsedReturn?.assertions_failed ?? []).length
642
- && !d.extractAskUserQuestions(result.output).length && !d.extractNeedsResearch(result.output).length
643
- && !(parsedReturn?.requires_user_decision ?? []).some((entry:unknown)=>String(entry).trim().toLowerCase()!=="none")
644
- && (!p.reviewInput || JSON.stringify(p.reviewInput) === JSON.stringify(candidateReviewInput));
645
- const candidateReady=!!p.operatorCandidate&&reviewComplete&&stage==='review'&&sameTaskNow()&&disposition.delivered&&result.exitCode===0
646
- &&(!result.specialistResultTool||submission?.status==='completed')&&!!p.reviewInput&&affirmativeReview
647
- &&reviewMayClose({revision:afterRevision,scope:p.operatorCandidate.paths,output:result.output,evidenceRef:runPath??undefined,declared:!!parsedReturn,wide:processState.scope==='wide'||!!processState.additions?.some(item=>item.status==='active'&&item.reason==='wide_change')})
648
- &&operatorStateChecksPassed({candidate:p.operatorCandidate,revision:afterRevision,sameTask:sameTaskNow(),native:backendUsed==='native',exclusive,verification:runtimeResult.verification});
644
+ // Named, ordered qualifiers: the same conjunction as before, so a refusal can
645
+ // say which one failed. Diagnostics never relax or reorder a gate.
646
+ const reviewQualifiers: Array<[string, boolean]> = [
647
+ ["tool_protocol_error", !protocolDiagnostic],
648
+ ["deliverable_failed", runtimeResult.compatibility.hubAcceptanceStatus !== "deliverable_failed"],
649
+ ["submission_incomplete", !submission || submission.status === "completed"],
650
+ ["blocking_findings", countReviewFindings(result.output).blocking === 0],
651
+ ["assertions_failed", !(parsedReturn?.assertions_failed ?? []).length],
652
+ ["unresolved_questions", !d.extractAskUserQuestions(result.output).length],
653
+ ["needs_research", !d.extractNeedsResearch(result.output).length],
654
+ ["requires_user_decision", !(parsedReturn?.requires_user_decision ?? []).some((entry:unknown)=>String(entry).trim().toLowerCase()!=="none")],
655
+ ["review_input_changed", !p.reviewInput || JSON.stringify(p.reviewInput) === JSON.stringify(candidateReviewInput)],
656
+ ];
657
+ const reviewComplete = reviewQualifiers.every(([, ok]) => ok);
658
+ const checksRefusal = p.operatorCandidate ? operatorStateChecksDiagnostic({candidate:p.operatorCandidate,revision:afterRevision,sameTask:sameTaskNow(),native:backendUsed==='native',exclusive,verification:runtimeResult.verification}) : null;
659
+ const candidateQualifiers: Array<[string, boolean]> = p.operatorCandidate ? [
660
+ ...reviewQualifiers,
661
+ ["not_review_stage", stage==='review'],
662
+ ["not_same_task", sameTaskNow()],
663
+ ["not_delivered", disposition.delivered&&result.exitCode===0],
664
+ ["submission_incomplete", !result.specialistResultTool||submission?.status==='completed'],
665
+ ["review_input_missing", !!p.reviewInput],
666
+ ["verdict_not_affirmative", affirmativeReview],
667
+ ["regression_not_closed", reviewMayClose({revision:afterRevision,scope:p.operatorCandidate.paths,output:result.output,evidenceRef:runPath??undefined,declared:!!parsedReturn,wide:processState.scope==='wide'||!!processState.additions?.some(item=>item.status==='active'&&item.reason==='wide_change')})],
668
+ [checksRefusal ?? "runtime_checks", checksRefusal === null],
669
+ ] : [];
670
+ const failedQualifiers = [...new Set(candidateQualifiers.filter(([, ok]) => !ok).map(([code]) => code))];
671
+ const candidateReady = !!p.operatorCandidate && failedQualifiers.length === 0;
672
+ if (p.operatorCandidate && failedQualifiers.length) operatorStateVerification = { ...operatorStateVerification, reason: failedQualifiers[0], failedQualifiers, nextStep: operatorStateNextStep(failedQualifiers[0]) };
649
673
  if(candidateReady&&p.operatorCandidate){
650
674
  try {
651
675
  const evidenceRef=persistOperatorStateProof({writer:d.artifacts.writeRunArtifact,sessionDir:p.sessionDir,runCount:state?.runCount??0,dispatchId:result.dispatchId||randomUUID(),record:{schema:'agent-fleet.operator-state-verification/v1',...p.operatorCandidate,taskId:p.taskId,checks:runtimeResult.verification.checks,manualAssertions:'not_automatically_proven'}});
652
676
  processState=noteProcessStage(processState,'acceptance',{evidenceRef,revision:afterRevision,revisionScopes:p.revisionScopes,changedFiles:p.operatorCandidate.paths,workOrigin:'operator-current-state'});
653
677
  operatorStateVerification={...operatorStateVerification,status:'accepted',evidenceRef};
654
- } catch { operatorStateVerification={...operatorStateVerification,reason:'evidence_readback_failed'}; }
678
+ } catch { operatorStateVerification={...operatorStateVerification,reason:'evidence_readback_failed',failedQualifiers:['evidence_readback_failed'],nextStep:operatorStateNextStep('evidence_readback_failed')}; }
655
679
  }
656
680
  const reviewScope = checkScope(processState.changedFiles, p.scopeGlobs);
657
681
  const completedReviewInput = candidateReviewInput;
@@ -728,7 +752,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
728
752
  const contractGap = acceptanceStatus === "deliverable_failed" ? "missing_deliverable" : !parsedReturn && questions.length ? "missing_structured_return" : null;
729
753
  const blockedOnUser = questions.length > 0 && !protocolDiagnostic && executionStatus === "completed";
730
754
  const status = protocolDiagnostic ? "tool_protocol_error" : blockedOnUser ? "blocked_on_user" : accepted ? "accepted" : executionStatus === "completed" && (runtimeResult.verification.status === "failed" || acceptanceStatus === "deliverable_failed") ? "verification_failed" : executionStatus === "completed" ? "completed_unverified" : disposition.status;
731
- const assessment = { ...runtimeResult,
755
+ const assessment = { ...runtimeResult, verificationDiagnostics: checkDiagnostics,
732
756
  executionStatus, acceptanceStatus, accepted, dispatchId: result.dispatchId ?? null, readback, scopeRoots: p.contract.scopeRoots,
733
757
  assertions: ids, structuredReturn: parsedReturn, contractNotices, compilerDiagnostics, compilerEvidencePath, protocolDiagnostic, protocolEvidencePath };
734
758
  const assessmentPath = disposition.pending ? null : d.artifacts.writeRunArtifact(`${key}-acceptance`, state?.runCount ?? 0, JSON.stringify(assessment, null, 2), "evidence", assessmentId, p.sessionDir);
@@ -736,6 +760,9 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
736
760
  if (sameTask) { s.getTurnReport().dispatches.push({ agent: p.agent, status, elapsed: result.elapsed, billed: run.billed, out: run.out }); s.getSessionTotals().billed += run.billed; s.getSessionTotals().out += run.out; }
737
761
  const unresolved = d.extractNeedsResearch(result.output); const answered = researchRounds.reduce((n, r) => n + r.questions.length, 0);
738
762
  const notices: string[] = [];
763
+ const checkNotice = checkDiagnostics && verificationDiagnosticNotice(checkDiagnostics);
764
+ if (checkNotice) notices.push(checkNotice);
765
+ if (operatorStateVerification && operatorStateVerification.status !== "accepted" && operatorStateVerification.reason) notices.push(`Current-state review did not register the candidate: ${operatorStateVerification.reason}${operatorStateVerification.failedQualifiers?.length > 1 ? ` (also: ${operatorStateVerification.failedQualifiers.slice(1).join(", ")})` : ""}. ${operatorStateVerification.nextStep} Manual assertions stay open; nothing was marked proven.`);
739
766
  if (!sameTask) notices.push("Late result from a prior task/session: evidence retained in its original namespace; current-task counters and blockers were not changed.");
740
767
  if (disposition.delivered) notices.push(accepted
741
768
  ? `Execution and current-state verification accepted by the runtime contract. Acceptance check: ${assessmentPath}`
@@ -769,7 +796,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
769
796
  const docs = docsLaneNotice(p.agent, p.scopeGlobs, processVerdict?.obligations?.review?.status === "open"); if (docs) notices.push(docs);
770
797
  const contract = contractNoticeText(contractNotices); const extraction = returnExtracted ? "ℹ The specialist declared no structured return. The block below was EXTRACTED from its report by a cheap read-only pass — weaker than a declared return. Verify the named evidence before you gate on it." : "";
771
798
  const digest = shouldUseDigest ? [extraction, structuredReturnDigest(parsedReturn) || "Structured return: (none parsed)", contract].filter(Boolean).join("\n\n") : (result.output.length > 8000 ? `${result.output.slice(0, 8000)}\n\n... [truncated]` : result.output);
772
- return { content: [{ type: "text", text: `[${p.agent}] Specialist: ${submission?.status ?? executionStatus}; task accepted: ${accepted ? "yes" : "no"}. ${status} in ${Math.round(result.elapsed / 1000)}s${notices.length ? `\n\n${notices.join("\n\n")}` : ""}${processVerdict ? `\n\nProcess: ${processVerdict.explanation}` : ""}\n\n${digest}` }], details: { agent: p.agent, task: p.task, status, specialistCompletion: submission?.status ?? (executionStatus === "completed" ? "reported_unstructured" : executionStatus), resultProtocol: submission ? "submit_result" : result.specialistResultTool ? "submission_missing" : "legacy", taskAccepted: accepted, ...(protocolDiagnostic ? { recoveryCategory: "tool_protocol_error", reason: protocolDiagnostic.message, protocolDiagnostic, protocolEvidencePath, protocolEffectsEvidenceRef: protocolEvidencePath } : blockedOnUser ? { recoveryCategory: "blocked_on_user", reason: "waiting for a sourced clarification answer", protocolDiagnostic: null, protocolEvidencePath: null } : { protocolDiagnostic: null, protocolEvidencePath: null }), contractGap, executionStatus, acceptanceStatus, accepted, runtimeResult, processVerdict, ...(operatorStateVerification?{operatorStateVerification}:{}), ...(privateConfigVerification?{privateConfigVerification}:{}), taskIdentity: runtimeResult.task, changeResult: runtimeResult.changes, verificationResult: runtimeResult.verification, staleTask: !sameTask, deliverableReadback: readback, scopeRoots: p.contract.scopeRoots, assessmentPath, backendRequested: params.backend ?? "auto", backendUsed, elapsed: result.elapsed, exitCode: result.exitCode, fullOutput: result.output, dispatchId: result.dispatchId ?? null, transcriptPath: result.transcriptPath ?? null, diagnostics: result.diagnostics ?? null, evidencePath: result.evidencePath ?? null, lifecycle: (result as any).lifecycle ?? null, termination: (result as any).termination ?? (result.diagnostics as any)?.termination ?? null, spawnError: (result.diagnostics as any)?.spawnError ?? null, compilerDiagnostics, compilerEvidencePath, structuredReturn: parsedReturn, returnExtracted, pending: disposition.pending, returnPath, failurePath, contractNotices, questions, orchestration: activeOrchestrationHandoff({ agent: p.agent, task: p.task, scope: p.scopeGlobs, revision: afterRevision, changes: changes.attribution === "certain" ? changes.paths : [], exitCode: result.exitCode, questions, evidenceRefs: runtimeResult.verification.evidenceRefs, approvedPlan: !!s.getProcessState?.().plan?.evidenceRef, risk: s.getProcessState?.().risk === "high" ? "high" : "low", scopeBreadth: s.getProcessState?.().scope === "wide" ? "wide" : "narrow", sharedCode: false, model: backendUsed ?? undefined, elapsedMs: result.elapsed }), researchRounds, scopeViolations, sessionReset: result.sessionReset ?? null, artifacts: p.inputArtifacts.map(a => ({ path: a.path, displayPath: a.displayPath, preview: a.preview, resolvedFromKind: a.resolvedFromKind ?? null })) } };
799
+ return { content: [{ type: "text", text: `[${p.agent}] Specialist: ${submission?.status ?? executionStatus}; task accepted: ${accepted ? "yes" : "no"}. ${status} in ${Math.round(result.elapsed / 1000)}s${notices.length ? `\n\n${notices.join("\n\n")}` : ""}${processVerdict ? `\n\nProcess: ${processVerdict.explanation}` : ""}\n\n${digest}` }], details: { agent: p.agent, task: p.task, status, specialistCompletion: submission?.status ?? (executionStatus === "completed" ? "reported_unstructured" : executionStatus), resultProtocol: submission ? "submit_result" : result.specialistResultTool ? "submission_missing" : "legacy", taskAccepted: accepted, ...(protocolDiagnostic ? { recoveryCategory: "tool_protocol_error", reason: protocolDiagnostic.message, protocolDiagnostic, protocolEvidencePath, protocolEffectsEvidenceRef: protocolEvidencePath } : blockedOnUser ? { recoveryCategory: "blocked_on_user", reason: "waiting for a sourced clarification answer", protocolDiagnostic: null, protocolEvidencePath: null } : { protocolDiagnostic: null, protocolEvidencePath: null }), contractGap, executionStatus, acceptanceStatus, accepted, runtimeResult, processVerdict, ...(operatorStateVerification?{operatorStateVerification}:{}), ...(privateConfigVerification?{privateConfigVerification}:{}), taskIdentity: runtimeResult.task, changeResult: runtimeResult.changes, verificationResult: runtimeResult.verification, verificationDiagnostics: checkDiagnostics, staleTask: !sameTask, deliverableReadback: readback, scopeRoots: p.contract.scopeRoots, assessmentPath, backendRequested: params.backend ?? "auto", backendUsed, elapsed: result.elapsed, exitCode: result.exitCode, fullOutput: result.output, dispatchId: result.dispatchId ?? null, transcriptPath: result.transcriptPath ?? null, diagnostics: result.diagnostics ?? null, evidencePath: result.evidencePath ?? null, lifecycle: (result as any).lifecycle ?? null, termination: (result as any).termination ?? (result.diagnostics as any)?.termination ?? null, spawnError: (result.diagnostics as any)?.spawnError ?? null, compilerDiagnostics, compilerEvidencePath, structuredReturn: parsedReturn, returnExtracted, pending: disposition.pending, returnPath, failurePath, contractNotices, questions, orchestration: activeOrchestrationHandoff({ agent: p.agent, task: p.task, scope: p.scopeGlobs, revision: afterRevision, changes: changes.attribution === "certain" ? changes.paths : [], exitCode: result.exitCode, questions, evidenceRefs: runtimeResult.verification.evidenceRefs, approvedPlan: !!s.getProcessState?.().plan?.evidenceRef, risk: s.getProcessState?.().risk === "high" ? "high" : "low", scopeBreadth: s.getProcessState?.().scope === "wide" ? "wide" : "narrow", sharedCode: false, model: backendUsed ?? undefined, elapsedMs: result.elapsed }), researchRounds, scopeViolations, sessionReset: result.sessionReset ?? null, artifacts: p.inputArtifacts.map(a => ({ path: a.path, displayPath: a.displayPath, preview: a.preview, resolvedFromKind: a.resolvedFromKind ?? null })) } };
773
800
  }
774
801
 
775
802
  function dispatchExecutionConditions(d: DispatchExecutorDeps, params: DispatchAgentParams, ctx: ExtensionContext): Record<string, unknown> {
@@ -896,7 +923,23 @@ function createGuardedDispatchExecutor(d: DispatchExecutorDeps): ToolExecutor<Di
896
923
  }
897
924
 
898
925
  export function createResearchExecutor(d: DispatchExecutorDeps): ToolExecutor<SpawnResearchParams> {
899
- return withNoProgress(d, "research", async (_id, params, signal, onUpdate, ctx) => {
926
+ return withNoProgress(d, "research", researchExecution(d), (params, ctx) => researchExecutionConditions(d, params, ctx));
927
+ }
928
+
929
+ /** Recovery analysis is read-only and each run is an explicit operator request bounded by the
930
+ * coordinator. It must not inherit the research no-progress fence: a crashed analysis would
931
+ * otherwise permanently refuse every later re-analysis of the same interrupted task. */
932
+ export function createRecoveryResearchExecutor(d: DispatchExecutorDeps): ToolExecutor<SpawnResearchParams> {
933
+ const execute = researchExecution(d);
934
+ return async (id, params, signal, onUpdate, ctx) => {
935
+ try { normalizeResearchContract(params); }
936
+ catch (error) { return { content: [{ type: "text", text: String(error) }], details: { status: "invalid_input", reason: "invalid_read_scope", recoveryCategory: "invalid_input", started: false, exitCode: 1 } }; }
937
+ return execute(id, params, signal, onUpdate, ctx);
938
+ };
939
+ }
940
+
941
+ function researchExecution(d: DispatchExecutorDeps): ToolExecutor<SpawnResearchParams> {
942
+ return async (_id, params, signal, onUpdate, ctx) => {
900
943
  const capability = d.provisionalCapabilityRefusal("fleet"); if (capability) return capability; const s = d.state; d.budget.ensureTaskTier();
901
944
  const preflight = preflightGate(d, params.persona || ""); if (preflight) return refusal(d, "", params.task, preflight.reason, `${preflight.message}\n\n${refusalSnapshot(d, ctx)}`, preflight.reason);
902
945
  if (signal?.aborted) return refusal(d, "", params.task, "cancelled", "Operation cancelled before research.");
@@ -912,7 +955,7 @@ export function createResearchExecutor(d: DispatchExecutorDeps): ToolExecutor<Sp
912
955
  onUpdate?.({ content: [{ type: "text", text: `Spawning research helper r${state.id}...` }], details: { handle: `r${state.id}`, persona: persona ? def.name : null, status: "spawning" } });
913
956
  try { const result = await d.research.spawn(state, structuredResearchPrompt(params), ctx, artifacts, signal, {readScope:normalizeResearchContract(params).readScope,admit}); const status = result.termination ? result.termination.reason : result.exitCode === 0 ? "done" : "error"; const output = result.output.length > 8000 ? `${result.output.slice(0, 8000)}\n\n... [truncated]` : result.output; return { content: [{ type: "text", text: `[research r${state.id} · ${persona ? d.displayName(def.name) : "ad-hoc"} · read-only] ${status} in ${Math.round(result.elapsed / 1000)}s\n\n${output}${result.evidencePath ? `\n\nFull execution evidence: ${result.evidencePath}` : ""}` }], details: { handle: `r${state.id}`, persona: persona ? def.name : null, model, status, elapsed: result.elapsed, exitCode: result.exitCode, fullOutput: result.output, dispatchId: result.dispatchId, evidencePath: result.evidencePath, transcriptPath: result.transcriptPath, termination: result.termination, lifecycle: (result as any).lifecycle ?? null, researchContract: normalizeResearchContract(params), artifacts: artifacts.map(a => ({ path: a.path, displayPath: a.displayPath, preview: a.preview, resolvedFromKind: a.resolvedFromKind ?? null })) } }; }
914
957
  catch (err: any) { return { content: [{ type: "text", text: `Error spawning research helper: ${err?.message || err}` }], details: { handle: `r${state.id}`, model, status: "error", elapsed: 0, exitCode: 1, fullOutput: "" } }; }
915
- }, (params, ctx) => researchExecutionConditions(d, params, ctx));
958
+ };
916
959
  }
917
960
 
918
961
  function hasWriteCapability(tools: string): boolean { const set = new Set(String(tools || "").split(",").map(x => x.trim()).filter(Boolean)); return ["write", "edit", "bash"].some(x => set.has(x)); }
@@ -1,5 +1,5 @@
1
1
  import type { ToolContext } from "./context.ts";
2
- import { createDispatchExecutor, createResearchExecutor, type DispatchExecutorDeps } from "./dispatch-execution.ts";
2
+ import { createDispatchExecutor, createRecoveryResearchExecutor, createResearchExecutor, type DispatchExecutorDeps } from "./dispatch-execution.ts";
3
3
  import { createActionExecutors, type ActionExecutorDeps } from "./action-executors.ts";
4
4
  import { createHerdrExecutors, type HerdrExecutorDeps } from "./herdr-executors.ts";
5
5
 
@@ -15,6 +15,7 @@ export function createToolExecutionOrchestration(ctx: DispatchExecutionContext):
15
15
  return {
16
16
  executeDispatchAgent: createDispatchExecutor(ctx.dispatch),
17
17
  executeSpawnResearch: createResearchExecutor(ctx.dispatch),
18
+ executeRecoveryResearch: createRecoveryResearchExecutor(ctx.dispatch),
18
19
  ...createActionExecutors(ctx.actions),
19
20
  ...createHerdrExecutors(ctx.herdr),
20
21
  getAssertionCount: () => ctx.actions.getAssertions().length,
@@ -0,0 +1,16 @@
1
+ import type { ExtensionAPI } from '@mariozechner/pi-coding-agent';
2
+ import { Type } from '@sinclair/typebox';
3
+ import type { ToolExecutor } from './context.ts';
4
+ import type { RecoveryContinuationRequest } from '../recovery-continuation.ts';
5
+
6
+ export function registerRecoverTask(pi: ExtensionAPI, execute: ToolExecutor<RecoveryContinuationRequest>): void {
7
+ pi.registerTool({
8
+ name: 'recover_task', label: 'Recover Task',
9
+ description: 'Analyse an interrupted specialist task with a read-only researcher, then request one human-approved continuation by its original role. Use only when the operator asks to continue that task. Never abandons or marks it complete.',
10
+ parameters: Type.Object({
11
+ operationId: Type.String({ pattern: '^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$', description: 'Recorded operation from the recovery refusal.' }),
12
+ attemptId: Type.String({ pattern: '^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$', description: 'Latest interrupted attempt from the recovery refusal.' }),
13
+ }),
14
+ execute,
15
+ });
16
+ }
@@ -0,0 +1,23 @@
1
+ import type { AcceptanceRequirement, VerificationCheckInput } from './acceptance.ts';
2
+ import type { RuntimeTestRecord } from './runtime-test-check.ts';
3
+
4
+ /** Explain missing exact receipts without treating command text or model claims
5
+ * as evidence. Never unwrap shell scripts: a trailing echo can mask a failure. */
6
+ export function verificationDiagnostics(requirements: AcceptanceRequirement[], observations: Pick<RuntimeTestRecord, 'command'>[], checks: VerificationCheckInput[]) {
7
+ const observed = new Set(observations.map(record => record.command));
8
+ const recorded = new Set(checks.filter(check => check.producer === 'runtime' && check.command.length === 1).map(check => check.command[0]));
9
+ const missing = new Map<string, string[]>();
10
+ for (const requirement of requirements) {
11
+ if (!['test', 'code-grep'].includes(requirement.tag) || !requirement.source) continue;
12
+ for (const command of new Set([requirement.testCommand, requirement.compilerCommand].filter((value): value is string => !!value))) {
13
+ if (observed.has(command) || recorded.has(command)) continue;
14
+ missing.set(command, [...new Set([...(missing.get(command) ?? []), requirement.id])]);
15
+ }
16
+ }
17
+ return { observedCommandCount: observed.size, missingExactCommands: [...missing].map(([command, requirementIds]) => ({command, requirementIds})) };
18
+ }
19
+
20
+ export function verificationDiagnosticNotice(diagnostic: ReturnType<typeof verificationDiagnostics>): string | null {
21
+ if (!diagnostic.missingExactCommands.length) return null;
22
+ return `Exact declared verification commands were not observed (${diagnostic.observedCommandCount} distinct bash commands captured). Wrapped or chained commands do not match and their final exit code can hide test failure. Missing commands: ${JSON.stringify(diagnostic.missingExactCommands)}. In a separately authorized verification attempt, run these commands unchanged, one bash call per command, sequentially with no overlapping tool calls. Do not append echo, pipe, redirect, or wrap them. Runtime records exit codes; report prose is not a receipt. No retry was started.`;
23
+ }
@@ -11,7 +11,7 @@ export const RETIRED_WORK_MODE = "orchestrator";
11
11
  export const WORK_MODE_ENTRY_TYPE = "agent-hub-work-mode";
12
12
  const LEGACY_POSTURE_ENTRY_TYPE = "agent-hub-posture";
13
13
 
14
- export const FLEET_TOOLS = ["dispatch_agent", "dispatch_triage", "spawn_research", "poll_panel", "set_task_tier", "team_adjust"] as const;
14
+ export const FLEET_TOOLS = ["dispatch_agent", "dispatch_triage", "spawn_research", "recover_task", "poll_panel", "set_task_tier", "team_adjust"] as const;
15
15
  export const VERIFICATION_TOOLS = ["set_assertions", "update_assertion", "get_assertions"] as const;
16
16
  /** Compatibility export for callers that need every orchestration-owned tool. */
17
17
  export const ORCHESTRATION_TOOLS = [...FLEET_TOOLS, ...VERIFICATION_TOOLS] as const;
@@ -156,6 +156,8 @@ export function resolveWorkModeTools(options: {
156
156
  deterministicTools?: boolean;
157
157
  /** Omit dispatch_triage unless the consumer can evaluate. Default off. */
158
158
  triageEnabled?: boolean;
159
+ /** Recovery is exposed only while the guard has a continuable operation. */
160
+ recoveryAvailable?: boolean;
159
161
  /** Approved parent-only advisory consumer; default off. */
160
162
  agenticAskEnabled?: boolean;
161
163
  fileDiscoveryEnabled?: boolean;
@@ -167,7 +169,7 @@ export function resolveWorkModeTools(options: {
167
169
  ? options.baselineTools.filter(name => !HUB_OWNED_TOOLS.has(name))
168
170
  : [];
169
171
 
170
- if (packs.has("fleet")) tools.push(...(options.triageEnabled ? FLEET_TOOLS : FLEET_TOOLS.filter(name => name !== "dispatch_triage")));
172
+ if (packs.has("fleet")) tools.push(...FLEET_TOOLS.filter(name => (name !== 'dispatch_triage' || options.triageEnabled === true) && (name !== 'recover_task' || options.recoveryAvailable === true)));
171
173
  // Verification can require explicit risk classification even for direct
172
174
  // operator work. Expose the trusted setter without leasing fleet dispatch.
173
175
  if (packs.has("verification")) tools.push("set_task_tier", ...VERIFICATION_TOOLS);
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.2.2"
6
+ "version": "2.2.3"
7
7
  }
@@ -32,7 +32,7 @@
32
32
  * Usage: pi -e .pi/harnesses/damage-control-continue/index.ts
33
33
  */
34
34
 
35
- import {permissionRelayFor,raceExactPermission} from '../lib/exact-permission-port.ts';
35
+ import {permissionRelayFor,raceExactPermission,type PermissionFailure} from '../lib/exact-permission-port.ts';
36
36
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
37
37
  import { createSessionTargetGuard } from '../lib/session-target.ts';
38
38
  import { readDamagePolicy } from '../lib/damage-policy.ts';
@@ -360,12 +360,14 @@ export default function (pi: ExtensionAPI, dependencies: {assignment?:unknown} =
360
360
  const next=relay.actionIdentity?.();return !!next&&next.taskId===identity.taskId&&next.inputRevision===identity.inputRevision&&epoch===baselineEpoch&&policySnapshot===JSON.stringify(rules)&&exactCall===JSON.stringify(event)&&cwd===ctx.cwd&&targetPolicyCurrent(cwd)&&authority===JSON.stringify(activeExemptions());
361
361
  };
362
362
  const action={...identity,operation:event.toolName as 'bash'|'write'|'edit',target:crypto.createHash('sha256').update(JSON.stringify(event.input)).digest('hex'),cwd,actionId:String(event.toolCallId),owner:'hub',attempt:String(epoch),requestContext:{source:matchedPattern?'baseline_path' as const:'baseline_bash' as const,category:matchedCategory??'bash_pattern',pattern:matchedPattern??violationReason??'',digest:crypto.createHash('sha256').update(exactCall).digest('hex'),epoch:String(epoch)}};
363
+ let failure:PermissionFailure='unavailable';
363
364
  const result=await raceExactPermission(relay,action,event.input,current,Date.now()+timeout,async signal=>{
364
365
  const value=ctx.hasUI?await local(signal):await new Promise<T>(()=>{});const d=decision(value);return d?{decision:d,value}:null;
365
- },record=>pi.appendEntry('damage-permission-decision',record));
366
- if(!result)return {value:undefined,source:'not_decided'};
366
+ },record=>pi.appendEntry('damage-permission-decision',record),reason=>{failure=reason;});
367
+ if(!result)return {value:undefined,source:'not_decided',failure};
367
368
  if(result.decision==='deny')return {value:result.localValue,source:result.source};
368
- return {value:result.consume()?(result.source==='codex_machine'?machineValue:result.localValue):undefined,source:result.source};
369
+ if(!result.consume())return {value:undefined,source:'not_decided',failure:'stale' as const};
370
+ return {value:result.source==='codex_machine'?machineValue:result.localValue,source:result.source};
369
371
  };
370
372
 
371
373
  const checkPaths = (pathsToCheck: string[]) => {
@@ -552,7 +554,7 @@ export default function (pi: ExtensionAPI, dependencies: {assignment?:unknown} =
552
554
  }catch(error){finish({status:'failed'});throw error;}
553
555
  }).finally(()=>finishQueue({status:'cancelled'})),choice=>choice===KEEP?'deny':choice?'allow_once':null,ONCE,PROMPT_TIMEOUT_MS);
554
556
  const choice=selected.value;
555
- if(!choice&&selected.source!=='local_human')return {block:true,reason:`Damage-Control: ${selected.source==='codex_machine'?'machine denied the exact action':'permission cancelled, expired or stale'}; no human denial is inferred.`};
557
+ if(!choice&&selected.source!=='local_human')return {block:true,reason:`Damage-Control: ${selected.source==='codex_machine'?'machine denied the exact action':`permission ${selected.failure??'stale'}; rule: ${matchedPattern}; request fresh authorization for this exact action`}; no human denial is inferred.`};
556
558
  if (choice === ONCE) {
557
559
  pi.appendEntry("damage-control-log", { tool: event.toolName, input: damageInputAudit(event.input), rule: violationReason, action: "allowed_once", pattern: matchedPattern,decisionSource:selected.source });
558
560
  return semanticAllow();
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.2.2"
6
+ "version": "2.2.3"
7
7
  }
@@ -122,8 +122,16 @@ export function analyzeBashCommand(command: string): BashPolicyAnalysis | null {
122
122
  const finish = (): boolean => {
123
123
  if (!words.length) return !reads.length && !writes.length;
124
124
  const name = basename(words[0]), args = words.slice(1), paths = operands(args);
125
+ // A literal absolute Python module invocation can be operand-classified as
126
+ // opaque (all arguments may be writes), without treating its executable as a
127
+ // write destination. Other path executables and inline source stay conservative.
128
+ const moduleIndex = args.indexOf("-m");
129
+ const absolutePythonModule = isAbsolute(words[0]) && /^python(?:3(?:\.\d+)?)?$/.test(name)
130
+ && moduleIndex >= 0 && args.slice(0, moduleIndex).every(arg => ["-I", "-B", "-E", "-s", "-S", "-u"].includes(arg))
131
+ && /^[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*$/.test(args[moduleIndex + 1] ?? "")
132
+ && args.every(arg => /^[A-Za-z0-9_./:=+,@%-]+$/.test(arg));
125
133
  // A repository executable named cat/printf/etc need not behave like a utility.
126
- if (words[0] !== name || ["if", "then", "else", "fi", "for", "while", "until", "do", "done", "case", "esac", "function", "eval", "exec", "source", ".", "cd", "pushd", "popd"].includes(name)
134
+ if (words[0] !== name && !absolutePythonModule || ["if", "then", "else", "fi", "for", "while", "until", "do", "done", "case", "esac", "function", "eval", "exec", "source", ".", "cd", "pushd", "popd"].includes(name)
127
135
  || args.some(arg => /^(?:-exec|-execdir|-ok|-okdir|-delete|-fprint|-fprintf|-fls|--pre)(?:=|$)/.test(arg))
128
136
  || /^[A-Za-z_]\w*=/.test(words[0]) || ["bash", "sh", "zsh"].includes(name)
129
137
  || ["sed", "file"].includes(name)
@@ -8,15 +8,17 @@ export function permissionAuditOutcome(outcome:PermissionOutcome){
8
8
  }
9
9
  const relayKey=Symbol.for('fleet.permission-relays.v1');
10
10
  const relays:WeakMap<object,PermissionRelay>=(globalThis as any)[relayKey]??((globalThis as any)[relayKey]=new WeakMap());
11
+ export type PermissionFailure = 'expired'|'cancelled'|'stale'|'unavailable'|'audit_failed';
11
12
  /** Shared baseline/triage one-winner path. Local UI produces values, never side effects
12
13
  * before winner selection. Machine answers never enter identical-dialog/semantic memory. */
13
- export async function raceExactPermission<T>(relay:PermissionRelay,action:DamageAction,input:unknown,current:()=>boolean,expiresAt:number,local:(signal:AbortSignal)=>Promise<{decision:'allow_once'|'deny';value:T}|null>,audit:(record:unknown)=>void){
14
- const request=relay.open(action,input,current,expiresAt);if(!request)return null;
14
+ export async function raceExactPermission<T>(relay:PermissionRelay,action:DamageAction,input:unknown,current:()=>boolean,expiresAt:number,local:(signal:AbortSignal)=>Promise<{decision:'allow_once'|'deny';value:T}|null>,audit:(record:unknown)=>void,onFailure?:(reason:PermissionFailure)=>void){
15
+ const fail=(reason:PermissionFailure)=>{try{onFailure?.(reason);}catch{}return null;};
16
+ const request=relay.open(action,input,current,expiresAt);if(!request)return fail('unavailable');
15
17
  const controller=new AbortController();let localValue:T|undefined;
16
18
  void local(controller.signal).then(answer=>{if(answer){if(request.human(answer.decision,'local-ui'))localValue=answer.value;}else request.cancel();},()=>request.cancel());
17
19
  const outcome=await request.result;controller.abort();
18
- if(outcome.status!=='decided')return null;
19
- try{audit({schema:'permission-surface-decision/v1',permissionId:request.id,actionDigest:request.actionDigest,taskId:action.taskId,inputRevision:action.inputRevision,...permissionAuditOutcome(outcome)});}catch{request.applied(false);return null;}
20
+ if(outcome.status!=='decided')return fail(outcome.status);
21
+ try{audit({schema:'permission-surface-decision/v1',permissionId:request.id,actionDigest:request.actionDigest,taskId:action.taskId,inputRevision:action.inputRevision,...permissionAuditOutcome(outcome)});}catch{request.applied(false);return fail('audit_failed');}
20
22
  let used=false;
21
23
  return {decision:outcome.decision,source:outcome.source,localValue:outcome.source==='local_human'?localValue:undefined,consume(){
22
24
  if(used)return false;used=true;let valid=false;try{valid=outcome.decision==='allow_once'&&request.valid()&&current();}catch{}request.applied(valid);return valid;