harnery 0.36.0 → 0.38.0

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 (432) hide show
  1. package/dist/commander.d.ts +9 -0
  2. package/dist/commander.d.ts.map +1 -1
  3. package/dist/commander.js +10 -1
  4. package/dist/commands/admission.d.ts +21 -0
  5. package/dist/commands/admission.d.ts.map +1 -0
  6. package/dist/commands/admission.js +565 -0
  7. package/dist/commands/agents.d.ts +7 -0
  8. package/dist/commands/agents.d.ts.map +1 -1
  9. package/dist/commands/agents.js +148 -47
  10. package/dist/commands/artifacts.d.ts.map +1 -1
  11. package/dist/commands/artifacts.js +73 -2
  12. package/dist/commands/browse-ai.d.ts +2 -2
  13. package/dist/commands/browse-ai.d.ts.map +1 -1
  14. package/dist/commands/browse-ai.js +6 -4
  15. package/dist/commands/browse.d.ts.map +1 -1
  16. package/dist/commands/browse.js +360 -21
  17. package/dist/commands/diagnostics.d.ts +4 -0
  18. package/dist/commands/diagnostics.d.ts.map +1 -0
  19. package/dist/commands/diagnostics.js +229 -0
  20. package/dist/commands/fetch.js +1 -0
  21. package/dist/commands/files.d.ts +12 -0
  22. package/dist/commands/files.d.ts.map +1 -1
  23. package/dist/commands/files.js +54 -1
  24. package/dist/commands/governor.d.ts.map +1 -1
  25. package/dist/commands/governor.js +4 -0
  26. package/dist/commands/ledger-v3.d.ts.map +1 -1
  27. package/dist/commands/ledger-v3.js +71 -2
  28. package/dist/commands/qa-record.d.ts +144 -0
  29. package/dist/commands/qa-record.d.ts.map +1 -0
  30. package/dist/commands/qa-record.js +0 -0
  31. package/dist/commands/qa-run.d.ts +8 -0
  32. package/dist/commands/qa-run.d.ts.map +1 -0
  33. package/dist/commands/qa-run.js +396 -0
  34. package/dist/commands/qa-status.d.ts +71 -0
  35. package/dist/commands/qa-status.d.ts.map +1 -0
  36. package/dist/commands/qa-status.js +490 -0
  37. package/dist/commands/qa-verify.d.ts +40 -0
  38. package/dist/commands/qa-verify.d.ts.map +1 -0
  39. package/dist/commands/qa-verify.js +180 -0
  40. package/dist/commands/resources.d.ts +4 -0
  41. package/dist/commands/resources.d.ts.map +1 -0
  42. package/dist/commands/resources.js +29 -0
  43. package/dist/commands/review-pack.d.ts +4 -0
  44. package/dist/commands/review-pack.d.ts.map +1 -0
  45. package/dist/commands/review-pack.js +1001 -0
  46. package/dist/commands/supervisor.d.ts +4 -0
  47. package/dist/commands/supervisor.d.ts.map +1 -0
  48. package/dist/commands/supervisor.js +101 -0
  49. package/dist/commands/web.d.ts.map +1 -1
  50. package/dist/commands/web.js +17 -0
  51. package/dist/commands/workflow.d.ts.map +1 -1
  52. package/dist/commands/workflow.js +4 -0
  53. package/dist/core/agents/cli.js +7 -3
  54. package/dist/core/agents/health.d.ts +17 -0
  55. package/dist/core/agents/health.d.ts.map +1 -0
  56. package/dist/core/agents/health.js +109 -0
  57. package/dist/core/agents/mailbox.d.ts +92 -0
  58. package/dist/core/agents/mailbox.d.ts.map +1 -0
  59. package/dist/core/agents/mailbox.js +325 -0
  60. package/dist/core/agents/qa-signal.d.ts +111 -0
  61. package/dist/core/agents/qa-signal.d.ts.map +1 -0
  62. package/dist/core/agents/qa-signal.js +231 -0
  63. package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
  64. package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
  65. package/dist/core/agents/reconcile-coordination-v3.js +58 -0
  66. package/dist/core/agents/render/prompt-context.d.ts +5 -0
  67. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  68. package/dist/core/agents/render/prompt-context.js +34 -13
  69. package/dist/core/agents/render/session-context.d.ts +8 -0
  70. package/dist/core/agents/render/session-context.d.ts.map +1 -1
  71. package/dist/core/agents/render/session-context.js +34 -3
  72. package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
  73. package/dist/core/agents/rules/commit-conflict.js +50 -1
  74. package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
  75. package/dist/core/agents/rules/stop-hook.js +6 -10
  76. package/dist/core/agents/session-finalizer-v3.js +4 -1
  77. package/dist/core/agents/session-name-display.d.ts +20 -5
  78. package/dist/core/agents/session-name-display.d.ts.map +1 -1
  79. package/dist/core/agents/session-name-display.js +67 -7
  80. package/dist/core/agents/state/heartbeat-reader.d.ts +7 -0
  81. package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -1
  82. package/dist/core/agents/state/heartbeat-writer.d.ts +11 -0
  83. package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
  84. package/dist/core/agents/state/heartbeat-writer.js +17 -0
  85. package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
  86. package/dist/core/agents/state/live-coordination-view.js +1 -0
  87. package/dist/core/agents/state/live-coordination-writer.js +5 -0
  88. package/dist/core/artifacts/constants.d.ts +1 -1
  89. package/dist/core/artifacts/constants.js +1 -1
  90. package/dist/core/artifacts/index.d.ts +82 -6
  91. package/dist/core/artifacts/index.d.ts.map +1 -1
  92. package/dist/core/artifacts/index.js +410 -15
  93. package/dist/core/config.d.ts +20 -0
  94. package/dist/core/config.d.ts.map +1 -1
  95. package/dist/core/config.js +59 -0
  96. package/dist/core/diagnostics/advice.d.ts +9 -0
  97. package/dist/core/diagnostics/advice.d.ts.map +1 -0
  98. package/dist/core/diagnostics/advice.js +112 -0
  99. package/dist/core/diagnostics/bundle.d.ts +51 -0
  100. package/dist/core/diagnostics/bundle.d.ts.map +1 -0
  101. package/dist/core/diagnostics/bundle.js +968 -0
  102. package/dist/core/diagnostics/comparison.d.ts +5 -0
  103. package/dist/core/diagnostics/comparison.d.ts.map +1 -0
  104. package/dist/core/diagnostics/comparison.js +444 -0
  105. package/dist/core/diagnostics/contract.d.ts +245 -0
  106. package/dist/core/diagnostics/contract.d.ts.map +1 -0
  107. package/dist/core/diagnostics/contract.js +18 -0
  108. package/dist/core/diagnostics/identity.d.ts +3 -0
  109. package/dist/core/diagnostics/identity.d.ts.map +1 -0
  110. package/dist/core/diagnostics/identity.js +10 -0
  111. package/dist/core/diagnostics/index.d.ts +8 -0
  112. package/dist/core/diagnostics/index.d.ts.map +1 -0
  113. package/dist/core/diagnostics/index.js +7 -0
  114. package/dist/core/diagnostics/replay.d.ts +8 -0
  115. package/dist/core/diagnostics/replay.d.ts.map +1 -0
  116. package/dist/core/diagnostics/replay.js +213 -0
  117. package/dist/core/diagnostics/sanitize.d.ts +9 -0
  118. package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
  119. package/dist/core/diagnostics/sanitize.js +84 -0
  120. package/dist/core/events/legacy-storage/compression.d.ts +13 -0
  121. package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
  122. package/dist/core/events/legacy-storage/compression.js +107 -0
  123. package/dist/core/events/legacy-storage/index.d.ts +1 -0
  124. package/dist/core/events/legacy-storage/index.d.ts.map +1 -1
  125. package/dist/core/events/legacy-storage/index.js +1 -0
  126. package/dist/core/events/v3/archive-retention.d.ts +33 -0
  127. package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
  128. package/dist/core/events/v3/archive-retention.js +195 -0
  129. package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
  130. package/dist/core/events/v3/bootstrap.js +10 -0
  131. package/dist/core/events/v3/capabilities.d.ts +1 -1
  132. package/dist/core/events/v3/capabilities.d.ts.map +1 -1
  133. package/dist/core/events/v3/capabilities.js +1 -0
  134. package/dist/core/events/v3/coordination-view.d.ts +3 -0
  135. package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
  136. package/dist/core/events/v3/coordination-view.js +69 -8
  137. package/dist/core/events/v3/index.d.ts +1 -0
  138. package/dist/core/events/v3/index.d.ts.map +1 -1
  139. package/dist/core/events/v3/index.js +1 -0
  140. package/dist/core/events/v3/live-routing.d.ts.map +1 -1
  141. package/dist/core/events/v3/live-routing.js +1 -0
  142. package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
  143. package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
  144. package/dist/core/events/v3/producers/hook-base.js +13 -2
  145. package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
  146. package/dist/core/events/v3/producers/intake.js +10 -2
  147. package/dist/core/events/v3/producers/recorder.d.ts +39 -0
  148. package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
  149. package/dist/core/events/v3/producers/recorder.js +350 -17
  150. package/dist/core/hooks/adapter/output.d.ts +8 -0
  151. package/dist/core/hooks/adapter/output.d.ts.map +1 -1
  152. package/dist/core/hooks/adapter/output.js +11 -1
  153. package/dist/core/hooks/cli.js +303 -219
  154. package/dist/core/hooks/health.d.ts +59 -0
  155. package/dist/core/hooks/health.d.ts.map +1 -0
  156. package/dist/core/hooks/health.js +84 -0
  157. package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
  158. package/dist/core/hooks/resolve/transcript.js +10 -3
  159. package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
  160. package/dist/core/hooks/session-name-presence.js +4 -1
  161. package/dist/core/qa-artifacts.d.ts +20 -0
  162. package/dist/core/qa-artifacts.d.ts.map +1 -0
  163. package/dist/core/qa-artifacts.js +110 -0
  164. package/dist/core/resources/contract.d.ts +96 -0
  165. package/dist/core/resources/contract.d.ts.map +1 -0
  166. package/dist/core/resources/contract.js +2 -0
  167. package/dist/core/resources/index.d.ts +6 -0
  168. package/dist/core/resources/index.d.ts.map +1 -0
  169. package/dist/core/resources/index.js +5 -0
  170. package/dist/core/resources/sampler.d.ts +34 -0
  171. package/dist/core/resources/sampler.d.ts.map +1 -0
  172. package/dist/core/resources/sampler.js +458 -0
  173. package/dist/core/resources/service-status.d.ts +3 -0
  174. package/dist/core/resources/service-status.d.ts.map +1 -0
  175. package/dist/core/resources/service-status.js +48 -0
  176. package/dist/core/resources/service.d.ts +26 -0
  177. package/dist/core/resources/service.d.ts.map +1 -0
  178. package/dist/core/resources/service.js +292 -0
  179. package/dist/core/resources/storage.d.ts +13 -0
  180. package/dist/core/resources/storage.d.ts.map +1 -0
  181. package/dist/core/resources/storage.js +30 -0
  182. package/dist/core/storage/atomic-json.d.ts +3 -0
  183. package/dist/core/storage/atomic-json.d.ts.map +1 -0
  184. package/dist/core/storage/atomic-json.js +15 -0
  185. package/dist/core/storage/builtins.d.ts.map +1 -1
  186. package/dist/core/storage/builtins.js +45 -6
  187. package/dist/core/storage/logger.d.ts +2 -0
  188. package/dist/core/storage/logger.d.ts.map +1 -1
  189. package/dist/core/storage/logger.js +2 -0
  190. package/dist/core/storage/query.d.ts +14 -0
  191. package/dist/core/storage/query.d.ts.map +1 -1
  192. package/dist/core/storage/query.js +51 -0
  193. package/dist/core/supervisor/activity.d.ts +4 -0
  194. package/dist/core/supervisor/activity.d.ts.map +1 -0
  195. package/dist/core/supervisor/activity.js +141 -0
  196. package/dist/core/supervisor/contract.d.ts +268 -0
  197. package/dist/core/supervisor/contract.d.ts.map +1 -0
  198. package/dist/core/supervisor/contract.js +35 -0
  199. package/dist/core/supervisor/explanations.d.ts +4 -0
  200. package/dist/core/supervisor/explanations.d.ts.map +1 -0
  201. package/dist/core/supervisor/explanations.js +71 -0
  202. package/dist/core/supervisor/findings.d.ts +20 -0
  203. package/dist/core/supervisor/findings.d.ts.map +1 -0
  204. package/dist/core/supervisor/findings.js +399 -0
  205. package/dist/core/supervisor/history.d.ts +9 -0
  206. package/dist/core/supervisor/history.d.ts.map +1 -0
  207. package/dist/core/supervisor/history.js +46 -0
  208. package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
  209. package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
  210. package/dist/core/supervisor/hook-health-alerts.js +70 -0
  211. package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
  212. package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
  213. package/dist/core/supervisor/hook-health-storage.js +24 -0
  214. package/dist/core/supervisor/hook-health.d.ts +72 -0
  215. package/dist/core/supervisor/hook-health.d.ts.map +1 -0
  216. package/dist/core/supervisor/hook-health.js +203 -0
  217. package/dist/core/supervisor/hooks.d.ts +10 -0
  218. package/dist/core/supervisor/hooks.d.ts.map +1 -0
  219. package/dist/core/supervisor/hooks.js +28 -0
  220. package/dist/core/supervisor/index.d.ts +15 -0
  221. package/dist/core/supervisor/index.d.ts.map +1 -0
  222. package/dist/core/supervisor/index.js +14 -0
  223. package/dist/core/supervisor/log-feed.d.ts +9 -0
  224. package/dist/core/supervisor/log-feed.d.ts.map +1 -0
  225. package/dist/core/supervisor/log-feed.js +103 -0
  226. package/dist/core/supervisor/service.d.ts +29 -0
  227. package/dist/core/supervisor/service.d.ts.map +1 -0
  228. package/dist/core/supervisor/service.js +450 -0
  229. package/dist/core/supervisor/services.d.ts +11 -0
  230. package/dist/core/supervisor/services.d.ts.map +1 -0
  231. package/dist/core/supervisor/services.js +155 -0
  232. package/dist/core/supervisor/status.d.ts +3 -0
  233. package/dist/core/supervisor/status.d.ts.map +1 -0
  234. package/dist/core/supervisor/status.js +48 -0
  235. package/dist/core/supervisor/storage.d.ts +30 -0
  236. package/dist/core/supervisor/storage.d.ts.map +1 -0
  237. package/dist/core/supervisor/storage.js +73 -0
  238. package/dist/core/supervisor/timeline.d.ts +3 -0
  239. package/dist/core/supervisor/timeline.d.ts.map +1 -0
  240. package/dist/core/supervisor/timeline.js +87 -0
  241. package/dist/core/workflow/admission.d.ts +23 -0
  242. package/dist/core/workflow/admission.d.ts.map +1 -0
  243. package/dist/core/workflow/admission.js +136 -0
  244. package/dist/core/workflow/engine.d.ts.map +1 -1
  245. package/dist/core/workflow/engine.js +77 -2
  246. package/dist/core/workflow/index.d.ts +3 -2
  247. package/dist/core/workflow/index.d.ts.map +1 -1
  248. package/dist/core/workflow/index.js +2 -1
  249. package/dist/core/workflow/proof.d.ts +2 -1
  250. package/dist/core/workflow/proof.d.ts.map +1 -1
  251. package/dist/core/workflow/proof.js +39 -1
  252. package/dist/core/workflow/run-state.d.ts +3 -2
  253. package/dist/core/workflow/run-state.d.ts.map +1 -1
  254. package/dist/core/workflow/run-state.js +8 -1
  255. package/dist/core/workflow/types.d.ts +33 -1
  256. package/dist/core/workflow/types.d.ts.map +1 -1
  257. package/dist/core/workflow/types.js +2 -1
  258. package/dist/lib/admission.d.ts +71 -0
  259. package/dist/lib/admission.d.ts.map +1 -0
  260. package/dist/lib/admission.js +264 -0
  261. package/dist/lib/agent-browser/client.d.ts +1 -1
  262. package/dist/lib/agent-browser/client.d.ts.map +1 -1
  263. package/dist/lib/agent-browser/client.js +1 -5
  264. package/dist/lib/browser/capture-fidelity.d.ts +39 -0
  265. package/dist/lib/browser/capture-fidelity.d.ts.map +1 -0
  266. package/dist/lib/browser/capture-fidelity.js +84 -0
  267. package/dist/lib/browser/client.d.ts +46 -1
  268. package/dist/lib/browser/client.d.ts.map +1 -1
  269. package/dist/lib/browser/client.js +168 -9
  270. package/dist/lib/browser/critique.d.ts +38 -1
  271. package/dist/lib/browser/critique.d.ts.map +1 -1
  272. package/dist/lib/browser/critique.js +34 -6
  273. package/dist/lib/browser/index.d.ts +5 -1
  274. package/dist/lib/browser/index.d.ts.map +1 -1
  275. package/dist/lib/browser/index.js +4 -0
  276. package/dist/lib/browser/page-review-judge.d.ts +64 -0
  277. package/dist/lib/browser/page-review-judge.d.ts.map +1 -0
  278. package/dist/lib/browser/page-review-judge.js +270 -0
  279. package/dist/lib/browser/page-review-pack.d.ts +613 -0
  280. package/dist/lib/browser/page-review-pack.d.ts.map +1 -0
  281. package/dist/lib/browser/page-review-pack.js +1751 -0
  282. package/dist/lib/browser/qa-run-contracts.d.ts +377 -0
  283. package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
  284. package/dist/lib/browser/qa-run-contracts.js +361 -0
  285. package/dist/lib/browser/qa-run.d.ts +141 -0
  286. package/dist/lib/browser/qa-run.d.ts.map +1 -0
  287. package/dist/lib/browser/qa-run.js +1283 -0
  288. package/dist/lib/browser/request-diagnostics.d.ts +13 -0
  289. package/dist/lib/browser/request-diagnostics.d.ts.map +1 -0
  290. package/dist/lib/browser/request-diagnostics.js +18 -0
  291. package/dist/lib/browser/tiling.d.ts +19 -0
  292. package/dist/lib/browser/tiling.d.ts.map +1 -1
  293. package/dist/lib/browser/tiling.js +28 -0
  294. package/dist/lib/cookies/client.d.ts +9 -0
  295. package/dist/lib/cookies/client.d.ts.map +1 -1
  296. package/dist/lib/cookies/client.js +197 -44
  297. package/dist/lib/cookies/extra.d.ts +18 -0
  298. package/dist/lib/cookies/extra.d.ts.map +1 -0
  299. package/dist/lib/cookies/extra.js +14 -0
  300. package/dist/lib/cookies/index.d.ts +2 -1
  301. package/dist/lib/cookies/index.d.ts.map +1 -1
  302. package/dist/lib/cookies/index.js +2 -1
  303. package/dist/lib/coord-root-id.d.ts +9 -0
  304. package/dist/lib/coord-root-id.d.ts.map +1 -0
  305. package/dist/lib/coord-root-id.js +17 -0
  306. package/dist/lib/durable-job.d.ts +124 -0
  307. package/dist/lib/durable-job.d.ts.map +1 -0
  308. package/dist/lib/durable-job.js +296 -0
  309. package/dist/lib/http/client.d.ts +7 -1
  310. package/dist/lib/http/client.d.ts.map +1 -1
  311. package/dist/lib/http/client.js +2 -0
  312. package/dist/lib/instructions/apply.d.ts +3 -1
  313. package/dist/lib/instructions/apply.d.ts.map +1 -1
  314. package/dist/lib/instructions/apply.js +74 -3
  315. package/dist/lib/instructions/templates.d.ts.map +1 -1
  316. package/dist/lib/instructions/templates.js +11 -2
  317. package/package.json +19 -2
  318. package/src/commander.ts +75 -1
  319. package/src/commands/admission.ts +699 -0
  320. package/src/commands/agents.ts +189 -50
  321. package/src/commands/artifacts.ts +132 -18
  322. package/src/commands/browse-ai.ts +10 -5
  323. package/src/commands/browse.ts +496 -20
  324. package/src/commands/diagnostics.ts +271 -0
  325. package/src/commands/fetch.ts +1 -0
  326. package/src/commands/files.ts +102 -2
  327. package/src/commands/governor.ts +8 -0
  328. package/src/commands/ledger-v3.ts +82 -0
  329. package/src/commands/qa-record.ts +682 -0
  330. package/src/commands/qa-run.ts +503 -0
  331. package/src/commands/qa-status.ts +608 -0
  332. package/src/commands/qa-verify.ts +238 -0
  333. package/src/commands/resources.ts +38 -0
  334. package/src/commands/review-pack.ts +1281 -0
  335. package/src/commands/supervisor.ts +141 -0
  336. package/src/commands/web.ts +19 -0
  337. package/src/commands/workflow.ts +8 -0
  338. package/src/core/agents/cli.ts +7 -3
  339. package/src/core/agents/health.ts +142 -0
  340. package/src/core/agents/mailbox.ts +373 -0
  341. package/src/core/agents/qa-signal.ts +261 -0
  342. package/src/core/agents/reconcile-coordination-v3.ts +77 -0
  343. package/src/core/agents/render/prompt-context.ts +42 -12
  344. package/src/core/agents/render/session-context.ts +37 -3
  345. package/src/core/agents/rules/commit-conflict.ts +58 -1
  346. package/src/core/agents/rules/stop-hook.ts +6 -12
  347. package/src/core/agents/session-finalizer-v3.ts +4 -1
  348. package/src/core/agents/session-name-display.ts +78 -7
  349. package/src/core/agents/state/heartbeat-reader.ts +7 -0
  350. package/src/core/agents/state/heartbeat-writer.ts +23 -0
  351. package/src/core/agents/state/live-coordination-view.ts +1 -0
  352. package/src/core/agents/state/live-coordination-writer.ts +5 -0
  353. package/src/core/artifacts/constants.ts +1 -1
  354. package/src/core/artifacts/index.ts +565 -30
  355. package/src/core/config.ts +134 -2
  356. package/src/core/diagnostics/advice.ts +147 -0
  357. package/src/core/diagnostics/bundle.ts +1250 -0
  358. package/src/core/diagnostics/comparison.ts +565 -0
  359. package/src/core/diagnostics/contract.ts +311 -0
  360. package/src/core/diagnostics/identity.ts +11 -0
  361. package/src/core/diagnostics/index.ts +7 -0
  362. package/src/core/diagnostics/replay.ts +314 -0
  363. package/src/core/diagnostics/sanitize.ts +97 -0
  364. package/src/core/events/legacy-storage/compression.ts +130 -0
  365. package/src/core/events/legacy-storage/index.ts +1 -0
  366. package/src/core/events/v3/archive-retention.ts +251 -0
  367. package/src/core/events/v3/bootstrap.ts +10 -0
  368. package/src/core/events/v3/capabilities.ts +2 -0
  369. package/src/core/events/v3/coordination-view.ts +100 -11
  370. package/src/core/events/v3/index.ts +9 -0
  371. package/src/core/events/v3/live-routing.ts +1 -0
  372. package/src/core/events/v3/producers/hook-base.ts +14 -2
  373. package/src/core/events/v3/producers/intake.ts +10 -2
  374. package/src/core/events/v3/producers/recorder.ts +420 -17
  375. package/src/core/hooks/adapter/output.ts +12 -1
  376. package/src/core/hooks/cli.ts +332 -247
  377. package/src/core/hooks/health.ts +146 -0
  378. package/src/core/hooks/resolve/transcript.ts +10 -3
  379. package/src/core/hooks/session-name-presence.ts +6 -1
  380. package/src/core/qa-artifacts.ts +126 -0
  381. package/src/core/resources/contract.ts +105 -0
  382. package/src/core/resources/index.ts +5 -0
  383. package/src/core/resources/sampler.ts +590 -0
  384. package/src/core/resources/service-status.ts +62 -0
  385. package/src/core/resources/service.ts +337 -0
  386. package/src/core/resources/storage.ts +44 -0
  387. package/src/core/storage/atomic-json.ts +15 -0
  388. package/src/core/storage/builtins.ts +62 -6
  389. package/src/core/storage/logger.ts +2 -0
  390. package/src/core/storage/query.ts +58 -0
  391. package/src/core/supervisor/activity.ts +193 -0
  392. package/src/core/supervisor/contract.ts +312 -0
  393. package/src/core/supervisor/explanations.ts +104 -0
  394. package/src/core/supervisor/findings.ts +788 -0
  395. package/src/core/supervisor/history.ts +61 -0
  396. package/src/core/supervisor/hook-health-alerts.ts +108 -0
  397. package/src/core/supervisor/hook-health-storage.ts +25 -0
  398. package/src/core/supervisor/hook-health.ts +301 -0
  399. package/src/core/supervisor/hooks.ts +35 -0
  400. package/src/core/supervisor/index.ts +14 -0
  401. package/src/core/supervisor/log-feed.ts +131 -0
  402. package/src/core/supervisor/service.ts +511 -0
  403. package/src/core/supervisor/services.ts +203 -0
  404. package/src/core/supervisor/status.ts +59 -0
  405. package/src/core/supervisor/storage.ts +126 -0
  406. package/src/core/supervisor/timeline.ts +133 -0
  407. package/src/core/workflow/admission.ts +215 -0
  408. package/src/core/workflow/engine.ts +93 -1
  409. package/src/core/workflow/index.ts +10 -0
  410. package/src/core/workflow/proof.ts +54 -1
  411. package/src/core/workflow/run-state.ts +13 -1
  412. package/src/core/workflow/types.ts +39 -1
  413. package/src/lib/admission.ts +347 -0
  414. package/src/lib/agent-browser/client.ts +2 -10
  415. package/src/lib/browser/capture-fidelity.ts +98 -0
  416. package/src/lib/browser/client.ts +212 -10
  417. package/src/lib/browser/critique.ts +62 -7
  418. package/src/lib/browser/index.ts +65 -0
  419. package/src/lib/browser/page-review-judge.ts +360 -0
  420. package/src/lib/browser/page-review-pack.ts +2384 -0
  421. package/src/lib/browser/qa-run-contracts.ts +743 -0
  422. package/src/lib/browser/qa-run.ts +1462 -0
  423. package/src/lib/browser/request-diagnostics.ts +27 -0
  424. package/src/lib/browser/tiling.ts +32 -0
  425. package/src/lib/cookies/client.ts +228 -42
  426. package/src/lib/cookies/extra.ts +28 -0
  427. package/src/lib/cookies/index.ts +2 -0
  428. package/src/lib/coord-root-id.ts +23 -0
  429. package/src/lib/durable-job.ts +407 -0
  430. package/src/lib/http/client.ts +13 -1
  431. package/src/lib/instructions/apply.ts +81 -2
  432. package/src/lib/instructions/templates.ts +11 -2
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQ1E,OAAO,EAGL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,wCAAwC,CAAC;AAMhD,OAAO,EAGL,KAAK,SAAS,EAEf,MAAM,0CAA0C,CAAC;AAelD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AA0FjE;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,C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M,CAAC,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,KAAK,SAAa,EAClB,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,qBAAqB,EAA6B,EAC9E,gBAAgB,SAAwB,GACvC,wBAAwB,CA0C1B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAEhF,wFAAwF;AACxF,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC,EACrD,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,mBAAmB,GAAG,IAAI,CAO5B"}
@@ -20,6 +20,9 @@ import { coordBinPath } from "../core/agents/coord-bin.js";
20
20
  import { checkGitFinalization, formatGitFinalizationFailure, readSessionWriteClaims, } from "../core/agents/finalization.js";
21
21
  import { emitEventV3, monorepoRoot, nativeSessionIdentity, normalizeAdapter, resolveOwner, resolveOwnerBySessionEnv, resolveOwnerWithSource, sessionIdentityFromEnv, } from "../core/agents/index.js";
22
22
  import { bootstrapLiveCoordinationAuthorityV3, LiveCoordinationAuthorityV3Error, reopenLiveCoordinationGenerationV3, } from "../core/agents/live-authority-v3.js";
23
+ import { isAddressableName, MailboxCapacityError, queueMailboxMessage, suggestNames, } from "../core/agents/mailbox.js";
24
+ import { qaSignalStatusRow } from "../core/agents/qa-signal.js";
25
+ import { reconcileCoordinationV3 } from "../core/agents/reconcile-coordination-v3.js";
23
26
  import { listSessionFinalizationRequestsV3, observeHostDisappearedV3, reconcileSessionFinalizationV3, requestSessionEndExplicitV3, } from "../core/agents/session-finalizer-v3.js";
24
27
  import { SESSION_NAME_DISPLAY_NOTE, sessionNameDisplayPending, } from "../core/agents/session-name-display.js";
25
28
  import { agentDisplayName } from "../core/agents/state/activity-log.js";
@@ -28,7 +31,7 @@ import { readLiveCoordinationRow, readLiveCoordinationRows, } from "../core/agen
28
31
  import { foldSessionState, } from "../core/agents/state/session-state.js";
29
32
  import { coordFreshnessSeconds, resolveBinName, sessionFinalizationConfig, } from "../core/config.js";
30
33
  import { readEventV3ControlState } from "../core/events/v3/control.js";
31
- import { projectCoordinationViewV3 } from "../core/events/v3/coordination-view.js";
34
+ import { projectCoordinationViewV3, readCoordinationViewV3, } from "../core/events/v3/coordination-view.js";
32
35
  import { liveInstanceIdV3 } from "../core/events/v3/live-routing.js";
33
36
  import { countSummarizedSinceV3, listDiagnosticSummariesV3, } from "../core/events/v3/producers/diagnostic-summaries.js";
34
37
  import { listHookIntakeGroupsV3, listHookIntakeRecordsV3, } from "../core/events/v3/producers/intake.js";
@@ -232,7 +235,8 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
232
235
  });
233
236
  cmd
234
237
  .command("reconcile")
235
- .description("Reconcile archive, idle, parent/run completion, stale, superseded, and host lifecycle signals into V3 session finalization.")
238
+ .description("Sweep the stale coordination cache, then reconcile archive, idle, parent/run " +
239
+ "completion, stale, superseded, and host lifecycle signals into V3 session finalization.")
236
240
  .option("--watch", "Keep reconciling until interrupted")
237
241
  .option("--interval-seconds <n>", "Watch interval in seconds")
238
242
  .option("--json", "JSON output")
@@ -267,9 +271,10 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
267
271
  });
268
272
  cmd
269
273
  .command("ping <name> <message...>")
270
- .description("Append a 'handoff' entry to a peer agent's journal. Body prefixed with " +
271
- "`from agent-<me>:`. Use to leave actionable coordination notes for peers " +
272
- "currently holding files you need.")
274
+ .description("Send a message to another agent by name. Works whether or not that agent " +
275
+ "is running: a live peer sees it on their next prompt, and a name with no " +
276
+ "live session gets it queued until a session of that name next starts. " +
277
+ "Only an unknown name is refused.")
273
278
  .option("--json", "JSON output")
274
279
  .action((name, message, opts) => {
275
280
  runPing(name, message.join(" "), opts);
@@ -299,7 +304,7 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
299
304
  cmd
300
305
  .command("health")
301
306
  .description("One-screen coord-layer health rollup: heal events, council activity, " +
302
- "zombie detection, and anomalies. Designed for " +
307
+ "heartbeat cache issues, and findings. Designed for " +
303
308
  "daily glance + dashboard ingestion. Reads .harnery/.")
304
309
  .option("--since <window>", "Window (Nh | Nd). Default: 24h.", "24h")
305
310
  .option("--json", "JSON envelope output")
@@ -431,7 +436,7 @@ async function runSessionReconcile(opts) {
431
436
  }
432
437
  let stopped = false;
433
438
  do {
434
- emit.data(reconcileSessionFinalizationV3(root));
439
+ emit.data(reconcileCoordinationV3(root));
435
440
  if (!opts.watch || stopped)
436
441
  return;
437
442
  await new Promise((resolvePromise) => {
@@ -1802,6 +1807,11 @@ function runStatus(opts) {
1802
1807
  catch {
1803
1808
  /* non-fatal: status box should not fail on council errors */
1804
1809
  }
1810
+ // Latest page-QA verdict for this session, with the RUNNER's clock. Session
1811
+ // age is not QA time; without this row an operator reads "session 58m" as if
1812
+ // the QA run took 58 minutes. Best-effort by contract — no pointer, a
1813
+ // malformed one, or any read failure renders no row.
1814
+ const qaSignal = qaSignalStatusRow({ coordRoot: root, instanceId: hb.instance_id });
1805
1815
  const data = {
1806
1816
  name: displayName,
1807
1817
  instance_id: hb.instance_id,
@@ -1839,6 +1849,7 @@ function runStatus(opts) {
1839
1849
  timestamp_iso: new Date().toISOString(),
1840
1850
  timestamp_local: timeStr,
1841
1851
  ...(quality ? { quality } : {}),
1852
+ ...(qaSignal ? { qa: qaSignal.pointer } : {}),
1842
1853
  ...(finalization ? { finalization } : {}),
1843
1854
  ...(sessionEnd ? { session_end: sessionEnd } : {}),
1844
1855
  };
@@ -1874,6 +1885,10 @@ function runStatus(opts) {
1874
1885
  const idx = rows.findIndex((row) => row[0] === "time");
1875
1886
  rows.splice(idx, 0, ["quality", formatRunQuality(quality.status, quality.signal_ids)]);
1876
1887
  }
1888
+ if (qaSignal) {
1889
+ const idx = rows.findIndex((row) => row[0] === "time");
1890
+ rows.splice(idx, 0, ["qa", qaSignal.value]);
1891
+ }
1877
1892
  if (sessionEnd) {
1878
1893
  const idx = rows.findIndex((row) => row[0] === "time");
1879
1894
  rows.splice(idx, 0, [
@@ -2481,6 +2496,46 @@ export function collectEventLedgerHealthV3(root, nowMs = Date.now()) {
2481
2496
  catch (error) {
2482
2497
  collectionErrors.push(`diagnostic summaries unreadable: ${errorText(error)}`);
2483
2498
  }
2499
+ let coordinationAuthority = {
2500
+ safe: false,
2501
+ global_diagnostics: 0,
2502
+ isolated_diagnostics: 0,
2503
+ affected_generations: [],
2504
+ codes: [],
2505
+ };
2506
+ try {
2507
+ const view = readCoordinationViewV3(root);
2508
+ const globalDiagnostics = view.global_diagnostics.filter((diagnostic) => diagnostic.authority_blocking);
2509
+ const isolatedDiagnostics = new Map();
2510
+ const affectedGenerations = [];
2511
+ for (const [generationId, diagnostics] of Object.entries(view.diagnostics_by_generation)) {
2512
+ const blocking = diagnostics.filter((diagnostic) => diagnostic.authority_blocking);
2513
+ if (blocking.length === 0)
2514
+ continue;
2515
+ affectedGenerations.push(generationId);
2516
+ for (const diagnostic of blocking) {
2517
+ isolatedDiagnostics.set([
2518
+ diagnostic.code,
2519
+ diagnostic.source_code ?? "",
2520
+ diagnostic.event_id ?? "",
2521
+ diagnostic.generation_id ?? "",
2522
+ diagnostic.subject_instance_id ?? "",
2523
+ ].join("\0"), diagnostic);
2524
+ }
2525
+ }
2526
+ coordinationAuthority = {
2527
+ safe: view.authority_safe,
2528
+ global_diagnostics: globalDiagnostics.length,
2529
+ isolated_diagnostics: isolatedDiagnostics.size,
2530
+ affected_generations: affectedGenerations.sort(),
2531
+ codes: [
2532
+ ...new Set([...globalDiagnostics, ...isolatedDiagnostics.values()].map((diagnostic) => diagnostic.source_code ?? diagnostic.code)),
2533
+ ].sort(),
2534
+ };
2535
+ }
2536
+ catch (error) {
2537
+ collectionErrors.push(`coordination authority unreadable: ${errorText(error)}`);
2538
+ }
2484
2539
  return {
2485
2540
  state: "live",
2486
2541
  mode: control.state,
@@ -2504,6 +2559,7 @@ export function collectEventLedgerHealthV3(root, nowMs = Date.now()) {
2504
2559
  recent_by_category: recentByCategory,
2505
2560
  mitigation_fail_open: mitigationFailOpen,
2506
2561
  },
2562
+ coordination_authority: coordinationAuthority,
2507
2563
  span_pressure: spanPressure,
2508
2564
  collection_errors: collectionErrors,
2509
2565
  };
@@ -3091,8 +3147,8 @@ function runHealth(opts) {
3091
3147
  // Heartbeat cache issues: files in active/ that are unparseable, nameless,
3092
3148
  // invalidly timestamped, or stale. Old parseable timestamps are ordinary
3093
3149
  // staleness, not evidence of epoch-like timestamp corruption.
3094
- let zombieCount = 0;
3095
- const zombieSamples = [];
3150
+ let cacheIssueCount = 0;
3151
+ const cacheIssueSamples = [];
3096
3152
  const STALE_HEARTBEAT_AGE_MS = 24 * 60 * 60 * 1000;
3097
3153
  if (existsSync(activeDir)) {
3098
3154
  for (const file of readdirSync(activeDir)) {
@@ -3107,16 +3163,16 @@ function runHealth(opts) {
3107
3163
  hb = null;
3108
3164
  }
3109
3165
  if (!hb || typeof hb.instance_id !== "string") {
3110
- zombieCount++;
3111
- if (zombieSamples.length < 5)
3112
- zombieSamples.push(`${idFromFile.slice(0, 12)} (unparseable/no-id)`);
3166
+ cacheIssueCount++;
3167
+ if (cacheIssueSamples.length < 5)
3168
+ cacheIssueSamples.push(`${idFromFile.slice(0, 12)} (unparseable/no-id)`);
3113
3169
  continue;
3114
3170
  }
3115
3171
  const cacheIssue = classifyHeartbeatCacheIssue(hb, nowMs, STALE_HEARTBEAT_AGE_MS);
3116
3172
  if (cacheIssue) {
3117
- zombieCount++;
3118
- if (zombieSamples.length < 5) {
3119
- zombieSamples.push(`${idFromFile.slice(0, 12)} (${cacheIssue})`);
3173
+ cacheIssueCount++;
3174
+ if (cacheIssueSamples.length < 5) {
3175
+ cacheIssueSamples.push(`${idFromFile.slice(0, 12)} (${cacheIssue})`);
3120
3176
  }
3121
3177
  }
3122
3178
  }
@@ -3132,11 +3188,11 @@ function runHealth(opts) {
3132
3188
  activeCouncils++;
3133
3189
  }
3134
3190
  }
3135
- // Anomaly detection.
3136
- const anomalies = [];
3191
+ // Finding detection.
3192
+ const findings = [];
3137
3193
  for (const { agent, count } of healTopAgents) {
3138
3194
  if (count >= 5) {
3139
- anomalies.push(`${agent} self-healed ${count}x in ${opts.since}; possible idle-prune loop or PID instability`);
3195
+ findings.push(`${agent} self-healed ${count}x in ${opts.since}; possible idle-prune loop or PID instability`);
3140
3196
  }
3141
3197
  }
3142
3198
  if (activeAgents.stale > 0) {
@@ -3144,49 +3200,58 @@ function runHealth(opts) {
3144
3200
  const action = activeAgents.source === "event-ledger-v3"
3145
3201
  ? "lifecycle reconciliation may be delayed"
3146
3202
  : "heal mechanism may not be firing";
3147
- anomalies.push(`${activeAgents.stale} active ${noun}(s) without activity for ${Math.floor(freshnessCutoffSecs() / 60)}min; ${action}`);
3203
+ findings.push(`${activeAgents.stale} active ${noun}(s) without activity for ${Math.floor(freshnessCutoffSecs() / 60)}min; ${action}`);
3148
3204
  }
3149
3205
  const expectedSchema = "v3";
3150
3206
  const unexpectedSchemas = Object.keys(activeAgents.by_schema_version).filter((schema) => schema !== expectedSchema);
3151
3207
  if (unexpectedSchemas.length > 0) {
3152
- anomalies.push(`Unexpected active-agent schema versions in use: ${unexpectedSchemas.join(", ")} (expected ${expectedSchema})`);
3208
+ findings.push(`Unexpected active-agent schema versions in use: ${unexpectedSchemas.join(", ")} (expected ${expectedSchema})`);
3153
3209
  }
3154
- // Only recent hook failures are active anomalies. Historical rows remain in
3210
+ // Only recent hook failures are active findings. Historical rows remain in
3155
3211
  // the report with exact error signatures and their latest timestamp.
3156
3212
  if (hookErrors.last1h > 0) {
3157
3213
  const top = hookErrors.recentTopErrors[0];
3158
3214
  const detail = top ? `: top '${top.error.slice(0, 80)}' x${top.count} (${top.phase})` : "";
3159
- anomalies.push(`agent-hook errored ${hookErrors.last1h}x in the last hour${detail}`);
3215
+ findings.push(`agent-hook errored ${hookErrors.last1h}x in the last hour${detail}`);
3160
3216
  }
3161
3217
  if (stream.cursor_backlog > 500) {
3162
- anomalies.push(`projection cursor is ${stream.cursor_backlog} events behind; drain lagging (stop projection may be failing)`);
3218
+ findings.push(`projection cursor is ${stream.cursor_backlog} events behind; drain lagging (stop projection may be failing)`);
3163
3219
  }
3164
- // Raw V3 stream size is not an anomaly; catalog rotation bounds readers.
3220
+ // Raw V3 stream size is not a finding; catalog rotation bounds readers.
3165
3221
  if ((sweptByReason.unparseable ?? 0) > 0) {
3166
- anomalies.push(`${sweptByReason.unparseable} heartbeat(s) swept as unparseable in ${opts.since}; possible corruption or a non-atomic writer`);
3222
+ findings.push(`${sweptByReason.unparseable} heartbeat(s) swept as unparseable in ${opts.since}; possible corruption or a non-atomic writer`);
3167
3223
  }
3168
- if (zombieCount > 0) {
3169
- anomalies.push(`${zombieCount} heartbeat cache issue(s) in active/ (${zombieSamples.join(", ")}); stale or malformed files the sweep isn't reaping`);
3224
+ if (cacheIssueCount > 0) {
3225
+ findings.push(`${cacheIssueCount} heartbeat cache issue(s) in active/ (${cacheIssueSamples.join(", ")}); ` +
3226
+ "rows the last sweep deliberately kept (malformed but mtime-fresh, or neither audit " +
3227
+ "write could persist), or that aged past the freshness cutoff since it ran");
3170
3228
  }
3171
3229
  if (stopRemediation.total > 0) {
3172
3230
  const who = stopRemediation.sessions.length > 0
3173
3231
  ? ` (sessions: ${stopRemediation.sessions.map((s) => s.slice(0, 8)).join(", ")})`
3174
3232
  : "";
3175
- anomalies.push(`stop-hook remediation cap exhausted ${stopRemediation.total}x in ${opts.since}${who}; these sessions ended turns without the end-of-turn ritual — check why their evidence never lands`);
3233
+ findings.push(`stop-hook remediation cap exhausted ${stopRemediation.total}x in ${opts.since}${who}; these sessions ended turns without the end-of-turn ritual — check why their evidence never lands`);
3176
3234
  }
3177
3235
  if (eventLedger.state === "live") {
3236
+ const authority = eventLedger.coordination_authority;
3237
+ if (authority.global_diagnostics > 0) {
3238
+ findings.push(`${authority.global_diagnostics} global coordination authority diagnostic(s): ${authority.codes.join(", ")}`);
3239
+ }
3240
+ if (authority.isolated_diagnostics > 0) {
3241
+ findings.push(`${authority.isolated_diagnostics} coordination authority diagnostic(s) isolated to ${authority.affected_generations.length} generation(s): ${authority.codes.join(", ")}`);
3242
+ }
3178
3243
  // Open spans whose generation has no open turn: the turn ended without its
3179
3244
  // tool spans closing, so an explicit end can only queue, never finalize.
3180
3245
  const orphanGenerations = eventLedger.open_spans.generations.filter((generation) => !generation.turn_open);
3181
3246
  if (orphanGenerations.length > 0) {
3182
3247
  const orphanSpans = orphanGenerations.reduce((sum, generation) => sum + generation.span_count, 0);
3183
- anomalies.push(`${orphanSpans} open tool span(s) across ${orphanGenerations.length} generation(s) with no open turn; orphaned spans block clean session end`);
3248
+ findings.push(`${orphanSpans} open tool span(s) across ${orphanGenerations.length} generation(s) with no open turn; orphaned spans block clean session end`);
3184
3249
  }
3185
3250
  for (const pressure of eventLedger.span_pressure) {
3186
- anomalies.push(`${pressure.instance_id} (${pressure.generation_id}) holds ${pressure.span_count} open spans (soft watermark ${SPAN_PRESSURE_SOFT_WATERMARK}; the reader's 256-span cap makes the state unreadable)`);
3251
+ findings.push(`${pressure.instance_id} (${pressure.generation_id}) holds ${pressure.span_count} open spans (soft watermark ${SPAN_PRESSURE_SOFT_WATERMARK}; the reader's 256-span cap makes the state unreadable)`);
3187
3252
  }
3188
3253
  for (const collectionError of eventLedger.collection_errors) {
3189
- anomalies.push(`event-ledger health: ${collectionError}`);
3254
+ findings.push(`event-ledger health: ${collectionError}`);
3190
3255
  }
3191
3256
  }
3192
3257
  const report = {
@@ -3230,14 +3295,14 @@ function runHealth(opts) {
3230
3295
  recent_top_errors: hookErrors.recentTopErrors,
3231
3296
  },
3232
3297
  stream,
3233
- zombies: { count: zombieCount, samples: zombieSamples },
3298
+ heartbeat_cache_issues: { count: cacheIssueCount, samples: cacheIssueSamples },
3234
3299
  event_ledger: eventLedger,
3235
3300
  stop_remediation: {
3236
3301
  total: stopRemediation.total,
3237
3302
  latest_at: stopRemediation.latestAt,
3238
3303
  sessions: stopRemediation.sessions,
3239
3304
  },
3240
- anomalies,
3305
+ findings,
3241
3306
  };
3242
3307
  if (opts.json) {
3243
3308
  emit.data(report);
@@ -3292,6 +3357,7 @@ function renderHealthBox(report) {
3292
3357
  .map((request) => request.age_ms < 0 ? "age?" : formatAge(Math.floor(request.age_ms / 1000)))
3293
3358
  .join(", ");
3294
3359
  ledgerStr = [
3360
+ `authority ${ledger.coordination_authority.safe ? "safe" : "unsafe"}${ledger.coordination_authority.isolated_diagnostics > 0 ? ` (${ledger.coordination_authority.isolated_diagnostics} isolated)` : ""}`,
3295
3361
  `open spans ${ledger.open_spans.total}${orphanGenerations > 0 ? ` (${orphanGenerations} gen turn-closed)` : ""}`,
3296
3362
  `pending ends ${ledger.pending_finalizations.length}${pendingAges ? ` (${pendingAges})` : ""}`,
3297
3363
  `intake ${ledger.intake_spool.total}`,
@@ -3316,19 +3382,19 @@ function renderHealthBox(report) {
3316
3382
  ["event ledger", ledgerStr],
3317
3383
  [
3318
3384
  "cache issues",
3319
- report.zombies.count === 0
3385
+ report.heartbeat_cache_issues.count === 0
3320
3386
  ? "0"
3321
- : `${report.zombies.count} (${report.zombies.samples.join(", ")})`,
3387
+ : `${report.heartbeat_cache_issues.count} (${report.heartbeat_cache_issues.samples.join(", ")})`,
3322
3388
  ],
3323
3389
  ["councils", councilParts.join(", ")],
3324
- ["anomalies", report.anomalies.length === 0 ? "(clean)" : `${report.anomalies.length} flagged`],
3390
+ ["findings", report.findings.length === 0 ? "(clean)" : `${report.findings.length} flagged`],
3325
3391
  ];
3326
3392
  const localTime = formatLocalTime(new Date(report.generated_at));
3327
3393
  const title = `Coord Health (${localTime})`;
3328
3394
  process.stdout.write(`${formatBox(title, rows)}\n`); // lint-ok-emission: chat-paste path; mirrors runStatus's direct write so the box surfaces in both TTY + harn-session-teed contexts
3329
- if (report.anomalies.length > 0) {
3395
+ if (report.findings.length > 0) {
3330
3396
  process.stdout.write("\n"); // lint-ok-emission: same chat-paste path
3331
- for (const a of report.anomalies) {
3397
+ for (const a of report.findings) {
3332
3398
  process.stdout.write(` ! ${a}\n`); // lint-ok-emission: same
3333
3399
  }
3334
3400
  }
@@ -3708,18 +3774,48 @@ function runPing(name, message, opts) {
3708
3774
  });
3709
3775
  process.exit(1);
3710
3776
  }
3777
+ const coordRoot = monorepoRoot();
3711
3778
  const peerOwner = resolveOwnerByName(name);
3712
- if (!peerOwner) {
3779
+ // A name with no live session is the common case, not an error: the agent it
3780
+ // refers to may have ended minutes ago and may come back under the same name.
3781
+ // Refuse only a name that no agent has ever held, which is a typo — queueing
3782
+ // that would swallow the message silently.
3783
+ if (!peerOwner && coordRoot && !isAddressableName(coordRoot, name)) {
3784
+ const suggestions = suggestNames(coordRoot, name);
3713
3785
  emit.error({
3714
- code: "no_peer",
3715
- message: `no live agent named "${name}" (case-insensitive). Run \`${resolveBinName()} agents list\` to see who's active.`,
3786
+ code: "unknown_agent",
3787
+ message: `no agent has ever been named "${name}". ` +
3788
+ (suggestions.length > 0 ? `Did you mean ${suggestions.join(", ")}? ` : "") +
3789
+ `Run \`${resolveBinName()} agents list\` for live sessions.`,
3716
3790
  });
3717
3791
  process.exit(1);
3718
3792
  }
3719
3793
  const myHb = readCurrentCoordinationRow(myOwner);
3720
3794
  const fromName = myHb?.name ?? "anonymous";
3721
3795
  const body = `from agent-${fromName}: ${message.trim()}`;
3722
- const doc = appendEntry(peerOwner, "handoff", body);
3796
+ // A live recipient gets the journal entry immediately, so a peer reading
3797
+ // their own journal mid-session sees it without waiting for a prompt. A
3798
+ // dormant recipient has no journal to write to yet; the drain writes it into
3799
+ // whichever session picks the message up.
3800
+ const doc = peerOwner ? appendEntry(peerOwner, "handoff", body) : null;
3801
+ let queued;
3802
+ try {
3803
+ queued = queueMailboxMessage({
3804
+ coordRoot: coordRoot ?? process.cwd(),
3805
+ toName: name,
3806
+ fromName,
3807
+ fromInstanceId: myOwner,
3808
+ body: message.trim(),
3809
+ journaled: Boolean(peerOwner),
3810
+ });
3811
+ }
3812
+ catch (error) {
3813
+ if (error instanceof MailboxCapacityError) {
3814
+ emit.error({ code: `mailbox_${error.reason_code}`, message: error.message });
3815
+ process.exit(1);
3816
+ }
3817
+ throw error;
3818
+ }
3723
3819
  // Canonical delivery record: sender is the envelope owner, recipient rides
3724
3820
  // in data, so read-only observers can render the communication without
3725
3821
  // joining journal files.
@@ -3730,17 +3826,20 @@ function runPing(name, message, opts) {
3730
3826
  observation: {
3731
3827
  event_type: "coord.message_observed",
3732
3828
  direction: "sent",
3733
- subject: peerOwner,
3829
+ subject: peerOwner ?? `name:${queued.message.to_name}`,
3734
3830
  body: message.trim(),
3735
3831
  },
3736
3832
  });
3737
3833
  const data = {
3738
- peer: name,
3834
+ peer: queued.message.to_name,
3739
3835
  peer_instance_id: peerOwner,
3836
+ delivery: peerOwner ? "live" : "queued",
3837
+ message_id: queued.message.message_id,
3838
+ pending: queued.pending,
3740
3839
  from: fromName,
3741
3840
  body,
3742
- journal_path: doc.path,
3743
- journal_bytes: doc.bytes,
3841
+ journal_path: doc?.path ?? null,
3842
+ journal_bytes: doc?.bytes ?? null,
3744
3843
  };
3745
3844
  if (opts.json) {
3746
3845
  emit.config({ format: "json" });
@@ -3748,7 +3847,9 @@ function runPing(name, message, opts) {
3748
3847
  return;
3749
3848
  }
3750
3849
  emit.data(data);
3751
- emit.text(`pinged agent-${name}: "${truncate(message.trim(), 80)}"\n`);
3850
+ emit.text(peerOwner
3851
+ ? `delivered to agent-${data.peer} (live; they see it on their next prompt): "${truncate(message.trim(), 80)}"\n`
3852
+ : `queued for agent-${data.peer} (no live session; delivered when a session of that name next starts): "${truncate(message.trim(), 80)}"\n`);
3752
3853
  }
3753
3854
  async function runWait(name, opts) {
3754
3855
  const timeoutMs = parseDurationToMs(opts.timeout);
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAc1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmGN"}
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAmB1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmMN"}
@@ -1,6 +1,6 @@
1
1
  import { monorepoRoot, resolveOwner } from "../core/agents/index.js";
2
2
  import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.js";
3
- import { cleanArtifacts, createArtifact, inventoryArtifacts, releaseArtifact, renewArtifact, showArtifact, } from "../core/artifacts/index.js";
3
+ import { adoptUnmanagedArtifactFiles, artifactCapabilities, cleanArtifacts, createArtifact, holdArtifact, inventoryArtifacts, migrateArtifacts, releaseArtifact, renewArtifact, showArtifact, unholdArtifact, } from "../core/artifacts/index.js";
4
4
  import { artifactDefaultRetentionDays, coordFreshnessSeconds } from "../core/config.js";
5
5
  export function registerArtifactsCommand(program, emit, context) {
6
6
  const root = program
@@ -12,10 +12,16 @@ export function registerArtifactsCommand(program, emit, context) {
12
12
  .description("Create one managed artifact workspace and print its path.")
13
13
  .requiredOption("--purpose <text>", "What the files are for")
14
14
  .option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
15
+ .option("--big", "Acknowledge that this workspace may exceed the per-bundle size ceiling")
16
+ .option("--hold <id>", "Create the workspace with this hold already present")
17
+ .option("--hold-reason <text>", "Why the initial hold is required")
18
+ .option("--actor <instance-id>", "Stable owner identity for the initial hold")
15
19
  .action((slug, opts) => {
16
20
  run(emit, () => {
17
21
  const repoRoot = requireRepoRoot(context);
18
- const actor = currentActor(repoRoot);
22
+ const actor = opts.actor ? { instance_id: opts.actor } : currentActor(repoRoot);
23
+ if (!!opts.hold !== !!opts.holdReason)
24
+ throw new Error("--hold and --hold-reason must be used together");
19
25
  const retentionDays = opts.days
20
26
  ? parseDays(opts.days)
21
27
  : artifactDefaultRetentionDays(repoRoot);
@@ -24,15 +30,39 @@ export function registerArtifactsCommand(program, emit, context) {
24
30
  purpose: opts.purpose,
25
31
  retentionDays,
26
32
  actor,
33
+ big: opts.big,
34
+ holds: opts.hold ? [{ id: opts.hold, reason: opts.holdReason }] : [],
27
35
  });
28
36
  emit.data({
29
37
  path: created.path,
30
38
  artifact_id: created.manifest.artifact_id,
31
39
  expires_at: created.manifest.retention.expires_at,
32
40
  owner_instance_id: actor?.instance_id ?? null,
41
+ holds: created.manifest.holds,
33
42
  });
34
43
  });
35
44
  });
45
+ root
46
+ .command("adopt-unmanaged")
47
+ .description("Preview loose direct-child files, or move them into one managed workspace.")
48
+ .option("--purpose <text>", "Why the adopted files are being retained", "Adopt legacy loose artifact files")
49
+ .option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
50
+ .option("--big", "Acknowledge an adopted bundle above the per-bundle size ceiling")
51
+ .option("--yes", "Move the exact previewed regular files into a managed workspace")
52
+ .action((opts) => {
53
+ run(emit, () => {
54
+ const repoRoot = requireRepoRoot(context);
55
+ emit.data(adoptUnmanagedArtifactFiles(repoRoot, {
56
+ yes: opts.yes,
57
+ big: opts.big,
58
+ purpose: opts.purpose,
59
+ retentionDays: opts.days
60
+ ? parseDays(opts.days)
61
+ : artifactDefaultRetentionDays(repoRoot),
62
+ actor: currentActor(repoRoot),
63
+ }));
64
+ });
65
+ });
36
66
  root
37
67
  .command("list")
38
68
  .description("Inventory every artifact workspace with its cleanup classification.")
@@ -79,6 +109,39 @@ export function registerArtifactsCommand(program, emit, context) {
79
109
  emit.data(releaseArtifact(repoRoot, ref, { actor: currentActor(repoRoot) }));
80
110
  });
81
111
  });
112
+ root
113
+ .command("capabilities")
114
+ .description("Report artifact schema and hold capabilities for embedding clients.")
115
+ .option("--json", "Emit the capability document as JSON")
116
+ .action(() => emit.data(artifactCapabilities()));
117
+ root
118
+ .command("migrate")
119
+ .description("Preview the explicit v1 to v2 manifest migration, preserving preimages.")
120
+ .option("--yes", "Apply the migration to valid v1 manifests")
121
+ .action((opts) => run(emit, () => emit.data({ rows: migrateArtifacts(requireRepoRoot(context), opts) })));
122
+ root
123
+ .command("hold <ref>")
124
+ .description("Protect an artifact from cleanup until its owner removes this exact hold.")
125
+ .requiredOption("--id <id>", "Unique hold id within this artifact")
126
+ .requiredOption("--reason <text>", "Why cleanup must retain these files")
127
+ .option("--actor <instance-id>", "Stable hold owner; defaults to the current agent")
128
+ .action((ref, opts) => run(emit, () => {
129
+ const repoRoot = requireRepoRoot(context);
130
+ emit.data(holdArtifact(repoRoot, ref, {
131
+ id: opts.id,
132
+ reason: opts.reason,
133
+ actor: requireHoldActor(repoRoot, opts.actor),
134
+ }));
135
+ }));
136
+ root
137
+ .command("unhold <ref>")
138
+ .description("Remove one exact hold belonging to the supplied owner.")
139
+ .requiredOption("--id <id>", "Exact hold id to remove")
140
+ .option("--actor <instance-id>", "Stable hold owner; defaults to the current agent")
141
+ .action((ref, opts) => run(emit, () => {
142
+ const repoRoot = requireRepoRoot(context);
143
+ emit.data(unholdArtifact(repoRoot, ref, opts.id, { actor: requireHoldActor(repoRoot, opts.actor) }));
144
+ }));
82
145
  root
83
146
  .command("clean")
84
147
  .description("Preview expired artifact deletion; pass --yes to delete.")
@@ -94,6 +157,12 @@ export function registerArtifactsCommand(program, emit, context) {
94
157
  });
95
158
  });
96
159
  }
160
+ function requireHoldActor(repoRoot, explicit) {
161
+ const actor = explicit ? { instance_id: explicit } : currentActor(repoRoot);
162
+ if (!actor)
163
+ throw new Error("hold operations require --actor or a current agent identity");
164
+ return actor;
165
+ }
97
166
  function currentActor(repoRoot) {
98
167
  const instanceId = resolveOwner();
99
168
  if (!instanceId)
@@ -125,9 +194,11 @@ function summarize(rows) {
125
194
  }
126
195
  return {
127
196
  total: rows.length,
197
+ bytes: rows.reduce((sum, row) => sum + (row.bytes ?? 0), 0),
128
198
  classifications,
129
199
  would_delete: rows.filter((row) => row.action === "would-delete").length,
130
200
  deleted: rows.filter((row) => row.action === "deleted").length,
201
+ would_delete_bytes: rows.reduce((sum, row) => sum + (row.action === "would-delete" ? (row.bytes ?? 0) : 0), 0),
131
202
  };
132
203
  }
133
204
  function run(emit, fn) {
@@ -1,4 +1,4 @@
1
1
  import type { Command } from "commander";
2
- import type { EmitContext } from "../commander.js";
3
- export declare function registerBrowseAiCommand(program: Command, emitParam: EmitContext): void;
2
+ import type { EmitContext, HarneryProgramContext } from "../commander.js";
3
+ export declare function registerBrowseAiCommand(program: Command, emitParam: EmitContext, context?: HarneryProgramContext): void;
4
4
  //# sourceMappingURL=browse-ai.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browse-ai.d.ts","sourceRoot":"","sources":["../../src/commands/browse-ai.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAiDnD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CA2CtF"}
1
+ {"version":3,"file":"browse-ai.d.ts","sourceRoot":"","sources":["../../src/commands/browse-ai.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAiD1E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CA2CN"}
@@ -1,7 +1,7 @@
1
1
  import { homedir } from "node:os";
2
2
  import { resolve } from "node:path";
3
3
  import { AgentBrowser } from "../lib/agent-browser/index.js";
4
- import { CookieJar } from "../lib/cookies/index.js";
4
+ import { applyExtraCookies, CookieJar } from "../lib/cookies/index.js";
5
5
  // Module-scoped emit assigned by registerBrowseAiCommand. Same pattern as
6
6
  // cookies/read/browse: helper functions close over `emit` so action
7
7
  // callbacks stay concise.
@@ -25,7 +25,7 @@ let emit;
25
25
  * works on the other modulo path differences.
26
26
  */
27
27
  const DEFAULT_STORE = resolve(homedir(), ".cache", "harnery", "cookies.json");
28
- export function registerBrowseAiCommand(program, emitParam) {
28
+ export function registerBrowseAiCommand(program, emitParam, context) {
29
29
  emit = emitParam;
30
30
  program
31
31
  .command("browse-ai <url>")
@@ -50,7 +50,7 @@ export function registerBrowseAiCommand(program, emitParam) {
50
50
  .option("--timeout <ms>", "Per-step timeout in ms", "60000")
51
51
  .action((url, opts) => {
52
52
  try {
53
- runBrowseAi(url, opts);
53
+ runBrowseAi(url, opts, context);
54
54
  }
55
55
  catch (err) {
56
56
  const msg = err instanceof Error ? err.message : String(err);
@@ -59,10 +59,12 @@ export function registerBrowseAiCommand(program, emitParam) {
59
59
  }
60
60
  });
61
61
  }
62
- function runBrowseAi(url, opts) {
62
+ function runBrowseAi(url, opts, context) {
63
63
  const jar = opts.cookies === false
64
64
  ? null
65
65
  : new CookieJar({ path: opts.store ?? DEFAULT_STORE, source: "harn-browse-ai" });
66
+ if (jar)
67
+ applyExtraCookies(url, jar, context?.extraCookies);
66
68
  const ab = new AgentBrowser({
67
69
  jar,
68
70
  timeoutMs: Number.parseInt(opts.timeout, 10),
@@ -1 +1 @@
1
- {"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAgO1E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,OAAO,SAAmB,GACzB,IAAI,CA+cN"}
1
+ {"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA8P1E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,OAAO,SAAmB,GACzB,IAAI,CA+fN"}