@chankov/agent-fleet 2.0.12 → 2.0.13

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 (616) hide show
  1. package/.pi/agent-fleet/scripts/flow.ts +5 -3
  2. package/.pi/agent-fleet/scripts/lib/flow-command.ts +9 -4
  3. package/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +3 -1
  4. package/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +34 -0
  5. package/.pi/agents/model-profiles.yaml +80 -29
  6. package/.pi/agents/peers.yaml +18 -18
  7. package/.pi/agents/voices.yaml +2 -2
  8. package/.pi/harnesses/agent-hub/README.md +55 -4
  9. package/.pi/harnesses/agent-hub/commands/audit.ts +1 -1
  10. package/.pi/harnesses/agent-hub/commands/context.ts +1 -1
  11. package/.pi/harnesses/agent-hub/config/model-profiles.ts +1 -0
  12. package/.pi/harnesses/agent-hub/delegate.ts +5 -3
  13. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +27 -2
  14. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +29 -0
  15. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +6 -0
  16. package/.pi/harnesses/agent-hub/index.ts +75 -40
  17. package/.pi/harnesses/agent-hub/package.json +1 -1
  18. package/.pi/harnesses/agent-hub/policy/profile-activation.ts +2 -2
  19. package/.pi/harnesses/agent-hub/proactive-config.ts +40 -0
  20. package/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  21. package/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  22. package/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  23. package/.pi/harnesses/agent-hub/proactive-local.ts +88 -0
  24. package/.pi/harnesses/agent-hub/proactive-observer.ts +105 -0
  25. package/.pi/harnesses/agent-hub/proactive-rules.ts +143 -0
  26. package/.pi/harnesses/agent-hub/proactive-runtime.ts +316 -0
  27. package/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  28. package/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  29. package/.pi/harnesses/agent-hub/proactive-snapshot.ts +243 -0
  30. package/.pi/harnesses/agent-hub/proactive-types.ts +63 -0
  31. package/.pi/harnesses/agent-hub/prompts/context.ts +2 -0
  32. package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +3 -0
  33. package/.pi/harnesses/agent-hub/research/runtime.ts +3 -1
  34. package/.pi/harnesses/agent-hub/research/spawn-run.ts +4 -1
  35. package/.pi/harnesses/agent-hub/return-extract.js +1 -1
  36. package/.pi/harnesses/agent-hub/session-audit.ts +6 -5
  37. package/.pi/harnesses/agent-hub/system1-activity.ts +67 -0
  38. package/.pi/harnesses/agent-hub/system1-report.ts +142 -1
  39. package/.pi/harnesses/agent-hub/system1-runtime.ts +3 -0
  40. package/.pi/harnesses/agent-hub/tools/run-flow.ts +16 -2
  41. package/.pi/harnesses/agent-hub/ui/detail-panel.ts +26 -5
  42. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +30 -5
  43. package/.pi/harnesses/agent-hub/ui/fleet-source.ts +7 -2
  44. package/.pi/harnesses/agent-hub/ui/grid.ts +12 -7
  45. package/.pi/harnesses/coms/package.json +1 -1
  46. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  47. package/.pi/harnesses/lib/context-budget-child-prompt.ts +41 -2
  48. package/.pi/harnesses/lib/context-budget-hub-prompt.ts +4 -2
  49. package/.pi/harnesses/lib/fleet-dashboard-view.ts +14 -3
  50. package/.pi/harnesses/lib/fleet-detail-view.ts +68 -7
  51. package/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  52. package/.pi/harnesses/lib/fleet-strip-view.ts +44 -9
  53. package/.pi/prompts/af-setup-rules.md +20 -0
  54. package/.versions/2.0.13/.pi/agent-fleet/hermes/README.md +347 -0
  55. package/.versions/2.0.13/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  56. package/.versions/2.0.13/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  57. package/.versions/2.0.13/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  58. package/.versions/2.0.13/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  59. package/.versions/2.0.13/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  60. package/.versions/2.0.13/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  61. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  62. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  63. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  64. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  65. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  66. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  67. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  68. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  69. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  70. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  71. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  72. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  73. package/.versions/2.0.13/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  74. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  75. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  76. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  77. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  78. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  79. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  80. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  81. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  82. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  83. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  84. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  85. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  86. package/.versions/2.0.13/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  87. package/.versions/2.0.13/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  88. package/.versions/2.0.13/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  89. package/.versions/2.0.13/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  90. package/.versions/2.0.13/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  91. package/.versions/2.0.13/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  92. package/.versions/2.0.13/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  93. package/.versions/2.0.13/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  94. package/.versions/2.0.13/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  95. package/.versions/2.0.13/.pi/agent-fleet/scripts/fleet.ts +216 -0
  96. package/.versions/2.0.13/.pi/agent-fleet/scripts/flow.ts +157 -0
  97. package/.versions/2.0.13/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  98. package/.versions/2.0.13/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  99. package/.versions/2.0.13/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  100. package/.versions/2.0.13/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  101. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  102. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  103. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  104. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  105. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  106. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  107. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  108. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  109. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
  110. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  111. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  112. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  113. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  114. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  115. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  116. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  117. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  118. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  119. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  120. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  121. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  122. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  123. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  124. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  125. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  126. package/.versions/2.0.13/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  127. package/.versions/2.0.13/.pi/agent-fleet/scripts/package-lock.json +35 -0
  128. package/.versions/2.0.13/.pi/agent-fleet/scripts/package.json +9 -0
  129. package/.versions/2.0.13/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  130. package/.versions/2.0.13/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  131. package/.versions/2.0.13/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  132. package/.versions/2.0.13/.pi/agent-fleet/scripts/team-up.ts +378 -0
  133. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
  134. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  135. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  136. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  137. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  138. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  139. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  140. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
  141. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  142. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  143. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  144. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  145. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  146. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  147. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +34 -0
  148. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  149. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  150. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  151. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  152. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  153. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  154. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  155. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  156. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  157. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  158. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  159. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  160. package/.versions/2.0.13/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  161. package/.versions/2.0.13/.pi/agents/dispatch-policy.yaml +32 -0
  162. package/.versions/2.0.13/.pi/agents/model-profiles.yaml +134 -0
  163. package/.versions/2.0.13/.pi/agents/peers.yaml +147 -0
  164. package/.versions/2.0.13/.pi/agents/teams.yaml +41 -0
  165. package/.versions/2.0.13/.pi/agents/voices.yaml +13 -0
  166. package/.versions/2.0.13/.pi/damage-control-rules.yaml +297 -0
  167. package/.versions/2.0.13/.pi/extensions/btw/README.md +120 -0
  168. package/.versions/2.0.13/.pi/extensions/btw/index.ts +914 -0
  169. package/.versions/2.0.13/.pi/extensions/btw/package.json +6 -0
  170. package/.versions/2.0.13/.pi/extensions/btw/state.js +179 -0
  171. package/.versions/2.0.13/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  172. package/.versions/2.0.13/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  173. package/.versions/2.0.13/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  174. package/.versions/2.0.13/.pi/extensions/compact-and-continue/README.md +42 -0
  175. package/.versions/2.0.13/.pi/extensions/compact-and-continue/index.ts +120 -0
  176. package/.versions/2.0.13/.pi/extensions/compact-and-continue/package.json +6 -0
  177. package/.versions/2.0.13/.pi/extensions/mcp-bridge/README.md +46 -0
  178. package/.versions/2.0.13/.pi/extensions/mcp-bridge/index.ts +206 -0
  179. package/.versions/2.0.13/.pi/extensions/mcp-bridge/package.json +6 -0
  180. package/.versions/2.0.13/.pi/extensions/package-lock.json +1175 -0
  181. package/.versions/2.0.13/.pi/extensions/package.json +9 -0
  182. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/README.md +224 -0
  183. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/config.ts +198 -0
  184. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  185. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/index.ts +248 -0
  186. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/package.json +6 -0
  187. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  188. package/.versions/2.0.13/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  189. package/.versions/2.0.13/.pi/harnesses/agent-hub/README.md +1360 -0
  190. package/.versions/2.0.13/.pi/harnesses/agent-hub/acceptance.ts +199 -0
  191. package/.versions/2.0.13/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  192. package/.versions/2.0.13/.pi/harnesses/agent-hub/artifacts.js +146 -0
  193. package/.versions/2.0.13/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
  194. package/.versions/2.0.13/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
  195. package/.versions/2.0.13/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  196. package/.versions/2.0.13/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  197. package/.versions/2.0.13/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  198. package/.versions/2.0.13/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
  199. package/.versions/2.0.13/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  200. package/.versions/2.0.13/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
  201. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  202. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  203. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  204. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  205. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  206. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  207. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  208. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  209. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  210. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  211. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  212. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  213. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  214. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  215. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  216. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  217. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/context.ts +45 -0
  218. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  219. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  220. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  221. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  222. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  223. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  224. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/recover.ts +52 -0
  225. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  226. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  227. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  228. package/.versions/2.0.13/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  229. package/.versions/2.0.13/.pi/harnesses/agent-hub/config/agents.ts +178 -0
  230. package/.versions/2.0.13/.pi/harnesses/agent-hub/config/model-profiles.ts +236 -0
  231. package/.versions/2.0.13/.pi/harnesses/agent-hub/config/overrides.ts +160 -0
  232. package/.versions/2.0.13/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  233. package/.versions/2.0.13/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  234. package/.versions/2.0.13/.pi/harnesses/agent-hub/context/budgets.ts +204 -0
  235. package/.versions/2.0.13/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  236. package/.versions/2.0.13/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  237. package/.versions/2.0.13/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  238. package/.versions/2.0.13/.pi/harnesses/agent-hub/context-window.js +108 -0
  239. package/.versions/2.0.13/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  240. package/.versions/2.0.13/.pi/harnesses/agent-hub/delegate.ts +467 -0
  241. package/.versions/2.0.13/.pi/harnesses/agent-hub/deterministic-fs.ts +127 -0
  242. package/.versions/2.0.13/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  243. package/.versions/2.0.13/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  244. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
  245. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  246. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-native-complete.ts +169 -0
  247. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +248 -0
  248. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +231 -0
  249. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-native-types.ts +257 -0
  250. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-native.ts +226 -0
  251. package/.versions/2.0.13/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  252. package/.versions/2.0.13/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  253. package/.versions/2.0.13/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  254. package/.versions/2.0.13/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  255. package/.versions/2.0.13/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  256. package/.versions/2.0.13/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  257. package/.versions/2.0.13/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
  258. package/.versions/2.0.13/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  259. package/.versions/2.0.13/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  260. package/.versions/2.0.13/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  261. package/.versions/2.0.13/.pi/harnesses/agent-hub/filesystem-tool.ts +73 -0
  262. package/.versions/2.0.13/.pi/harnesses/agent-hub/fixtures/registration-surface.json +61 -0
  263. package/.versions/2.0.13/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  264. package/.versions/2.0.13/.pi/harnesses/agent-hub/footer.ts +30 -0
  265. package/.versions/2.0.13/.pi/harnesses/agent-hub/helpers.ts +270 -0
  266. package/.versions/2.0.13/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
  267. package/.versions/2.0.13/.pi/harnesses/agent-hub/index.ts +2336 -0
  268. package/.versions/2.0.13/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  269. package/.versions/2.0.13/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  270. package/.versions/2.0.13/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +125 -0
  271. package/.versions/2.0.13/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  272. package/.versions/2.0.13/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  273. package/.versions/2.0.13/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  274. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  275. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  276. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  277. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  278. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  279. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  280. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  281. package/.versions/2.0.13/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  282. package/.versions/2.0.13/.pi/harnesses/agent-hub/no-progress.ts +359 -0
  283. package/.versions/2.0.13/.pi/harnesses/agent-hub/package.json +7 -0
  284. package/.versions/2.0.13/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  285. package/.versions/2.0.13/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  286. package/.versions/2.0.13/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  287. package/.versions/2.0.13/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  288. package/.versions/2.0.13/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  289. package/.versions/2.0.13/.pi/harnesses/agent-hub/policy/work-mode.ts +126 -0
  290. package/.versions/2.0.13/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  291. package/.versions/2.0.13/.pi/harnesses/agent-hub/presentation.ts +48 -0
  292. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-config.ts +40 -0
  293. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  294. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  295. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  296. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-local.ts +88 -0
  297. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-observer.ts +105 -0
  298. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-rules.ts +143 -0
  299. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-runtime.ts +316 -0
  300. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  301. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  302. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-snapshot.ts +243 -0
  303. package/.versions/2.0.13/.pi/harnesses/agent-hub/proactive-types.ts +63 -0
  304. package/.versions/2.0.13/.pi/harnesses/agent-hub/process-obligations.ts +57 -0
  305. package/.versions/2.0.13/.pi/harnesses/agent-hub/prompts/context.ts +53 -0
  306. package/.versions/2.0.13/.pi/harnesses/agent-hub/prompts/fragments.ts +118 -0
  307. package/.versions/2.0.13/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  308. package/.versions/2.0.13/.pi/harnesses/agent-hub/prompts/system-prompt.ts +115 -0
  309. package/.versions/2.0.13/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  310. package/.versions/2.0.13/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  311. package/.versions/2.0.13/.pi/harnesses/agent-hub/recover-policy.ts +27 -0
  312. package/.versions/2.0.13/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  313. package/.versions/2.0.13/.pi/harnesses/agent-hub/recovery-contract.ts +80 -0
  314. package/.versions/2.0.13/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  315. package/.versions/2.0.13/.pi/harnesses/agent-hub/research/runtime.ts +195 -0
  316. package/.versions/2.0.13/.pi/harnesses/agent-hub/research/spawn-run.ts +174 -0
  317. package/.versions/2.0.13/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  318. package/.versions/2.0.13/.pi/harnesses/agent-hub/return-contract.js +327 -0
  319. package/.versions/2.0.13/.pi/harnesses/agent-hub/return-extract.js +77 -0
  320. package/.versions/2.0.13/.pi/harnesses/agent-hub/review-findings.js +104 -0
  321. package/.versions/2.0.13/.pi/harnesses/agent-hub/run-budget.js +542 -0
  322. package/.versions/2.0.13/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  323. package/.versions/2.0.13/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
  324. package/.versions/2.0.13/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  325. package/.versions/2.0.13/.pi/harnesses/agent-hub/scope-gate.js +123 -0
  326. package/.versions/2.0.13/.pi/harnesses/agent-hub/session-audit.ts +227 -0
  327. package/.versions/2.0.13/.pi/harnesses/agent-hub/session-health.js +110 -0
  328. package/.versions/2.0.13/.pi/harnesses/agent-hub/session-start.ts +42 -0
  329. package/.versions/2.0.13/.pi/harnesses/agent-hub/spawn.ts +526 -0
  330. package/.versions/2.0.13/.pi/harnesses/agent-hub/system1-activity.ts +510 -0
  331. package/.versions/2.0.13/.pi/harnesses/agent-hub/system1-report.ts +225 -0
  332. package/.versions/2.0.13/.pi/harnesses/agent-hub/system1-runtime.ts +276 -0
  333. package/.versions/2.0.13/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  334. package/.versions/2.0.13/.pi/harnesses/agent-hub/timeline.ts +72 -0
  335. package/.versions/2.0.13/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
  336. package/.versions/2.0.13/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  337. package/.versions/2.0.13/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  338. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/action-executors.ts +185 -0
  339. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  340. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/context.ts +142 -0
  341. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
  342. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +498 -0
  343. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  344. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  345. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  346. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
  347. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  348. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
  349. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  350. package/.versions/2.0.13/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
  351. package/.versions/2.0.13/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  352. package/.versions/2.0.13/.pi/harnesses/agent-hub/types.ts +66 -0
  353. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  354. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
  355. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  356. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  357. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +124 -0
  358. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  359. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/fleet-source.ts +175 -0
  360. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  361. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  362. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  363. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  364. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  365. package/.versions/2.0.13/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  366. package/.versions/2.0.13/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  367. package/.versions/2.0.13/.pi/harnesses/agent-hub/version.ts +42 -0
  368. package/.versions/2.0.13/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  369. package/.versions/2.0.13/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  370. package/.versions/2.0.13/.pi/harnesses/agent-hub/work-mode.ts +173 -0
  371. package/.versions/2.0.13/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  372. package/.versions/2.0.13/.pi/harnesses/ask-user-remote/README.md +59 -0
  373. package/.versions/2.0.13/.pi/harnesses/ask-user-remote/index.ts +558 -0
  374. package/.versions/2.0.13/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  375. package/.versions/2.0.13/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  376. package/.versions/2.0.13/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
  377. package/.versions/2.0.13/.pi/harnesses/coms/README.md +100 -0
  378. package/.versions/2.0.13/.pi/harnesses/coms/index.ts +282 -0
  379. package/.versions/2.0.13/.pi/harnesses/coms/package.json +7 -0
  380. package/.versions/2.0.13/.pi/harnesses/coms/version.ts +42 -0
  381. package/.versions/2.0.13/.pi/harnesses/damage-control-continue/README.md +135 -0
  382. package/.versions/2.0.13/.pi/harnesses/damage-control-continue/index.ts +550 -0
  383. package/.versions/2.0.13/.pi/harnesses/damage-control-continue/package.json +7 -0
  384. package/.versions/2.0.13/.pi/harnesses/damage-control-continue/version.ts +42 -0
  385. package/.versions/2.0.13/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  386. package/.versions/2.0.13/.pi/harnesses/lib/coms-core-io.ts +385 -0
  387. package/.versions/2.0.13/.pi/harnesses/lib/coms-core.ts +577 -0
  388. package/.versions/2.0.13/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  389. package/.versions/2.0.13/.pi/harnesses/lib/context-budget-child-prompt.ts +219 -0
  390. package/.versions/2.0.13/.pi/harnesses/lib/context-budget-hub-prompt.ts +116 -0
  391. package/.versions/2.0.13/.pi/harnesses/lib/context-budget-view.ts +107 -0
  392. package/.versions/2.0.13/.pi/harnesses/lib/context-budget.ts +114 -0
  393. package/.versions/2.0.13/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  394. package/.versions/2.0.13/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
  395. package/.versions/2.0.13/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  396. package/.versions/2.0.13/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  397. package/.versions/2.0.13/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  398. package/.versions/2.0.13/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  399. package/.versions/2.0.13/.pi/harnesses/lib/fleet-dashboard-view.ts +147 -0
  400. package/.versions/2.0.13/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  401. package/.versions/2.0.13/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  402. package/.versions/2.0.13/.pi/harnesses/lib/fleet-panel.ts +34 -0
  403. package/.versions/2.0.13/.pi/harnesses/lib/fleet-read-model.ts +536 -0
  404. package/.versions/2.0.13/.pi/harnesses/lib/fleet-selection.ts +24 -0
  405. package/.versions/2.0.13/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  406. package/.versions/2.0.13/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  407. package/.versions/2.0.13/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  408. package/.versions/2.0.13/.pi/harnesses/lib/herdr-client.ts +472 -0
  409. package/.versions/2.0.13/.pi/harnesses/lib/herdr-presence.ts +399 -0
  410. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  411. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  412. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  413. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  414. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  415. package/.versions/2.0.13/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  416. package/.versions/2.0.13/.pi/harnesses/lib/spawned-peers.js +191 -0
  417. package/.versions/2.0.13/.pi/harnesses/lib/system1/config.js +61 -0
  418. package/.versions/2.0.13/.pi/harnesses/lib/system1/contracts.ts +152 -0
  419. package/.versions/2.0.13/.pi/harnesses/lib/system1/demo.ts +106 -0
  420. package/.versions/2.0.13/.pi/harnesses/lib/system1/jev.ts +503 -0
  421. package/.versions/2.0.13/.pi/harnesses/lib/system1/service.ts +245 -0
  422. package/.versions/2.0.13/.pi/harnesses/lib/update-check.ts +222 -0
  423. package/.versions/2.0.13/.pi/harnesses/package-lock.json +2039 -0
  424. package/.versions/2.0.13/.pi/harnesses/package.json +10 -0
  425. package/.versions/2.0.13/.pi/prompts/af-build.md +24 -0
  426. package/.versions/2.0.13/.pi/prompts/af-code-simplify.md +22 -0
  427. package/.versions/2.0.13/.pi/prompts/af-constraints.md +31 -0
  428. package/.versions/2.0.13/.pi/prompts/af-plan.md +17 -0
  429. package/.versions/2.0.13/.pi/prompts/af-review.md +16 -0
  430. package/.versions/2.0.13/.pi/prompts/af-set-hermes-telegram.md +15 -0
  431. package/.versions/2.0.13/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  432. package/.versions/2.0.13/.pi/prompts/af-setup-rules.md +20 -0
  433. package/.versions/2.0.13/.pi/prompts/af-ship.md +17 -0
  434. package/.versions/2.0.13/.pi/prompts/af-spec.md +15 -0
  435. package/.versions/2.0.13/.pi/prompts/af-test.md +19 -0
  436. package/.versions/2.0.13/.pi/skills/bowser/SKILL.md +145 -0
  437. package/.versions/2.0.13/.version +1 -0
  438. package/.versions/2.0.13/agents/architect.md +24 -0
  439. package/.versions/2.0.13/agents/bowser.md +28 -0
  440. package/.versions/2.0.13/agents/builder.md +55 -0
  441. package/.versions/2.0.13/agents/code-reviewer.md +209 -0
  442. package/.versions/2.0.13/agents/deep-researcher.md +32 -0
  443. package/.versions/2.0.13/agents/documenter.md +22 -0
  444. package/.versions/2.0.13/agents/orchestrator.md +22 -0
  445. package/.versions/2.0.13/agents/plan-reviewer.md +83 -0
  446. package/.versions/2.0.13/agents/planner.md +105 -0
  447. package/.versions/2.0.13/agents/releaser.md +24 -0
  448. package/.versions/2.0.13/agents/researcher.md +30 -0
  449. package/.versions/2.0.13/agents/security-auditor.md +167 -0
  450. package/.versions/2.0.13/agents/test-engineer.md +153 -0
  451. package/.versions/2.0.13/agents/web-debugger.md +44 -0
  452. package/.versions/2.0.13/agents/web-performance-auditor.md +194 -0
  453. package/.versions/2.0.13/bin/catalog/harness-runtime-closure.json +73 -0
  454. package/.versions/2.0.13/codex/fleet-session-client/SKILL.md +34 -0
  455. package/.versions/2.0.13/codex/fleet-session-client.zip +0 -0
  456. package/.versions/2.0.13/docs/ARCHITECTURE.md +753 -0
  457. package/.versions/2.0.13/docs/agent-fleet-setup.md +900 -0
  458. package/.versions/2.0.13/docs/claude-code-coms-bridge.md +134 -0
  459. package/.versions/2.0.13/docs/codex-session-bridge.md +219 -0
  460. package/.versions/2.0.13/docs/coms-hermes-bridge.md +188 -0
  461. package/.versions/2.0.13/docs/getting-started.md +126 -0
  462. package/.versions/2.0.13/docs/npm-install.md +468 -0
  463. package/.versions/2.0.13/docs/pi-extensions.md +454 -0
  464. package/.versions/2.0.13/docs/pi-setup.md +92 -0
  465. package/.versions/2.0.13/docs/skill-anatomy.md +150 -0
  466. package/.versions/2.0.13/install-manifest.json +3175 -0
  467. package/.versions/2.0.13/justfile +247 -0
  468. package/.versions/2.0.13/manifest-meta.json +1057 -0
  469. package/.versions/2.0.13/references/accessibility-checklist.md +160 -0
  470. package/.versions/2.0.13/references/communication-contract.md +26 -0
  471. package/.versions/2.0.13/references/definition-of-done.md +67 -0
  472. package/.versions/2.0.13/references/fleet-coordination-patterns.md +171 -0
  473. package/.versions/2.0.13/references/observability-checklist.md +92 -0
  474. package/.versions/2.0.13/references/orchestration-patterns.md +370 -0
  475. package/.versions/2.0.13/references/performance-checklist.md +236 -0
  476. package/.versions/2.0.13/references/prompting-patterns.md +380 -0
  477. package/.versions/2.0.13/references/security-checklist.md +245 -0
  478. package/.versions/2.0.13/references/testing-patterns.md +235 -0
  479. package/.versions/2.0.13/references/workflow-authoring.md +304 -0
  480. package/.versions/2.0.13/skills/_internal/grilling.md +59 -0
  481. package/.versions/2.0.13/skills/browser-testing-with-devtools/SKILL.md +351 -0
  482. package/.versions/2.0.13/skills/code-review-and-quality/SKILL.md +396 -0
  483. package/.versions/2.0.13/skills/compound-learning/SKILL.md +137 -0
  484. package/.versions/2.0.13/skills/constraint-driven-development/SKILL.md +338 -0
  485. package/.versions/2.0.13/skills/constraint-driven-development/references/floor-guard.md +99 -0
  486. package/.versions/2.0.13/skills/context-engineering/SKILL.md +341 -0
  487. package/.versions/2.0.13/skills/deprecation-and-migration/SKILL.md +247 -0
  488. package/.versions/2.0.13/skills/designing-agents/SKILL.md +394 -0
  489. package/.versions/2.0.13/skills/designing-agents/pi-harness-authoring.md +222 -0
  490. package/.versions/2.0.13/skills/drafting-workflows/SKILL.md +143 -0
  491. package/.versions/2.0.13/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  492. package/.versions/2.0.13/skills/frontend-ui-engineering/SKILL.md +328 -0
  493. package/.versions/2.0.13/skills/git-workflow-and-versioning/SKILL.md +316 -0
  494. package/.versions/2.0.13/skills/idea-refine/SKILL.md +182 -0
  495. package/.versions/2.0.13/skills/idea-refine/examples.md +238 -0
  496. package/.versions/2.0.13/skills/idea-refine/frameworks.md +99 -0
  497. package/.versions/2.0.13/skills/idea-refine/refinement-criteria.md +113 -0
  498. package/.versions/2.0.13/skills/idea-refine/scripts/idea-refine.sh +15 -0
  499. package/.versions/2.0.13/skills/incremental-implementation/SKILL.md +302 -0
  500. package/.versions/2.0.13/skills/interview-me/SKILL.md +226 -0
  501. package/.versions/2.0.13/skills/orchestration-verification/SKILL.md +182 -0
  502. package/.versions/2.0.13/skills/peer-coms/SKILL.md +90 -0
  503. package/.versions/2.0.13/skills/performance-optimization/SKILL.md +496 -0
  504. package/.versions/2.0.13/skills/planning-and-task-breakdown/SKILL.md +289 -0
  505. package/.versions/2.0.13/skills/repository-ai-setup/SKILL.md +117 -0
  506. package/.versions/2.0.13/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  507. package/.versions/2.0.13/skills/repository-ai-setup/references/apply-contract.md +74 -0
  508. package/.versions/2.0.13/skills/repository-ai-setup/references/provenance-template.md +16 -0
  509. package/.versions/2.0.13/skills/repository-ai-setup/references/setup-flow.md +108 -0
  510. package/.versions/2.0.13/skills/repository-ai-setup/references/verify-setup.md +20 -0
  511. package/.versions/2.0.13/skills/security-and-hardening/SKILL.md +524 -0
  512. package/.versions/2.0.13/skills/spec-driven-development/SKILL.md +295 -0
  513. package/.versions/2.0.13/skills/using-agent-skills/SKILL.md +198 -0
  514. package/.versions/2.0.13/vendor/agent-skills-upstream/LICENSE +21 -0
  515. package/.versions/2.0.13/vendor/agent-skills-upstream/README.md +430 -0
  516. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  517. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  518. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  519. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  520. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  521. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  522. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  523. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  524. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  525. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  526. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  527. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  528. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  529. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  530. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  531. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  532. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  533. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  534. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  535. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  536. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  537. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  538. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  539. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  540. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  541. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  542. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  543. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  544. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  545. package/.versions/2.0.13/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  546. package/CHANGELOG.md +10 -0
  547. package/README.md +3 -3
  548. package/agents/architect.md +2 -3
  549. package/agents/bowser.md +2 -2
  550. package/agents/builder.md +2 -3
  551. package/agents/code-reviewer.md +7 -8
  552. package/agents/deep-researcher.md +3 -4
  553. package/agents/documenter.md +2 -3
  554. package/agents/orchestrator.md +2 -3
  555. package/agents/plan-reviewer.md +5 -6
  556. package/agents/planner.md +5 -6
  557. package/agents/releaser.md +2 -3
  558. package/agents/researcher.md +4 -5
  559. package/agents/security-auditor.md +6 -7
  560. package/agents/test-engineer.md +3 -4
  561. package/agents/web-debugger.md +3 -3
  562. package/agents/web-performance-auditor.md +3 -3
  563. package/bin/catalog/harness-runtime-closure.json +30 -18
  564. package/bin/cli.js +47 -1
  565. package/bin/lib/apply.js +16 -0
  566. package/bin/lib/overrides.js +37 -1
  567. package/bin/lib/project-provenance.js +119 -0
  568. package/bin/lib/scan.js +1 -1
  569. package/bin/lib/transaction.js +1 -1
  570. package/bin/lib/validate-overrides.js +37 -3
  571. package/catalog/agent-prompts/README.md +12 -0
  572. package/catalog/agent-prompts/architecture-decision-author.md +24 -0
  573. package/catalog/agent-prompts/requirements-author.md +21 -0
  574. package/catalog/commands/README.md +13 -0
  575. package/catalog/commands/assess-change-impact.md +19 -0
  576. package/catalog/commands/audit-documentation.md +19 -0
  577. package/catalog/rules/README.md +33 -0
  578. package/catalog/rules/ai/policy-authoring.md +22 -0
  579. package/catalog/rules/architecture/behavior-preserving-refactoring.md +25 -0
  580. package/catalog/rules/architecture/public-contracts.md +22 -0
  581. package/catalog/rules/architecture/repository-boundaries.md +21 -0
  582. package/catalog/rules/architecture/structural-change-registration.md +25 -0
  583. package/catalog/rules/backend/notification-date-time.md +25 -0
  584. package/catalog/rules/bundles/README.md +16 -0
  585. package/catalog/rules/data/enum-semantics.md +25 -0
  586. package/catalog/rules/data/mixed-ownership-data.md +22 -0
  587. package/catalog/rules/data/reporting-queries.md +34 -0
  588. package/catalog/rules/docs/docs-maintenance.md +25 -0
  589. package/catalog/rules/frameworks/vue.md +25 -0
  590. package/catalog/rules/frontend/async-ui-states.md +26 -0
  591. package/catalog/rules/frontend/established-ui-primitives.md +25 -0
  592. package/catalog/rules/frontend/form-validation.md +26 -0
  593. package/catalog/rules/frontend/navigation-contracts.md +25 -0
  594. package/catalog/rules/languages/csharp.md +25 -0
  595. package/catalog/rules/languages/javascript.md +25 -0
  596. package/catalog/rules/languages/sql.md +24 -0
  597. package/catalog/rules/security/authorization-before-effects.md +26 -0
  598. package/catalog/rules/security/diagnostic-data-safety.md +22 -0
  599. package/catalog/rules/security/response-data-minimization.md +25 -0
  600. package/catalog/rules/security/trusted-tenant-scope.md +26 -0
  601. package/catalog/rules/testing/shared-package-consumers.md +25 -0
  602. package/catalog/rules/testing/verification-conventions.md +24 -0
  603. package/docs/ARCHITECTURE.md +50 -2
  604. package/docs/agent-fleet-setup.md +246 -28
  605. package/docs/codex-session-bridge.md +1 -1
  606. package/docs/pi-extensions.md +10 -5
  607. package/docs/workflows.md +4 -3
  608. package/install-manifest.json +125 -3
  609. package/manifest-meta.json +77 -15
  610. package/package.json +5 -3
  611. package/skills/repository-ai-setup/SKILL.md +117 -0
  612. package/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  613. package/skills/repository-ai-setup/references/apply-contract.md +74 -0
  614. package/skills/repository-ai-setup/references/provenance-template.md +16 -0
  615. package/skills/repository-ai-setup/references/setup-flow.md +108 -0
  616. package/skills/repository-ai-setup/references/verify-setup.md +20 -0
@@ -0,0 +1,753 @@
1
+ # Agent Fleet Architecture
2
+
3
+ Agent Fleet is a Pi-centered multi-agent orchestration system. This page maps
4
+ the runtime responsibilities and where each module lives in the repository.
5
+
6
+ For the principles governing future plans and design decisions, read the
7
+ [project philosophy](PHILOSOPHY.md). That document states the intended direction;
8
+ this page describes the current architecture.
9
+
10
+ ## Runtime layers
11
+
12
+ | Layer | Role | Implementation |
13
+ | --- | --- | --- |
14
+ | **Pi Coding Agent** | Primary local runtime — runs the dispatcher and specialist subagents | `.pi/harnesses/`, `.pi/extensions/`, `.pi/agents/`, `.pi/prompts/` |
15
+ | **agent-hub** | Thin-context multi-agent harness: dispatcher + specialists + research helpers + Verification Contract | `.pi/harnesses/agent-hub/` |
16
+ | **Workflows** | Headless, code-owned phase order, retries, gates, writes enforcement, and acceptance through `just flow` | `.pi/agent-fleet/scripts/flow.ts`, `.pi/agent-fleet/scripts/workflows/` — see [workflows.md](workflows.md) |
17
+ | **Herdr** | Fleet/workspace control plane — spawns peer teams as tiled workspaces, presence via push events, snapshot/resume | [herdr.dev](https://herdr.dev); client in `.pi/harnesses/lib/herdr-client.ts`, layout in `.pi/agent-fleet/scripts/lib/herdr-layout.ts` |
18
+ | **coms** | Peer communication protocol/data plane — envelope-based P2P messaging between agents | Shared peer lifecycle in `.pi/harnesses/lib/coms-core.ts` and `coms-core-io.ts`; Pi registrations in `.pi/harnesses/coms/` and `agent-hub/`; wire helpers in `.pi/agent-fleet/scripts/lib/coms-envelope.ts` and `.pi/agent-fleet/scripts/coms-cli.ts` |
19
+ | **Claude Code bridge** | Makes an interactive Claude Code pane a bidirectional coms peer | `.pi/agent-fleet/scripts/coms-claude-bridge.ts`, `.pi/agent-fleet/hooks/coms-stop-hook.mjs`, `skills/peer-coms/` — see [claude-code-coms-bridge.md](claude-code-coms-bridge.md) |
20
+ | **Hermes bridge** | Remote human control — relays hub questions to Telegram, races phone vs. local answers, conductor/liaison skills | `.pi/agent-fleet/scripts/coms-hermes-bridge.ts`, `.pi/harnesses/ask-user-remote/`, `.pi/agent-fleet/hermes/skills/` — see [coms-hermes-bridge.md](coms-hermes-bridge.md) |
21
+ | **Hermes local monitor transport** | Local, authenticated monitor contract for Hub-owned task generations; consumers supply their own presentation | `.pi/harnesses/agent-hub/monitor-*.ts`, `.pi/harnesses/lib/hermes-monitor-{model,store,registry,socket}.ts` (with compatibility re-exports under `.pi/agent-fleet/scripts/lib/`) — see [Hermes artifacts](../.pi/agent-fleet/hermes/README.md#local-agent-hub-monitor-integration) and [watchdog limits](hermes-watchdog-supervisor.md) |
22
+ | **Hermes Desktop plugin** (`agent-fleet-herdr`) | Fleet observability surface — read-only panel of every live session joined from the coms registry, herdr presence, agent transcripts, and the monitor transport; `focus` and subagent `cancel` are its only write doors | `.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/` (Electron pane), `.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/` (FastAPI backend), installed by `.pi/agent-fleet/scripts/install-hermes-plugin.sh` — see [hermes-desktop-plugins.md](hermes-desktop-plugins.md) |
23
+ | **ChatGPT Fleet session client** | Experimental ChatGPT-initiated client for an existing Pi session; no daemon or idle wake | `.pi/agent-fleet/scripts/fleet-codex-client.ts`, `.pi/agent-fleet/scripts/lib/fleet-codex-*`, opt-in feature `chatgpt-client` — see [codex-session-bridge.md](codex-session-bridge.md) |
24
+ | **System 1 foundation** | Experimental, opt-in provider-neutral structured judgments; currently TypeSafe Jev only, with a separate off-by-default native watchdog shadow consumer and closed active gate | `.pi/harnesses/lib/system1/`, feature `system1`, human-owned `.ai/system1.json` |
25
+ | **Skill library** | Lifecycle workflows and quality gates every agent follows | `skills/` (native) + `vendor/agent-skills-upstream/skills/` (vendored) — see [UPSTREAM-SKILLS.md](UPSTREAM-SKILLS.md) |
26
+ | **Personas** | Reusable specialist definitions, installed verbatim | `agents/` in the package → `.pi/agents/personas/` in a workspace; `bin/lib/personas.js` |
27
+
28
+ ## One Hub runtime, independent axes
29
+
30
+ Every public Pi launch through `just fleet` loads Fleet Core and the `agent-hub`
31
+ harness. Three independent choices shape that runtime:
32
+
33
+ | Axis | Choices | What it controls |
34
+ | --- | --- | --- |
35
+ | **Work Mode** | `operator`, `orchestrator` | Whether the main agent may use direct coding tools. Operator retains the captured `read`/`bash`/`edit`/`write` and approved extension surface; orchestrator removes direct coding tools and keeps dispatch, research, assertions, `ask_user`, and available coms/Herdr tools. `/af-work-mode` and **Alt+M** switch this axis. |
36
+ | **Native roster** | empty or one entry from `.pi/agents/teams.yaml` | Which in-process Pi specialist personas `dispatch_agent` may start. Roster changes do not change work mode in a live session. |
37
+ | **Peer topology** | current terminal, Hub-only Herdr workspace, or Hub plus a `.pi/agents/peers.yaml` preset | Which separate, addressable Pi/Claude processes occupy sibling panes. Starting or spawning peers does not change work mode or the native roster. |
38
+
39
+ Bare `just fleet` therefore means operator work mode, an empty native roster, and
40
+ the current terminal. At startup an explicit `--work-mode` wins; otherwise
41
+ `--agents <roster>` implies orchestrator; otherwise operator is used. An
42
+ orchestrator startup requires a roster. `/af-work-mode` and **Alt+M** switch
43
+ only work mode in the live session, and `/af-agents-*` changes
44
+ only the native roster. Dispatch, research, nested delegation, and Verification
45
+ Contract rigor follow the **task tier** (`trivial`/`small`/`feature`/`project`),
46
+ not a session execution mode.
47
+
48
+ All Hub-owned slash commands remain registered in both work modes. Capability packs are resolved automatically from explicit task intent, work mode, tier, pending work, and compaction state—there is no activation command. Runtime **readiness** (a coms or Herdr connection) is not model-visible capability: ready-but-unrequested peer/workspace packs remain inactive. Ambiguous fleet, peer, and workspace requests are provisionally visible but require one `ask_user` confirmation before their first side effect; a rejection removes the provisional pack. Task packs persist across follow-ups and reset only through `set_task_tier(new_task: true)`, while mandatory work mode and pending-operation leases remain.
49
+
50
+ `/af-context` is a standalone, read-only full-screen budget diagnostic; it separates stable prompt cost, volatile state, active schemas, and zero-cost inactive/loaded-excluded inputs. Provider totals and cache read/write fields are authoritative where Pi supplies them; it never fabricates provider usage or combines capacity percentages across Hub, child, and peer planes. `/af-audit` is a separate read-only session audit over existing runtime-owned records: it reports allowlisted T1 recovery categories, T2 result states, T3 protocol failures, and T8 permission correlations while keeping root, child, compaction snapshot, and repeated-record identities distinct. It never copies prompts, model text, tool payloads, environment values, or transcript content, and unavailable evidence stays explicit rather than becoming a zero count. Managed specialists and research children use explicit replacement prompts/context manifests with selected persona, policy, and skill paths instead of inherited global skills/context files. Configured project rule and documentation pointers are rendered into the Hub prompt in both work modes and into native specialist, nested delegate, research, and coms handoffs. Files are read directly; folders are resolved index-first, with recursive rule discovery only when no index exists. The prompt carries pointers and selection instructions rather than bulk-injecting rule bodies, and the Hub ledger attributes that text as `hub/policy/project`. Runtime gates control whether an action can proceed: without coms, Herdr, a visible target, or an active roster, the corresponding command refuses with an actionable message rather than disappearing. `--browser` and `--all-extensions` expand the captured operator surface only when those optional extensions are installed.
51
+
52
+ T12 diagnostics have been withdrawn by user decision; there is no command, runner, or replacement entry point. Historical results and accounting remain unchanged. `diagnostic-series-budget.ts` retains the shared v2 ledger, stage/per-unit ceilings, conservative input preflight, migration refusal for ambiguous history, ownership locks, and cancellation fences used by benchmark consumers. `diagnostic-probe-extension.ts` is now a side-effect-free compatibility library exposing only provider/API output-cap mapping, its types, and the transport refusal exit constant. It preserves the reviewed 2048 cap and rejects unsupported payload semantics; it does not register an extension or tool. Existing sessions must be reloaded after updating. The installer retires unchanged managed command/runner files; user-modified obsolete files are preserved and reported for manual review, never deleted automatically. Such retained files are not imported by the current Hub.
53
+
54
+ ### Context pressure and recovery
55
+
56
+ Standing prompt ceilings constrain the repeatable replacement prompt and active schemas; they do not
57
+ bound conversation messages or results accumulated inside a long tool loop. The Hub therefore has a
58
+ second, runtime pressure guard. It samples provider usage, projects a finalized tool result at
59
+ `message_end`, warns and exposes transient compaction support at **80%**, then at **90%** aborts the
60
+ pre-model continuation and waits for `agent_settled` before requesting one Pi compaction. This
61
+ ordering ensures the result is persisted before summarization and prevents an ordinary provider call
62
+ from escaping between pressure detection and recovery.
63
+
64
+ Recovery is single-flight. High-context startup or concurrent input is retained in memory and
65
+ replayed exactly once after success; failure retains it for `/compact` or a larger-context model.
66
+ `/af-context` and the status line report phase, usage, thresholds, episode, and last outcome. Session
67
+ entries store only numeric/enumerated pressure metadata, never prompts, tool payloads, credentials,
68
+ error bodies, or summaries.
69
+
70
+ A persisted native roster is also metadata, not copied configuration: only its team name is stored
71
+ and it is re-resolved against current teams and persona definitions. A stale or absent roster in a
72
+ resumed orchestrator session fails closed—work mode remains orchestrator, direct tools remain removed,
73
+ and model input is blocked until `/af-agents-team`, an explicit `--agent-team <name>` restart, or an
74
+ explicit operator selection resolves it. Explicit CLI work mode and roster selections retain
75
+ precedence.
76
+
77
+ Pi's session JSONL is the authoritative append-only record for rebuilding a session, including
78
+ compaction and Hub metadata. Pressure and roster recovery operate through Pi/Hub lifecycle APIs;
79
+ they never rewrite prior entries. Operators must not edit, truncate, reorder, or synthesize JSONL to
80
+ recover a session.
81
+
82
+ The project selected by `--project <name>` is the coms namespace for the Hub
83
+ and every standing or dynamically spawned peer. The Hub-facing peer spawn API
84
+ cannot override it. Native subagents remain children of that Hub and inherit
85
+ its repository context; peers are separate processes in their own panes.
86
+
87
+ At dispatch time, `backend: "auto"` applies
88
+ `.pi/agents/dispatch-policy.yaml`; `backend: "native"` bypasses same-name peer
89
+ substitution; and `backend: "coms"` requires a visible same-name peer and never
90
+ falls back to a native child. `.pi/agents/peers.yaml` owns how a peer runs
91
+ (`runner`, persona, model, extensions, and declared `env_file`), not whether a
92
+ dispatch uses it.
93
+
94
+ ## Fleet hierarchy
95
+
96
+ Agent Fleet is layered on purpose. Work flows **down** (delegate); evidence and status flow **up** — as compact structured returns, never raw dumps.
97
+
98
+ ```mermaid
99
+ flowchart TD
100
+ You(["You · Hermes inbound relay · Codex outbound conductor on your phone"])
101
+
102
+ subgraph HUBL["HUB — guarded runtime (bare just fleet)"]
103
+ Hub["agent-hub harness<br/>operator or orchestrator work mode · routes tasks<br/>owns the Verification Contract on disk · keeps research dumps out of its own context"]
104
+ end
105
+
106
+ subgraph TEAML["OPTIONAL NATIVE ROSTER (.pi/agents/teams.yaml)"]
107
+ Team["default: builder · test-engineer · code-reviewer · documenter<br/>also: plan · debug · frontend · security · hotfix · release · info"]
108
+ end
109
+
110
+ subgraph RESL["RESEARCH HELPERS — read-only, always available"]
111
+ Research["researcher (fast tier — simple reads)<br/>deep-researcher (deep tier — hard, cross-cutting questions)"]
112
+ end
113
+
114
+ subgraph SUBL["SUB-AGENTS — focused children, narrow tools + models"]
115
+ Subs["planner → scout · rules · risk<br/>plan-reviewer → feasibility · deps<br/>builder → recon · verifier<br/>test-engineer → coverage-scout · conventions<br/>code-reviewer → preflight · quality · perf · docs<br/>security-auditor → recon · input-sweep · secrets-sweep"]
116
+ end
117
+
118
+ You -->|task| Hub
119
+ Hub -->|"dispatch_agent — one persona = one specialist session"| Team
120
+ Hub -->|"spawn_research"| Research
121
+ Research -.->|"findings written to disk — hub gets paths, not dumps"| Hub
122
+ Team -->|"subagents: block (delegate_depth ≥ 1)"| Subs
123
+ Subs -.->|"results return to the parent agent only"| Team
124
+ Team -.->|"structured return + evidence"| Hub
125
+ Hub -.->|"one status line: Assertions: 2✓ 1○ 1✗"| You
126
+ ```
127
+
128
+ Every specialist session is one persona from [`agents/`](../agents/) (installed to `.pi/agents/personas/`) — *skills* tell each agent **how** to work; *personas* define **who** they are (see [agents.md](agents.md)).
129
+
130
+ The same idea as a tree:
131
+
132
+ ```text
133
+ hub (operator by default; orchestrator when selected)
134
+ ├── optional native roster (empty by default; example: default)
135
+ │ ├── builder → recon · verifier
136
+ │ ├── test-engineer → coverage-scout · conventions
137
+ │ ├── code-reviewer → preflight · quality · perf · docs
138
+ │ └── documenter
139
+ ├── research helpers (spawn_research, any time)
140
+ │ ├── researcher
141
+ │ └── deep-researcher
142
+ └── optional fleet peers (herdr + coms)
143
+ ├── architect / releaser / web-debugger panes
144
+ ├── Claude Code peer (coms bridge)
145
+ ├── Hermes (phone human · inbound ask_user)
146
+ └── ChatGPT Fleet session client (Desktop/Android · existing Pi session)
147
+ ```
148
+
149
+ Composition rule: **the hub (or a slash command) orchestrates; personas do not invoke other personas as peers.** Specialists may only fan out to their configured **sub-agents**. Research helpers write findings to disk; the hub resumes specialists with paths, not raw dumps.
150
+
151
+ ### Research search supervision
152
+
153
+ The shared `spawnPiAgent` seam supervises every `read`/`grep`/`find`/`ls` call from native
154
+ research helpers and nested delegate children. The supervisor tracks JSONL `toolCallId` values
155
+ independently, with a default 120-second deadline (`recon-search-timeout-s: 1..3600|off` under
156
+ `## agent-hub`). It is a per-tool watchdog; the whole-run bound is separate — the task-tier
157
+ per-run deadline (`agent-turn-timeout-s`), which terminates a hung run as `turn_timeout`.
158
+ On timeout or caller cancellation it owns and terminates the child's process group (SIGTERM,
159
+ then SIGKILL after a bounded grace), has a separate settlement timer for missing `close`/pipe
160
+ drain, and reports timeout separately from cancellation. Research helpers and nested delegates
161
+ are each given safe process-group ownership; delegates forward parent termination so no detached
162
+ child is orphaned. Full pattern catalog: [references/orchestration-patterns.md](../references/orchestration-patterns.md).
163
+
164
+ ### Task-tier budgets
165
+
166
+ The hub enforces per-user-turn budgets in code (`run-budget.js`): the current **task tier**
167
+ caps `dispatch_agent` calls, `spawn_research` calls, and active time per turn, sets the
168
+ per-run deadline above, and controls nested delegation (`off` at trivial/small). Exhausted
169
+ budgets make the dispatch tools refuse and request one Yes/No `ask_user` confirmation; Yes
170
+ renews the turn in the same tool loop. A normal new user message also opens a fresh turn
171
+ window.
172
+ Specialist context pressure is measured over input + cacheRead + cacheWrite against **that
173
+ agent's own** model window, resolved from pi's model registry with the source recorded
174
+ (`context-window.js`) — measuring a 49k local model against the dispatcher's window is what
175
+ made readings like "315%" unactionable; anything over 100% now emits a one-time diagnostic
176
+ naming the window and where it came from. Specialist sessions are recycled (fresh spawn
177
+ instead of `-c` resume) after `session-recycle-runs` runs, at ≥60% measured context, and
178
+ unconditionally at a full window; a resumed session whose *projected* prompt would overflow
179
+ is recycled before the spawn rather than after the run. Requests to one provider are capped
180
+ per process (`provider-semaphore.js`: 2 in flight for `custom/*` by default, unlimited
181
+ elsewhere, `AGENT_HUB_PROVIDER_LIMITS` to override) — the cap is per level of the delegation
182
+ tree, and a nested spawn reuses its parent's permit so it can never wait on its own ancestor.
183
+ Configured under `## agent-hub` (`max-dispatches-per-turn`,
184
+ `max-research-per-turn`, `turn-wall-time-s`, `agent-turn-timeout-s`, `session-recycle-runs`,
185
+ `run-history-keep`) as ceilings (`min` with the tier). A leftover `mode:` key is ignored with
186
+ a warning.
187
+
188
+ A per-message allowance cannot bound a task, so a second envelope sits above the turn one:
189
+ the **task budget** (`run-budget.js`, `3×` the turn envelope) counts dispatches, research
190
+ runs and **active** time across the WHOLE task and is *not* reset by a user message. Both turn
191
+ and task active time exclude `ask_user` waits — billing human idle false-stops a normal steered
192
+ session and teaches people to reset reflexively. The auto-research pipe is exempt from the turn
193
+ budget but charged against the task envelope, so it cannot smuggle 8 helpers per dispatch past
194
+ the outer bound.
195
+
196
+ Either envelope stops before another dispatch/research call and asks one localized Yes/No
197
+ `ask_user` question. A confirmed turn continuation renews its counters/clock in the same tool
198
+ loop. A confirmed task continuation opens one audited tranche, also renews the turn, and
199
+ preserves task tier, assertions, capability packs, label, blockers, and progress. No typed
200
+ `continue` message or slash command is required. `set_task_tier` with `new_task: true` is only
201
+ for genuinely different work and clears task identity/state. This is the guardrail the
202
+ post-mortem run never hit: every steering message reopened the turn window,
203
+ so one workspace stayed open 47 hours on a change that took 13 minutes in a narrow one.
204
+
205
+ ### Runtime acceptance and recovery
206
+
207
+ Writable specialist operations (`write`, `edit`, or `bash`) receive the same T2 minimal
208
+ acceptance contract at every task tier. The trigger is the actual operation/tool contract and
209
+ current assertion ledger, not user-language matching or the model's tier label. Read-only
210
+ operations remain lightweight. Language heuristics only expose the fuller verification pack;
211
+ they are supplementary and do not decide whether changed work needs evidence. Pending
212
+ capability leases survive a new-task transition, while stale task packs and assertion state
213
+ reset through the explicit lifecycle path.
214
+
215
+ The runtime-owned result schema is `agent-fleet.runtime-result/v1`. It records orthogonal
216
+ `execution` (`completed | failed | pending`), `changes` (`changed | unchanged | unknown`, with
217
+ `certain | uncertain | not_observed` attribution), `verification`
218
+ (`passed | failed | missing | stale | unsupported`), and `acceptance`
219
+ (`accepted | not_accepted`) dimensions, bound to task identity, before/after revision, command,
220
+ integer exit status, and evidence references. A changed result and failed verification can
221
+ therefore both be true. Compatibility presentation remains
222
+ `not_available | deliverable_failed | needs_verification | accepted` for the Hub and
223
+ `accepted | rejected` for flows.
224
+
225
+ Only native Pi children support trusted runtime checks. The Hub injects the code-owned
226
+ `runtime-test-check.ts` observer only when the native persona has `bash`; the observer wraps the
227
+ existing bash implementation and preserves the normal damage-control `tool_call` approval and
228
+ bash error-event semantics. The parent accepts a check only when producer schema, observed bash
229
+ start, exact declared command, task, coverage metadata, exit status, and unchanged inspected
230
+ revision agree. This proves exact command execution, not semantic adequacy: even a declared
231
+ `true` command can pass, so test quality remains subject to independent or human review.
232
+ Coms peers cannot produce trusted checks, and `manual`/`runtime-ui` requirements currently have
233
+ no trusted producer; all three paths fail closed as missing or unsupported.
234
+
235
+ The observer and trusted event-correlation path have an observed compatibility dependency on
236
+ `@earendil-works/pi-coding-agent@0.84.2`: they rely on its `createBashToolDefinition`, `tool_result`
237
+ hook, `args.path`, and JSON-event passthrough contracts. This records the currently verified API
238
+ surface rather than changing or independently pinning the package version; Pi upgrades must
239
+ re-verify these integration points.
240
+
241
+ Native runs also retain a bounded record of actual tool starts/ends by tool-call identity. T3
242
+ uses those code-owned events only to correlate a terminal, unfenced pseudo-write claim with the
243
+ readback of an explicitly declared deliverable. It never executes tool-shaped text. Fenced
244
+ XML/JSON documentation examples are excluded; a real matching write event with failed readback
245
+ remains a T2 verification/effect failure rather than being relabelled as a protocol failure.
246
+
247
+ A mismatch emits `agent-fleet.tool-protocol-diagnostic/v1` with category
248
+ `tool_protocol_error`, task-or-controlled-probe origin, effective backend/model/tool
249
+ configuration, the claimed effect, matching-event and deliverable facts, `none | partial`
250
+ effects, this-run-only conclusion, and evidence references. The T2 runtime-result dimensions
251
+ remain unchanged and orthogonal. For a real task, the retained diagnostic artifact is the only
252
+ input accepted by the task-generation-bound `establishEffects` recovery port; it records what
253
+ already happened so unchanged retries cannot replay partial effects. It does not authorize a
254
+ retry by itself and does not turn a task failure into a probe result or a universal model
255
+ judgment. The withdrawn T12 runner is not part of this path; historical evidence remains archived.
256
+
257
+ T5's opt-in `filesystem` tool performs deterministic inventory, byte excerpts, artifact readback, and
258
+ local-file-only source snapshots without another model run. It is registered in the Hub and native
259
+ children but appears in their effective tool surface only while the inherited complete profile has
260
+ `assist.deterministic-tools: true`; stale or forged calls are refused at execution too. Profile and
261
+ work-mode changes rebuild the truthful T4 catalog, and compaction reconciles that effective surface.
262
+ Orchestrator mode may use this narrow inspection/managed-snapshot exception, but still has no generic
263
+ bash, edit, or write tools. Native specialist, research, and nested-delegate explicit tool caps remain
264
+ authoritative: the assist flag cannot append `filesystem` outside a declared cap.
265
+ Opaque handles bind canonical paths,
266
+ content hashes/fingerprints, and offsets; continuation fails on stale bytes or directory state,
267
+ and canonical-root checks reject symlink escape. Snapshot bytes and provenance metadata are
268
+ stored separately under the owning current session, marked untrusted, and never interpreted as analysis
269
+ or fetched from a network origin. Snapshot destinations are runtime-owned and cannot be supplied by the
270
+ caller; this narrow artifact creation path grants no general write or shell authority. Every source
271
+ path—including the path resolved from a readback handle—passes through the existing damage-control
272
+ `zeroAccessPaths` hook before execution, preserving its exemptions and interactive/headless approval
273
+ semantics; a denial occurs before source bytes or snapshot artifacts are created. Handle decoding is
274
+ single-sourced in `.pi/harnesses/lib/deterministic-handle-path.ts`, so damage-control retains this guard
275
+ when installed with its declared shared-library companion but without agent-hub. Inventory names and
276
+ all other operation results are marked untrusted. Because snapshot has a managed artifact side effect,
277
+ `filesystem` is not classified as replay-safe for automatic mid-run model fallback.
278
+ `assist.deterministic-tools` and `assist.bounded-output` are independent. Enabling
279
+ `bounded-output` alone bounds read-only tool results inside native specialists, research helpers,
280
+ and nested delegates before the next model continuation, and bounds parent reply transport too;
281
+ `deterministic-tools` controls the deterministic filesystem assistance without being a prerequisite
282
+ for output bounds. The fixed bounds are 500 inventory entries per page, 64 KiB per content/reply,
283
+ and 180 Unicode characters per preview; truncation always names a retained full-output path and
284
+ retrieval handle. With `bounded-output` off, legacy transport is preserved regardless of the
285
+ `deterministic-tools` setting. Inventory records an escaping or unavailable symlink as a denied
286
+ entry without traversing it or disclosing its target outside the authorized inventory.
287
+ T5 does not consume `assist.write-isolation`; the separate T6c native launch boundary does.
288
+
289
+ Recovery remains the single T1 contract: no automatic retry, queue, model fallback, or new
290
+ numeric allowance. Busy work is refused before execution accounting or history mutation and is
291
+ not recorded as no-progress failure. A settled indeterminate failure permits at most one
292
+ explicit, warned, human-authorized retry per logical operation after the prior process is
293
+ confirmed finished and the executor is idle; partial side effects may be duplicated. Neither
294
+ `/af-recover retry <operationId> <attemptId>` nor legacy `/af-retry <dispatchId>` executes work:
295
+ both use the same authorization lane and offer a stored original-contract invocation for a
296
+ separate explicit tool call under unchanged budgets and safety gates. Pending/unknown process,
297
+ second grant, stale IDs, and missing original contract fail closed. `/af-recover inspect` is
298
+ read-only; `reconcile` clears only a technical block when independent current-revision
299
+ readback and nonblocking reviewer evidence cover the failed attempt, leaving the immutable
300
+ failure and open T2/T11 requirements intact; `abandon` never satisfies dependent work.
301
+ Operator cancellation fences the same agent identity until a fresh, one-use authorization is consumed.
302
+ Other agent identities—including the anonymous, read-only research actor—remain independent,
303
+ and a task reset does not erase the cancellation fence. Native session reuse is bound to an exact,
304
+ normalized current-task contract (task identity, instructions, scope, deliverables, input artifacts,
305
+ effective model, and permissions). A different/narrower task starts with a fresh session and
306
+ replacement manifest; only an exact continuation, including the auto-research continuation path,
307
+ receives Pi resume transport. This remains context hygiene rather than confinement.
308
+
309
+ When `assist.write-isolation` is explicitly true, dispatch snapshots that effective setting before
310
+ routing and forces a native child. Explicit coms is refused because remote isolation cannot be
311
+ claimed. The complete Pi process and descendants run under Linux bubblewrap or macOS Seatbelt;
312
+ the repository/root view is read-only except for existing exact relative files, expressly allowed
313
+ existing recursive directories, and separate current-run runtime/artifact/temp roots. Glob scope,
314
+ absolute/escaping scope, symlinked grants, an empty writable grant set, absent or wrong-platform
315
+ backends, and sandbox launch failure all fail closed without an unsandboxed retry. Damage-control remains the policy/audit/
316
+ approval overlay, but an approval cannot widen the OS boundary already created for a run; a wider
317
+ path requires a new explicitly authorized dispatch contract. Network, model, and read access are
318
+ otherwise unchanged. Turning the profile flag off does not dismantle an
319
+ active process boundary; the next run takes a new snapshot. Opt-out retains the legacy spawn path.
320
+ The sandbox never rolls back or deletes user edits, and it cannot protect an allowlisted file from
321
+ a concurrent writer. Exact-file grants support direct writes to the existing inode but intentionally
322
+ block temp-file-plus-rename atomic saves; callers must explicitly grant the containing directory for
323
+ that behavior, and the runtime never widens the grant automatically. Sandboxed spawn uses exactly
324
+ three pipe stdio entries and rejects extra inherited descriptors, closing the known writable-FD
325
+ bypass. Linux deliberately preserves the Hub-owned process group instead of adding a PID namespace,
326
+ and `/dev/tty` remains narrowly available; confinement therefore assumes host ptrace and terminal
327
+ injection controls prevent same-uid cross-process escape (for example Linux Yama ptrace restrictions
328
+ and disabled legacy TIOCSTI). Linux enforcement is exercised on a real bubblewrap host. Seatbelt
329
+ canonicalizes only trusted runtime/artifact/temp aliases such as `/tmp` → `/private/tmp`, while user
330
+ scope grants retain strict symlink rejection; its only device write exceptions are literal
331
+ `/dev/null` and `/dev/tty`, never a blanket `/dev` grant. The Seatbelt profile has contract coverage
332
+ but still requires a Darwin runtime check before T6c is fully verified.
333
+
334
+ T4 adds a code-owned effective-tool catalog without creating another recovery policy. Every
335
+ application of work-mode tools compares the actual active catalog before and after
336
+ `setActiveTools` and can emit `agent-fleet.tool-catalog-delta/v1`: removed, added/available,
337
+ active substitutes with explicit limitations, `permissionExpansion: false`, and SHA-256 catalog
338
+ identities. The delta is persisted as a trusted session entry and included in the next system
339
+ prompt. Orchestrator mode still excludes direct `write`, `edit`, and `bash`; a substitute is only
340
+ an already-active path such as `dispatch_agent` or read-only inspection, and is never invoked by
341
+ the catalog machinery.
342
+
343
+ The runtime latches the effective catalog at `before_agent_start`. Actual assistant tool-call
344
+ blocks are compared to that originating-turn catalog on the real `message_end` path, so a
345
+ next-turn mode switch cannot charge an unknown-tool refusal for a call that was legal when the
346
+ turn began; text blocks are ignored and no pseudo-tool text is executed. On `session_compact`,
347
+ the runtime reconciles the restored `agent-fleet.tool-catalog-state/v1` identity with Pi's current
348
+ active tools, persists restore evidence, and retains the task-scoped unknown-tool counter. Catalog
349
+ errors are recorded fail-closed but cannot skip the existing compaction settlement/deferred-input
350
+ lifecycle.
351
+
352
+ Each unavailable tool refusal is keyed by normalized task and tool, while normalized arguments
353
+ and catalog identity record whether the request or availability was reevaluated. The
354
+ operator-approved limit is exactly three counted refusals, including the first. Mode switches,
355
+ compaction, prose, and real catalog changes never refill it; only the explicit new-task lifecycle
356
+ resets it. A real `unknown_tool` dispatch failure is stamped by the Hub with the latched,
357
+ code-owned catalog identity; a result-supplied identity is ignored. A later successfully persisted
358
+ effective-catalog event can establish `toolStateChanged` evidence for the existing T1
359
+ `unknown_tool` `recoveryDecision`, but still requires explicit reinvocation and existing general
360
+ budgets; it never schedules an automatic retry.
361
+
362
+ On top of the tier envelope sit several qualitative guardrails. **Task triage**: the dispatcher
363
+ classifies the current TASK via the `set_task_tier` tool (`trivial`/`small`/`feature`/`project`)
364
+ and that classification *is* the budget. The tier is task-scoped and **ratcheted** — it survives
365
+ the user's next message, lowering is free, raising needs a stated `reason` — because a
366
+ turn-scoped tier reset to `feature` on every correction. Three refusals enforce
367
+ proportionality in code rather than prose: a duplicate-dispatch guard (near-identical
368
+ re-dispatches within a turn), a **tier persona gate** (`planner`, `plan-reviewer`,
369
+ `architect`, `security-auditor`, `deep-researcher` are refused at trivial/small — each opens
370
+ a document/finding loop), and a **review round cap** (review dispatches per task, by tier).
371
+ Skipping triage assumes `small`, not `feature`: the tier latches for the task, and the case
372
+ where it was never declared is exactly the case where proportionality was not being
373
+ considered. The review **finding** budget is the one thing deliberately left advisory — the
374
+ hub counts blocking findings (`review-findings.js`) and reports an over-budget return, but
375
+ never reclassifies one, because no rule it can evaluate separates an invented manifest from
376
+ a leaked credential; the round cap is what carries the enforcement.
377
+ **Process obligations (T11)** are task-scoped and independent of that budget tier. The
378
+ `set_task_tier` tool accepts explicit `risk` (`unknown | low | high`) and process `scope`
379
+ (`read-only | small | wide`); neither is inferred from task prose. Legacy/omitted risk is
380
+ `unknown`, risk changes require a reason, and scope expansion requires a reason plus an
381
+ explicit risk reassessment. Unknown permits read-only research but cannot accept changed
382
+ work. Confirmed low-risk small work uses the existing T2 minimal acceptance path; high risk
383
+ adds a separate review stage, while wide work adds plan and review stages. These obligations
384
+ ratchet within a task, so lowering spend cannot erase them. Completed stage records name an
385
+ artifact and revision but only prove that the stage occurred—not that model-authored review
386
+ is semantically adequate.
387
+
388
+ The same code-owned state is consumed by dispatch acceptance in operator and orchestrator
389
+ modes, appended as `agent-hub-process-state`, restored from the session log, and retained
390
+ through compaction and mode changes. Only `set_task_tier(new_task: true)` creates fresh
391
+ unknown-risk process state. `/af-audit` exports allowlisted satisfied/open/unsupported
392
+ obligation statuses and explains that the budget tier limits spend rather than correctness;
393
+ reasons and task prose are not copied. This extends the existing task/acceptance/audit paths
394
+ and is not a second workflow engine.
395
+
396
+ **Docs lane** (`docs-lane.js`): a dispatch whose whole declared `scope` is documentation
397
+ refuses review personas (overridable with `review_reason`) and tells the dispatcher not to
398
+ open a review gate; an absent scope is never the lighter lane. **External-blocker stop**
399
+ (`external-blocker.js`): a specialist emits `EXTERNAL_BLOCKED: …` when it needs something
400
+ outside the fleet's reach (account, permission, credential, telemetry destination), and the
401
+ hub refuses the next dispatch with an owner-escalation packet until the human is addressed —
402
+ the alternative, observed, is hours spent approximating the missing fact with scripts,
403
+ manifests and fixtures while the assertion still ends UNPROVEN. **Drift watchdog**
404
+ (`drift-watchdog.js`): armed dispatches are
405
+ observed in-flight from the JSON event stream — deterministic rules (out-of-scope writes
406
+ against the declared `scope` globs, tool-call loops, consecutive failures, tool-call cap)
407
+ escalate to a one-shot cheap LLM judge whose DRIFTING/STUCK verdict terminates the run as
408
+ `drift_stop` (exit 125, partial output preserved); enabled per hub/agent/dispatch
409
+ (`watchdog` key, `/af-watchdog`, `watchdog` param). Orchestrator work mode auto-arms the
410
+ watchdog when the hub setting is `auto`/`on`; a dispatch `watchdog: false` cannot disarm it
411
+ there. Hub or per-agent `off` remains the opt-out. Two rules about scope: the session's
412
+ own `artifacts/`, `findings/`, and `delegations/` subtrees are implicitly in scope (the
413
+ deliverable protocol *orders* specialists to write there, and the judge is told so), and the
414
+ `scope` rule is non-terminal — it reports a drift advisory on the result and never stops a
415
+ run by itself, matching the post-run scope gate, which reverts nothing. **Dynamic teams**: `/af-agents-add`,
416
+ `/af-agents-drop`, `/af-agents-save` restructure the roster live (the system prompt rebuilds
417
+ every turn), and the gated `team_adjust` tool lets the dispatcher itself adjust the roster
418
+ when nested delegation is on (feature/project), with user notification. `/af-hub-report` accounts each turn's dispatches,
419
+ tokens (billed = input + cacheRead + cacheWrite), recycles, drift stops, and refusals.
420
+
421
+ ## Runtime stack (tools the fleet sits on)
422
+
423
+ ```mermaid
424
+ flowchart TD
425
+ AF["<b>Agent Fleet</b><br/>agent-hub · personas · skills · coms · bridges · CLI"]
426
+ AF -->|primary runtime| PI["<b>pi</b><br/>coding agent — loads harnesses,<br/>extensions, prompts, personas"]
427
+ AF -->|control plane| HERDR["<b>herdr</b><br/>tiled peer workspaces,<br/>presence, snapshot/resume"]
428
+ AF -->|coms peer only| CC["<b>Claude Code</b><br/>bidirectional peer via<br/>the coms bridge<br/><i>not an install target</i>"]
429
+ AF -->|remote human| HERMES["<b>Hermes</b><br/>hub questions relayed to your phone,<br/>plus the Desktop fleet panel"]
430
+ AF -->|ChatGPT-initiated session client| CODEX["<b>ChatGPT Fleet session client</b><br/>existing Pi session via<br/>opt-in chatgpt-client (experimental)"]
431
+ ```
432
+
433
+ ### External dependencies
434
+
435
+ These are the external systems Agent Fleet assumes or integrates with — not npm packages, but the **runtime stack** the fleet operates on top of.
436
+
437
+ | Dependency | Role | Required? |
438
+ | --- | --- | --- |
439
+ | **[pi](https://github.com/badlogic/pi-mono)** (or your pi install) | Primary coding-agent runtime; loads harnesses, extensions, prompts, and personas | Yes for `just fleet` |
440
+ | **[herdr](https://herdr.dev)** | Workspace control plane: Hub/peer panes, presence push events, team snapshot/resume | Required for `--herdr` or `--peers`; optional for bare `just fleet` |
441
+ | **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** | First-class coms peer via the [coms bridge](claude-code-coms-bridge.md) — cross-model review and analysis. Never an install target: it hosts no skills, commands, or personas | Optional peer |
442
+ | **Hermes** | Remote human-in-the-loop (Telegram relay for hub questions — [coms-hermes-bridge](coms-hermes-bridge.md)) and the Desktop fleet panel ([hermes-desktop-plugins](hermes-desktop-plugins.md), needs v0.19.0+ and the Desktop app) | Optional |
443
+ | **ChatGPT Desktop/Android** | Experimental opt-in Fleet session client for an existing Pi session; Node 22.18+, Python 3.10+, local herdr/coms access — [runbook](codex-session-bridge.md) | Optional experimental feature `chatgpt-client` |
444
+ | **[addyosmani/agent-skills](https://github.com/addyosmani/agent-skills)** | Upstream skill library (manually vendored) | Bundled (vendored) |
445
+ | **[disler/pi-vs-claude-code](https://github.com/disler/pi-vs-claude-code)** | Source inspiration / MIT port origin for pi harnesses | Design lineage (ported in-repo) |
446
+ | **LLM providers** | Models per persona (`model:` / `models:` in agent frontmatter) — e.g. OpenAI Codex, GitHub Copilot, Ollama, … | Yes (at least one provider your agents can call) |
447
+ | **Chrome DevTools MCP** / **Playwright Agent CLI** | Browser verify (`browser-testing-with-devtools`) and headless automation (`bowser`) | Optional, feature-specific |
448
+ | **Node.js + npm** | CLI (`npx @chankov/agent-fleet`), package install, `just` recipes | Yes for install & tooling |
449
+
450
+ The existing `agent-fleet doctor` command also performs a read-only manifest preflight. It reports exact selected installation files and manifest-declared tool probes as environment readiness, distinguishes missing installation from unknown or unavailable platforms, and names the existing explicit remediation path. Bare doctor never repairs or installs; `doctor --fix` remains the only repair activation, and package/tool installation remains behind its existing explicit consent path.
451
+
452
+ ### System 1 watchdog consumer (off by default)
453
+
454
+ The native specialist Layer 1 drift watchdog can use the shared System 1 runtime
455
+ only after explicit `watchdog-system1: shadow` in `## agent-hub`, feature selection,
456
+ valid provider configuration, an available key and an armed watchdog. It takes a
457
+ session snapshot; setup and doctor do not infer. Shadow starts the LLM judge at
458
+ once and separately observes the same bounded state with Jev. Only the LLM
459
+ verdict may terminate a child; an unavailable LLM judge is recorded as
460
+ `judge_unavailable` and gets one revalidated retry at 5 s, not a successful
461
+ 90 s cooldown. Successful decisions keep 90 s. Every physical attempt has
462
+ separate identities; D1 retries create a new snapshot and do not reuse or
463
+ repeat the previous System 1 evaluation.
464
+
465
+ The state carries a redacted task, relative scope/paths, up to 40 structured
466
+ kinds/outcomes/repeat counts, rule facts and coverage, not raw arguments,
467
+ commands, edit bodies or outputs. This limit applies to System 1 only: the
468
+ existing parallel LLM judge prompt contains the original task, scope and a
469
+ recent trail with up to 120 characters of raw tool arguments per call. Use
470
+ only reviewed nonsecret pilot inputs; manual review does not rule out
471
+ unexpected agent actions. The native spawn boundary removes
472
+ `TYPESAFE_API_KEY` after env overrides. This cannot prevent file reads or
473
+ requests from other launchers. The append-only session watchdog trace stores
474
+ only safe metadata, with explicit unknown usage and interrupted readback.
475
+ The below-chat Fleet strip and `/af-agents` owner detail share a projection;
476
+ `/af-watchdog` shows readiness/active blocking, `/af-hub-report` separates
477
+ watchdog checks, S1 evaluations and LLM attempts, and `/af-audit` lists safe
478
+ read-only lifecycle outcomes. UI/trace failure does not change judgment.
479
+
480
+ `watchdog-system1: active` explicitly opts into an **uncalibrated experimental**
481
+ shortcut available in installed workspaces: only advisory `scope` may skip LLM
482
+ when Jev `jev-1.13.0` reports provider on-track with confidence and on-track
483
+ distribution ≥0.95 and all three contradiction probabilities ≤0.05. Terminal
484
+ rules always use the LLM; System 1 cannot stop a child. The watchdog status
485
+ labels the mode `experimental: scope only; G2 not validated`; default remains
486
+ off and production approved profiles remain empty. Human snapshot labels,
487
+ session-separated held-out measurement and independent maintainer G2 approval
488
+ are still required before calling this calibrated or expanding its authority. Offline tests and installed-package checks do not
489
+ constitute a live pilot (G1) or active approval (G2). Roll back with
490
+ `watchdog-system1: off` and restart Hub; cancel the current run if needed.
491
+
492
+ ### Proactive turn review (separate opt-in consumer)
493
+
494
+ The Hub's `proactive-*` modules compose a separate, off-by-default consumer of the
495
+ existing shared System 1 library and its provider/key; they do not create another
496
+ provider owner or change watchdog authority. A human-owned per-repository
497
+ `.ai/proactive-review.json` selects `off`, `shadow`, or `advisory` and exact
498
+ repository-relative include scope. Missing/off means **zero proactive capture,
499
+ inference, and feedback**. Enabled config with `remoteContext: "disabled"` is
500
+ local-only: bounded source/rule capture and reviewed local validators may run,
501
+ but no semantic provider assessment. `selected-excerpts` separately permits
502
+ bounded selected source/assistant excerpts to the shared System 1 service when
503
+ it is ready; shadow records findings without delivery, advisory may deliver
504
+ feedback at the next *already-occurring* context hook for the same owner,
505
+ attempt, task, and bound rule/source revision. It never creates a turn, fixes
506
+ code, terminates work, changes acceptance gates, or suppresses the watchdog.
507
+ No activation, outbound transmission, or remote repository authorization is
508
+ conferred by installing this code or reading this documentation.
509
+
510
+ At `turn_start`/`turn_end`, Hub and supported native Pi specialists bind the
511
+ explicit task/plan and session rule catalog, collect bounded immutable
512
+ before/after worktree and text evidence, and retain private snapshots separately
513
+ from metadata-only finding/report projections. Source-backed rules come from
514
+ `rules:` folders in `## agent-hub` (legacy `## agent-team`), with index-first
515
+ Markdown discovery, explicit linked sections, and bounded fallback; discovery
516
+ is read-only and never executes rule instructions. Rule identity includes path,
517
+ heading occurrence and hash. Incomplete discovery, unselected sections,
518
+ unsupported Markdown, missing plan (`task_only`), concurrent edits, and
519
+ changed source stays partial, unsupported, uncertain or stale—not
520
+ confirmed passes. Rule references use the session-bound revision: on-disk rule
521
+ edits do not themselves stale a finding, and a restart is required to adopt them. Only explicitly reviewed bindings support deterministic
522
+ local link-form and new-file-placement checks; model findings remain
523
+ suspicions, not validated bugs. Rules are **bound per session**: editing a rule
524
+ in a running session does not reload it; restart to adopt edits. Research
525
+ helpers, nested delegates, coms peers and Hermes are not instrumented by this
526
+ consumer. Native observer hooks/integration were checked with repo-local Pi
527
+ 0.84.2; Node 18 compatibility concerns the extracted installer CLI/doctor,
528
+ not running the TypeScript observer under Node 18.
529
+
530
+ Limits and exclusions, exact config, local report/labels usage, and consent
531
+ sequence are in [Project Files — Proactive turn review](agent-fleet-setup.md#proactive-turn-review-experimental).
532
+ Offline/installed tests and C5 operator visibility establish neither live-pilot
533
+ utility nor universal correctness. The finding-label source fix passed final independent source/docs review;
534
+ this establishes offline/package readiness, not human-labelled semantic acceptance. Only retained finding keys
535
+ are exposed for human labels: checked-clear units lack an operator-accessible
536
+ key, so miss/true-negative labeling and full recall evaluation are not operational.
537
+ C7 human acceptance and any release/deployment remain separate. Current caveats include
538
+ unknown native delivery without a receipt and a rare async-close error risk.
539
+
540
+ ### Experimental System 1 foundation
541
+
542
+ System 1 is a shared Fleet library for bounded structured judgments, not a Pi
543
+ model and not a workflow stage. Its provider-neutral contract exposes
544
+ `choice`, `predicate`, and `ordinal` questions with explicit `ok`, `skipped`,
545
+ `unavailable`, `unsupported`, and `cancelled` outcomes. A valid judgment never
546
+ grants action authority. The contract retains distributions, predicate
547
+ probabilities, and provider confidence when supplied and required, but never
548
+ invents missing uncertainty or treats provider confidence as universal
549
+ calibration.
550
+
551
+ The experimental `system1` feature must be named explicitly in the human-owned
552
+ `.ai/agent-fleet.json`; automatic Full excludes it. Provider configuration is a
553
+ separate human-owned `.ai/system1.json` with exactly this version-1 contract:
554
+
555
+ ```json
556
+ {
557
+ "version": 1,
558
+ "mode": "auto",
559
+ "provider": "typesafe",
560
+ "model": "jev-1.13.0",
561
+ "apiKeyEnv": "TYPESAFE_API_KEY"
562
+ }
563
+ ```
564
+
565
+ Selection, valid `mode: "auto"` configuration, and a nonempty key in the
566
+ caller's environment are all required. `mode: "off"` wins, and key presence by
567
+ itself never activates the service. The runtime and imports do not load `.env`
568
+ or mutate global environment. Managed `just` launches may load the workspace
569
+ root `.env`; direct Node launches must export or inject the key themselves.
570
+
571
+ The only phase-0 production adapter uses the fixed official TypeSafe endpoint
572
+ and pinned `jev-1.13.0` model. It has a 2,000 ms total deadline, including body
573
+ collection and at most one budget-fitting retry for 429/529, rejects redirects,
574
+ and bounds request and response bodies at 1 MiB without truncation. Cancellation
575
+ prevents retry and late-result use; a 401 latches that service instance. Normal
576
+ failures return structured, sanitized outcomes rather than raw response bodies.
577
+ There is no arbitrary endpoint, SDK dependency, Pi/local-model fallback, daemon,
578
+ or local-model installation.
579
+
580
+ Doctor reuses the shared configuration validator and is advisory, read-only,
581
+ and offline—even with `--fix`. It distinguishes an `.env` declaration from a
582
+ nonempty key in its own process but cannot prove API validity. The standalone
583
+ demo is also offline by default; only explicit `--live` sends its embedded
584
+ synthetic Bulgarian/English examples. Public setup and commands are documented
585
+ in [Install and lifecycle](npm-install.md#experimental-system-1-foundation).
586
+
587
+ This foundation has no Watchdog integration or other action consumer. It also
588
+ makes no child-environment isolation promise: existing Fleet children may
589
+ inherit caller environment. A future consumer must own field allowlisting,
590
+ credential filtering, policy, thresholds, and calibration for its provider,
591
+ model, question version, domain, and language. Synthetic success is not
592
+ Watchdog accuracy.
593
+
594
+ Evidence remains split by boundary. Offline contract and extracted-package
595
+ checks passed on Node 25.2.1. A real-provider smoke was not executed because
596
+ `TYPESAFE_API_KEY` was absent, packaged doctor execution on Node 18 remains
597
+ unverified because no Node 18 runtime was available, and final maintainer review
598
+ is pending. None of those open items is implied by fixtures or readiness output.
599
+
600
+ ## Repository module map
601
+
602
+ ### Agent Hub composition
603
+
604
+ `.pi/harnesses/agent-hub/index.ts` owns mutable Hub state and composes the extracted concerns without merging their context contracts:
605
+
606
+ ```text
607
+ agent-hub/
608
+ ├── index.ts # bounded composition root; constructs root-owned mutable ports
609
+ ├── types.ts # shared Hub agent/state contracts
610
+ ├── config/ # agent/frontmatter, teams, profiles, dispatch policy, overrides
611
+ ├── context/ # state, budgets, assertions/artifacts, session-health factories
612
+ ├── commands/ # 27 typed /af-* command registrars
613
+ ├── tools/ # 16 tools plus dispatch/research execution orchestration
614
+ ├── dispatch-core.ts # facade over native, coms, and observability dispatch
615
+ ├── dispatch-*.ts # native preparation/spawn/completion and backend adapters
616
+ ├── acceptance.ts # agent-fleet.runtime-result/v1 and minimal acceptance evaluation
617
+ ├── runtime-test-check.ts # code-owned native bash observer for trusted runtime checks
618
+ ├── tool-protocol.ts # T3 event/readback correlation and shared diagnostic schema
619
+ ├── recovery-contract.ts # shared typed failure/recovery policy
620
+ ├── policy/ # model, roster, capability, and work-mode decisions
621
+ ├── research/ # helper runtime, spawn transitions, and controls
622
+ ├── ui/ # grid, dashboard, detail, context, pool, zoom, and history
623
+ ├── input/ # shortcuts and completion derivation
624
+ ├── lifecycle/ # turn, pressure, monitor, session, and shutdown orchestration
625
+ ├── prompts/ # data-oriented system/session templates + HubPromptContext
626
+ ├── session-start.ts # typed ordered session_start step runner
627
+ ├── presentation.ts # marker, name, thinking, and delegate-path helpers
628
+ ├── timeline.ts # bounded transcript/timeline append helpers
629
+ ├── monitor-*.ts # local monitor transport and recovery primitives
630
+ └── *.test.{ts,js} # registration, loader, parity, and behavior contracts
631
+ ```
632
+
633
+ Cross-harness coms lifecycle remains shared in `.pi/harnesses/lib/coms-core.ts` and `coms-core-io.ts`; it is not owned by the Hub composition root.
634
+
635
+ ```text
636
+ .pi/ # Pi runtime: harnesses, extensions, agents config, prompts
637
+ .pi/agent-fleet/ # The fleet runtime, mirrored verbatim into a workspace:
638
+ scripts/ # CLI helpers, bridges, team + one-off peer launchers (pure logic in scripts/lib/)
639
+ scripts/workflows/ # deterministic flow graphs + phase/gate/permission/quality runtime
640
+ hermes/ # Hermes-facing skills/integration assets
641
+ hooks/ # the coms bridge Stop hook
642
+ docs/ # the one doc that installs into a workspace (workflows.md)
643
+ skills/ # Agent Fleet-native skills (shadow vendored names)
644
+ agents/ # Personas/subagents; installed to a workspace's .pi/agents/personas/
645
+ codex/ # Canonical Codex conductor contract (runtime copy lives outside checkout)
646
+ systemd/user/ # Owned user-unit template for Codex remote control
647
+ vendor/agent-skills-upstream/ # Manually imported upstream skills (pinned SHA)
648
+ bin/ # npm CLI: init/update/doctor + the installer engine
649
+ references/ # Supplementary checklists, installed with the skills that cite them
650
+ docs/ # This file, setup guides, bridge references, vendoring policy
651
+ ```
652
+
653
+ The fleet runtime keeps its *source* layout identical to its *installed* layout.
654
+ That is not cosmetic: `companion:harness-runtime-closure` and its siblings copy
655
+ with `preserveLayout`, so a relative import written here resolves the same way in
656
+ a workspace — including the ones reaching from the stationary `.pi/harnesses/`
657
+ into the movable `.pi/agent-fleet/scripts/`. `bin/test/path-boundaries.test.js`
658
+ holds that invariant.
659
+
660
+ Reserved for future modules (do not repurpose these paths):
661
+
662
+ ```text
663
+ apps/dashboard/ # future dashboard: Kanban state, Herdr workspaces, peer status
664
+ packages/fleet-core/ # future extracted core orchestration library
665
+ packages/herdr-bridge/ # future Herdr integration package
666
+ packages/hermes-bridge/ # future Hermes integration package
667
+ ```
668
+
669
+ ## Design rules
670
+
671
+ - **Workflow engine remains single-sourced.** `just flow` owns deterministic phase order, retries, executable gates, post-hoc writes enforcement, and one flow acceptance decision. It uses the clean spawn/context seams and keeps its clean-tree guard while staying on the current branch by default; creating a flow branch requires explicit `--branch`; normal traces live under `.pi/flow-sessions/`. Explicit flow branches retain source/result metadata, while reserved `cleanup` and `merge` delegate safe removal and squash integration to Worktrunk. The initial Hub `run_flow` adapter calls the same exported dispatcher directly and permits only read-only `scout`: it runs in a stable detached snapshot with no flow branch, stores trace/manifest in the current Hub session, and has one Hub budget/cancellation owner. Snapshot overlay operations validate plain parents before mutation and never follow a HEAD symlink leaf. The native process and descendants use `confineNativeChild`, with only the session-owned phase directory writable; the actual `read`/`grep`/`find`/`ls` data paths are separately limited to the snapshot while damage-control remains loaded. Runtime/model libraries and provider configuration remain readable for Pi startup, so this is intentionally not a global no-read claim. Duplicate identity is idempotent; stale/busy calls are uncharged. All setup/result exceptions settle as structured failures, release active ownership, and preserve honest charged/started state. Owned scout snapshots are cleaned on settlement, with visible cleanup status/errors; traces and explicit branches are retained. Flow acceptance never promotes parent assertions or closes T11 obligations. Writable/committing flows remain outside this adapter pending a separate review.
672
+ - **Thin dispatcher context.** Nothing lands persistently in the dispatcher's
673
+ context if it can live on disk or in a one-line status. Research findings,
674
+ the Verification Contract ledger, and team snapshots are all disk-first.
675
+ - **A harness fault must never look like a specialist fault.** The hub passes
676
+ `--session <file>` on every run, so one corrupt session file used to fail a
677
+ persona in ~1s with no output — indistinguishable from a bad agent, and
678
+ unrecoverable by drop + re-add. Unusable session files are now validated and
679
+ quarantined (`session-health.js`) with the reset named in the result. Same rule
680
+ for the return contract: a report the parser cannot read gets one cheap
681
+ read-only extraction pass (`return-extract.js`) before its assertions are
682
+ written off as unproven, and extracted evidence is always labelled as weaker
683
+ than declared evidence. The converse also holds: a run that errored or timed
684
+ out writes to `artifacts/failures/`, never `returns/` — an error stub filed
685
+ as a return reads as a specialist verdict and gets acted on as one.
686
+ - **A pool status field beats reading the screen.** `coms_list` publishes each
687
+ peer's `pane_id` and `status` (`idle`/`working`/`booting`), and
688
+ `herdr_spawn_peer` waits for the peer to register and returns `peer_ready`
689
+ rather than a bare pane id. A spawned peer boots idle and does nothing until
690
+ addressed, so peers spawned and never sent to are named at turn end and in
691
+ `/af-hub-report` (`spawned-peers.js`); closing stays the human's call.
692
+ - **A declared requirement carries its origin.** Every assertion in the ledger
693
+ names its source (`assertion-ledger.js`), and the open ledger is soft-capped
694
+ at 8 — an id nobody can trace back to a plan line costs a dispatch and an
695
+ ASK_USER cycle to re-derive.
696
+ - **Pre-flight validation is free.** Anything the hub can reject before spawning
697
+ — an unresolvable artifact path, an unknown research persona, a heavy persona
698
+ at a low tier, a reviewer on a docs-only scope — is refused without spending a
699
+ budget slot. Artifact paths also resolve across artifact kinds when the name is
700
+ unique, since the hub writes every auto-return under `returns/` while
701
+ dispatchers reasonably guess `reviews/`.
702
+ - **Evidence is archived, never overwritten.** Session start moves the previous
703
+ session's `artifacts/` into an immutable `.pi/agent-sessions/runs/<runId>/`
704
+ namespace with a read-only `meta.json` and an appended `runs/index.json`
705
+ (`run-namespace.js`), retained per `run-history-keep` (default 10). The old
706
+ behaviour — delete `artifacts/` at start, name returns by a per-session counter
707
+ — collided two ways at once and made a post-mortem record eleven specialist
708
+ returns and two reviews as NOT RECOVERABLE. A failed archive leaves the
709
+ artifacts in place: a stale tree is recoverable, a deleted one is not.
710
+ - **Herdr owns panes, presence, and lifecycle; coms owns messages.** Herdr
711
+ topology recipes (`--herdr` or `--peers`) require a running server and refuse
712
+ with an actionable message otherwise. Bare Fleet does not require Herdr.
713
+ `--no-coms` leaves direct/native execution available but disables peer
714
+ messaging, peer-backed dispatch, and handoff from the Hub.
715
+ - **External agents are peers, not plugins.** Claude Code (and future CLI
716
+ agents) join the fleet through bridge adaptors that speak coms envelopes —
717
+ the fleet core stays agent-agnostic. Hermes remains the inbound `ask_user`/
718
+ Telegram route; the experimental Codex conductor is outbound-initiated only,
719
+ approval-gated, and restricted to listed peers through the validated wrapper.
720
+ - **Hermes monitor presentation is outside the fleet core.** Agent Fleet exposes owner-only
721
+ local monitor operations for Hub-owned state; a consumer owns its UI and lifecycle. The
722
+ worktree contains additive monitor/event/invoke code, but that implementation and its local
723
+ tests are not proof of a durable external identity or live delivery contract. `invoke`, where
724
+ available, is Hub-owned and queues dispatcher work rather than exposing tools directly.
725
+ - **Packaged Hermes source is opt-in, never auto-installed.** The npm tarball carries the
726
+ `hub-watchdog` skill (`.pi/agent-fleet/hermes/skills/`) plus the backend and Desktop monitor plugin source
727
+ (`.pi/agent-fleet/hermes/plugins/`, `.pi/agent-fleet/hermes/desktop-plugins/`) as runtime-only source. Shipping that source
728
+ makes it available to an operator; installing it into a Hermes profile is always an explicit
729
+ action through `agent-fleet set-hermes-watchdog` (skill) or the consumer's own flow (plugins).
730
+ Nothing is enabled, launched, or configured by installing the package.
731
+ - **Watchdog delivery is capability-gated and currently unproven.** No checked-in
732
+ Gate O live artifact proves Hermes origin identity, updates, reconnect, or two-chat isolation,
733
+ so its supported posture is journal-only/dormant: no delivery, steering, or surgical use. It
734
+ never manages services, gateways, Herdr, or shell commands. Local runtime evidence — including
735
+ a real foreground watcher against a disposable Hub UDS — is `synthetic-local` and proves none of
736
+ those capabilities; see [the watchdog runbook](hermes-watchdog-supervisor.md).
737
+ - **External conductor contracts are advisory.** Pi damage-control wraps Pi
738
+ tool calls, not Hermes or Codex processes; human approvals and their
739
+ contracts reduce risk but do not provide an OS command allowlist.
740
+ - **Destructive fleet verbs are damage-control-guarded.** Specialists cannot
741
+ spawn/close herdr panes; the human confirms destructive actions.
742
+ - **Native-over-vendored skills.** The skill catalogue resolves `skills/`
743
+ first, then the vendored upstream import; upstream updates are explicit
744
+ maintainer actions ([UPSTREAM-SKILLS.md](UPSTREAM-SKILLS.md)).
745
+
746
+ ## History
747
+
748
+ Agent Fleet began as a fork of `addyosmani/agent-skills` and was split into a
749
+ standalone repository in July 2026, with upstream demoted to vendored content.
750
+ The one-time migration record, including the history-filtering commands, lives
751
+ in [MIGRATION-agent-fleet.md](MIGRATION-agent-fleet.md). The product
752
+ requirements that drove the split were a one-off planning document and are no
753
+ longer maintained.