@apralabs/apra-fleet 0.4.0 → 0.4.2

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 (548) hide show
  1. package/README.md +159 -13
  2. package/dist/agents/backlog-groomer.md +31 -19
  3. package/dist/agents/ci-watcher.md +16 -1
  4. package/dist/agents/deployer.md +37 -47
  5. package/dist/agents/doer.md +147 -114
  6. package/dist/agents/harvester.md +41 -34
  7. package/dist/agents/integ-test-runner.md +98 -114
  8. package/dist/agents/kb-reconciler.md +205 -0
  9. package/dist/agents/plan-reviewer.md +45 -44
  10. package/dist/agents/planner.md +121 -50
  11. package/dist/agents/regression-test-runner.md +84 -81
  12. package/dist/agents/reviewer.md +118 -44
  13. package/dist/agents/schemas/doer-output.json +63 -3
  14. package/dist/agents/schemas/harvester-output.json +59 -2
  15. package/dist/agents/schemas/integ-test-runner-output.json +3 -3
  16. package/dist/agents/schemas/kb-reconciler-output.json +87 -0
  17. package/dist/agents/schemas/planner-output.json +65 -0
  18. package/dist/agents/schemas/regression-test-runner-output.json +4 -17
  19. package/dist/agents/schemas/reviewer-output.json +105 -8
  20. package/dist/cli/auth.d.ts.map +1 -1
  21. package/dist/cli/auth.js +1 -2
  22. package/dist/cli/auth.js.map +1 -1
  23. package/dist/cli/config.d.ts +3 -3
  24. package/dist/cli/config.d.ts.map +1 -1
  25. package/dist/cli/config.js +4 -13
  26. package/dist/cli/config.js.map +1 -1
  27. package/dist/cli/install.d.ts +1 -0
  28. package/dist/cli/install.d.ts.map +1 -1
  29. package/dist/cli/install.js +141 -44
  30. package/dist/cli/install.js.map +1 -1
  31. package/dist/cli/join.js +1 -1
  32. package/dist/cli/join.js.map +1 -1
  33. package/dist/cli/kb-commit.d.ts +12 -0
  34. package/dist/cli/kb-commit.d.ts.map +1 -0
  35. package/dist/cli/kb-commit.js +53 -0
  36. package/dist/cli/kb-commit.js.map +1 -0
  37. package/dist/cli/kb-directives.d.ts +17 -0
  38. package/dist/cli/kb-directives.d.ts.map +1 -0
  39. package/dist/cli/kb-directives.js +146 -0
  40. package/dist/cli/kb-directives.js.map +1 -0
  41. package/dist/cli/kb-import.d.ts +13 -0
  42. package/dist/cli/kb-import.d.ts.map +1 -0
  43. package/dist/cli/kb-import.js +56 -0
  44. package/dist/cli/kb-import.js.map +1 -0
  45. package/dist/cli/register-member.js +1 -1
  46. package/dist/cli/start.d.ts.map +1 -1
  47. package/dist/cli/start.js +7 -0
  48. package/dist/cli/start.js.map +1 -1
  49. package/dist/cli/uninstall.d.ts.map +1 -1
  50. package/dist/cli/uninstall.js +16 -3
  51. package/dist/cli/uninstall.js.map +1 -1
  52. package/dist/cli/watch.d.ts +76 -4
  53. package/dist/cli/watch.d.ts.map +1 -1
  54. package/dist/cli/watch.js +150 -17
  55. package/dist/cli/watch.js.map +1 -1
  56. package/dist/commands/kb-server.d.ts +8 -0
  57. package/dist/commands/kb-server.d.ts.map +1 -0
  58. package/dist/commands/kb-server.js +221 -0
  59. package/dist/commands/kb-server.js.map +1 -0
  60. package/dist/index.js +77 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/os/git-bash-candidates.d.ts +35 -0
  63. package/dist/os/git-bash-candidates.d.ts.map +1 -0
  64. package/dist/os/git-bash-candidates.js +46 -0
  65. package/dist/os/git-bash-candidates.js.map +1 -0
  66. package/dist/os/index.d.ts +13 -4
  67. package/dist/os/index.d.ts.map +1 -1
  68. package/dist/os/index.js +17 -2
  69. package/dist/os/index.js.map +1 -1
  70. package/dist/os/linux.d.ts +1 -0
  71. package/dist/os/linux.d.ts.map +1 -1
  72. package/dist/os/linux.js +19 -2
  73. package/dist/os/linux.js.map +1 -1
  74. package/dist/os/os-commands.d.ts +12 -0
  75. package/dist/os/os-commands.d.ts.map +1 -1
  76. package/dist/os/os-commands.js.map +1 -1
  77. package/dist/os/windows-gitbash.d.ts +93 -0
  78. package/dist/os/windows-gitbash.d.ts.map +1 -0
  79. package/dist/os/windows-gitbash.js +244 -0
  80. package/dist/os/windows-gitbash.js.map +1 -0
  81. package/dist/os/windows.d.ts +35 -0
  82. package/dist/os/windows.d.ts.map +1 -1
  83. package/dist/os/windows.js +93 -35
  84. package/dist/os/windows.js.map +1 -1
  85. package/dist/providers/agy.d.ts +15 -3
  86. package/dist/providers/agy.d.ts.map +1 -1
  87. package/dist/providers/agy.js +145 -11
  88. package/dist/providers/agy.js.map +1 -1
  89. package/dist/providers/claude.d.ts +14 -3
  90. package/dist/providers/claude.d.ts.map +1 -1
  91. package/dist/providers/claude.js +69 -22
  92. package/dist/providers/claude.js.map +1 -1
  93. package/dist/providers/codex.d.ts +14 -3
  94. package/dist/providers/codex.d.ts.map +1 -1
  95. package/dist/providers/codex.js +34 -8
  96. package/dist/providers/codex.js.map +1 -1
  97. package/dist/providers/copilot.d.ts +14 -3
  98. package/dist/providers/copilot.d.ts.map +1 -1
  99. package/dist/providers/copilot.js +33 -8
  100. package/dist/providers/copilot.js.map +1 -1
  101. package/dist/providers/email/headers.d.ts +15 -0
  102. package/dist/providers/email/headers.d.ts.map +1 -0
  103. package/dist/providers/email/headers.js +42 -0
  104. package/dist/providers/email/headers.js.map +1 -0
  105. package/dist/providers/email/index.d.ts +18 -0
  106. package/dist/providers/email/index.d.ts.map +1 -0
  107. package/dist/providers/email/index.js +60 -0
  108. package/dist/providers/email/index.js.map +1 -0
  109. package/dist/providers/email/provider.d.ts +49 -0
  110. package/dist/providers/email/provider.d.ts.map +1 -0
  111. package/dist/providers/email/provider.js +2 -0
  112. package/dist/providers/email/provider.js.map +1 -0
  113. package/dist/providers/email/sendgrid.d.ts +12 -0
  114. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  115. package/dist/providers/email/sendgrid.js +67 -0
  116. package/dist/providers/email/sendgrid.js.map +1 -0
  117. package/dist/providers/email/smtp.d.ts +65 -0
  118. package/dist/providers/email/smtp.d.ts.map +1 -0
  119. package/dist/providers/email/smtp.js +373 -0
  120. package/dist/providers/email/smtp.js.map +1 -0
  121. package/dist/providers/index.d.ts +0 -1
  122. package/dist/providers/index.d.ts.map +1 -1
  123. package/dist/providers/index.js +0 -3
  124. package/dist/providers/index.js.map +1 -1
  125. package/dist/providers/none.d.ts +14 -3
  126. package/dist/providers/none.d.ts.map +1 -1
  127. package/dist/providers/none.js +26 -2
  128. package/dist/providers/none.js.map +1 -1
  129. package/dist/providers/opencode.d.ts +14 -3
  130. package/dist/providers/opencode.d.ts.map +1 -1
  131. package/dist/providers/opencode.js +60 -6
  132. package/dist/providers/opencode.js.map +1 -1
  133. package/dist/providers/provider.d.ts +91 -5
  134. package/dist/providers/provider.d.ts.map +1 -1
  135. package/dist/providers/provider.js +45 -1
  136. package/dist/providers/provider.js.map +1 -1
  137. package/dist/services/agent-provisioner.d.ts.map +1 -1
  138. package/dist/services/agent-provisioner.js +5 -8
  139. package/dist/services/agent-provisioner.js.map +1 -1
  140. package/dist/services/cloud/activity.js +2 -2
  141. package/dist/services/cloud/activity.js.map +1 -1
  142. package/dist/services/cloud/lifecycle.d.ts.map +1 -1
  143. package/dist/services/cloud/lifecycle.js +3 -0
  144. package/dist/services/cloud/lifecycle.js.map +1 -1
  145. package/dist/services/cloud/task-wrapper.d.ts +18 -0
  146. package/dist/services/cloud/task-wrapper.d.ts.map +1 -1
  147. package/dist/services/cloud/task-wrapper.js +157 -0
  148. package/dist/services/cloud/task-wrapper.js.map +1 -1
  149. package/dist/services/context-admission.d.ts.map +1 -1
  150. package/dist/services/context-admission.js +9 -7
  151. package/dist/services/context-admission.js.map +1 -1
  152. package/dist/services/credential-cleanup.d.ts.map +1 -1
  153. package/dist/services/credential-cleanup.js +22 -3
  154. package/dist/services/credential-cleanup.js.map +1 -1
  155. package/dist/services/github-app.d.ts.map +1 -1
  156. package/dist/services/github-app.js +11 -2
  157. package/dist/services/github-app.js.map +1 -1
  158. package/dist/services/knowledge/audn.d.ts +37 -0
  159. package/dist/services/knowledge/audn.d.ts.map +1 -0
  160. package/dist/services/knowledge/audn.js +219 -0
  161. package/dist/services/knowledge/audn.js.map +1 -0
  162. package/dist/services/knowledge/file-hash.d.ts +11 -0
  163. package/dist/services/knowledge/file-hash.d.ts.map +1 -0
  164. package/dist/services/knowledge/file-hash.js +123 -0
  165. package/dist/services/knowledge/file-hash.js.map +1 -0
  166. package/dist/services/knowledge/http-provider.d.ts +46 -0
  167. package/dist/services/knowledge/http-provider.d.ts.map +1 -0
  168. package/dist/services/knowledge/http-provider.js +254 -0
  169. package/dist/services/knowledge/http-provider.js.map +1 -0
  170. package/dist/services/knowledge/kb-providers.d.ts +15 -0
  171. package/dist/services/knowledge/kb-providers.d.ts.map +1 -0
  172. package/dist/services/knowledge/kb-providers.js +92 -0
  173. package/dist/services/knowledge/kb-providers.js.map +1 -0
  174. package/dist/services/knowledge/kb-scope-input.d.ts +5 -0
  175. package/dist/services/knowledge/kb-scope-input.d.ts.map +1 -0
  176. package/dist/services/knowledge/kb-scope-input.js +11 -0
  177. package/dist/services/knowledge/kb-scope-input.js.map +1 -0
  178. package/dist/services/knowledge/kb-service.d.ts +3 -0
  179. package/dist/services/knowledge/kb-service.d.ts.map +1 -0
  180. package/dist/services/knowledge/kb-service.js +2 -0
  181. package/dist/services/knowledge/kb-service.js.map +1 -0
  182. package/dist/services/knowledge/path-validation.d.ts +2 -0
  183. package/dist/services/knowledge/path-validation.d.ts.map +1 -0
  184. package/dist/services/knowledge/path-validation.js +13 -0
  185. package/dist/services/knowledge/path-validation.js.map +1 -0
  186. package/dist/services/knowledge/pre-init.d.ts +14 -0
  187. package/dist/services/knowledge/pre-init.d.ts.map +1 -0
  188. package/dist/services/knowledge/pre-init.js +147 -0
  189. package/dist/services/knowledge/pre-init.js.map +1 -0
  190. package/dist/services/knowledge/project-slug.d.ts +2 -0
  191. package/dist/services/knowledge/project-slug.d.ts.map +1 -0
  192. package/dist/services/knowledge/project-slug.js +49 -0
  193. package/dist/services/knowledge/project-slug.js.map +1 -0
  194. package/dist/services/knowledge/sqlite-provider.d.ts +147 -0
  195. package/dist/services/knowledge/sqlite-provider.d.ts.map +1 -0
  196. package/dist/services/knowledge/sqlite-provider.js +1646 -0
  197. package/dist/services/knowledge/sqlite-provider.js.map +1 -0
  198. package/dist/services/knowledge/types.d.ts +163 -0
  199. package/dist/services/knowledge/types.d.ts.map +1 -0
  200. package/dist/services/knowledge/types.js +9 -0
  201. package/dist/services/knowledge/types.js.map +1 -0
  202. package/dist/services/member-home.d.ts +89 -0
  203. package/dist/services/member-home.d.ts.map +1 -0
  204. package/dist/services/member-home.js +259 -0
  205. package/dist/services/member-home.js.map +1 -0
  206. package/dist/services/member-remote-url.d.ts +34 -0
  207. package/dist/services/member-remote-url.d.ts.map +1 -0
  208. package/dist/services/member-remote-url.js +39 -0
  209. package/dist/services/member-remote-url.js.map +1 -0
  210. package/dist/services/model-pricing.d.ts.map +1 -1
  211. package/dist/services/model-pricing.js +0 -5
  212. package/dist/services/model-pricing.js.map +1 -1
  213. package/dist/services/orphan-recovery.d.ts +9 -3
  214. package/dist/services/orphan-recovery.d.ts.map +1 -1
  215. package/dist/services/orphan-recovery.js +22 -8
  216. package/dist/services/orphan-recovery.js.map +1 -1
  217. package/dist/services/preflight-check.d.ts +56 -0
  218. package/dist/services/preflight-check.d.ts.map +1 -0
  219. package/dist/services/preflight-check.js +277 -0
  220. package/dist/services/preflight-check.js.map +1 -0
  221. package/dist/services/shell-probe.d.ts +131 -0
  222. package/dist/services/shell-probe.d.ts.map +1 -0
  223. package/dist/services/shell-probe.js +210 -0
  224. package/dist/services/shell-probe.js.map +1 -0
  225. package/dist/services/singleton.d.ts +2 -0
  226. package/dist/services/singleton.d.ts.map +1 -1
  227. package/dist/services/singleton.js +1 -1
  228. package/dist/services/singleton.js.map +1 -1
  229. package/dist/services/ssh.js +2 -2
  230. package/dist/services/ssh.js.map +1 -1
  231. package/dist/services/stall/find-log-file.d.ts.map +1 -1
  232. package/dist/services/stall/find-log-file.js +22 -16
  233. package/dist/services/stall/find-log-file.js.map +1 -1
  234. package/dist/services/stall/log-path-resolver.d.ts +11 -8
  235. package/dist/services/stall/log-path-resolver.d.ts.map +1 -1
  236. package/dist/services/stall/log-path-resolver.js +17 -40
  237. package/dist/services/stall/log-path-resolver.js.map +1 -1
  238. package/dist/services/stall/read-log-tail.d.ts.map +1 -1
  239. package/dist/services/stall/read-log-tail.js +6 -5
  240. package/dist/services/stall/read-log-tail.js.map +1 -1
  241. package/dist/services/stall/stall-detector.d.ts +32 -0
  242. package/dist/services/stall/stall-detector.d.ts.map +1 -1
  243. package/dist/services/stall/stall-detector.js +149 -6
  244. package/dist/services/stall/stall-detector.js.map +1 -1
  245. package/dist/services/stall/stall-poller.d.ts +34 -0
  246. package/dist/services/stall/stall-poller.d.ts.map +1 -1
  247. package/dist/services/stall/stall-poller.js +160 -35
  248. package/dist/services/stall/stall-poller.js.map +1 -1
  249. package/dist/services/strategy.d.ts +9 -0
  250. package/dist/services/strategy.d.ts.map +1 -1
  251. package/dist/services/strategy.js +41 -7
  252. package/dist/services/strategy.js.map +1 -1
  253. package/dist/services/tool-registry.d.ts.map +1 -1
  254. package/dist/services/tool-registry.js +87 -1
  255. package/dist/services/tool-registry.js.map +1 -1
  256. package/dist/services/user-config.js +1 -1
  257. package/dist/services/user-config.js.map +1 -1
  258. package/dist/services/vcs/azure-devops.d.ts +1 -1
  259. package/dist/services/vcs/azure-devops.d.ts.map +1 -1
  260. package/dist/services/vcs/azure-devops.js +105 -10
  261. package/dist/services/vcs/azure-devops.js.map +1 -1
  262. package/dist/services/vcs/bitbucket.d.ts.map +1 -1
  263. package/dist/services/vcs/bitbucket.js +16 -0
  264. package/dist/services/vcs/bitbucket.js.map +1 -1
  265. package/dist/services/vcs/github.d.ts.map +1 -1
  266. package/dist/services/vcs/github.js +56 -1
  267. package/dist/services/vcs/github.js.map +1 -1
  268. package/dist/services/vcs/types.d.ts +123 -2
  269. package/dist/services/vcs/types.d.ts.map +1 -1
  270. package/dist/services/version-check.d.ts +22 -0
  271. package/dist/services/version-check.d.ts.map +1 -0
  272. package/dist/services/version-check.js +103 -0
  273. package/dist/services/version-check.js.map +1 -0
  274. package/dist/skills/fleet-sprint-cli/SKILL.md +15 -3
  275. package/dist/skills/pm/SKILL.md +0 -1
  276. package/dist/skills/pm/beads.md +6 -0
  277. package/dist/skills/pm/cost.md +0 -1
  278. package/dist/skills/pm/fleet-addendum.md +6 -1
  279. package/dist/skills/pm/index.md +56 -0
  280. package/dist/skills/pm/kb-reconcile.md +132 -0
  281. package/dist/skills/pm/kb-review.md +109 -0
  282. package/dist/tools/check-status.d.ts +47 -0
  283. package/dist/tools/check-status.d.ts.map +1 -1
  284. package/dist/tools/check-status.js +245 -3
  285. package/dist/tools/check-status.js.map +1 -1
  286. package/dist/tools/child-id-allocator.d.ts +2 -2
  287. package/dist/tools/cloud-control.js +2 -2
  288. package/dist/tools/cloud-control.js.map +1 -1
  289. package/dist/tools/code-intelligence-codebase-memory.d.ts +11 -0
  290. package/dist/tools/code-intelligence-codebase-memory.d.ts.map +1 -0
  291. package/dist/tools/code-intelligence-codebase-memory.js +270 -0
  292. package/dist/tools/code-intelligence-codebase-memory.js.map +1 -0
  293. package/dist/tools/code-intelligence-freshness.d.ts +2 -0
  294. package/dist/tools/code-intelligence-freshness.d.ts.map +1 -0
  295. package/dist/tools/code-intelligence-freshness.js +26 -0
  296. package/dist/tools/code-intelligence-freshness.js.map +1 -0
  297. package/dist/tools/code-intelligence-gitnexus.d.ts +14 -0
  298. package/dist/tools/code-intelligence-gitnexus.d.ts.map +1 -0
  299. package/dist/tools/code-intelligence-gitnexus.js +475 -0
  300. package/dist/tools/code-intelligence-gitnexus.js.map +1 -0
  301. package/dist/tools/code-intelligence-kb-enrich.d.ts +2 -0
  302. package/dist/tools/code-intelligence-kb-enrich.d.ts.map +1 -0
  303. package/dist/tools/code-intelligence-kb-enrich.js +65 -0
  304. package/dist/tools/code-intelligence-kb-enrich.js.map +1 -0
  305. package/dist/tools/code-intelligence-reindex.d.ts +7 -0
  306. package/dist/tools/code-intelligence-reindex.d.ts.map +1 -0
  307. package/dist/tools/code-intelligence-reindex.js +106 -0
  308. package/dist/tools/code-intelligence-reindex.js.map +1 -0
  309. package/dist/tools/code-intelligence-telemetry.d.ts +5 -0
  310. package/dist/tools/code-intelligence-telemetry.d.ts.map +1 -0
  311. package/dist/tools/code-intelligence-telemetry.js +52 -0
  312. package/dist/tools/code-intelligence-telemetry.js.map +1 -0
  313. package/dist/tools/code-intelligence-tests.d.ts +2 -0
  314. package/dist/tools/code-intelligence-tests.d.ts.map +1 -0
  315. package/dist/tools/code-intelligence-tests.js +24 -0
  316. package/dist/tools/code-intelligence-tests.js.map +1 -0
  317. package/dist/tools/code-intelligence.d.ts +114 -0
  318. package/dist/tools/code-intelligence.d.ts.map +1 -0
  319. package/dist/tools/code-intelligence.js +124 -0
  320. package/dist/tools/code-intelligence.js.map +1 -0
  321. package/dist/tools/compose-permissions.d.ts +26 -0
  322. package/dist/tools/compose-permissions.d.ts.map +1 -1
  323. package/dist/tools/compose-permissions.js +257 -33
  324. package/dist/tools/compose-permissions.js.map +1 -1
  325. package/dist/tools/execute-command.d.ts +2 -0
  326. package/dist/tools/execute-command.d.ts.map +1 -1
  327. package/dist/tools/execute-command.js +114 -28
  328. package/dist/tools/execute-command.js.map +1 -1
  329. package/dist/tools/execute-prompt.d.ts +13 -1
  330. package/dist/tools/execute-prompt.d.ts.map +1 -1
  331. package/dist/tools/execute-prompt.js +310 -61
  332. package/dist/tools/execute-prompt.js.map +1 -1
  333. package/dist/tools/kb-capture.d.ts +53 -0
  334. package/dist/tools/kb-capture.d.ts.map +1 -0
  335. package/dist/tools/kb-capture.js +130 -0
  336. package/dist/tools/kb-capture.js.map +1 -0
  337. package/dist/tools/kb-context.d.ts +17 -0
  338. package/dist/tools/kb-context.d.ts.map +1 -0
  339. package/dist/tools/kb-context.js +29 -0
  340. package/dist/tools/kb-context.js.map +1 -0
  341. package/dist/tools/kb-export.d.ts +19 -0
  342. package/dist/tools/kb-export.d.ts.map +1 -0
  343. package/dist/tools/kb-export.js +344 -0
  344. package/dist/tools/kb-export.js.map +1 -0
  345. package/dist/tools/kb-feedback.d.ts +23 -0
  346. package/dist/tools/kb-feedback.d.ts.map +1 -0
  347. package/dist/tools/kb-feedback.js +43 -0
  348. package/dist/tools/kb-feedback.js.map +1 -0
  349. package/dist/tools/kb-freshness-sweep.d.ts +14 -0
  350. package/dist/tools/kb-freshness-sweep.d.ts.map +1 -0
  351. package/dist/tools/kb-freshness-sweep.js +29 -0
  352. package/dist/tools/kb-freshness-sweep.js.map +1 -0
  353. package/dist/tools/kb-harvest.d.ts +20 -0
  354. package/dist/tools/kb-harvest.d.ts.map +1 -0
  355. package/dist/tools/kb-harvest.js +143 -0
  356. package/dist/tools/kb-harvest.js.map +1 -0
  357. package/dist/tools/kb-import.d.ts +44 -0
  358. package/dist/tools/kb-import.d.ts.map +1 -0
  359. package/dist/tools/kb-import.js +239 -0
  360. package/dist/tools/kb-import.js.map +1 -0
  361. package/dist/tools/kb-invalidate.d.ts +19 -0
  362. package/dist/tools/kb-invalidate.d.ts.map +1 -0
  363. package/dist/tools/kb-invalidate.js +34 -0
  364. package/dist/tools/kb-invalidate.js.map +1 -0
  365. package/dist/tools/kb-list.d.ts +32 -0
  366. package/dist/tools/kb-list.d.ts.map +1 -0
  367. package/dist/tools/kb-list.js +43 -0
  368. package/dist/tools/kb-list.js.map +1 -0
  369. package/dist/tools/kb-promote.d.ts +20 -0
  370. package/dist/tools/kb-promote.d.ts.map +1 -0
  371. package/dist/tools/kb-promote.js +20 -0
  372. package/dist/tools/kb-promote.js.map +1 -0
  373. package/dist/tools/kb-query.d.ts +35 -0
  374. package/dist/tools/kb-query.d.ts.map +1 -0
  375. package/dist/tools/kb-query.js +111 -0
  376. package/dist/tools/kb-query.js.map +1 -0
  377. package/dist/tools/kb-reconcile-prefilter.d.ts +14 -0
  378. package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -0
  379. package/dist/tools/kb-reconcile-prefilter.js +26 -0
  380. package/dist/tools/kb-reconcile-prefilter.js.map +1 -0
  381. package/dist/tools/kb-resolve-contradiction.d.ts +23 -0
  382. package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -0
  383. package/dist/tools/kb-resolve-contradiction.js +37 -0
  384. package/dist/tools/kb-resolve-contradiction.js.map +1 -0
  385. package/dist/tools/kb-session-prime.d.ts +26 -0
  386. package/dist/tools/kb-session-prime.d.ts.map +1 -0
  387. package/dist/tools/kb-session-prime.js +392 -0
  388. package/dist/tools/kb-session-prime.js.map +1 -0
  389. package/dist/tools/kb-setup.d.ts +20 -0
  390. package/dist/tools/kb-setup.d.ts.map +1 -0
  391. package/dist/tools/kb-setup.js +49 -0
  392. package/dist/tools/kb-setup.js.map +1 -0
  393. package/dist/tools/kb-stats.d.ts +20 -0
  394. package/dist/tools/kb-stats.d.ts.map +1 -0
  395. package/dist/tools/kb-stats.js +115 -0
  396. package/dist/tools/kb-stats.js.map +1 -0
  397. package/dist/tools/list-members.d.ts.map +1 -1
  398. package/dist/tools/list-members.js +6 -2
  399. package/dist/tools/list-members.js.map +1 -1
  400. package/dist/tools/member-detail.d.ts.map +1 -1
  401. package/dist/tools/member-detail.js +13 -3
  402. package/dist/tools/member-detail.js.map +1 -1
  403. package/dist/tools/member-reservation.d.ts.map +1 -1
  404. package/dist/tools/member-reservation.js +13 -1
  405. package/dist/tools/member-reservation.js.map +1 -1
  406. package/dist/tools/monitor-task.d.ts.map +1 -1
  407. package/dist/tools/monitor-task.js +38 -5
  408. package/dist/tools/monitor-task.js.map +1 -1
  409. package/dist/tools/provision-auth.d.ts.map +1 -1
  410. package/dist/tools/provision-auth.js +15 -8
  411. package/dist/tools/provision-auth.js.map +1 -1
  412. package/dist/tools/provision-vcs-auth.d.ts +5 -2
  413. package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
  414. package/dist/tools/provision-vcs-auth.js +58 -52
  415. package/dist/tools/provision-vcs-auth.js.map +1 -1
  416. package/dist/tools/register-member.d.ts +21 -12
  417. package/dist/tools/register-member.d.ts.map +1 -1
  418. package/dist/tools/register-member.js +70 -3
  419. package/dist/tools/register-member.js.map +1 -1
  420. package/dist/tools/remove-member.d.ts.map +1 -1
  421. package/dist/tools/remove-member.js +19 -5
  422. package/dist/tools/remove-member.js.map +1 -1
  423. package/dist/tools/report-status.d.ts.map +1 -1
  424. package/dist/tools/report-status.js +2 -1
  425. package/dist/tools/report-status.js.map +1 -1
  426. package/dist/tools/revoke-vcs-auth.js +2 -2
  427. package/dist/tools/revoke-vcs-auth.js.map +1 -1
  428. package/dist/tools/send-email.d.ts +69 -0
  429. package/dist/tools/send-email.d.ts.map +1 -0
  430. package/dist/tools/send-email.js +177 -0
  431. package/dist/tools/send-email.js.map +1 -0
  432. package/dist/tools/setup-ssh-key.d.ts.map +1 -1
  433. package/dist/tools/setup-ssh-key.js +4 -1
  434. package/dist/tools/setup-ssh-key.js.map +1 -1
  435. package/dist/tools/stop-prompt.js +2 -2
  436. package/dist/tools/stop-prompt.js.map +1 -1
  437. package/dist/tools/update-agent-cli.js +2 -2
  438. package/dist/tools/update-agent-cli.js.map +1 -1
  439. package/dist/tools/update-member.d.ts +21 -12
  440. package/dist/tools/update-member.d.ts.map +1 -1
  441. package/dist/tools/update-member.js +43 -2
  442. package/dist/tools/update-member.js.map +1 -1
  443. package/dist/types.d.ts +12 -1
  444. package/dist/types.d.ts.map +1 -1
  445. package/dist/utils/agent-helpers.d.ts +36 -0
  446. package/dist/utils/agent-helpers.d.ts.map +1 -1
  447. package/dist/utils/agent-helpers.js +39 -1
  448. package/dist/utils/agent-helpers.js.map +1 -1
  449. package/dist/utils/platform.d.ts +7 -0
  450. package/dist/utils/platform.d.ts.map +1 -1
  451. package/dist/utils/platform.js +11 -1
  452. package/dist/utils/platform.js.map +1 -1
  453. package/dist/utils/prompt-errors.js +1 -1
  454. package/dist/utils/prompt-errors.js.map +1 -1
  455. package/dist/utils/session-caller.d.ts +28 -0
  456. package/dist/utils/session-caller.d.ts.map +1 -0
  457. package/dist/utils/session-caller.js +24 -0
  458. package/dist/utils/session-caller.js.map +1 -0
  459. package/dist/utils/work-folder-validation.d.ts +39 -0
  460. package/dist/utils/work-folder-validation.d.ts.map +1 -0
  461. package/dist/utils/work-folder-validation.js +60 -0
  462. package/dist/utils/work-folder-validation.js.map +1 -0
  463. package/dist/utils/workspace-trust.d.ts.map +1 -1
  464. package/dist/utils/workspace-trust.js +5 -1
  465. package/dist/utils/workspace-trust.js.map +1 -1
  466. package/dist/workflows/auto-sprint.js +550 -23
  467. package/package.json +7 -4
  468. package/packages/apra-fleet-client/src/client/api.mjs +210 -7
  469. package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +31 -19
  470. package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +16 -1
  471. package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -47
  472. package/packages/apra-fleet-se/apra-pm/agents/doer.md +147 -114
  473. package/packages/apra-fleet-se/apra-pm/agents/harvester.md +41 -34
  474. package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +98 -114
  475. package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +205 -0
  476. package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +45 -44
  477. package/packages/apra-fleet-se/apra-pm/agents/planner.md +121 -50
  478. package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +84 -81
  479. package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +118 -44
  480. package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +63 -3
  481. package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +59 -2
  482. package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +3 -3
  483. package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -0
  484. package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +65 -0
  485. package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
  486. package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +105 -8
  487. package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +0 -1
  488. package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +6 -0
  489. package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -1
  490. package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +6 -1
  491. package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +56 -0
  492. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +132 -0
  493. package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +109 -0
  494. package/packages/apra-fleet-se/bin/cli.mjs +139 -3
  495. package/packages/apra-fleet-se/bin/serve.mjs +49 -2
  496. package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +182 -38
  497. package/packages/apra-fleet-se/fleet-sprint/docs/README.md +23 -8
  498. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +258 -0
  499. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1487 -0
  500. package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -0
  501. package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +399 -0
  502. package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
  503. package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +1148 -0
  504. package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +229 -112
  505. package/packages/apra-fleet-se/fleet-sprint/errors.mjs +91 -6
  506. package/packages/apra-fleet-se/fleet-sprint/runner.js +2469 -238
  507. package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
  508. package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +154 -0
  509. package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
  510. package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
  511. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +15 -3
  512. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
  513. package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
  514. package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +51 -0
  515. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +657 -12
  516. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
  517. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +60 -30
  518. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +205 -2
  519. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +164 -0
  520. package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +141 -26
  521. package/packages/apra-fleet-se/package.json +1 -0
  522. package/packages/apra-fleet-workflow/src/viewer/index.mjs +294 -14
  523. package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
  524. package/packages/apra-fleet-workflow/src/workflow/index.mjs +443 -35
  525. package/skills/fleet/SKILL.md +20 -9
  526. package/skills/fleet/auth-azdevops.md +44 -5
  527. package/skills/fleet/auth-bitbucket.md +3 -3
  528. package/skills/fleet/auth-github.md +2 -2
  529. package/skills/fleet/beads-conflict-resolution.md +141 -0
  530. package/skills/fleet/beads.md +16 -12
  531. package/skills/fleet/knowledge-agent.md +66 -0
  532. package/skills/fleet/onboarding.md +4 -4
  533. package/skills/fleet/permissions.md +32 -8
  534. package/skills/fleet/profiles/base-dev.json +10 -1
  535. package/skills/fleet/profiles/base-reviewer.json +8 -1
  536. package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
  537. package/skills/fleet/skill-matrix.md +1 -1
  538. package/skills/fleet/troubleshooting.md +2 -1
  539. package/version.json +1 -1
  540. package/dist/providers/gemini.d.ts +0 -42
  541. package/dist/providers/gemini.d.ts.map +0 -1
  542. package/dist/providers/gemini.js +0 -202
  543. package/dist/providers/gemini.js.map +0 -1
  544. package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -151
  545. package/packages/apra-fleet-se/fleet-sprint/docs/dolt-tier2-runbook.md +0 -127
  546. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-path-b.mjs +0 -339
  547. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-tier2.mjs +0 -360
  548. package/packages/apra-fleet-se/fleet-sprint/dolt-recovery.mjs +0 -363
@@ -48,45 +48,46 @@
48
48
  * purpose-based API incrementally; they are IMPLEMENTATION DETAIL of the three
49
49
  * entry points above, not a second supported surface.
50
50
  *
51
- * RECOVERY-LADDER DISPOSITION (apra-fleet-417.2.1 AC3; EXECUTED by
52
- * apra-fleet-vkc.1)
51
+ * CONFLICT-RECOVERY DISPOSITION (docs/dolt-sync-redesign.md Parts 2.2/2.4)
53
52
  * -------------------------------------------------------------------------
54
- * Decision: WIRE, not decommission -- and, as of apra-fleet-vkc.1, DONE.
55
- * dolt-recovery.mjs (Path A: gated allowlist resolve-in-place),
56
- * dolt-recovery-path-b.mjs (Path B: discard-and-re-bootstrap from the shared
57
- * remote) and dolt-recovery-tier2.mjs (Tier 2: agent escalation against
58
- * docs/dolt-tier2-runbook.md) were previously imported only by their own
59
- * tests -- doltPushAfter()'s diverged path threw DoltDivergedError with no
60
- * recovery attempt. They are NOT decommissioned because the failure they
61
- * handle is real and was sprint-fatal: a wedged beads clone stops the whole
62
- * sprint, and the ladder is the only written-down remedy for it.
63
- *
64
- * How it is wired (apra-fleet-vkc.1): dolt-recovery-tier2.mjs now exports
65
- * buildDoltRecoveryLadder(member, opts), the ONE place the three paths are
66
- * composed into a single zero-argument callback. doltPushAfter() accepts that
67
- * callback as `opts.recover` and invokes it at its divergence terminal -- the
68
- * single place a divergence outlives the bounded first-successful-pusher-wins
69
- * reconcile -- logging each tier's outcome and surfacing the DoltDivergedError
70
- * (-> BEADS_SYNC_CONFLICT) only if the whole ladder fails. runner.js's
71
- * post-dispatch sync bracket (syncMemberAfterOrdered) builds the callback and
72
- * threads it through DoltSync.syncAfter(), so every one of runner.js's D-push
73
- * call sites inherits recovery without opting in. DoltSync.repair() runs the
74
- * same ladder (capabilities().supportsRepair is now true).
75
- *
76
- * Kept unchanged on purpose: with NO `recover` callback wired, doltPushAfter()
77
- * behaves exactly as before (DoltDivergedError propagates immediately), so the
53
+ * The old 3-tier ladder (dolt-recovery.mjs Path A, dolt-recovery-path-b.mjs
54
+ * Path B, dolt-recovery-tier2.mjs Tier 2 + docs/dolt-tier2-runbook.md) is
55
+ * RETIRED, not merely rewired. In production it could never resolve anything:
56
+ * Path A threw its precondition guard on every invocation (no sql runtime was
57
+ * ever injected at its call site), Path B was hard-disabled for a correct
58
+ * reason, and Tier 2 only DISPATCHED an LLM -- it never verified, so
59
+ * recoverDoltConflict() returned `ok: false` by construction, 100% of the
60
+ * time. Worse, its teardown was an instruction step an agent could abandon
61
+ * mid-procedure (apra-fleet-5mqg).
62
+ *
63
+ * It is replaced by ONE deterministic function: settleDoltConflicts()
64
+ * (fleet-sprint/dolt-settle.mjs), total over every row-level conflict shape
65
+ * this data model can produce -- no gates, no allowlist, no escalation, no
66
+ * LLM -- with a real `finally` teardown. This module holds it as
67
+ * `opts.settle`: a zero-argument callback (buildSettleCallback(), same file)
68
+ * that RESOLVES on a verified recovery, because settle itself republishes and
69
+ * verifies before returning.
70
+ *
71
+ * Where it is wired -- BOTH divergence terminals, not just the push side:
72
+ * - doltPushAfter()'s terminal, where a divergence outlives the bounded
73
+ * first-successful-pusher-wins reconcile (where the ladder used to sit).
74
+ * - doltPullBefore()'s diverged terminal, which had NO recovery at all: a
75
+ * clone wedged by an earlier failed reconcile used to hard-abort the next
76
+ * sprint at the readiness gate (preflightBeadsHealthGate delegates here,
77
+ * so it inherits the same self-heal).
78
+ * - repair(), the operator/tool entry point -- same one implementation.
79
+ *
80
+ * Kept unchanged on purpose: with NO `settle` callback wired, both brackets
81
+ * behave exactly as before (the typed error propagates immediately), so the
78
82
  * degraded-by-default path (apra-fleet-417.3.1) and every existing call site
79
- * keep their pre-vkc.1 semantics. Path A additionally requires an injected
80
- * sql()/spawnSqlServer() runtime; runner.js does not yet supply one, so in
81
- * production Path A is reached and cleanly self-defers to Path B (no silent
82
- * dead module) until such a runtime is injected -- see buildDoltRecoveryLadder.
83
+ * keep their prior semantics.
83
84
  *
84
85
  * ASCII only.
85
86
  */
86
87
 
87
88
  import { DoltDivergedError, DoltSyncError } from './errors.mjs';
88
89
  import { classifyFailure, toDoltVerdict } from './vcs-module.mjs';
89
- import { buildDoltRecoveryLadder } from './dolt-recovery-tier2.mjs';
90
+ import { buildSettleCallback } from './dolt-settle.mjs';
90
91
 
91
92
  // ---------------------------------------------------------------------------
92
93
  // Dolt sync brackets: D-pull / D-push
@@ -226,8 +227,30 @@ export async function isMemberSyncRemoteConfigured(member, opts) {
226
227
  // instant re-issue -- the previous code retried with zero delay, which turned
227
228
  // the bound into "fail twice as fast". Delay is attempt-indexed and capped, and
228
229
  // `sleep` is injectable so unit suites never actually wait.
230
+ //
231
+ // apra-fleet-ka1u follow-up: a live Windows machine-wide git.exe spawn outage
232
+ // (fork/exec ... "Not enough memory resources") was directly measured to last
233
+ // 1-3 MINUTES per occurrence (fleet supervisor log analysis), during which
234
+ // essentially every dolt-initiated git spawn fails -- not an isolated blip.
235
+ // The original 8s cap meant even 5 retries covered at most ~15s of backoff,
236
+ // structurally unable to span an outage an order of magnitude longer; the
237
+ // sprint kept dying with retries correctly firing but exhausted. Raised to
238
+ // 30s so a realistic retry budget (see maxTransientRetries below) can
239
+ // actually outlast one of these windows instead of just softening it.
229
240
  const DOLT_BACKOFF_BASE_MS = 500;
230
- const DOLT_BACKOFF_MAX_MS = 8000;
241
+ const DOLT_BACKOFF_MAX_MS = 30000;
242
+
243
+ // apra-fleet-jxdf.2: every `bd dolt pull`/`bd dolt push` this module issues
244
+ // used to inherit whatever generic default the injected command() primitive
245
+ // falls back to when no timeout is specified (120s, sized for an ordinary
246
+ // shell command, not a Dolt sync). A live incident confirmed an INCREMENTAL
247
+ // pull against an already-cloned, several-hundred-MB embedded Dolt DB can
248
+ // take multiple minutes -- an order of magnitude past that default -- and
249
+ // every one of those pulls was timing out, silently, every single time,
250
+ // with no fatal error surfaced and the caller left reading stale data. Size
251
+ // this for realistic Dolt DB sizes in this fleet, not a toy DB; callers that
252
+ // need a different budget can still override via opts.timeoutS.
253
+ const DOLT_STEP_TIMEOUT_S = 600;
231
254
 
232
255
  /**
233
256
  * Delay before transient retry #`attempt` (1-based): base * 2^(attempt-1),
@@ -238,6 +261,13 @@ const DOLT_BACKOFF_MAX_MS = 8000;
238
261
  * @param {number} [maxMs]
239
262
  * @returns {number}
240
263
  */
264
+ /** How often the push mutex's lease is renewed while this bracket holds it.
265
+ * Well under the supervisor mutex's 60s lease (src/supervisor/dolt-mutex.mjs
266
+ * DEFAULT_LEASE_MS), so a legitimately long hold -- push + reconcile +
267
+ * settle -- never loses mutual exclusion to reclaimExpired(). Design doc
268
+ * Part 3.4. */
269
+ export const DOLT_MUTEX_RENEW_INTERVAL_MS = 20_000;
270
+
241
271
  export function doltBackoffDelayMs(attempt, baseMs = DOLT_BACKOFF_BASE_MS, maxMs = DOLT_BACKOFF_MAX_MS) {
242
272
  const n = Math.max(1, Number(attempt) || 1);
243
273
  return Math.min(maxMs, baseMs * Math.pow(2, n - 1));
@@ -271,12 +301,12 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
271
301
  *
272
302
  * @returns {Promise<{ ok: boolean, output: string, error: string|null, kind?: 'no-remote'|'empty-remote'|'remote-unreachable'|'diverged'|'auth'|'transient'|'unknown' }>}
273
303
  */
274
- async function runDoltStep({ command, member, cmd, label, log, maxTransientRetries, onAuthFailure, sleep = defaultSleep, backoffBaseMs = DOLT_BACKOFF_BASE_MS }) {
304
+ async function runDoltStep({ command, member, cmd, label, log, maxTransientRetries, onAuthFailure, sleep = defaultSleep, backoffBaseMs = DOLT_BACKOFF_BASE_MS, timeoutS = DOLT_STEP_TIMEOUT_S }) {
275
305
  let attempt = 0;
276
306
  let authHealAttempted = false;
277
307
  // eslint-disable-next-line no-constant-condition
278
308
  while (true) {
279
- const res = await command(cmd, { member_name: member, silent: true, failSoft: true, label });
309
+ const res = await command(cmd, { member_name: member, silent: true, failSoft: true, label, timeout_s: timeoutS });
280
310
  if (res && res.ok) return res;
281
311
  const error = res ? res.error : 'unknown command failure';
282
312
  const kind = classifyDoltFailure(error);
@@ -294,11 +324,22 @@ async function runDoltStep({ command, member, cmd, label, log, maxTransientRetri
294
324
  await onAuthFailure({ member, label, cmd, error, kind: 'dolt' });
295
325
  } catch (healErr) {
296
326
  log(`[Dolt] self-heal for member '${member}' (${label}) failed; not retrying further: ${healErr.message}`);
327
+ log(`[Dolt] ${label} FAILED (${kind}) -- reads/writes for member '${member}' may be stale until this is resolved. Raw: ${error}`);
297
328
  return { ok: false, output: res ? res.output : '', error, kind };
298
329
  }
299
330
  log(`[Dolt] self-heal for member '${member}' (${label}) completed; retrying the failed dolt command once.`);
300
331
  continue;
301
332
  }
333
+ // apra-fleet-jxdf.2: every non-ok exit from this function used to be
334
+ // reported ONLY as a structured return value -- a caller on the
335
+ // fatal:false path (the common case, e.g. refreshView's documented
336
+ // "never throws" contract) could silently proceed on stale data with
337
+ // no trace of this failure anywhere in the sprint log. Log it loudly
338
+ // here, once, at the single choke point every D-pull/D-push passes
339
+ // through, so a degraded read/write is always visible to whoever is
340
+ // watching a live sprint -- independent of whether the caller treats
341
+ // it as fatal.
342
+ log(`[Dolt] ${label} FAILED (${kind}) -- reads/writes for member '${member}' may be stale until this is resolved. Raw: ${error}`);
302
343
  return { ok: false, output: res ? res.output : '', error, kind };
303
344
  }
304
345
  }
@@ -339,8 +380,42 @@ async function runDoltStep({ command, member, cmd, label, log, maxTransientRetri
339
380
  * @param {{ command: Function, log?: Function, maxTransientRetries?: number, checkSyncRemoteConfigured?: Function, skipPull?: boolean, onAuthFailure?: Function }} opts
340
381
  * @returns {Promise<{ ok: true, member: string, skipped?: true, reason?: 'no-remote'|'empty-remote'|'already-fresh' }>}
341
382
  */
383
+ /**
384
+ * Invoke the injected settle callback at a divergence terminal, if one is
385
+ * wired. Returns the settle result on a verified recovery, or null when there
386
+ * is no callback / settle itself failed -- in which case the caller surfaces
387
+ * its typed error exactly as it did before settle existed.
388
+ *
389
+ * A settle failure is an OPERATIONAL failure (no usable dolt binary, server
390
+ * would not start, a SQL statement errored), never "this conflict is
391
+ * unresolvable" -- there is no such outcome. It is logged and folded into the
392
+ * existing divergence terminal rather than being escalated anywhere.
393
+ *
394
+ * @param {{ settle?: Function, member: string, operation: string, error: Error, log: Function }} ctx
395
+ * @returns {Promise<object|null>}
396
+ */
397
+ async function attemptSettle({ settle, member, operation, error, log }) {
398
+ if (typeof settle !== 'function') return null;
399
+ log(`[Dolt] ${operation} for member '${member}' diverged; running settleDoltConflicts() (deterministic, no escalation) before surfacing BEADS_SYNC_CONFLICT.`);
400
+ let result = null;
401
+ try {
402
+ result = await settle({ operation, error });
403
+ } catch (settleErr) {
404
+ log(`[Dolt] settle itself failed operationally for member '${member}' (treated as unrecovered; this is an infra failure, NOT an unresolvable conflict): ${(settleErr && settleErr.message) || settleErr}`);
405
+ return null;
406
+ }
407
+ if (result && result.ok) {
408
+ const tables = (result.resolvedTables || []).join(', ') || 'none';
409
+ log(`[Dolt] settle RESOLVED the divergence for member '${member}' (tables: ${tables}) and republished; ${operation} reconciled.`);
410
+ for (const warning of result.warnings || []) log(`[Dolt] settle warning for member '${member}': ${warning}`);
411
+ return result;
412
+ }
413
+ log(`[Dolt] settle returned no verified recovery for member '${member}'; surfacing the divergence.`);
414
+ return null;
415
+ }
416
+
342
417
  export async function doltPullBefore(member, opts = {}) {
343
- const { command, log = () => {}, maxTransientRetries = 1, checkSyncRemoteConfigured, skipPull = false, onAuthFailure, sleep, backoffBaseMs } = opts;
418
+ const { command, log = () => {}, maxTransientRetries = 8, checkSyncRemoteConfigured, skipPull = false, onAuthFailure, sleep, backoffBaseMs, timeoutS, settle } = opts;
344
419
  if (typeof command !== 'function') {
345
420
  throw new Error("doltPullBefore requires an injected command() in opts");
346
421
  }
@@ -363,7 +438,7 @@ export async function doltPullBefore(member, opts = {}) {
363
438
 
364
439
  const pull = await runDoltStep({
365
440
  command, member, cmd: 'bd dolt pull',
366
- label: `D-pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
441
+ label: `D-pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
367
442
  });
368
443
  if (!pull.ok) {
369
444
  if (pull.kind === 'no-remote') {
@@ -379,10 +454,22 @@ export async function doltPullBefore(member, opts = {}) {
379
454
  return { ok: true, member, skipped: true, reason: 'empty-remote' };
380
455
  }
381
456
  if (pull.kind === 'diverged') {
382
- throw new DoltDivergedError(
457
+ // The pull-side divergence terminal. Before this was wired
458
+ // (docs/dolt-sync-redesign.md Part 2.3), a clone wedged by an
459
+ // earlier failed reconcile had NO recovery seam here at all and
460
+ // hard-aborted the next sprint at its readiness gate.
461
+ const diverged = new DoltDivergedError(
383
462
  `[Dolt] D-pull for member '${member}' hit an unmergeable beads conflict and must not be auto-resolved by judgment: ${pull.error}`,
384
463
  { member, doltOutput: pull.error, operation: 'pull' },
385
464
  );
465
+ const settled = await attemptSettle({ settle, member, operation: 'D-pull', error: diverged, log });
466
+ if (settled) {
467
+ // settle ends with its own `bd dolt pull` + `bd dolt push`, so
468
+ // a resolved settle means this clone is already current --
469
+ // there is nothing left for this bracket to pull.
470
+ return { ok: true, member, recovered: true, settledTables: settled.resolvedTables || [] };
471
+ }
472
+ throw diverged;
386
473
  }
387
474
  if (pull.kind === 'auth') {
388
475
  // apra-fleet-spp: a credential failure is its own class. It is NOT
@@ -531,18 +618,18 @@ export async function preflightBeadsHealthGate(member, opts = {}) {
531
618
  * (including the reconcile/re-push) -- see runDoltStep's AUTH SELF-HEAL
532
619
  * CONTRACT.
533
620
  *
534
- * `opts.recover` (apra-fleet-vkc.1) is the optional Path A -> Path B -> Tier 2
535
- * recovery ladder callback (buildDoltRecoveryLadder, dolt-recovery-tier2.mjs).
536
- * When present, a divergence that outlives the bounded reconcile attempts the
537
- * ladder before the DoltDivergedError is surfaced as BEADS_SYNC_CONFLICT; when
538
- * absent the divergence propagates immediately (pre-vkc.1 behavior).
621
+ * `opts.settle` is the optional deterministic conflict-settlement callback
622
+ * (buildSettleCallback, dolt-settle.mjs). When present, a divergence that
623
+ * outlives the bounded reconcile runs settle before the DoltDivergedError is
624
+ * surfaced as BEADS_SYNC_CONFLICT; when absent the divergence propagates
625
+ * immediately (pre-settle behavior).
539
626
  *
540
627
  * @param {string} member
541
- * @param {{ command: Function, pushBeads?: boolean, log?: Function, maxTransientRetries?: number, mutex?: { acquire: Function, release: Function }, sprintId?: string, checkSyncRemoteConfigured?: Function, onAuthFailure?: Function, recover?: () => Promise<{ ok: boolean, tier: string }> }} opts
542
- * @returns {Promise<{ ok: true, member: string, pushed: boolean, reconciled: boolean, skipped?: true, reason?: 'no-remote', recovered?: true, recoveryTier?: string }>}
628
+ * @param {{ command: Function, pushBeads?: boolean, log?: Function, maxTransientRetries?: number, mutex?: { acquire: Function, release: Function }, sprintId?: string, checkSyncRemoteConfigured?: Function, onAuthFailure?: Function, settle?: () => Promise<{ ok: boolean, resolvedTables?: string[] }> }} opts
629
+ * @returns {Promise<{ ok: true, member: string, pushed: boolean, reconciled: boolean, skipped?: true, reason?: 'no-remote', recovered?: true, settledTables?: string[] }>}
543
630
  */
544
631
  export async function doltPushAfter(member, opts = {}) {
545
- const { command, pushBeads = true, log = () => {}, maxTransientRetries = 1, mutex, sprintId, checkSyncRemoteConfigured, onAuthFailure, sleep, backoffBaseMs, recover } = opts;
632
+ const { command, pushBeads = true, log = () => {}, maxTransientRetries = 8, mutex, sprintId, checkSyncRemoteConfigured, onAuthFailure, sleep, backoffBaseMs, timeoutS, settle, renewIntervalMs = DOLT_MUTEX_RENEW_INTERVAL_MS } = opts;
546
633
  if (typeof command !== 'function') {
547
634
  throw new Error("doltPushAfter requires an injected command() in opts");
548
635
  }
@@ -559,20 +646,52 @@ export async function doltPushAfter(member, opts = {}) {
559
646
  // suppress a push that was already declared must not happen. The
560
647
  // failure-path downgrade below stays as defense in depth.
561
648
  const preGateCheckFn = checkSyncRemoteConfigured || isMemberSyncRemoteConfigured;
562
- if (!(await preGateCheckFn(member, { command, log }))) {
649
+ // apra-fleet-7h6n.5: cache the pre-gate's boolean result so the
650
+ // failure-path downgrade below (which used to re-invoke the same probe a
651
+ // second time in this call) can reuse it instead of re-probing. By the
652
+ // time the failure path runs, this pre-gate has already returned `true`
653
+ // (a `false` result exits right here), so reusing it there is
654
+ // behavior-preserving, not a new assumption.
655
+ const syncRemoteConfiguredAtPreGate = await preGateCheckFn(member, { command, log });
656
+ if (!syncRemoteConfiguredAtPreGate) {
563
657
  log(`[Dolt] D-push for member '${member}' skipped pre-attempt: bd-level sync.remote neutralized/absent -- no push command issued`);
564
658
  return { ok: true, member, pushed: false, reconciled: false, skipped: true, reason: 'no-remote' };
565
659
  }
566
660
 
567
661
  // Serialize this push behind the global mutex: acquire (waiting our FIFO
568
662
  // turn) before touching the remote; release on every exit.
663
+ //
664
+ // LEASE RENEWAL (docs/dolt-sync-redesign.md Part 3.4): the mutex lease is
665
+ // 60s and reclaimExpired() force-evicts at expiry EVEN IF the holder is
666
+ // alive. This bracket can legitimately outlive that -- a push, a reconcile
667
+ // pull, and now a full settle (ephemeral server spawn + merge + resolve +
668
+ // republish) -- so acquiring once and never renewing silently loses mutual
669
+ // exclusion mid-operation. Renew on an interval well under the lease while
670
+ // we hold it, and stop renewing in the same `finally` that releases.
569
671
  let grant = null;
570
672
  if (mutex && typeof mutex.acquire === 'function') {
571
673
  grant = await mutex.acquire(sprintId || member, { pid: process.pid });
572
674
  }
675
+ let renewTimer = null;
676
+ if (grant && mutex && typeof mutex.renew === 'function') {
677
+ renewTimer = setInterval(() => {
678
+ Promise.resolve()
679
+ .then(() => mutex.renew(grant.token))
680
+ .then((renewed) => {
681
+ if (renewed === false) {
682
+ log(`[Dolt] mutex lease renewal for member '${member}' was REFUSED (the lease was already reclaimed) -- another sprint may now hold the push mutex.`);
683
+ }
684
+ })
685
+ .catch((renewErr) => {
686
+ log(`[Dolt] mutex lease renewal for member '${member}' failed (non-fatal; the lease may expire): ${(renewErr && renewErr.message) || renewErr}`);
687
+ });
688
+ }, renewIntervalMs);
689
+ if (typeof renewTimer.unref === 'function') renewTimer.unref();
690
+ }
573
691
  try {
574
692
  return await doltPushGuarded();
575
693
  } finally {
694
+ if (renewTimer) clearInterval(renewTimer);
576
695
  if (grant && mutex && typeof mutex.release === 'function') {
577
696
  try {
578
697
  await mutex.release(grant.token);
@@ -582,35 +701,21 @@ export async function doltPushAfter(member, opts = {}) {
582
701
  }
583
702
  }
584
703
 
585
- // apra-fleet-vkc.1: the recovery ladder terminal. A divergence that
586
- // outlives the bounded first-successful-pusher-wins reconcile is exactly
587
- // the wedged-clone failure the Path A -> Path B -> Tier 2 ladder exists
588
- // for. When an `opts.recover` ladder callback is wired (runner.js builds it
589
- // via buildDoltRecoveryLadder and threads it through DoltSync.syncAfter),
590
- // the diverged terminal attempts it -- logging each outcome -- and only
591
- // surfaces the DoltDivergedError (which runner.js classifies as the
592
- // terminal BEADS_SYNC_CONFLICT) if the whole ladder fails to close the
593
- // clone. With no recover callback wired the behavior is unchanged: the
594
- // DoltDivergedError propagates immediately, so every existing call site and
595
- // the degraded-by-default path keep their pre-vkc.1 semantics.
704
+ // The push-side divergence terminal. A divergence that outlives the
705
+ // bounded first-successful-pusher-wins reconcile is exactly the
706
+ // wedged-clone failure settleDoltConflicts() exists for. When an
707
+ // `opts.settle` callback is wired (runner.js builds it via
708
+ // buildSettleCallback and threads it through DoltSync.syncAfter), this
709
+ // terminal runs it, and only surfaces the DoltDivergedError (which
710
+ // runner.js classifies as the terminal BEADS_SYNC_CONFLICT) if settle
711
+ // itself failed operationally. Unlike the retired Tier 2, a settle that
712
+ // resolves IS a verified recovery: it republishes and verifies the push
713
+ // before returning. With no settle callback wired the behavior is
714
+ // unchanged: the DoltDivergedError propagates immediately.
596
715
  async function surfaceDivergence(divergedError, operation) {
597
- if (typeof recover === 'function') {
598
- log(`[Dolt] D-push for member '${member}' diverged (${operation}); attempting the recovery ladder (Path A -> Path B -> Tier 2) before surfacing BEADS_SYNC_CONFLICT.`);
599
- let ladder = null;
600
- try {
601
- ladder = await recover({ operation, error: divergedError });
602
- } catch (recErr) {
603
- log(`[Dolt] recovery ladder itself threw for member '${member}' (treated as unrecovered): ${(recErr && recErr.message) || recErr}`);
604
- }
605
- if (ladder && ladder.ok) {
606
- log(`[Dolt] recovery ladder RESOLVED the divergence for member '${member}' at tier '${ladder.tier}' -- D-push reconciled.`);
607
- return { ok: true, member, pushed: true, reconciled: true, recovered: true, recoveryTier: ladder.tier };
608
- }
609
- log(
610
- `[Dolt] recovery ladder did NOT resolve the divergence for member '${member}'` +
611
- `${ladder ? ` (last tier '${ladder.tier}'${ladder.escalated ? ', escalated to Tier 2' : ''})` : ' (no ladder result)'}; ` +
612
- 'surfacing DoltDivergedError -> BEADS_SYNC_CONFLICT.',
613
- );
716
+ const settled = await attemptSettle({ settle, member, operation: `D-push (${operation})`, error: divergedError, log });
717
+ if (settled) {
718
+ return { ok: true, member, pushed: true, reconciled: true, recovered: true, settledTables: settled.resolvedTables || [] };
614
719
  }
615
720
  throw divergedError;
616
721
  }
@@ -618,7 +723,7 @@ export async function doltPushAfter(member, opts = {}) {
618
723
  async function doltPushGuarded() {
619
724
  let push = await runDoltStep({
620
725
  command, member, cmd: 'bd dolt push',
621
- label: `D-push for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
726
+ label: `D-push for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
622
727
  });
623
728
  if (push.ok) {
624
729
  return { ok: true, member, pushed: true, reconciled: false };
@@ -637,8 +742,11 @@ export async function doltPushAfter(member, opts = {}) {
637
742
  // misclassify a neutralized-sandbox failure as 'unknown'). An
638
743
  // absent sync.remote means nothing is supposed to be pushed from this
639
744
  // clone, so the failure is the same benign no-remote skip.
640
- const checkFn = checkSyncRemoteConfigured || isMemberSyncRemoteConfigured;
641
- const syncRemoteConfigured = await checkFn(member, { command, log });
745
+ // apra-fleet-7h6n.5: reuse the pre-gate's cached probe result instead
746
+ // of re-invoking checkSyncRemoteConfigured/isMemberSyncRemoteConfigured
747
+ // a second time -- see the pre-gate's comment above for why this is
748
+ // always `true` by the time this failure path is reachable.
749
+ const syncRemoteConfigured = syncRemoteConfiguredAtPreGate;
642
750
  if (!syncRemoteConfigured) {
643
751
  log(`[Dolt] D-push for member '${member}' skipped: no dolt remote configured (bd-level sync.remote neutralized/absent; push failure treated as benign: ${push.error})`);
644
752
  return { ok: true, member, pushed: false, reconciled: false, skipped: true, reason: 'no-remote' };
@@ -673,7 +781,7 @@ export async function doltPushAfter(member, opts = {}) {
673
781
  log(`[Dolt] D-push for member '${member}' was rejected (another writer pushed first); reconciling with a single D-pull then one re-push (first-successful-pusher-wins).`);
674
782
  const reconcile = await runDoltStep({
675
783
  command, member, cmd: 'bd dolt pull',
676
- label: `D-push reconcile pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
784
+ label: `D-push reconcile pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
677
785
  });
678
786
  if (!reconcile.ok) {
679
787
  if (reconcile.kind === 'diverged') {
@@ -693,7 +801,7 @@ export async function doltPushAfter(member, opts = {}) {
693
801
 
694
802
  push = await runDoltStep({
695
803
  command, member, cmd: 'bd dolt push',
696
- label: `D-push re-push after reconcile for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
804
+ label: `D-push re-push after reconcile for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
697
805
  });
698
806
  if (push.ok) {
699
807
  return { ok: true, member, pushed: true, reconciled: true };
@@ -882,10 +990,10 @@ export function toNeutralDegradedKind(kind) {
882
990
  * adapter: declares which neutral degraded.kind values this backend can ever
883
991
  * produce, plus the booleans callers use instead of assuming Dolt semantics.
884
992
  *
885
- * `supportsRepair: true` (apra-fleet-vkc.1) reflects that `repair()` below now
886
- * runs the real Path A -> Path B -> Tier 2 recovery ladder
887
- * (buildDoltRecoveryLadder, dolt-recovery-tier2.mjs) rather than being a named
888
- * seam only -- see the RECOVERY-LADDER DISPOSITION note in this file's header.
993
+ * `supportsRepair: true` reflects that `repair()` below runs the real
994
+ * deterministic settle (settleDoltConflicts, dolt-settle.mjs) rather than
995
+ * being a named seam only -- see the CONFLICT-RECOVERY DISPOSITION note in
996
+ * this file's header.
889
997
  *
890
998
  * @returns {{ wholeStatePublish: boolean, supportsRepair: boolean, supportsCoordinationLock: boolean, kinds: string[] }}
891
999
  */
@@ -1018,7 +1126,9 @@ async function runDegradable(run, ctx) {
1018
1126
  *
1019
1127
  * All other opts are passed through unchanged to doltPullBefore():
1020
1128
  * `command` (required), `log`, `maxTransientRetries`, `onAuthFailure`,
1021
- * `checkSyncRemoteConfigured`, `sleep`, `backoffBaseMs`.
1129
+ * `checkSyncRemoteConfigured`, `sleep`, `backoffBaseMs`, `timeoutS` (defaults
1130
+ * to DOLT_STEP_TIMEOUT_S -- override only for a call site with a known-
1131
+ * different Dolt DB size/latency profile).
1022
1132
  *
1023
1133
  * @param {string} member
1024
1134
  * @param {{ command: Function, readinessGate?: boolean, fatal?: boolean, onDegraded?: Function, log?: Function, maxTransientRetries?: number, checkSyncRemoteConfigured?: Function, skipRefresh?: boolean, onAuthFailure?: Function, sleep?: Function, backoffBaseMs?: number }} opts
@@ -1070,10 +1180,9 @@ export async function syncBefore(member, opts = {}) {
1070
1180
  * `fatal: true` at a call site that must still hard-abort (the post-dispatch
1071
1181
  * sync bracket does, so an unreachable close can never be advertised).
1072
1182
  *
1073
- * This is the seam the recovery ladder is wired behind (apra-fleet-vkc.1): an
1074
- * `opts.recover` ladder callback is passed straight through to doltPushAfter(),
1075
- * whose divergence terminal invokes it -- see the RECOVERY-LADDER DISPOSITION
1076
- * note in the module header.
1183
+ * This is the seam settle is wired behind: an `opts.settle` callback is passed
1184
+ * straight through to doltPushAfter(), whose divergence terminal invokes it --
1185
+ * see the CONFLICT-RECOVERY DISPOSITION note in the module header.
1077
1186
  *
1078
1187
  * `opts.mutatedItemIds` (ADR Decision 2/3, apra-fleet-417.5) is accepted per
1079
1188
  * the TaskDBModule contract but INTENTIONALLY NOT CONSUMED by this adapter:
@@ -1194,38 +1303,46 @@ export function flush(filter = {}) {
1194
1303
  * credential re-provisioning. Called by operators/tools and by ensureReady();
1195
1304
  * never inline from a per-operation sync path."
1196
1305
  *
1197
- * WIRED (apra-fleet-vkc.1): runs the real Path A -> Path B -> Tier 2 recovery
1198
- * ladder (buildDoltRecoveryLadder, dolt-recovery-tier2.mjs) against a wedged
1199
- * beads clone and reports whether it was repaired. This is the operator/tool
1200
- * entry point onto the SAME ladder doltPushAfter()'s divergence terminal
1201
- * invokes -- one composed implementation, two callers -- so a manual repair
1202
- * and an automatic one behave identically. `command` is required (every
1203
- * recovery path issues `bd dolt` commands through it); the Path A sql runtime
1204
- * and the Tier 2 `agent` are optional (see buildDoltRecoveryLadder for how
1205
- * each path degrades when its dependency is absent).
1306
+ * WIRED: runs the real deterministic settle (settleDoltConflicts,
1307
+ * dolt-settle.mjs) against a wedged beads clone and reports whether it was
1308
+ * repaired. This is the operator/tool entry point onto the SAME function both
1309
+ * divergence terminals invoke -- one implementation, three callers -- so a
1310
+ * manual repair and an automatic one behave identically. `command` is
1311
+ * required (settle issues every `bd dolt`/`dolt` command through it);
1312
+ * `platform`/`arch` are optional and probed from the member when absent.
1313
+ * `opts.settle` may be supplied to override the callback (tests do this).
1314
+ *
1315
+ * `opts.shell` threads the member's REGISTERED shell into dolt-settle
1316
+ * (apra-fleet-7dir.16/.24) the same way every other buildSettleCallback call
1317
+ * site does -- omitted (defaulting to '', the PowerShell dialect on
1318
+ * Windows) is the pre-shell-aware behavior, not a regression, for any
1319
+ * caller that has not resolved it.
1206
1320
  *
1207
1321
  * @param {string} member
1208
- * @param {{ command?: Function, log?: Function, agent?: Function, [key: string]: any }} [opts]
1209
- * @returns {Promise<{ repaired: boolean, tier?: string, escalation?: string, result?: object }>}
1322
+ * @param {{ command?: Function, log?: Function, platform?: string, arch?: string, shell?: string, settle?: Function, [key: string]: any }} [opts]
1323
+ * @returns {Promise<{ repaired: boolean, escalation?: string, result?: object }>}
1210
1324
  */
1211
1325
  export async function repair(member, opts = {}) {
1212
- const { command, log = () => {} } = opts;
1326
+ const { command, log = () => {}, platform, arch, shell = '' } = opts;
1213
1327
  if (typeof command !== 'function') {
1214
- return { repaired: false, escalation: 'not-configured: repair() requires an injected command() to run the recovery ladder' };
1328
+ return { repaired: false, escalation: 'not-configured: repair() requires an injected command() to run settle' };
1329
+ }
1330
+ const settle = typeof opts.settle === 'function'
1331
+ ? opts.settle
1332
+ : buildSettleCallback(member, { command, log, platform, arch, shell });
1333
+ let result = null;
1334
+ try {
1335
+ result = await settle({ operation: 'repair' });
1336
+ } catch (err) {
1337
+ log(`[Dolt] repair() failed operationally for member '${member}' (an infra failure, NOT an unresolvable conflict): ${(err && err.message) || err}`);
1338
+ return { repaired: false, escalation: 'settle-operational-failure', result: { error: (err && err.message) || String(err) } };
1215
1339
  }
1216
- const ladder = buildDoltRecoveryLadder(member, opts);
1217
- const result = await ladder();
1218
1340
  if (result && result.ok) {
1219
- log(`[Dolt] repair() resolved member '${member}' via the recovery ladder at tier '${result.tier}'.`);
1220
- return { repaired: true, tier: result.tier, result };
1341
+ log(`[Dolt] repair() settled member '${member}' (tables: ${(result.resolvedTables || []).join(', ') || 'none'}).`);
1342
+ return { repaired: true, result };
1221
1343
  }
1222
- log(`[Dolt] repair() did NOT resolve member '${member}' (tier '${result && result.tier}'${result && result.escalated ? ', escalated to Tier 2' : ''}).`);
1223
- return {
1224
- repaired: false,
1225
- tier: result && result.tier,
1226
- escalation: result && result.escalated ? 'tier-2-dispatched' : 'unrecovered',
1227
- result,
1228
- };
1344
+ log(`[Dolt] repair() did NOT settle member '${member}'.`);
1345
+ return { repaired: false, escalation: 'unrecovered', result };
1229
1346
  }
1230
1347
 
1231
1348
  export const DoltSync = {