@chankov/agent-fleet 2.0.14 → 2.0.15

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 (617) hide show
  1. package/.pi/agent-fleet/scripts/fleet.ts +2 -1
  2. package/.pi/extensions/compact-and-continue/README.md +2 -2
  3. package/.pi/harnesses/agent-hub/README.md +89 -10
  4. package/.pi/harnesses/agent-hub/budget-recovery.ts +2 -2
  5. package/.pi/harnesses/agent-hub/commands/context.ts +2 -0
  6. package/.pi/harnesses/agent-hub/commands/recover.ts +13 -4
  7. package/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  8. package/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  9. package/.pi/harnesses/agent-hub/context/budgets.ts +9 -7
  10. package/.pi/harnesses/agent-hub/deterministic-fs.ts +51 -12
  11. package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +4 -0
  12. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +14 -3
  13. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +3 -0
  14. package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -1
  15. package/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +2 -1
  16. package/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +2 -0
  17. package/.pi/harnesses/agent-hub/dispatch-triage-state.ts +23 -5
  18. package/.pi/harnesses/agent-hub/docs-lane.js +2 -1
  19. package/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  20. package/.pi/harnesses/agent-hub/filesystem-tool.ts +75 -11
  21. package/.pi/harnesses/agent-hub/index.ts +246 -19
  22. package/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +13 -5
  23. package/.pi/harnesses/agent-hub/no-progress.ts +232 -28
  24. package/.pi/harnesses/agent-hub/orchestration-activation.ts +112 -0
  25. package/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  26. package/.pi/harnesses/agent-hub/orchestration-route.ts +76 -0
  27. package/.pi/harnesses/agent-hub/package.json +1 -1
  28. package/.pi/harnesses/agent-hub/policy/work-mode.ts +14 -5
  29. package/.pi/harnesses/agent-hub/process-obligations.ts +116 -15
  30. package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -11
  31. package/.pi/harnesses/agent-hub/recover-policy.ts +18 -1
  32. package/.pi/harnesses/agent-hub/recover-state.ts +1 -1
  33. package/.pi/harnesses/agent-hub/recovery-contract.ts +70 -0
  34. package/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  35. package/.pi/harnesses/agent-hub/research/runtime.ts +2 -0
  36. package/.pi/harnesses/agent-hub/research/spawn-run.ts +15 -6
  37. package/.pi/harnesses/agent-hub/return-contract.js +27 -5
  38. package/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  39. package/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  40. package/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  41. package/.pi/harnesses/agent-hub/run-budget.js +12 -0
  42. package/.pi/harnesses/agent-hub/scope-gate.js +23 -2
  43. package/.pi/harnesses/agent-hub/session-audit.ts +94 -8
  44. package/.pi/harnesses/agent-hub/spawn.ts +10 -2
  45. package/.pi/harnesses/agent-hub/system1-activity.ts +116 -1
  46. package/.pi/harnesses/agent-hub/system1-communication-store.ts +47 -13
  47. package/.pi/harnesses/agent-hub/system1-report.ts +50 -0
  48. package/.pi/harnesses/agent-hub/system1-runtime.ts +3 -2
  49. package/.pi/harnesses/agent-hub/task-triage-authorization.ts +122 -0
  50. package/.pi/harnesses/agent-hub/task-triage-config.ts +37 -0
  51. package/.pi/harnesses/agent-hub/task-triage-contract.ts +19 -0
  52. package/.pi/harnesses/agent-hub/task-triage-obligations.ts +104 -0
  53. package/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  54. package/.pi/harnesses/agent-hub/task-triage-runtime.ts +125 -0
  55. package/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  56. package/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  57. package/.pi/harnesses/agent-hub/tools/action-executors.ts +33 -10
  58. package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +1 -1
  59. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +86 -26
  60. package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +9 -0
  61. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +9 -6
  62. package/.pi/harnesses/agent-hub/ui/fleet-source.ts +6 -2
  63. package/.pi/harnesses/agent-hub/ui/system1-communication.ts +1 -1
  64. package/.pi/harnesses/agent-hub/work-mode.ts +13 -8
  65. package/.pi/harnesses/coms/package.json +1 -1
  66. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  67. package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -1
  68. package/.pi/harnesses/lib/fleet-dashboard-view.ts +29 -4
  69. package/.pi/harnesses/lib/fleet-read-model.ts +73 -0
  70. package/.pi/harnesses/lib/system1/demo.ts +2 -4
  71. package/.pi/harnesses/lib/system1/selection.js +11 -0
  72. package/.pi/prompts/af-build.md +9 -6
  73. package/.versions/2.0.15/.pi/agent-fleet/hermes/README.md +347 -0
  74. package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  75. package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  76. package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  77. package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  78. package/.versions/2.0.15/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  79. package/.versions/2.0.15/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  80. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  81. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  82. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  83. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  84. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  85. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  86. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  87. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  88. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  89. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  90. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  91. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  92. package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  93. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  94. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  95. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  96. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  97. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  98. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  99. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  100. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  101. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  102. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  103. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  104. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  105. package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  106. package/.versions/2.0.15/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  107. package/.versions/2.0.15/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  108. package/.versions/2.0.15/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  109. package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  110. package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  111. package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  112. package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  113. package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  114. package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet.ts +217 -0
  115. package/.versions/2.0.15/.pi/agent-fleet/scripts/flow.ts +157 -0
  116. package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  117. package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  118. package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  119. package/.versions/2.0.15/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  120. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  121. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  122. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  123. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  124. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  125. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  126. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  127. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  128. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
  129. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  130. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  131. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  132. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  133. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  134. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  135. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  136. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  137. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  138. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  139. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  140. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  141. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  142. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  143. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  144. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  145. package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  146. package/.versions/2.0.15/.pi/agent-fleet/scripts/package-lock.json +35 -0
  147. package/.versions/2.0.15/.pi/agent-fleet/scripts/package.json +9 -0
  148. package/.versions/2.0.15/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  149. package/.versions/2.0.15/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  150. package/.versions/2.0.15/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  151. package/.versions/2.0.15/.pi/agent-fleet/scripts/team-up.ts +378 -0
  152. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
  153. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  154. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  155. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  156. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  157. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  158. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  159. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
  160. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  161. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  162. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  163. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  164. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  165. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  166. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +34 -0
  167. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  168. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  169. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  170. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  171. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  172. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  173. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  174. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  175. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  176. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  177. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  178. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  179. package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  180. package/.versions/2.0.15/.pi/agents/dispatch-policy.yaml +32 -0
  181. package/.versions/2.0.15/.pi/agents/model-profiles.yaml +134 -0
  182. package/.versions/2.0.15/.pi/agents/peers.yaml +147 -0
  183. package/.versions/2.0.15/.pi/agents/teams.yaml +41 -0
  184. package/.versions/2.0.15/.pi/agents/voices.yaml +13 -0
  185. package/.versions/2.0.15/.pi/damage-control-rules.yaml +297 -0
  186. package/.versions/2.0.15/.pi/extensions/btw/README.md +120 -0
  187. package/.versions/2.0.15/.pi/extensions/btw/index.ts +914 -0
  188. package/.versions/2.0.15/.pi/extensions/btw/package.json +6 -0
  189. package/.versions/2.0.15/.pi/extensions/btw/state.js +179 -0
  190. package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  191. package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  192. package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  193. package/.versions/2.0.15/.pi/extensions/compact-and-continue/README.md +42 -0
  194. package/.versions/2.0.15/.pi/extensions/compact-and-continue/index.ts +120 -0
  195. package/.versions/2.0.15/.pi/extensions/compact-and-continue/package.json +6 -0
  196. package/.versions/2.0.15/.pi/extensions/mcp-bridge/README.md +46 -0
  197. package/.versions/2.0.15/.pi/extensions/mcp-bridge/index.ts +206 -0
  198. package/.versions/2.0.15/.pi/extensions/mcp-bridge/package.json +6 -0
  199. package/.versions/2.0.15/.pi/extensions/package-lock.json +1175 -0
  200. package/.versions/2.0.15/.pi/extensions/package.json +9 -0
  201. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/README.md +224 -0
  202. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/config.ts +198 -0
  203. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  204. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/index.ts +248 -0
  205. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/package.json +6 -0
  206. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  207. package/.versions/2.0.15/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  208. package/.versions/2.0.15/.pi/harnesses/agent-hub/README.md +1448 -0
  209. package/.versions/2.0.15/.pi/harnesses/agent-hub/acceptance.ts +199 -0
  210. package/.versions/2.0.15/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  211. package/.versions/2.0.15/.pi/harnesses/agent-hub/artifacts.js +146 -0
  212. package/.versions/2.0.15/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
  213. package/.versions/2.0.15/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
  214. package/.versions/2.0.15/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  215. package/.versions/2.0.15/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  216. package/.versions/2.0.15/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  217. package/.versions/2.0.15/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
  218. package/.versions/2.0.15/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  219. package/.versions/2.0.15/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
  220. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  221. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  222. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  223. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  224. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  225. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  226. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  227. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  228. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  229. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  230. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  231. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  232. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  233. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  234. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  235. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  236. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/context.ts +47 -0
  237. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  238. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  239. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  240. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  241. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  242. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  243. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
  244. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  245. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  246. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  247. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  248. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  249. package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  250. package/.versions/2.0.15/.pi/harnesses/agent-hub/config/agents.ts +178 -0
  251. package/.versions/2.0.15/.pi/harnesses/agent-hub/config/model-profiles.ts +236 -0
  252. package/.versions/2.0.15/.pi/harnesses/agent-hub/config/overrides.ts +160 -0
  253. package/.versions/2.0.15/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  254. package/.versions/2.0.15/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  255. package/.versions/2.0.15/.pi/harnesses/agent-hub/context/budgets.ts +206 -0
  256. package/.versions/2.0.15/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  257. package/.versions/2.0.15/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  258. package/.versions/2.0.15/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  259. package/.versions/2.0.15/.pi/harnesses/agent-hub/context-window.js +108 -0
  260. package/.versions/2.0.15/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  261. package/.versions/2.0.15/.pi/harnesses/agent-hub/delegate.ts +467 -0
  262. package/.versions/2.0.15/.pi/harnesses/agent-hub/deterministic-fs.ts +166 -0
  263. package/.versions/2.0.15/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  264. package/.versions/2.0.15/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  265. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
  266. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  267. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
  268. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +259 -0
  269. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +231 -0
  270. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-types.ts +260 -0
  271. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native.ts +234 -0
  272. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  273. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +38 -0
  274. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +76 -0
  275. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  276. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  277. package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  278. package/.versions/2.0.15/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  279. package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  280. package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  281. package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  282. package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  283. package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
  284. package/.versions/2.0.15/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  285. package/.versions/2.0.15/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  286. package/.versions/2.0.15/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  287. package/.versions/2.0.15/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  288. package/.versions/2.0.15/.pi/harnesses/agent-hub/filesystem-tool.ts +137 -0
  289. package/.versions/2.0.15/.pi/harnesses/agent-hub/fixtures/registration-surface.json +64 -0
  290. package/.versions/2.0.15/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  291. package/.versions/2.0.15/.pi/harnesses/agent-hub/footer.ts +30 -0
  292. package/.versions/2.0.15/.pi/harnesses/agent-hub/helpers.ts +270 -0
  293. package/.versions/2.0.15/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
  294. package/.versions/2.0.15/.pi/harnesses/agent-hub/index.ts +2597 -0
  295. package/.versions/2.0.15/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  296. package/.versions/2.0.15/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  297. package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +133 -0
  298. package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  299. package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  300. package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  301. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  302. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  303. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  304. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  305. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  306. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  307. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  308. package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  309. package/.versions/2.0.15/.pi/harnesses/agent-hub/no-progress.ts +563 -0
  310. package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-activation.ts +112 -0
  311. package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  312. package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-route.ts +76 -0
  313. package/.versions/2.0.15/.pi/harnesses/agent-hub/package.json +7 -0
  314. package/.versions/2.0.15/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  315. package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  316. package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  317. package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  318. package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  319. package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/work-mode.ts +135 -0
  320. package/.versions/2.0.15/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  321. package/.versions/2.0.15/.pi/harnesses/agent-hub/presentation.ts +48 -0
  322. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-config.ts +40 -0
  323. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  324. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  325. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  326. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-local.ts +88 -0
  327. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-observer.ts +105 -0
  328. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-rules.ts +143 -0
  329. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-runtime.ts +316 -0
  330. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  331. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  332. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-snapshot.ts +243 -0
  333. package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-types.ts +63 -0
  334. package/.versions/2.0.15/.pi/harnesses/agent-hub/process-obligations.ts +158 -0
  335. package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/context.ts +54 -0
  336. package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/fragments.ts +116 -0
  337. package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  338. package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/system-prompt.ts +122 -0
  339. package/.versions/2.0.15/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  340. package/.versions/2.0.15/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  341. package/.versions/2.0.15/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  342. package/.versions/2.0.15/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  343. package/.versions/2.0.15/.pi/harnesses/agent-hub/recovery-contract.ts +150 -0
  344. package/.versions/2.0.15/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  345. package/.versions/2.0.15/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  346. package/.versions/2.0.15/.pi/harnesses/agent-hub/research/runtime.ts +197 -0
  347. package/.versions/2.0.15/.pi/harnesses/agent-hub/research/spawn-run.ts +183 -0
  348. package/.versions/2.0.15/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  349. package/.versions/2.0.15/.pi/harnesses/agent-hub/return-contract.js +349 -0
  350. package/.versions/2.0.15/.pi/harnesses/agent-hub/return-extract.js +77 -0
  351. package/.versions/2.0.15/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  352. package/.versions/2.0.15/.pi/harnesses/agent-hub/review-findings.js +104 -0
  353. package/.versions/2.0.15/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  354. package/.versions/2.0.15/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  355. package/.versions/2.0.15/.pi/harnesses/agent-hub/run-budget.js +554 -0
  356. package/.versions/2.0.15/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  357. package/.versions/2.0.15/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
  358. package/.versions/2.0.15/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  359. package/.versions/2.0.15/.pi/harnesses/agent-hub/scope-gate.js +144 -0
  360. package/.versions/2.0.15/.pi/harnesses/agent-hub/session-audit.ts +313 -0
  361. package/.versions/2.0.15/.pi/harnesses/agent-hub/session-health.js +110 -0
  362. package/.versions/2.0.15/.pi/harnesses/agent-hub/session-start.ts +42 -0
  363. package/.versions/2.0.15/.pi/harnesses/agent-hub/spawn.ts +534 -0
  364. package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  365. package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-communication-store.ts +129 -0
  366. package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  367. package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-runtime.ts +280 -0
  368. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  369. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-authorization.ts +122 -0
  370. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-config.ts +37 -0
  371. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-contract.ts +19 -0
  372. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  373. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-live-stage-closure.user-run.mjs +336 -0
  374. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-obligations.ts +104 -0
  375. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  376. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  377. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  378. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  379. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only.user-run.mjs +157 -0
  380. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-runtime.ts +125 -0
  381. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  382. package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  383. package/.versions/2.0.15/.pi/harnesses/agent-hub/timeline.ts +72 -0
  384. package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
  385. package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  386. package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  387. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/action-executors.ts +208 -0
  388. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  389. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/context.ts +144 -0
  390. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
  391. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +558 -0
  392. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  393. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  394. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  395. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/herdr-executors.ts +95 -0
  396. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
  397. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  398. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
  399. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  400. package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
  401. package/.versions/2.0.15/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  402. package/.versions/2.0.15/.pi/harnesses/agent-hub/types.ts +66 -0
  403. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  404. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
  405. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  406. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  407. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
  408. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  409. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  410. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  411. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  412. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  413. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  414. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  415. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  416. package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  417. package/.versions/2.0.15/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  418. package/.versions/2.0.15/.pi/harnesses/agent-hub/version.ts +42 -0
  419. package/.versions/2.0.15/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  420. package/.versions/2.0.15/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  421. package/.versions/2.0.15/.pi/harnesses/agent-hub/work-mode.ts +179 -0
  422. package/.versions/2.0.15/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  423. package/.versions/2.0.15/.pi/harnesses/ask-user-remote/README.md +59 -0
  424. package/.versions/2.0.15/.pi/harnesses/ask-user-remote/index.ts +558 -0
  425. package/.versions/2.0.15/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  426. package/.versions/2.0.15/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  427. package/.versions/2.0.15/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
  428. package/.versions/2.0.15/.pi/harnesses/coms/README.md +100 -0
  429. package/.versions/2.0.15/.pi/harnesses/coms/index.ts +282 -0
  430. package/.versions/2.0.15/.pi/harnesses/coms/package.json +7 -0
  431. package/.versions/2.0.15/.pi/harnesses/coms/version.ts +42 -0
  432. package/.versions/2.0.15/.pi/harnesses/damage-control-continue/README.md +135 -0
  433. package/.versions/2.0.15/.pi/harnesses/damage-control-continue/index.ts +550 -0
  434. package/.versions/2.0.15/.pi/harnesses/damage-control-continue/package.json +7 -0
  435. package/.versions/2.0.15/.pi/harnesses/damage-control-continue/version.ts +42 -0
  436. package/.versions/2.0.15/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  437. package/.versions/2.0.15/.pi/harnesses/lib/coms-core-io.ts +385 -0
  438. package/.versions/2.0.15/.pi/harnesses/lib/coms-core.ts +577 -0
  439. package/.versions/2.0.15/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  440. package/.versions/2.0.15/.pi/harnesses/lib/context-budget-child-prompt.ts +219 -0
  441. package/.versions/2.0.15/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
  442. package/.versions/2.0.15/.pi/harnesses/lib/context-budget-view.ts +107 -0
  443. package/.versions/2.0.15/.pi/harnesses/lib/context-budget.ts +114 -0
  444. package/.versions/2.0.15/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  445. package/.versions/2.0.15/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
  446. package/.versions/2.0.15/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  447. package/.versions/2.0.15/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  448. package/.versions/2.0.15/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  449. package/.versions/2.0.15/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  450. package/.versions/2.0.15/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
  451. package/.versions/2.0.15/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  452. package/.versions/2.0.15/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  453. package/.versions/2.0.15/.pi/harnesses/lib/fleet-panel.ts +34 -0
  454. package/.versions/2.0.15/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  455. package/.versions/2.0.15/.pi/harnesses/lib/fleet-selection.ts +24 -0
  456. package/.versions/2.0.15/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  457. package/.versions/2.0.15/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  458. package/.versions/2.0.15/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  459. package/.versions/2.0.15/.pi/harnesses/lib/herdr-client.ts +472 -0
  460. package/.versions/2.0.15/.pi/harnesses/lib/herdr-presence.ts +399 -0
  461. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  462. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  463. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  464. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  465. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  466. package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  467. package/.versions/2.0.15/.pi/harnesses/lib/spawned-peers.js +191 -0
  468. package/.versions/2.0.15/.pi/harnesses/lib/system1/config.js +61 -0
  469. package/.versions/2.0.15/.pi/harnesses/lib/system1/contracts.ts +152 -0
  470. package/.versions/2.0.15/.pi/harnesses/lib/system1/demo.ts +104 -0
  471. package/.versions/2.0.15/.pi/harnesses/lib/system1/jev.ts +503 -0
  472. package/.versions/2.0.15/.pi/harnesses/lib/system1/selection.js +11 -0
  473. package/.versions/2.0.15/.pi/harnesses/lib/system1/service.ts +245 -0
  474. package/.versions/2.0.15/.pi/harnesses/lib/update-check.ts +222 -0
  475. package/.versions/2.0.15/.pi/harnesses/package-lock.json +2039 -0
  476. package/.versions/2.0.15/.pi/harnesses/package.json +10 -0
  477. package/.versions/2.0.15/.pi/prompts/af-build.md +27 -0
  478. package/.versions/2.0.15/.pi/prompts/af-code-simplify.md +22 -0
  479. package/.versions/2.0.15/.pi/prompts/af-constraints.md +31 -0
  480. package/.versions/2.0.15/.pi/prompts/af-plan.md +17 -0
  481. package/.versions/2.0.15/.pi/prompts/af-review.md +16 -0
  482. package/.versions/2.0.15/.pi/prompts/af-set-hermes-telegram.md +15 -0
  483. package/.versions/2.0.15/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  484. package/.versions/2.0.15/.pi/prompts/af-setup-rules.md +20 -0
  485. package/.versions/2.0.15/.pi/prompts/af-ship.md +17 -0
  486. package/.versions/2.0.15/.pi/prompts/af-spec.md +15 -0
  487. package/.versions/2.0.15/.pi/prompts/af-test.md +19 -0
  488. package/.versions/2.0.15/.pi/skills/bowser/SKILL.md +145 -0
  489. package/.versions/2.0.15/.version +1 -0
  490. package/.versions/2.0.15/agents/architect.md +24 -0
  491. package/.versions/2.0.15/agents/bowser.md +28 -0
  492. package/.versions/2.0.15/agents/builder.md +55 -0
  493. package/.versions/2.0.15/agents/code-reviewer.md +209 -0
  494. package/.versions/2.0.15/agents/deep-researcher.md +32 -0
  495. package/.versions/2.0.15/agents/documenter.md +22 -0
  496. package/.versions/2.0.15/agents/orchestrator.md +22 -0
  497. package/.versions/2.0.15/agents/plan-reviewer.md +83 -0
  498. package/.versions/2.0.15/agents/planner.md +105 -0
  499. package/.versions/2.0.15/agents/releaser.md +24 -0
  500. package/.versions/2.0.15/agents/researcher.md +30 -0
  501. package/.versions/2.0.15/agents/security-auditor.md +167 -0
  502. package/.versions/2.0.15/agents/test-engineer.md +153 -0
  503. package/.versions/2.0.15/agents/web-debugger.md +44 -0
  504. package/.versions/2.0.15/agents/web-performance-auditor.md +194 -0
  505. package/.versions/2.0.15/bin/catalog/harness-runtime-closure.json +73 -0
  506. package/.versions/2.0.15/codex/fleet-session-client/SKILL.md +34 -0
  507. package/.versions/2.0.15/codex/fleet-session-client.zip +0 -0
  508. package/.versions/2.0.15/docs/ARCHITECTURE.md +829 -0
  509. package/.versions/2.0.15/docs/agent-fleet-setup.md +1090 -0
  510. package/.versions/2.0.15/docs/claude-code-coms-bridge.md +134 -0
  511. package/.versions/2.0.15/docs/codex-session-bridge.md +219 -0
  512. package/.versions/2.0.15/docs/coms-hermes-bridge.md +188 -0
  513. package/.versions/2.0.15/docs/getting-started.md +126 -0
  514. package/.versions/2.0.15/docs/npm-install.md +525 -0
  515. package/.versions/2.0.15/docs/pi-extensions.md +454 -0
  516. package/.versions/2.0.15/docs/pi-setup.md +92 -0
  517. package/.versions/2.0.15/docs/skill-anatomy.md +150 -0
  518. package/.versions/2.0.15/install-manifest.json +3193 -0
  519. package/.versions/2.0.15/justfile +247 -0
  520. package/.versions/2.0.15/manifest-meta.json +1071 -0
  521. package/.versions/2.0.15/references/accessibility-checklist.md +160 -0
  522. package/.versions/2.0.15/references/communication-contract.md +26 -0
  523. package/.versions/2.0.15/references/definition-of-done.md +67 -0
  524. package/.versions/2.0.15/references/fleet-coordination-patterns.md +171 -0
  525. package/.versions/2.0.15/references/observability-checklist.md +92 -0
  526. package/.versions/2.0.15/references/orchestration-patterns.md +370 -0
  527. package/.versions/2.0.15/references/performance-checklist.md +236 -0
  528. package/.versions/2.0.15/references/prompting-patterns.md +380 -0
  529. package/.versions/2.0.15/references/security-checklist.md +245 -0
  530. package/.versions/2.0.15/references/testing-patterns.md +235 -0
  531. package/.versions/2.0.15/references/workflow-authoring.md +304 -0
  532. package/.versions/2.0.15/skills/_internal/grilling.md +59 -0
  533. package/.versions/2.0.15/skills/browser-testing-with-devtools/SKILL.md +351 -0
  534. package/.versions/2.0.15/skills/code-review-and-quality/SKILL.md +396 -0
  535. package/.versions/2.0.15/skills/compound-learning/SKILL.md +137 -0
  536. package/.versions/2.0.15/skills/constraint-driven-development/SKILL.md +338 -0
  537. package/.versions/2.0.15/skills/constraint-driven-development/references/floor-guard.md +99 -0
  538. package/.versions/2.0.15/skills/context-engineering/SKILL.md +341 -0
  539. package/.versions/2.0.15/skills/deprecation-and-migration/SKILL.md +247 -0
  540. package/.versions/2.0.15/skills/designing-agents/SKILL.md +394 -0
  541. package/.versions/2.0.15/skills/designing-agents/pi-harness-authoring.md +222 -0
  542. package/.versions/2.0.15/skills/drafting-workflows/SKILL.md +143 -0
  543. package/.versions/2.0.15/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  544. package/.versions/2.0.15/skills/frontend-ui-engineering/SKILL.md +328 -0
  545. package/.versions/2.0.15/skills/git-workflow-and-versioning/SKILL.md +316 -0
  546. package/.versions/2.0.15/skills/idea-refine/SKILL.md +182 -0
  547. package/.versions/2.0.15/skills/idea-refine/examples.md +238 -0
  548. package/.versions/2.0.15/skills/idea-refine/frameworks.md +99 -0
  549. package/.versions/2.0.15/skills/idea-refine/refinement-criteria.md +113 -0
  550. package/.versions/2.0.15/skills/idea-refine/scripts/idea-refine.sh +15 -0
  551. package/.versions/2.0.15/skills/incremental-implementation/SKILL.md +353 -0
  552. package/.versions/2.0.15/skills/interview-me/SKILL.md +226 -0
  553. package/.versions/2.0.15/skills/orchestration-verification/SKILL.md +182 -0
  554. package/.versions/2.0.15/skills/peer-coms/SKILL.md +90 -0
  555. package/.versions/2.0.15/skills/performance-optimization/SKILL.md +496 -0
  556. package/.versions/2.0.15/skills/planning-and-task-breakdown/SKILL.md +318 -0
  557. package/.versions/2.0.15/skills/repository-ai-setup/SKILL.md +117 -0
  558. package/.versions/2.0.15/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  559. package/.versions/2.0.15/skills/repository-ai-setup/references/apply-contract.md +74 -0
  560. package/.versions/2.0.15/skills/repository-ai-setup/references/provenance-template.md +16 -0
  561. package/.versions/2.0.15/skills/repository-ai-setup/references/setup-flow.md +108 -0
  562. package/.versions/2.0.15/skills/repository-ai-setup/references/verify-setup.md +20 -0
  563. package/.versions/2.0.15/skills/security-and-hardening/SKILL.md +524 -0
  564. package/.versions/2.0.15/skills/spec-driven-development/SKILL.md +295 -0
  565. package/.versions/2.0.15/skills/using-agent-skills/SKILL.md +198 -0
  566. package/.versions/2.0.15/vendor/agent-skills-upstream/LICENSE +21 -0
  567. package/.versions/2.0.15/vendor/agent-skills-upstream/README.md +430 -0
  568. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  569. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  570. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  571. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  572. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  573. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  574. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  575. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  576. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  577. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  578. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  579. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  580. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  581. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  582. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  583. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  584. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  585. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  586. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  587. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  588. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  589. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  590. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  591. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  592. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  593. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  594. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  595. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  596. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  597. package/.versions/2.0.15/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  598. package/CHANGELOG.md +6 -0
  599. package/README.md +1 -1
  600. package/agents/builder.md +2 -2
  601. package/bin/cli.js +16 -2
  602. package/bin/lib/apply.js +5 -0
  603. package/bin/lib/doctor.js +85 -12
  604. package/bin/lib/reconcile.js +9 -1
  605. package/bin/lib/state.js +1 -0
  606. package/bin/lib/task-triage-setup.js +76 -0
  607. package/bin/lib/transaction.js +4 -0
  608. package/docs/ARCHITECTURE.md +99 -24
  609. package/docs/agent-fleet-setup.md +179 -6
  610. package/docs/npm-install.md +64 -15
  611. package/docs/pi-extensions.md +1 -1
  612. package/install-manifest.json +13 -3
  613. package/manifest-meta.json +6 -0
  614. package/package.json +9 -2
  615. package/skills/incremental-implementation/SKILL.md +64 -13
  616. package/skills/planning-and-task-breakdown/SKILL.md +43 -14
  617. package/skills/using-agent-skills/SKILL.md +2 -2
@@ -47,7 +47,8 @@ DETERMINISTIC FLOWS
47
47
  just flow merge 2 # squash-merge accepted selection 2, then remove it
48
48
  Cleanup and merge require Worktrunk. Dirty worktrees are refused; merge
49
49
  targets the source branch recorded when the run started. See
50
- .pi/agent-fleet/docs/workflows.md.
50
+ docs/workflows.md in a source checkout, or
51
+ .pi/agent-fleet/docs/workflows.md in an installed workspace.
51
52
 
52
53
  FLEET CORE — loaded in every Pi mode
53
54
  Damage Control Continue · local/remote ask_user · Compact & Continue
@@ -16,13 +16,13 @@ This keeps the user in control: compaction never interrupts a tool call mid-flig
16
16
  | `reason` | string | no | Short explanation recorded in tool details. |
17
17
  | `continuationPrompt` | string | no | Self-contained summary of the remaining plan. If provided, pi auto-resumes from this message after compaction. **Do not copy the original prompt verbatim** — restate the next concrete actions. |
18
18
 
19
- The tool does not ask for confirmation. Workflows that need confirmation (e.g. `/af-build`) must ask the user **before** calling it.
19
+ The tool does not ask for confirmation. Workflows that need confirmation (e.g. `/af-build` on the default slice gate) must ask the user **before** calling it. Whole-plan execution, when the operator already opted in, may compact without a new slice-approval question. The continuation prompt must restate that opt-in, the remaining tasks, and that an unresolved plan or PRD problem still interrupts for grilling and `ask_user`.
20
20
 
21
21
  ## When to use
22
22
 
23
23
  Use only when explicitly requested by the user, a skill, or a prompt template. Do not call it pre-emptively or on a hunch that context is "getting long" — pi has its own autocompaction for that.
24
24
 
25
- The canonical usage point in this repo is `/af-build`: at slice-approval time, the user can pick "Compact & continue" to compact between slices and resume from a summarized remaining plan. See `.pi/prompts/af-build.md` and `skills/incremental-implementation/SKILL.md`.
25
+ The canonical usage point in this repo is `/af-build`: on the default path, at slice-approval time, the user can pick "Compact & continue" to compact between slices and resume from a summarized remaining plan. See `.pi/prompts/af-build.md` and `skills/incremental-implementation/SKILL.md`.
26
26
 
27
27
  ## Install
28
28
 
@@ -17,6 +17,70 @@ peers, and hand the session to a visible coms peer.
17
17
 
18
18
  **Optional ChatGPT client:** `just fleet --agents <roster> --peers <preset> --project <name>` can supply the live Pi session that the experimental [ChatGPT Fleet session client](https://github.com/chankov/agent-fleet/blob/main/docs/codex-session-bridge.md) selects. Hermes remains the inbound `ask_user` route.
19
19
 
20
+ ## System 1 task triage (active experimental; off by default)
21
+
22
+ Task triage is a separate consumer of the existing TypeSafe `jev-1.13.0` service,
23
+ not `dispatch_triage` persona advice, watchdog calibration or the spend tier.
24
+ Select experimental `system1-task-triage` with separate task-context consent;
25
+ Default/Full and `--yes` alone do not enable it. Over an existing desired file,
26
+ use `--save-desired` for permanent headless opt-in/disable. Setup proposes absent
27
+ nonsecret consumer/provider configs transactionally and never flips a human off
28
+ config or collects a key. Runtime dependencies and caller key readiness remain
29
+ separate. See [exact config and setup](../../../docs/agent-fleet-setup.md#task-triage-active-experimental-off-by-default).
30
+
31
+ An enabled consumer evaluates accepted user task input before the first model
32
+ turn, including when the dispatcher skips `set_task_tier` or watchdog is off.
33
+ Limits: 40 KiB aggregate user task/clarifications, 64 KiB state, 100 logical calls
34
+ per saved session and 2,000 ms per evaluation. Identical input/scope is cached;
35
+ new scope can require another call. Reset, compaction, resume or work-mode change
36
+ does not refill the allowance. No file bodies/tool outputs/environment are sent
37
+ by this consumer; sensitive/oversized input is refused, not silently truncated.
38
+
39
+ Independent predicates add review for requested security changes (p ≥0.80),
40
+ plan/review for broad changes (p ≥0.85), and exact-action one-use confirmation for
41
+ requested potentially irreversible execution (p ≥0.80). They do not change the
42
+ tier/model/roster, increase spend or authorize effects. Review is before task
43
+ acceptance, not a blanket authoring ban. Low probability is never safety clearance.
44
+ Baseline and source additions persist through failures, disable and resume.
45
+
46
+ Missing roles require the human `/af-agents-add planner`, `/af-agents-add
47
+ code-reviewer` (or a permitted reviewer), or `/af-agents-team` path. Budget
48
+ exhaustion needs existing explicit continuation, not automatic escalation.
49
+ `/af-task-triage-waive <addition-id> <reason>` uses a correlated human answer for
50
+ one current addition; it remains waived rather than satisfied and cannot erase
51
+ baseline/other additions. `/af-task-triage-recover` performs checked process
52
+ append/readback, not JSONL editing. Pending input must be bound before dependent
53
+ effects. Direct Hub bash/edit/write confirmation is exact-call/input/cwd-bound.
54
+ It shows complete tool inputs as JSON and working directory, not merely a hash;
55
+ the **8 KiB (8192 bytes)** detail cap refuses missing, invalid, sensitive,
56
+ terminal/bidi-control, mismatched or oversized inputs **without truncation or
57
+ partial redaction**. JSON escapes preserve non-ASCII data. Sensitive-text refusal
58
+ is heuristic, not complete secret/PII detection. Inputs, cwd, task/revision,
59
+ operation and call ID are rechecked before one-use consumption. The human
60
+ question is **not local-only**: the existing ask-user local/remote human route
61
+ can carry action paths/content. Metadata-only audit does not sanitize ordinary
62
+ Pi tool/session rendering, human-route records or clipboard. Unsupported
63
+ child/coms/remote action bindings refuse that effect. Damage-control
64
+ and existing review/acceptance gates remain independent.
65
+
66
+ The full Fleet dashboard shows assessment, probabilities, active/waived additions,
67
+ effective stages and blockers even with no workers; it adds no small-strip badge.
68
+ Fleet `1` offers separately enabled memory-only capture with the unchanged
69
+ 32 KiB viewer cap; larger otherwise-valid payloads are withheld. `/af-audit`
70
+ separates logical reservations/physical attempts/unknown usage and action grant,
71
+ consumption and tool result. Provider ok, assessment applied, process complete,
72
+ a waiver and tool-result success are not independent semantic acceptance. Trace
73
+ failure is optional; authoritative process/grant/consumption persistence failure
74
+ blocks the dependent effect.
75
+
76
+ Disable with the complete remaining feature set plus `--save-desired`, then
77
+ restart/resume; the human config and old task obligations survive. Cancel current
78
+ work normally if immediate stopping is needed. Active experimental is not live
79
+ accuracy, calibration, universal remote protection or release authority.
80
+ `npm run test:task-triage` is the guarded source regression suite and is included
81
+ in `npm run test:full`; scripted fixture reviews never replace independent
82
+ semantic review.
83
+
20
84
  ## Proactive turn review (experimental; off by default)
21
85
 
22
86
  This is a **separate, per-repository, session-bound** advisory consumer of the
@@ -73,8 +137,10 @@ These are independent runtime axes:
73
137
  restarting or losing session state; `/af-work-mode` without an argument and **Alt+M** open the
74
138
  two-option picker. Operator keeps `read`, `bash`, `edit`, `write`, approved extension tools, and
75
139
  orchestration. Orchestrator withholds direct coding tools but keeps dispatch, research, assertions,
76
- roster controls, `ask_user`, ready coms, and ready Herdr tools. In orchestrator work mode, raw
77
- Herdr panes are auxiliary-process orchestration—not a route around delegation for reading,
140
+ roster controls, `ask_user`, read-only `filesystem` stat/inventory/excerpt/readback, ready coms, and ready Herdr tools.
141
+ Self-read stops above 64 KiB for one file or for the turn; use research or a specialist and pass the path.
142
+ `dispatch_triage` is listed only when that consumer can evaluate. Snapshot stays profile-gated.
143
+ In orchestrator work mode, raw Herdr panes are auxiliary-process orchestration—not a route around delegation for reading,
78
144
  editing, testing, or implementing code.
79
145
  - **Native roster** — local headless Pi specialists from `.pi/agents/teams.yaml`. Bare Fleet starts
80
146
  empty; select one with `--agents frontend` or add one live with `/af-agents-add code-reviewer`.
@@ -86,6 +152,8 @@ team in configuration order (`default` in the shipped configuration), skipping e
86
152
  with missing personas. Existing agents are kept. If no valid team is available, the switch is refused
87
153
  with a warning. The selected team is saved in the session just like a manual team selection.
88
154
  Budgets, nested delegation, and Verification Contract rigor follow the **task tier**, not Work Mode.
155
+ Orchestrator turn dispatches are the exception: trivial/small rise to at least 3 per turn unless
156
+ `max-dispatches-per-turn` sets a lower ceiling. Research calls and the task envelope stay on the tier.
89
157
 
90
158
  All Hub slash commands, including `/af-handoff`, are registered in both work modes. A command whose
91
159
  runtime capability is unavailable refuses with remediation rather than disappearing. `--no-coms`
@@ -106,7 +174,11 @@ the Hub asks one focused `ask_user` confirmation. Confirming promotes it for the
106
174
  cancel removes it and leaves no message, child, or pane behind. Active task packs persist through
107
175
  follow-up turns so a workflow does not lose tools. They shrink only through
108
176
  `set_task_tier(new_task: true)` (apart from mandatory work mode and pending-operation leases), never
109
- merely because the next message sounds different.
177
+ merely because the next message sounds different. Compaction is the transient exception:
178
+ a task-triage assessment refresh preserves the current input's already-resolved explicit
179
+ compaction intent without re-reading task text or promoting declined packs. The next
180
+ ordinary input/reset/restore clears that explicit intent; context-pressure and pending-operation
181
+ leases remain independent. Showing `request_compaction` does not itself execute compaction.
110
182
 
111
183
  `/af-context` separates stable replacement-prompt cost from the volatile state capsule and active
112
184
  schemas. Inactive and ready-but-inactive packs cost zero model-visible characters. Provider totals,
@@ -876,7 +948,8 @@ Terminal `loop`, `failures`, and `toolcap` always go to LLM. `/af-watchdog`
876
948
  shows `experimental: scope only; G2 not validated`; an unavailable/mismatched
877
949
  provider falls back to LLM. Production approved profiles are still empty.
878
950
  This is not G2 approval or a safety guarantee: the experiment can miss a scope
879
- advisory. No automatic hook is added for research, coms or normal Hub requests.
951
+ advisory. This watchdog consumer adds no automatic hook for research, coms or normal Hub
952
+ requests; the separately consented task-triage consumer owns its own Hub input hook.
880
953
 
881
954
  The limited **System 1** state includes reviewed task text, normalized
882
955
  relative paths, structured tool kinds/outcomes and counters, not tool
@@ -1299,18 +1372,24 @@ retaining failed delivery and every open AF-MIN-CHANGE/test/review/plan obligati
1299
1372
  does not satisfy dependent work. Audit exports IDs/statuses only, never prompts, nonces,
1300
1373
  raw contracts or evidence paths.
1301
1374
 
1302
- Non-busy recovery refusals spend existing turn/task operation allowances. Exhaustion
1375
+ Non-busy recovery refusals use separate accounting and never consume turn/task launch
1376
+ counters. A `not_started` preflight refusal (runtime-owned, `started:false`, `effects:none`)
1377
+ records 0 launches and 0 indeterminate attempts; correcting the prerequisite and re-invoking
1378
+ explicitly needs no slash reset, grant, or reconcile. Exhaustion
1303
1379
  returns budget_refused; no new limit, parent abort, retry, wait or queue is added.
1304
- Busy operations that never started spend no allowance. Turn reports include charged
1305
- refusals as zero-time/zero-token no_progress_refused rows (research in its count);
1306
- refusal totals include even uncharged budget refusals. Session execution totals
1380
+ Busy operations that never started spend no allowance and record no failure. Turn reports no
1381
+ longer charge refusals as dispatches; refusal totals count every refusal while launch
1382
+ counters count only real child executions. Session execution totals
1307
1383
  still count real dispatch attempts rather than guard refusals.
1308
1384
 
1309
1385
  The shared recovery contract is fail-closed. Protocol errors require changed
1310
1386
  conditions plus a trusted prior-effects inspection. The internal task-generation-bound
1311
1387
  establishEffects port accepts a retained inspection reference; it is not a model
1312
- parameter or a promise that T3 exists. No T3 producer is installed yet. Unknown-tool
1313
- recovery likewise has no trusted catalog-change producer in this slice.
1388
+ parameter or a promise that T3 exists. Launch/close/termination lifecycle facts are
1389
+ produced by the native spawn path and the research spawn path (safety refusal and spawn
1390
+ failure never launched; timeout without close stays uncertain). Unknown-tool
1391
+ recovery has a task-generation-bound catalog-change port; a trusted catalog-change
1392
+ producer must still supply the evidence — prose alone never authorizes it.
1314
1393
 
1315
1394
  ### Runtime verification contract
1316
1395
 
@@ -39,13 +39,13 @@ export interface BudgetRecovery {
39
39
  /** Keeps the approved identity scoped to one synchronous task-window reset. */
40
40
  export function createReservedTaskIdentityReset(
41
41
  budgetRecovery: Pick<BudgetRecovery, "adopt" | "reset">,
42
- noProgress: { adopt(id: string): void; reset(): void },
42
+ noProgress: { adopt(id: string): void; reset(persistIdentity?: boolean): void },
43
43
  ) {
44
44
  let reservedId: string | undefined;
45
45
  const rawBudgetReset = budgetRecovery.reset.bind(budgetRecovery);
46
46
  const rawNoProgressReset = noProgress.reset.bind(noProgress);
47
47
  budgetRecovery.reset = () => { if (reservedId) budgetRecovery.adopt(reservedId); else rawBudgetReset(); };
48
- noProgress.reset = () => { if (reservedId) noProgress.adopt(reservedId); else rawNoProgressReset(); };
48
+ noProgress.reset = (persistIdentity?: boolean) => { if (reservedId) noProgress.adopt(reservedId); else rawNoProgressReset(persistIdentity); };
49
49
  return {
50
50
  run(id: string, resetTaskWindow: () => void) {
51
51
  if (reservedId) throw new Error("A reserved task identity reset is already active.");
@@ -33,6 +33,8 @@ export interface CommandContext {
33
33
  handleBudgetContinue(ctx: ExtensionContext): Promise<void>;
34
34
  handleRetry(args: string, ctx: ExtensionContext): Promise<void>;
35
35
  handleRecover(args: string, ctx: ExtensionContext): Promise<void>;
36
+ handleTaskTriageWaive(args: string, ctx: ExtensionContext): Promise<boolean>;
37
+ handleTaskTriageRecover(): boolean;
36
38
  handleDebate(args: string, ctx: ExtensionContext): Promise<void>;
37
39
  getAgentsKillCompletions(prefix: string): AutocompleteItem[] | null;
38
40
  getZoomCompletions(prefix: string): AutocompleteItem[] | null;
@@ -2,7 +2,7 @@ import type { ExtensionAPI, ExtensionContext } from '@mariozechner/pi-coding-age
2
2
  import type { CommandContext } from './context.ts';
3
3
  import type { NoProgressGuard } from '../no-progress.ts';
4
4
  import { confirmRecoverAction, type RecoverAuthorizationPorts } from '../budget-recovery.ts';
5
- import { renderNextInvocation, renderRecoverCommands } from '../recover-policy.ts';
5
+ import { describeInvocationAvailability, renderNextInvocation, renderRecoverCommands } from '../recover-policy.ts';
6
6
 
7
7
  const ID = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/;
8
8
  export type RecoverRequest = { action: 'inspect'; operationId: string } | { action: 'retry' | 'reconcile' | 'abandon'; operationId: string; attemptId: string };
@@ -29,8 +29,16 @@ export async function runRecoverCommand(args: string, ctx: ExtensionContext, dep
29
29
  if (request.action === "inspect") {
30
30
  const last = op.attempts.at(-1);
31
31
  const commands = last ? renderRecoverCommands(deps.noProgress, op.operationId, last.attemptId) : null;
32
- const missing = !last?.category ? 'pending or unknown process; settle before recovery' : last.category === 'indeterminate' && !last.settled ? 'independent process settlement' : !deps.noProgress.isIdle(op.executor) ? 'executor idle' : op.abandoned ? 'operation abandoned' : !deps.noProgress.invocation(op.operationId) ? 'validated original invocation' : 'category-specific evidence and existing budget/safety gates';
33
- ctx.ui.notify(JSON.stringify({ operationId: op.operationId, taskId: op.taskId, attempts: op.attempts.map(a => ({ attemptId: a.attemptId, dispatchId: a.dispatchId, category: a.category ?? 'pending', settled: !!a.settled })), technical_block: op.technical?.status ?? 'open', abandoned: !!op.abandoned, indeterminateGrantUsed: op.indeterminateGrantUsed, missingPrerequisites: missing, commands }), 'info'); return;
32
+ // T6: proven no-launch history needs no slash reset; each missing prerequisite is distinct.
33
+ const invocationDetail = describeInvocationAvailability(deps.noProgress, op.operationId);
34
+ const missing = !last?.category ? 'pending_or_unknown_process: settle the live process before recovery; independent inspection is allowed'
35
+ : last.category === 'not_started' ? 'none: preflight refused before launch with no effects; correct inputs/prerequisites and re-invoke explicitly (no slash reset, no grant, no reconcile)'
36
+ : last.category === 'indeterminate' && !last.settled ? 'independent_process_settlement: missing close/termination facts'
37
+ : !deps.noProgress.isIdle(op.executor) ? 'executor_idle'
38
+ : op.abandoned ? 'operation_abandoned: abandon closed the operation; parent obligations remain open'
39
+ : invocationDetail !== 'available' ? invocationDetail
40
+ : 'category-specific evidence and existing budget/safety gates';
41
+ ctx.ui.notify(JSON.stringify({ operationId: op.operationId, taskId: op.taskId, attempts: op.attempts.map(a => ({ attemptId: a.attemptId, dispatchId: a.dispatchId, category: a.category ?? 'pending', settled: !!a.settled })), technical_block: op.technical?.status ?? 'open', abandoned: !!op.abandoned, indeterminateGrantUsed: op.indeterminateGrantUsed, missingPrerequisites: missing, invocationAvailability: invocationDetail, commands }), 'info'); return;
34
42
  }
35
43
  const attempt = op.attempts.find(a => a.attemptId === request.attemptId);
36
44
  if (!attempt || op.attempts.at(-1)?.attemptId !== attempt.attemptId || !attempt.category) { ctx.ui.notify("Unknown, live or stale attempt; nothing changed.", "error"); return; }
@@ -44,7 +52,8 @@ export async function runRecoverCommand(args: string, ctx: ExtensionContext, dep
44
52
  const authorized = await deps.confirm({ taskId: deps.noProgress.taskId(), operationId: op.operationId, attemptId: attempt.attemptId, action: request.action, category: attempt.category }, ctx, deps.askPorts(op, attempt, request.action));
45
53
  if (!authorized) { ctx.ui.notify("Human approval denied, stale, concurrent, or duplicate; no permission granted.", "error"); return; }
46
54
  const next = renderNextInvocation(deps.noProgress, op.operationId);
47
- ctx.ui.notify(request.action === "abandon" ? "Operation abandoned; parent obligations remain open." : `One-use permission recorded; no work was started. ${next ? `Next explicit original-contract invocation: ${next}` : 'Original validated invocation unavailable; re-establish the contract before dispatching.'} Existing budgets and safety gates apply. ${renderRecoverCommands(deps.noProgress, op.operationId, attempt.attemptId) ?? ''}`, "info");
55
+ const invocationDetail = describeInvocationAvailability(deps.noProgress, op.operationId);
56
+ ctx.ui.notify(request.action === "abandon" ? "Operation abandoned; parent obligations remain open." : `One-use permission recorded; no work was started. ${next ? `Next explicit original-contract invocation: ${next}` : `Original validated invocation unavailable (${invocationDetail}); re-establish the contract before dispatching.`} Existing budgets and safety gates apply. ${renderRecoverCommands(deps.noProgress, op.operationId, attempt.attemptId) ?? ''}`, "info");
48
57
  }
49
58
 
50
59
  export function registerRecover(pi: ExtensionAPI, commandCtx: CommandContext) {
@@ -0,0 +1,12 @@
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
+ import type { CommandContext } from "./context.ts";
3
+
4
+ export function registerTaskTriageRecover(pi: ExtensionAPI, commandCtx: CommandContext): void {
5
+ pi.registerCommand("af-task-triage-recover", {
6
+ description: "Recheck and persist the in-memory process union after a persistence failure (no effect or waiver)",
7
+ handler: async (_args, ctx) => {
8
+ const recovered = commandCtx.handleTaskTriageRecover();
9
+ ctx.ui.notify(recovered ? "Process state restored with checked append/readback; open gates still apply." : "Recovery refused: persisted state differs, is corrupt, oversized or remains unwritable; effects stay blocked. Inspect or resume a valid session without editing JSONL.", recovered ? "info" : "error");
10
+ },
11
+ });
12
+ }
@@ -0,0 +1,12 @@
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
+ import type { CommandContext } from "./context.ts";
3
+
4
+ export function registerTaskTriageWaiver(pi: ExtensionAPI, commandCtx: CommandContext): void {
5
+ pi.registerCommand("af-task-triage-waive", {
6
+ description: "Request a human-authorized, source-scoped task-triage waiver: <additionId> <reason>",
7
+ handler: async (args, ctx) => {
8
+ const applied = await commandCtx.handleTaskTriageWaive(args, ctx);
9
+ ctx.ui.notify(applied ? "Exact addition waived; baseline and other additions remain." : "Waiver denied, stale or could not persist.", applied ? "info" : "warning");
10
+ },
11
+ });
12
+ }
@@ -1,6 +1,6 @@
1
1
  import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
2
2
  import {
3
- DEFAULT_TASK_TIER, budgetStatusLine, closeTaskClock, resetTaskClock,
3
+ DEFAULT_TASK_TIER, budgetStatusLine, closeTaskClock, orchestratorTurnBudget, resetTaskClock,
4
4
  resolveTaskBudget, resolveTurnBudget, taskClockElapsedMs,
5
5
  } from "../run-budget.js";
6
6
  import { buildBudgetContinuationAudit, buildHubAuditIdentity, buildTaskResetAudit } from "../hub-state-audit.js";
@@ -38,7 +38,7 @@ export interface BudgetStatePorts {
38
38
  getTurnBudgetAskUserWaitMs(): number;
39
39
  setTurnBudgetAskUserWaitMs(value: number): void;
40
40
  resetBudgetRecovery(): void;
41
- resetNoProgress(): void;
41
+ resetNoProgress(persistTaskIdentity?: boolean): void;
42
42
  resetUnknownToolCounter(): void;
43
43
  getTaskContinuationCount(): number;
44
44
  setTaskContinuationCount(value: number): void;
@@ -68,6 +68,7 @@ export interface BudgetStatePorts {
68
68
  getAuditContext(): { cwd?: string; sessionId?: string; project?: string };
69
69
  appendEntry(type: string, data: unknown): void;
70
70
  executionHistory: ExecutionHistoryStore;
71
+ getWorkMode?(): string;
71
72
  }
72
73
 
73
74
  export interface BudgetContext {
@@ -79,7 +80,7 @@ export interface BudgetContext {
79
80
  renewTurnBudgetWindow(now?: number): void;
80
81
  continueTaskBudgetWindow(now?: number): void;
81
82
  closeTurnActiveTime(now?: number): void;
82
- resetTaskWindow(label?: string | null, now?: number): void;
83
+ resetTaskWindow(label?: string | null, now?: number, persistTaskIdentity?: boolean): void;
83
84
  hubAuditIdentity(ctx?: ExtensionContext): ReturnType<typeof buildHubAuditIdentity>;
84
85
  hubLocationSuffix(ctx?: ExtensionContext): string;
85
86
  taskResetSnapshot(now?: number): { tier: string | null; dispatches: number; research: number; reviewRounds: number; activeMs: number };
@@ -99,8 +100,9 @@ export function createSessionTotals(): SessionTotals {
99
100
  }
100
101
 
101
102
  export function createBudgetContext(state: BudgetStatePorts): BudgetContext {
102
- const currentBudget = () => resolveTurnBudget(state.getTaskTier() ?? DEFAULT_TASK_TIER, state.getBudgetOverrides());
103
- const currentTaskBudget = () => resolveTaskBudget(currentBudget());
103
+ const tierTurnBudget = () => resolveTurnBudget(state.getTaskTier() ?? DEFAULT_TASK_TIER, state.getBudgetOverrides());
104
+ const currentBudget = () => orchestratorTurnBudget(tierTurnBudget(), state.getWorkMode?.() ?? "operator", state.getBudgetOverrides().maxDispatches);
105
+ const currentTaskBudget = () => resolveTaskBudget(tierTurnBudget());
104
106
  const taskCounters = () => ({ dispatches: state.getTaskDispatchCount(), research: state.getTaskResearchCount() });
105
107
  const taskActiveElapsedMs = (now = Date.now()) => taskClockElapsedMs(state.getTaskClock(), now, state.executionHistory.openAskUserWaitMs(now));
106
108
  const turnBudgetActiveElapsedMs = (now = Date.now()) => turnBudgetActiveMs(
@@ -150,14 +152,14 @@ export function createBudgetContext(state: BudgetStatePorts): BudgetContext {
150
152
  renewTurnBudgetWindow(now);
151
153
  },
152
154
  closeTurnActiveTime(now = Date.now()) { state.setTaskClock(closeTaskClock(state.getTaskClock(), now)); },
153
- resetTaskWindow(label = null, now = Date.now()) {
155
+ resetTaskWindow(label = null, now = Date.now(), persistTaskIdentity = true) {
154
156
  state.setTaskDispatchCount(0);
155
157
  state.setTaskResearchCount(0);
156
158
  state.setTaskClock(resetTaskClock(state.getTaskClock(), now));
157
159
  state.setTaskReviewRounds(0);
158
160
  state.setTaskContinuationCount(0);
159
161
  state.resetBudgetRecovery();
160
- state.resetNoProgress();
162
+ state.resetNoProgress(persistTaskIdentity);
161
163
  state.resetUnknownToolCounter();
162
164
  state.setTaskLabel(label);
163
165
  state.setTaskTier(null);
@@ -1,5 +1,5 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
- import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
2
+ import { closeSync, copyFileSync, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
3
3
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
4
4
  import { decodeDeterministicHandle } from "../lib/deterministic-handle-path.ts";
5
5
  export { deterministicHandlePath } from "../lib/deterministic-handle-path.ts";
@@ -23,11 +23,52 @@ function checkedExisting(path: string, allowedRoot = dirname(resolve(path))): st
23
23
  if (!within(rootReal, cursorReal)) throw new Error(`Symlink escape outside allowed root: ${path}`);
24
24
  return lexical;
25
25
  }
26
+ function hashAndSize(path: string): { size: number; hash: string } {
27
+ const fd = openSync(path, "r");
28
+ try {
29
+ const size = fstatSync(fd).size, hash = createHash("sha256"), chunk = Buffer.alloc(64 * 1024);
30
+ let offset = 0;
31
+ while (offset < size) {
32
+ const n = readSync(fd, chunk, 0, Math.min(chunk.length, size - offset), offset);
33
+ if (n <= 0) break;
34
+ hash.update(chunk.subarray(0, n));
35
+ offset += n;
36
+ }
37
+ return { size, hash: hash.digest("hex") };
38
+ } finally { closeSync(fd); }
39
+ }
40
+ function readWindow(path: string, offset: number, length: number): Buffer {
41
+ const fd = openSync(path, "r");
42
+ try {
43
+ const buf = Buffer.alloc(length);
44
+ let filled = 0;
45
+ while (filled < length) {
46
+ const n = readSync(fd, buf, filled, length - filled, offset + filled);
47
+ if (n <= 0) break;
48
+ filled += n;
49
+ }
50
+ return buf.subarray(0, filled);
51
+ } finally { closeSync(fd); }
52
+ }
53
+ function lineAtFile(path: string, offset: number): number {
54
+ if (offset <= 0) return 1;
55
+ const fd = openSync(path, "r");
56
+ try {
57
+ const chunk = Buffer.alloc(64 * 1024);
58
+ let seen = 0, lines = 1;
59
+ while (seen < offset) {
60
+ const n = readSync(fd, chunk, 0, Math.min(chunk.length, offset - seen), seen);
61
+ if (n <= 0) break;
62
+ for (let i = 0; i < n; i++) if (chunk[i] === 10) lines++;
63
+ seen += n;
64
+ }
65
+ return lines;
66
+ } finally { closeSync(fd); }
67
+ }
26
68
  function fileState(path: string, allowedRoot?: string) {
27
69
  const checked = checkedExisting(path, allowedRoot);
28
70
  if (!existsSync(checked) || !statSync(checked).isFile()) throw new Error(`Not a regular file: ${path}`);
29
- const bytes = readFileSync(checked);
30
- return { path: checked, bytes, hash: sha256(bytes) };
71
+ return { path: checked, ...hashAndSize(checked) };
31
72
  }
32
73
  function directoryState(root: string) {
33
74
  const checked = checkedExisting(root, root);
@@ -49,8 +90,6 @@ function directoryState(root: string) {
49
90
  function utf8Preview(bytes: Buffer, chars = PREVIEW_CHARS): string {
50
91
  return [...bytes.toString("utf8")].slice(0, chars).join("");
51
92
  }
52
- function lineAt(bytes: Buffer, offset: number): number { return offset === 0 ? 1 : bytes.subarray(0, offset).toString("utf8").split("\n").length; }
53
-
54
93
  export function inventory(input: { root: string; handle?: string; pageSize?: number; boundedOutput?: boolean; followSymlinkEscape?: boolean }) {
55
94
  if (input.followSymlinkEscape) throw new Error("Symlink escape following is forbidden");
56
95
  const state = directoryState(input.root);
@@ -75,12 +114,12 @@ export function excerpt(input: { path: string; allowedRoot?: string; handle?: st
75
114
  if (handle.kind !== "file" || resolve(handle.path) !== state.path || handle.hash !== state.hash) throw new Error("Stale file handle");
76
115
  offset = handle.offset;
77
116
  }
78
- if (!Number.isSafeInteger(offset) || offset < 0 || offset > state.bytes.length) throw new Error("Invalid excerpt offset");
79
- const requested = input.maxBytes ?? (input.boundedOutput === false ? state.bytes.length : CONTENT_REPLY_BYTES);
117
+ if (!Number.isSafeInteger(offset) || offset < 0 || offset > state.size) throw new Error("Invalid excerpt offset");
118
+ const requested = input.maxBytes ?? (input.boundedOutput === false ? state.size : CONTENT_REPLY_BYTES);
80
119
  const maxBytes = input.boundedOutput === false ? requested : Math.min(requested, CONTENT_REPLY_BYTES);
81
- const content = state.bytes.subarray(offset, Math.min(state.bytes.length, offset + maxBytes));
82
- const nextOffset = offset + content.length, nextHandle = nextOffset < state.bytes.length ? encode({ v: 1, kind: "file", path: state.path, hash: state.hash, offset: nextOffset }) : null;
83
- return { path: state.path, reference: `${state.path}:${lineAt(state.bytes, offset)}`, hash: state.hash, offset, content: Buffer.from(content), contentBytes: content.length, totalBytes: state.bytes.length, preview: utf8Preview(content, Math.min(input.previewChars ?? PREVIEW_CHARS, PREVIEW_CHARS)), onDiskHandle: encode({ v: 1, kind: "file", path: state.path, hash: state.hash, offset }), nextHandle, truncated: nextHandle !== null, untrusted: true, modelDelegated: false };
120
+ const content = readWindow(state.path, offset, Math.min(maxBytes, state.size - offset));
121
+ const nextOffset = offset + content.length, nextHandle = nextOffset < state.size ? encode({ v: 1, kind: "file", path: state.path, hash: state.hash, offset: nextOffset }) : null;
122
+ return { path: state.path, reference: `${state.path}:${lineAtFile(state.path, offset)}`, hash: state.hash, offset, content: Buffer.from(content), contentBytes: content.length, totalBytes: state.size, preview: utf8Preview(content, Math.min(input.previewChars ?? PREVIEW_CHARS, PREVIEW_CHARS)), onDiskHandle: encode({ v: 1, kind: "file", path: state.path, hash: state.hash, offset }), nextHandle, truncated: nextHandle !== null, untrusted: true, modelDelegated: false };
84
123
  }
85
124
 
86
125
  export function readback(input: { handle: string; expectedHash?: string; allowedRoot?: string; maxBytes?: number; boundedOutput?: boolean }) {
@@ -105,9 +144,9 @@ export function snapshotSource(input: { origin: "file"; path: string; allowedRoo
105
144
  if (existing.hash !== state.hash) throw new Error(`Snapshot collision or stale target: ${contentPath}`);
106
145
  }
107
146
  const metadataPath = `${contentPath}.json`;
108
- if (!existsSync(metadataPath)) writeFileSync(metadataPath, JSON.stringify({ source: { origin: "file", path: state.path, bytes: state.bytes.length }, sha256: state.hash, contentPath, untrusted: true, modelDelegated: false }, null, 2), { mode: 0o600 });
147
+ if (!existsSync(metadataPath)) writeFileSync(metadataPath, JSON.stringify({ source: { origin: "file", path: state.path, bytes: state.size }, sha256: state.hash, contentPath, untrusted: true, modelDelegated: false }, null, 2), { mode: 0o600 });
109
148
  else checkedExisting(metadataPath, root);
110
- return { source: { origin: "file" as const, path: state.path, bytes: state.bytes.length }, hash: state.hash, contentPath, metadataPath, handle: encode({ v: 1, kind: "file", path: contentPath, hash: state.hash, offset: 0 }), untrusted: true, modelDelegated: false };
149
+ return { source: { origin: "file" as const, path: state.path, bytes: state.size }, hash: state.hash, contentPath, metadataPath, handle: encode({ v: 1, kind: "file", path: contentPath, hash: state.hash, offset: 0 }), untrusted: true, modelDelegated: false };
111
150
  }
112
151
 
113
152
  function utf8Prefix(buffer: Buffer, maxBytes: number): Buffer {
@@ -1,4 +1,5 @@
1
1
  import type { NativeDispatchResult, NativeExecutionDiagnostics, NativeSpawnOutcome, PreparedNativeRun } from "./dispatch-native-types.ts";
2
+ import { explicitProcessLifecycle } from "./recovery-contract.ts";
2
3
  import { boundOutput } from "./deterministic-fs.ts";
3
4
  import { safePathWithin } from "./helpers.ts";
4
5
 
@@ -26,11 +27,14 @@ export async function completeNativeRun(run: PreparedNativeRun, outcome: NativeS
26
27
  termination: res.termination ?? null, modelFallback: res.modelFallback ?? null,
27
28
  };
28
29
  const diagnosticText = diagnostics.reason ? formatDiagnostics(diagnostics) : "";
30
+ const lifecycle = explicitProcessLifecycle(res.lifecycle);
29
31
  const finish = (result: NativeDispatchResult): NativeDispatchResult => {
30
32
  const combined = result.output + diagnosticText;
31
33
  const parent = res.boundedOutput ? boundOutput({ content: combined, retentionDir: safePathWithin(run.evidenceDir, "bounded-output", "parent"), label: "parent-summary" }) : null;
32
34
  return {
33
35
  ...result, runtimeTests: res.runtimeTests, toolEvents: res.toolEvents, writeIsolation: res.writeIsolation, dispatchId: run.dispatchId, transcriptPath: run.transcriptPath, diagnostics, sessionReset,
36
+ // T3: pass through explicit launch/close facts only. Missing lifecycle stays unknown.
37
+ ...(lifecycle ? { lifecycle } : {}),
34
38
  output: parent?.reply ?? combined,
35
39
  };
36
40
  };
@@ -16,6 +16,8 @@ import { extractAssertionIds } from "./return-contract.js";
16
16
  import type { NativeDispatchResult, NativeRunBase, PreparedNativeRun } from "./dispatch-native-types.ts";
17
17
  import { bindResume, type TaskResumeInput } from "./task-resume-contract.ts";
18
18
  import { confineNativeChild, type WriteIsolationRequest } from "./write-isolation.ts";
19
+ import { effectiveProcessStage } from "./process-obligations.ts";
20
+ import { stageProducerTools } from "./task-triage-stage-guard.ts";
19
21
 
20
22
  export function sessionObserverAssignment(config: ProactiveConfig | null | undefined, personaKey: string, assignment: Omit<ObserverAssignment, "config">): ObserverAssignment | undefined {
21
23
  return isProactiveSpecialist(personaKey) && config && isCaptureEnabled(config) ? { ...assignment, config } : undefined;
@@ -92,7 +94,9 @@ export async function prepareNativeRun(base: NativeRunBase, _resumeRequested: bo
92
94
  }))
93
95
  : null;
94
96
  const delegateExtPath = deps.getDelegateExtensionPath();
95
- const delegationActive = turnBudget.delegation && !!subagentRoles && !!delegateExtPath;
97
+ const stageConfirmation = !!deps.getProcessState && effectiveProcessStage(deps.getProcessState(), "confirmation");
98
+ if (stageConfirmation) resumeAllowed = false; // never resume a prior, unguarded tool catalog
99
+ const delegationActive = !stageConfirmation && turnBudget.delegation && !!subagentRoles && !!delegateExtPath;
96
100
  const projectPolicy = {
97
101
  rulesPaths: deps.specialistProjectPolicyPaths(ctx.cwd || process.cwd()),
98
102
  docsPaths: deps.getProjectDocsPaths(),
@@ -118,8 +122,14 @@ export async function prepareNativeRun(base: NativeRunBase, _resumeRequested: bo
118
122
  const deterministicTools = assist['deterministic-tools'] && (state.def.toolsExplicit !== true || declaredTools.includes("filesystem"));
119
123
  if (boundedOutput) extensions.push(fileURLToPath(new URL("./bounded-output.ts", import.meta.url)));
120
124
  if (deterministicTools) extensions.push(fileURLToPath(new URL("./filesystem-tool.ts", import.meta.url)));
121
- if (declaredTools.includes("bash")) extensions.push(fileURLToPath(new URL("./runtime-test-check.ts", import.meta.url)));
125
+ if (!stageConfirmation && declaredTools.includes("bash")) extensions.push(fileURLToPath(new URL("./runtime-test-check.ts", import.meta.url)));
122
126
  let effectiveTools = deterministicTools && !declaredTools.includes("filesystem") ? `${state.def.tools},filesystem` : state.def.tools;
127
+ if (stageConfirmation) {
128
+ // Stage children have no exact action binding. The Hub records their
129
+ // response as a run artifact; neither shell nor planner writes are exempt.
130
+ effectiveTools = stageProducerTools(state.def.tools);
131
+ extensions.push(fileURLToPath(new URL("./task-triage-stage-guard.ts", import.meta.url)));
132
+ }
123
133
  let delegateEnv: Record<string, string> | undefined;
124
134
  if (delegationActive) {
125
135
  const delegationDir = safePathWithin(base.evidenceDir, "delegations");
@@ -168,7 +178,8 @@ export async function prepareNativeRun(base: NativeRunBase, _resumeRequested: bo
168
178
  delegateRoles: delegationActive ? Object.keys(subagentRoles!) : [],
169
179
  });
170
180
  state.specialistManifest = manifest;
171
- const replacementSystemPrompt = nativeSpecialistSystemPrompt({ manifest, userLanguage: deps.getUserLanguage(), agentKey, runNumber, artifactRoot: safePathWithin(base.sessionDir, "artifacts"), dispatchId: base.dispatchId });
181
+ const replacementSystemPrompt = nativeSpecialistSystemPrompt({ manifest, userLanguage: deps.getUserLanguage(), agentKey, runNumber, artifactRoot: safePathWithin(base.sessionDir, "artifacts"), dispatchId: base.dispatchId })
182
+ + (stageConfirmation ? "\n\nActive exact-action confirmation: this stage run has inspection tools only. Return the full plan/review in your final response; the Hub saves that response as the stage artifact. Do not use bash, write, edit, delegate or remote execution. No stage result authorizes a later effect." : "");
172
183
  const thinkingLevel = deps.resolveThinkingLevel(deps.resolvedThinking(state.def));
173
184
  const wantThinking = thinkingLevel !== "off";
174
185
  const runPrompt = deps.appendDeclaredScope(deps.appendInputArtifacts(task, inputArtifacts), scopeGlobs);
@@ -94,6 +94,8 @@ export interface NativeDispatchResult {
94
94
  runtimeTests?: import("./runtime-test-check.ts").RuntimeTestRecord[];
95
95
  writeIsolation?: Pick<WriteIsolationResult, "applied" | "failClosed" | "mechanism" | "permissionExpansion" | "rollsBackUserEdits" | "protectsConcurrentUserWrites">;
96
96
  toolEvents?: import("./tool-protocol.ts").ToolExecutionEvent[];
97
+ /** T3 runtime lifecycle facts: launch/close/termination are separate from exit/acceptance. */
98
+ lifecycle?: { launched: boolean; closeSeen: boolean };
97
99
  evidencePath?: string;
98
100
  sessionPath?: string;
99
101
  dispatchId?: string;
@@ -126,6 +128,7 @@ export interface NativeProviderSemaphore {
126
128
 
127
129
  export interface NativeDispatchDeps {
128
130
  getAgentState(key: string): NativeDispatchState | undefined;
131
+ getProcessState?(): import("./process-obligations.ts").ProcessObligationState;
129
132
  listAgentStates(): NativeDispatchState[];
130
133
  getSessionDir(): string;
131
134
  getDispatchPolicy(): NativeDispatchPolicy;
@@ -8,6 +8,7 @@ import { comsRequiredRefusal, explicitComsRefusal, resolveDispatchBackend } from
8
8
  import { monitorKeyForAgent } from "./monitor-control.ts";
9
9
  import { normalizeAgentInput, safeAgentKey, safePathWithin } from "./helpers.ts";
10
10
  import { prepareNativeRun } from "./dispatch-native-prepare.ts";
11
+ import { effectiveProcessStage, processPreEffectGate } from "./process-obligations.ts";
11
12
  import { runPreparedNative } from "./dispatch-native-spawn.ts";
12
13
  import { completeNativeRun } from "./dispatch-native-complete.ts";
13
14
  import type { TaskResumeInput } from "./task-resume-contract.ts";
@@ -132,7 +133,14 @@ async function routeDispatch(run: NativeRunBase, requestedBackend: NativeBackend
132
133
  const { deps, state, task, ctx, inputArtifacts, scopeGlobs, personaKey, monitorKey, startTime, histEntry } = run;
133
134
  const livePeerNames = () => deps.isComsReady() && deps.getIdentity() ? deps.peersInScope().map(entry => entry.name) : [];
134
135
  const isolationRequired = run.assistSnapshot['write-isolation'];
135
- const forceNative = isolationRequired || (run.activeProfileSnapshot ? profileForcesNativePeers(run.activeProfileSnapshot) : false);
136
+ const processState = deps.getProcessState?.();
137
+ const confirmationRequired = !!processState && effectiveProcessStage(processState, "confirmation");
138
+ if (confirmationRequired) {
139
+ const gate = processPreEffectGate(processState!, "child", personaKey);
140
+ if (gate) return run.finishRun(gate.message, 1);
141
+ if (requestedBackend === "coms") return run.finishRun("Confirmation-required stage production needs a guarded native child; coms has no exact effect binding.", 1);
142
+ }
143
+ const forceNative = confirmationRequired || isolationRequired || (run.activeProfileSnapshot ? profileForcesNativePeers(run.activeProfileSnapshot) : false);
136
144
  if (isolationRequired && requestedBackend === "coms") return run.finishRun("Write isolation is native-only; coms dispatch refused because remote isolation cannot be claimed.", 1);
137
145
  if (forceNative && requestedBackend === 'coms') return run.finishRun('Active model profile requires native execution; coms dispatch refused.', 1);
138
146
  const dispatchPolicy = forceNative ? { default: 'native', grace_s: 0, substitutions: {} } : deps.getDispatchPolicy();
@@ -4,6 +4,7 @@ import { resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import type { System1Result, System1Service } from "../lib/system1/contracts.ts";
6
6
  import { createSystem1Runtime } from "../lib/system1/service.ts";
7
+ import { system1SelectedByDesired } from "../lib/system1/selection.js";
7
8
  import { parseTriageConfig, triageQuestions, TRIAGE_VERSION, type TriageInput, type TriageConfig } from "./dispatch-triage-contract.ts";
8
9
  import { buildTriageState } from "./dispatch-triage-state.ts";
9
10
  import { triageAdvice } from "./dispatch-triage-policy.ts";
@@ -67,7 +68,7 @@ export async function runTriageEvaluator(argv=process.argv.slice(2)) {
67
68
  // Consent and budget validation happens before constructing the provider or reading its key.
68
69
  if (!config.remoteContextApproved || corpus.some(e=>!e.remoteApproved) || !Number.isSafeInteger(Number(value("--max-calls"))) || Number(value("--max-calls"))<=0 || !Number.isSafeInteger(Number(value("--max-ms"))) || Number(value("--max-ms"))<=0) throw new Error("Live consent or budgets missing");
69
70
  const desired=JSON.parse(readFileSync(resolve(workspace,".ai/agent-fleet.json"),"utf8"));
70
- const runtime=createSystem1Runtime({selected:desired?.features?.system1===true,config:JSON.parse(readFileSync(resolve(workspace,".ai/system1.json"),"utf8")),env:process.env});
71
+ const runtime=createSystem1Runtime({selected:system1SelectedByDesired(desired),config:JSON.parse(readFileSync(resolve(workspace,".ai/system1.json"),"utf8")),env:process.env});
71
72
  if (runtime.readiness.status!=="ready") throw new Error("System 1 unavailable"); service=runtime.service;
72
73
  }
73
74
  console.log(JSON.stringify(await evaluateCorpus(corpus,config,{service,maxCalls:Number(value("--max-calls")),maxMs:Number(value("--max-ms"))}),null,2));
@@ -11,6 +11,8 @@ export function createTriageRuntime(deps: { config: TriageConfig | null; service
11
11
  return {
12
12
  get calls() { return calls; },
13
13
  get orchestratorBeforeDispatch() { return !disposed && deps.config?.mode === "advisory" && deps.config.remoteContextApproved && deps.config.orchestratorBeforeDispatch === true && !!deps.service && calls < deps.config.maxCalls; },
14
+ /** Model-visible only when a call can do more than return consumer_off. */
15
+ get available() { return !disposed && !!deps.config && deps.config.mode !== "off" && deps.config.remoteContextApproved && !!deps.service; },
14
16
  dispose() { disposed = true; abort.abort(); evaluations.clear(); },
15
17
  disposition(id: string, persona: string, reason: string) {
16
18
  const e = evaluations.get(id);