@wardby/cli 0.5.3 → 0.6.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 (370) hide show
  1. package/.env.example +33 -0
  2. package/README.md +25 -14
  3. package/dist/claude-coding-worker/context.d.ts +22 -0
  4. package/dist/claude-coding-worker/context.js +92 -0
  5. package/dist/claude-coding-worker/driver.d.ts +7 -1
  6. package/dist/claude-coding-worker/driver.js +38 -5
  7. package/dist/claude-coding-worker/sdk.js +13 -4
  8. package/dist/cli-help.d.ts +1 -1
  9. package/dist/cli-help.js +5 -2
  10. package/dist/cli-native-mode.d.ts +9 -0
  11. package/dist/cli-native-mode.js +20 -0
  12. package/dist/cli.d.ts +3 -1
  13. package/dist/cli.js +141 -5
  14. package/dist/coding/claude-context.d.ts +45 -0
  15. package/dist/coding/claude-context.js +434 -0
  16. package/dist/coding/profile.d.ts +12 -0
  17. package/dist/coding/profile.js +6 -0
  18. package/dist/coding/protocol.d.ts +104 -0
  19. package/dist/coding/protocol.js +87 -3
  20. package/dist/coding-worker/artifact.d.ts +8 -0
  21. package/dist/coding-worker/artifact.js +2 -2
  22. package/dist/coding-worker/driver.js +2 -0
  23. package/dist/coding-worker/sdk.d.ts +6 -0
  24. package/dist/coding-worker/sdk.js +1 -0
  25. package/dist/coding-worker/skills.d.ts +23 -0
  26. package/dist/coding-worker/skills.js +117 -0
  27. package/dist/coding-worker/types.d.ts +2 -0
  28. package/dist/config/github-allowed-accounts.d.ts +15 -0
  29. package/dist/config/github-allowed-accounts.js +36 -0
  30. package/dist/config/low-power.d.ts +12 -0
  31. package/dist/config/low-power.js +18 -0
  32. package/dist/config/mobile.d.ts +12 -0
  33. package/dist/config/mobile.js +18 -0
  34. package/dist/config/providers.d.ts +53 -0
  35. package/dist/config/providers.js +92 -6
  36. package/dist/core/db.d.ts +16 -6
  37. package/dist/core/db.js +12 -10
  38. package/dist/core/dispatch.d.ts +11 -0
  39. package/dist/core/dispatch.js +36 -1
  40. package/dist/core/engine-native.js +9 -5
  41. package/dist/core/host-events.d.ts +49 -3
  42. package/dist/core/host-events.js +289 -15
  43. package/dist/core/issue-bridge.js +42 -2
  44. package/dist/core/issue-events.js +12 -1
  45. package/dist/core/issue-status.js +14 -3
  46. package/dist/core/merge-order-check.d.ts +129 -0
  47. package/dist/core/merge-order-check.js +336 -0
  48. package/dist/core/notification-dispatcher.d.ts +70 -0
  49. package/dist/core/notification-dispatcher.js +368 -0
  50. package/dist/core/notification-templates.d.ts +25 -0
  51. package/dist/core/notification-templates.js +105 -0
  52. package/dist/core/notifications.d.ts +10 -0
  53. package/dist/core/notifications.js +38 -0
  54. package/dist/core/pg-auth.d.ts +22 -0
  55. package/dist/core/pg-auth.js +152 -0
  56. package/dist/core/power-composition.d.ts +16 -0
  57. package/dist/core/power-composition.js +37 -0
  58. package/dist/core/power-idle.d.ts +14 -0
  59. package/dist/core/power-idle.js +30 -0
  60. package/dist/core/power.d.ts +71 -0
  61. package/dist/core/power.js +202 -0
  62. package/dist/core/reconciler.d.ts +4 -2
  63. package/dist/core/reconciler.js +29 -5
  64. package/dist/core/related-pull-requests.d.ts +48 -4
  65. package/dist/core/related-pull-requests.js +113 -11
  66. package/dist/core/repo-access.d.ts +15 -0
  67. package/dist/core/repo-access.js +66 -0
  68. package/dist/core/review-fix.d.ts +37 -0
  69. package/dist/core/review-fix.js +207 -6
  70. package/dist/core/review-host-tools.d.ts +20 -0
  71. package/dist/core/review-host-tools.js +58 -2
  72. package/dist/core/runner.d.ts +336 -3
  73. package/dist/core/runner.js +894 -317
  74. package/dist/core/secret-broker-config.d.ts +103 -0
  75. package/dist/core/secret-broker-config.js +112 -0
  76. package/dist/core/secrets.d.ts +39 -4
  77. package/dist/core/secrets.js +148 -40
  78. package/dist/core/workflow-event-recorder.d.ts +14 -0
  79. package/dist/core/workflow-event-recorder.js +120 -0
  80. package/dist/core/workflow-events.d.ts +82 -0
  81. package/dist/core/workflow-events.js +44 -0
  82. package/dist/core/workflow-run-events.d.ts +16 -0
  83. package/dist/core/workflow-run-events.js +40 -0
  84. package/dist/generated/prisma/browser.d.ts +58 -0
  85. package/dist/generated/prisma/client.d.ts +58 -0
  86. package/dist/generated/prisma/commonInputTypes.d.ts +150 -0
  87. package/dist/generated/prisma/enums.d.ts +27 -0
  88. package/dist/generated/prisma/enums.js +23 -0
  89. package/dist/generated/prisma/internal/class.d.ts +88 -0
  90. package/dist/generated/prisma/internal/class.js +4 -4
  91. package/dist/generated/prisma/internal/prismaNamespace.d.ts +772 -1
  92. package/dist/generated/prisma/internal/prismaNamespace.js +135 -4
  93. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +139 -0
  94. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +135 -4
  95. package/dist/generated/prisma/models/Agent.d.ts +360 -1
  96. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +73 -1
  97. package/dist/generated/prisma/models/CodingRun.d.ts +205 -1
  98. package/dist/generated/prisma/models/DeferredReview.d.ts +78 -1
  99. package/dist/generated/prisma/models/NativeGatewayCall.d.ts +1675 -0
  100. package/dist/generated/prisma/models/NativeGatewayCall.js +1 -0
  101. package/dist/generated/prisma/models/NativeGatewaySession.d.ts +1517 -0
  102. package/dist/generated/prisma/models/NativeGatewaySession.js +1 -0
  103. package/dist/generated/prisma/models/NativeWarmWorker.d.ts +1296 -0
  104. package/dist/generated/prisma/models/NativeWarmWorker.js +1 -0
  105. package/dist/generated/prisma/models/NotificationChannel.d.ts +1543 -0
  106. package/dist/generated/prisma/models/NotificationChannel.js +1 -0
  107. package/dist/generated/prisma/models/NotificationDelivery.d.ts +1502 -0
  108. package/dist/generated/prisma/models/NotificationDelivery.js +1 -0
  109. package/dist/generated/prisma/models/NotificationThread.d.ts +1090 -0
  110. package/dist/generated/prisma/models/NotificationThread.js +1 -0
  111. package/dist/generated/prisma/models/Run.d.ts +826 -1
  112. package/dist/generated/prisma/models/RunHostCheck.d.ts +36 -1
  113. package/dist/generated/prisma/models/Secret.d.ts +37 -1
  114. package/dist/generated/prisma/models/SecretBrokerChange.d.ts +1101 -0
  115. package/dist/generated/prisma/models/SecretBrokerChange.js +1 -0
  116. package/dist/generated/prisma/models/WorkflowEvent.d.ts +1422 -0
  117. package/dist/generated/prisma/models/WorkflowEvent.js +1 -0
  118. package/dist/generated/prisma/models.d.ts +8 -0
  119. package/dist/help/build.js +4 -2
  120. package/dist/help/catalog.d.ts +1 -1
  121. package/dist/help/catalog.js +31 -6
  122. package/dist/help-index.json +1363 -176
  123. package/dist/import/create.js +17 -0
  124. package/dist/import/neutral-schema.d.ts +6 -2
  125. package/dist/import/neutral-schema.js +2 -0
  126. package/dist/mcp/auth/access.d.ts +1 -0
  127. package/dist/mcp/auth/repo-authorization.js +14 -0
  128. package/dist/mcp/auth/resource-server.d.ts +2 -1
  129. package/dist/mcp/auth/resource-server.js +7 -2
  130. package/dist/mcp/auth/self-hosted/browser.d.ts +1 -1
  131. package/dist/mcp/auth/self-hosted/browser.js +19 -6
  132. package/dist/mcp/context.d.ts +6 -0
  133. package/dist/mcp/host-events/github-ingress.d.ts +23 -1
  134. package/dist/mcp/host-events/github-ingress.js +68 -0
  135. package/dist/mcp/index.d.ts +13 -0
  136. package/dist/mcp/index.js +59 -10
  137. package/dist/mcp/tools/agents.js +82 -11
  138. package/dist/mcp/tools/notification-channels.d.ts +2 -0
  139. package/dist/mcp/tools/notification-channels.js +293 -0
  140. package/dist/mcp/tools/power.d.ts +2 -0
  141. package/dist/mcp/tools/power.js +77 -0
  142. package/dist/mcp/tools/runs.d.ts +0 -6
  143. package/dist/mcp/tools/runs.js +7 -2
  144. package/dist/mcp/tools/secret-broker-compat.d.ts +12 -0
  145. package/dist/mcp/tools/secret-broker-compat.js +23 -0
  146. package/dist/mcp/tools/secret-elicitation-form.d.ts +22 -2
  147. package/dist/mcp/tools/secret-elicitation-form.js +200 -10
  148. package/dist/mcp/tools/secret-elicitation-server.js +8 -1
  149. package/dist/mcp/tools/secret-elicitation.d.ts +38 -3
  150. package/dist/mcp/tools/secret-elicitation.js +110 -12
  151. package/dist/mcp/tools/secrets.js +184 -7
  152. package/dist/mcp/tools/tools.d.ts +1 -1
  153. package/dist/mcp/tools/tools.js +22 -2
  154. package/dist/native-worker/composition.d.ts +23 -0
  155. package/dist/native-worker/composition.js +77 -0
  156. package/dist/native-worker/docker-isolation.d.ts +65 -0
  157. package/dist/native-worker/docker-isolation.js +183 -0
  158. package/dist/native-worker/docker-launcher.d.ts +74 -0
  159. package/dist/native-worker/docker-launcher.js +237 -0
  160. package/dist/native-worker/gateway-server.d.ts +39 -0
  161. package/dist/native-worker/gateway-server.js +315 -0
  162. package/dist/native-worker/gateway.d.ts +44 -0
  163. package/dist/native-worker/gateway.js +197 -0
  164. package/dist/native-worker/http-server.d.ts +22 -0
  165. package/dist/native-worker/http-server.js +109 -0
  166. package/dist/native-worker/http-transport.d.ts +17 -0
  167. package/dist/native-worker/http-transport.js +88 -0
  168. package/dist/native-worker/kubernetes-isolation.d.ts +90 -0
  169. package/dist/native-worker/kubernetes-isolation.js +218 -0
  170. package/dist/native-worker/kubernetes-launcher.d.ts +102 -0
  171. package/dist/native-worker/kubernetes-launcher.js +335 -0
  172. package/dist/native-worker/launch.d.ts +45 -0
  173. package/dist/native-worker/launch.js +44 -0
  174. package/dist/native-worker/ledger.d.ts +109 -0
  175. package/dist/native-worker/ledger.js +192 -0
  176. package/dist/native-worker/loopback.d.ts +12 -0
  177. package/dist/native-worker/loopback.js +49 -0
  178. package/dist/native-worker/main.d.ts +7 -0
  179. package/dist/native-worker/main.js +74 -0
  180. package/dist/native-worker/protocol.d.ts +744 -0
  181. package/dist/native-worker/protocol.js +200 -0
  182. package/dist/native-worker/sandbox-executor.d.ts +68 -0
  183. package/dist/native-worker/sandbox-executor.js +210 -0
  184. package/dist/native-worker/stdio.d.ts +29 -0
  185. package/dist/native-worker/stdio.js +188 -0
  186. package/dist/native-worker/warm-delivery.d.ts +16 -0
  187. package/dist/native-worker/warm-delivery.js +33 -0
  188. package/dist/native-worker/warm-pool-ledger.d.ts +39 -0
  189. package/dist/native-worker/warm-pool-ledger.js +73 -0
  190. package/dist/native-worker/warm-pool.d.ts +107 -0
  191. package/dist/native-worker/warm-pool.js +283 -0
  192. package/dist/native-worker/worker.d.ts +17 -0
  193. package/dist/native-worker/worker.js +115 -0
  194. package/dist/providers/auth/authorization-server.d.ts +3 -0
  195. package/dist/providers/auth/index.js +2 -0
  196. package/dist/providers/auth/self-hosted.d.ts +13 -1
  197. package/dist/providers/auth/self-hosted.js +54 -4
  198. package/dist/providers/chat/fake.d.ts +46 -0
  199. package/dist/providers/chat/fake.js +39 -0
  200. package/dist/providers/chat/index.d.ts +4 -0
  201. package/dist/providers/chat/index.js +8 -0
  202. package/dist/providers/chat/slack.d.ts +37 -0
  203. package/dist/providers/chat/slack.js +105 -0
  204. package/dist/providers/chat/types.d.ts +42 -0
  205. package/dist/providers/chat/types.js +19 -0
  206. package/dist/providers/engine/types.d.ts +19 -0
  207. package/dist/providers/engine/types.js +22 -0
  208. package/dist/providers/executor/composition.d.ts +24 -1
  209. package/dist/providers/executor/composition.js +39 -6
  210. package/dist/providers/executor/container.d.ts +24 -1
  211. package/dist/providers/executor/container.js +101 -11
  212. package/dist/providers/executor/dbos.d.ts +42 -0
  213. package/dist/providers/executor/dbos.js +118 -12
  214. package/dist/providers/executor/deferred.d.ts +56 -0
  215. package/dist/providers/executor/deferred.js +119 -0
  216. package/dist/providers/executor/routing.d.ts +37 -10
  217. package/dist/providers/executor/routing.js +73 -32
  218. package/dist/providers/executor/types.d.ts +12 -0
  219. package/dist/providers/jobs/docker.js +3 -3
  220. package/dist/providers/jobs/fake-kubernetes-api.d.ts +21 -2
  221. package/dist/providers/jobs/fake-kubernetes-api.js +42 -1
  222. package/dist/providers/jobs/kubernetes-api.d.ts +17 -1
  223. package/dist/providers/jobs/kubernetes-api.js +7 -0
  224. package/dist/providers/jobs/kubernetes-client.d.ts +10 -1
  225. package/dist/providers/jobs/kubernetes-client.js +52 -3
  226. package/dist/providers/jobs/kubernetes-dry-run-fixture.d.ts +6 -1
  227. package/dist/providers/jobs/kubernetes-dry-run-fixture.js +6 -3
  228. package/dist/providers/jobs/kubernetes-isolation.d.ts +3 -1
  229. package/dist/providers/jobs/kubernetes-isolation.js +6 -0
  230. package/dist/providers/jobs/kubernetes-platform.d.ts +4 -1
  231. package/dist/providers/jobs/kubernetes-platform.js +38 -1
  232. package/dist/providers/jobs/kubernetes-preflight.d.ts +2 -1
  233. package/dist/providers/jobs/kubernetes-preflight.js +4 -2
  234. package/dist/providers/jobs/kubernetes.d.ts +36 -1
  235. package/dist/providers/jobs/kubernetes.js +74 -4
  236. package/dist/providers/jobs/metadata-probes.d.ts +11 -0
  237. package/dist/providers/jobs/metadata-probes.js +13 -0
  238. package/dist/providers/jobs/types.d.ts +9 -0
  239. package/dist/providers/review-host/github.d.ts +11 -1
  240. package/dist/providers/review-host/github.js +50 -0
  241. package/dist/providers/review-host/types.d.ts +23 -0
  242. package/dist/providers/vcs/github.d.ts +32 -6
  243. package/dist/providers/vcs/github.js +74 -16
  244. package/dist/quickstart/coding-seed.d.ts +10 -3
  245. package/dist/quickstart/coding-seed.js +74 -3
  246. package/dist/quickstart/images.d.ts +2 -0
  247. package/dist/quickstart/images.js +7 -1
  248. package/dist/quickstart/reviewer-prompt.d.ts +1 -1
  249. package/dist/quickstart/reviewer-prompt.js +1 -1
  250. package/dist/quickstart-images.json +1 -1
  251. package/dist/sandbox/brokered-fetch.d.ts +23 -0
  252. package/dist/sandbox/brokered-fetch.js +37 -0
  253. package/dist/sandbox/host-functions.d.ts +34 -0
  254. package/dist/sandbox/host-functions.js +144 -80
  255. package/dist/sandbox/prelude.js +7 -1
  256. package/dist/sandbox/run-in-sandbox.d.ts +19 -0
  257. package/dist/sandbox/run-in-sandbox.js +28 -10
  258. package/dist/sandbox/safe-fetch.d.ts +2 -0
  259. package/dist/sandbox/safe-fetch.js +3 -1
  260. package/dist/sandbox/secret-broker-sigv4.d.ts +2 -0
  261. package/dist/sandbox/secret-broker-sigv4.js +49 -0
  262. package/dist/sandbox/secret-broker.d.ts +34 -0
  263. package/dist/sandbox/secret-broker.js +162 -0
  264. package/dist/sandbox/user-tool.d.ts +14 -0
  265. package/dist/sandbox/user-tool.js +32 -0
  266. package/dist/serve.js +18 -0
  267. package/dist/viewer/api-schema.d.ts +210 -14
  268. package/dist/viewer/api-schema.js +22 -0
  269. package/dist/viewer/build-schemas.js +4 -1
  270. package/dist/viewer/event-bus.d.ts +6 -0
  271. package/dist/viewer/event-bus.js +16 -7
  272. package/dist/viewer/graph.d.ts +5 -2
  273. package/dist/viewer/graph.js +7 -2
  274. package/dist/viewer/http.d.ts +0 -1
  275. package/dist/viewer/http.js +2 -2
  276. package/dist/viewer/infra.js +25 -2
  277. package/dist/viewer/limits.d.ts +4 -0
  278. package/dist/viewer/limits.js +4 -0
  279. package/dist/viewer/openapi.d.ts +15 -0
  280. package/dist/viewer/openapi.js +172 -0
  281. package/docs/README.md +7 -0
  282. package/docs/agent-recipes.md +57 -8
  283. package/docs/architecture-runtime.md +16 -1
  284. package/docs/code-review-agents.md +139 -5
  285. package/docs/coding-agent-setup.md +113 -5
  286. package/docs/coding-packages.md +4 -2
  287. package/docs/coding-services.md +3 -1
  288. package/docs/coding-worker-byo-images.md +198 -6
  289. package/docs/coding-worker-isolation.md +68 -14
  290. package/docs/getting-started-gke.md +225 -9
  291. package/docs/getting-started-identity-provider.md +21 -10
  292. package/docs/getting-started.md +5 -4
  293. package/docs/jira-agents.md +5 -1
  294. package/docs/native-sandbox.md +635 -0
  295. package/docs/release-verification.md +9 -0
  296. package/docs/security-deployment.md +113 -12
  297. package/docs/slack-notifications.md +252 -0
  298. package/docs/tool-secrets.md +252 -0
  299. package/docs/viewer-api.md +46 -5
  300. package/docs/viewer-api.openapi.yml +1404 -0
  301. package/help/admin-viewer.md +6 -2
  302. package/help/agent-recipes.md +27 -0
  303. package/help/architecture-agent.md +1 -1
  304. package/help/brokered-secrets.md +79 -0
  305. package/help/build-claude-code-image.md +131 -0
  306. package/help/build-worker-image.md +3 -6
  307. package/help/code-review-agents.md +68 -6
  308. package/help/deploy-gke.md +8 -1
  309. package/help/deployment-targets.md +25 -14
  310. package/help/errors/coding-provider-not-configured.md +2 -2
  311. package/help/errors/database-auth-invalid.md +28 -0
  312. package/help/errors/github-account-not-allowed.md +25 -0
  313. package/help/errors/low-power-disabled.md +29 -0
  314. package/help/errors/low-power-scale-forbidden.md +35 -0
  315. package/help/errors/low-power-wake-timeout.md +30 -0
  316. package/help/errors/mobile-disabled.md +31 -0
  317. package/help/errors/native-sandbox-capacity.md +22 -0
  318. package/help/errors/native-sandbox-deadline-exceeded.md +19 -0
  319. package/help/errors/native-sandbox-docker-failed.md +20 -0
  320. package/help/errors/native-sandbox-gateway-unavailable.md +21 -0
  321. package/help/errors/native-sandbox-image-not-pinned.md +19 -0
  322. package/help/errors/native-sandbox-isolation-mismatch.md +20 -0
  323. package/help/errors/native-sandbox-network-unenforced.md +22 -0
  324. package/help/errors/native-sandbox-requires-catalog.md +31 -0
  325. package/help/errors/native-sandbox-unavailable.md +19 -0
  326. package/help/errors/native-sandbox-warm-delivery-failed.md +21 -0
  327. package/help/errors/native-sandbox-worker-exited.md +20 -0
  328. package/help/errors/native-sandbox-worker-lost.md +20 -0
  329. package/help/errors/native-sandbox-worker-unready.md +22 -0
  330. package/help/errors/secret-broker-body-invalid.md +26 -0
  331. package/help/errors/secret-broker-changed.md +20 -0
  332. package/help/errors/secret-broker-config-invalid.md +30 -0
  333. package/help/errors/secret-broker-conflict.md +27 -0
  334. package/help/errors/secret-broker-destination-denied.md +28 -0
  335. package/help/errors/secret-broker-value-invalid.md +28 -0
  336. package/help/errors/secret-brokered.md +24 -0
  337. package/help/errors/secret-not-brokered.md +25 -0
  338. package/help/errors/slack-auth-failed.md +48 -0
  339. package/help/errors/slack-channel-unreachable.md +39 -0
  340. package/help/errors/slack-not-configured.md +33 -0
  341. package/help/getting-started.md +4 -5
  342. package/help/github.md +18 -1
  343. package/help/identity-and-access.md +5 -1
  344. package/help/local-repositories.md +2 -3
  345. package/help/low-power-mode.md +125 -0
  346. package/help/merge-order-check.md +117 -0
  347. package/help/mobile-app.md +54 -0
  348. package/help/native-sandbox.md +136 -0
  349. package/help/observability.md +8 -0
  350. package/help/related-pull-requests.md +70 -9
  351. package/help/repo-instructions-and-skills.md +91 -0
  352. package/help/review-fix-rounds.md +10 -0
  353. package/help/slack-notifications.md +62 -0
  354. package/help/troubleshooting/coding-workers.md +21 -0
  355. package/package.json +11 -4
  356. package/prisma/migrations/20261009000003_native_execution_mode/migration.sql +12 -0
  357. package/prisma/migrations/20261009000004_native_gateway_ledger/migration.sql +65 -0
  358. package/prisma/migrations/20261009000005_native_gateway_call_child_agent/migration.sql +5 -0
  359. package/prisma/migrations/20261009000006_run_deferred_start_stop/migration.sql +14 -0
  360. package/prisma/migrations/20261009000007_native_gateway_network_ready/migration.sql +5 -0
  361. package/prisma/migrations/20261010000001_workflow_notifications/migration.sql +99 -0
  362. package/prisma/migrations/20261011000001_native_gateway_session_status_index/migration.sql +2 -0
  363. package/prisma/migrations/20261012000001_native_warm_worker/migration.sql +32 -0
  364. package/prisma/migrations/20261013000001_coding_run_merge_order/migration.sql +2 -0
  365. package/prisma/migrations/20261013000001_secret_broker/migration.sql +17 -0
  366. package/prisma/migrations/20261013000002_deferred_review_request/migration.sql +4 -0
  367. package/prisma/migrations/20261014000000_repo_skills/migration.sql +15 -0
  368. package/prisma/migrations/20261015000001_coding_run_merge_order_index/migration.sql +2 -0
  369. package/prisma/migrations/20261015000002_no_change_rereview/migration.sql +2 -0
  370. package/prisma/schema.prisma +362 -91
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  id: related-pull-requests
3
3
  title: Related pull requests across repositories
4
- summary: Wardby lists the other pull requests from the same request in each pull request's description, with a suggested merge order.
4
+ summary: Wardby lists the other pull requests from the same request in each pull request's description, in the merge order the delegating agent set (mergeOrder) or else a suggested merge order.
5
5
  audience: operator
6
6
  tags: [github, pull-requests, multi-repo, merge-order, related, siblings, continuePriorRun, coding-agents, jira]
7
7
  appliesTo: ">=0.4.2"
@@ -14,7 +14,7 @@ agent that delegates to one coding agent per repository, or several runs for
14
14
  the same Jira issue — Wardby adds a **Related pull requests** section to each
15
15
  of those pull requests' descriptions. It lists the others with links and
16
16
  their state, names the originating issue when there is one, and gives a
17
- suggested merge order.
17
+ merge order: the one the delegating agent set, or else a suggested one.
18
18
 
19
19
  Without a tracked Jira issue, the list covers the pull requests opened by
20
20
  runs in the same delegation tree (the same lead run and everything it
@@ -30,13 +30,33 @@ included, plus that run tree's own siblings.
30
30
  section on every open pull request of the request with the full list and
31
31
  current states. A later run that pushes to any pull request in the set
32
32
  refreshes the section on all of them the same way, and never removes it.
33
- - **Suggested merge order (the order Wardby's agent opened them in)** numbers
34
- the open (and draft) pull requests in delegation order. It is not a
35
- dependency analysis — it is only reliable when the lead delegates
36
- repositories that own shared data first (see
33
+ With Wardby 0.6.0 or later, a reviewer linked to one of these pull requests does
34
+ not review it until that same lead run finishes, however it ends. When the
35
+ lead finishes normally the section has already been rewritten by then;
36
+ when it is ended another way, such as being cancelled, reviews start
37
+ without that rewrite, so reviewers should rely on `repo_pr_read`'s
38
+ `relatedPullRequests` either way — see [Reviewing a pull request a
39
+ delegated run
40
+ opened](code-review-agents.md#reviewing-a-pull-request-a-delegated-run-opened).
41
+ - **Merge order.** Without a `mergeOrder` (see below) on any pull request in
42
+ the set, open (and draft) pull requests are numbered as a **Suggested merge
43
+ order (the order Wardby's agent opened them in)** — delegation order, not a
44
+ dependency analysis, and only reliable when the lead delegates repositories
45
+ that own shared data first (see
37
46
  [Fanning out to several builders](../docs/agent-recipes.md#fanning-out-to-several-builders)).
38
- Check it before merging. Merged and closed pull requests follow in a
39
- separate "Already merged or closed" list, as context only.
47
+ When any pull request in the set has a `mergeOrder` (open, merged or
48
+ closed), the open ones that have one are numbered under **Merge order (set
49
+ by the delegating agent; equal steps can merge in either order)** and
50
+ labelled "step k of n" (equal values share a step and merge in either
51
+ order relative to each other), and any open pull request without one is
52
+ listed after under "Not ordered:". If only merged or closed pull requests
53
+ have a `mergeOrder`, every open one is listed under "Not ordered:" and the
54
+ "Merge order" heading is left out. Steps are counted over the whole set,
55
+ merged and closed pull requests included, so "step 2 of 3" keeps its label
56
+ after step 1 merges. Either way, check it before merging — neither is a
57
+ guarantee. Merged and closed pull requests follow in a separate "Already
58
+ merged or closed" list, as context only, with their step label when they
59
+ have one.
40
60
  - Only open pull requests that Wardby's own GitHub App opened are edited;
41
61
  merged or closed ones are listed but never changed, and a pull request
42
62
  from a different Wardby deployment sharing the same App is never touched.
@@ -49,9 +69,50 @@ included, plus that run tree's own siblings.
49
69
 
50
70
  Reviewers see the section in the pull request description, so a reviewer
51
71
  agent can tell that a field, route, or schema a change relies on is added by
52
- a sibling pull request rather than missing. See the reviewer step in
72
+ a sibling pull request rather than missing. Because the description is only
73
+ rewritten at the points above, a sibling opened (or merged, or closed) since
74
+ then can be missing from it or shown with an old state. With Wardby 0.6.0 or later,
75
+ `repo_pr_read`'s `relatedPullRequests` field lists the request's pull
76
+ requests fresh on every call instead, so a reviewer should prefer it over
77
+ the description's section when they disagree. Its entry for the pull request
78
+ just read always carries that pull request's live state; another entry
79
+ carries a state only when Wardby has one stored (pull requests linked to an
80
+ issue) and omits it otherwise, so call `repo_pr_read` on that pull request
81
+ for its live state. `relatedPullRequests` is empty for a pull request on a
82
+ local repository, which has no App-authored marker to resolve the request
83
+ from. See the
84
+ reviewer step in
53
85
  [Run GitHub code-review agents](code-review-agents.md#ci-and-sibling-pull-requests).
54
86
 
87
+ ## Setting a merge order
88
+
89
+ A lead agent sets the order explicitly by passing `mergeOrder` on its
90
+ `delegate_to_<name>` call to a coding sub-agent: an integer from 1 to 99,
91
+ where 1 merges first. Give a repository that other repositories' changes
92
+ depend on a lower number than the ones that use it — for example a shared
93
+ service `1`, the API that calls it `2`, the client that calls the API `3`.
94
+ Give two changes the same number when there is no order between them; they
95
+ share a step and either can merge first. A bad value (not an integer, or
96
+ outside 1-99) is refused as a tool error, not silently dropped or clamped.
97
+
98
+ Set it whenever one request's change spans several repositories and the
99
+ pull requests need to land in a specific sequence; leave it out and the set
100
+ keeps the delegation-order suggestion above. `mergeOrder` applies only to
101
+ coding sub-agents, since only a coding run's pull request can be ordered: a
102
+ native sub-agent ignores it, and its tool result notes that it did.
103
+
104
+ Each pull request shows the value most recently set for it, by the run that
105
+ opened it or a later continuation of it. A `continuePriorRun` call that
106
+ omits `mergeOrder` keeps that current value, so a follow-up does not need to
107
+ repeat it to keep a pull request in its place; one that sets `mergeOrder`
108
+ replaces it.
109
+
110
+ With Wardby 0.6.0 or later, once a set has more than one `mergeOrder`, each
111
+ open or draft pull request Wardby opened in it also gets a check run named
112
+ `wardby merge order`, tracking whether the pull requests it depends on have
113
+ merged yet. It's an informational check by default; search help for "merge
114
+ order check" for its states and for requiring it in branch protection.
115
+
55
116
  ## Follow-up runs and sibling pull requests
56
117
 
57
118
  When someone asks for a follow-up on one of these pull requests (an
@@ -0,0 +1,91 @@
1
+ ---
2
+ id: repo-instructions-and-skills
3
+ title: Repository instructions and skills in coding runs
4
+ summary: What AGENTS.md, CLAUDE.md, and repo skills a coding run loads, and how to turn repo skills off per agent with codingProfile.repoSkills.
5
+ audience: all
6
+ tags: [coding, skills, repoSkills, claudeBareMode, CLAUDE.md, AGENTS.md, SKILL.md, codex, claude-code]
7
+ appliesTo: ">=0.5.4"
8
+ ---
9
+
10
+ # Repository instructions and skills in coding runs
11
+
12
+ Every coding run loads the repository's own instructions, and by default
13
+ also loads whatever agent skills the repository ships. This is on for both
14
+ builders and cannot be turned off for instructions; skills can be turned off
15
+ per agent.
16
+
17
+ ## Repository instructions (always on)
18
+
19
+ | Builder | Gets |
20
+ | ----------- | --------------------------------------------------------------------------------- |
21
+ | Codex | `AGENTS.md`, read directly from the checkout |
22
+ | Claude Code | `CLAUDE.md`, `.claude/CLAUDE.md`, and their `@path` imports (up to 5 levels deep) |
23
+
24
+ A repository that only has `AGENTS.md` still gets it in Claude Code, through
25
+ a one-line `CLAUDE.md` wardby synthesizes for it. Subdirectory `CLAUDE.md`
26
+ files (anything other than the repository root and `.claude/CLAUDE.md`) are
27
+ not loaded unless an imported file pulls them in.
28
+
29
+ Claude Code's instructions and skills are bounded: at most 64 KiB per file,
30
+ 200 files, and 256 KiB combined; symlinks and non-UTF-8 files are refused. A
31
+ file that doesn't pass is left out of the run rather than failing it.
32
+ Repository settings, hooks, `.mcp.json`, agents, and commands are never sent
33
+ to Claude Code — only Markdown instruction files and
34
+ `.claude/skills/<name>/SKILL.md` files are allowed through, whatever an
35
+ instruction file imports.
36
+
37
+ Repository instructions and skills are untrusted guidance: they can shape a
38
+ run's work but never relax the worker's sandbox rules.
39
+
40
+ ## Repository skills
41
+
42
+ `codingProfile.repoSkills` loads the repository's own agent skills into a
43
+ run. It defaults to `true`, and the agent owner or an admin can set it with
44
+ `create_agent`/`update_agent`:
45
+
46
+ ```json
47
+ { "id": "<agent-id>", "codingProfile": { "repoSkills": false } }
48
+ ```
49
+
50
+ | Builder | Reads skills from | `repoSkills: false` |
51
+ | ----------- | ----------------------------------- | ---------------------------------- |
52
+ | Codex | `.agents/skills/`, `.codex/skills/` | Every repository skill is disabled |
53
+ | Claude Code | `.claude/skills/<name>/SKILL.md` | No skill context is collected |
54
+
55
+ Codex's own four built-in skills (`imagegen`, `openai-docs`, `skill-creator`,
56
+ `skill-installer`) are always disabled, whatever `repoSkills` is set to.
57
+
58
+ A Claude Code skill ships to the worker as its `SKILL.md` only; its other
59
+ files (scripts, references, data) stay in the repository checkout, read or
60
+ run through the command runner at `/workspace/.claude/skills/<name>/`.
61
+
62
+ ## Claude Code loading mode
63
+
64
+ `codingProfile.claudeBareMode` (Claude Code agents only, default `true`)
65
+ decides how Claude Code uses its repository instructions and skills:
66
+
67
+ - **`true` (default).** Claude Code's hardened bare mode stays on. Wardby
68
+ adds the repository's instruction files to the system prompt in full, and
69
+ lists each skill by name, description, and path; the model reads a
70
+ skill's full `SKILL.md` itself with `run_command`.
71
+ - **`false`.** Bare mode is off and Claude Code loads `CLAUDE.md` and skills
72
+ itself, through its native Skill tool, instead of reading them from the
73
+ system prompt.
74
+
75
+ Repository settings, hooks, MCP configuration, agents, and commands are
76
+ never loaded in either mode.
77
+
78
+ ```json
79
+ { "id": "<agent-id>", "codingProfile": { "claudeBareMode": false } }
80
+ ```
81
+
82
+ ## See also
83
+
84
+ - [Choose a native or coding agent](creating-agents.md) for `codingProfile`
85
+ basics and the other fields it accepts.
86
+ - [Bring-Your-Own Coding-Worker Images](../docs/coding-worker-byo-images.md)
87
+ — a custom `workerImageRef` image must be rebuilt for the current release. A
88
+ Codex agent's image built on an older driver base rejects
89
+ `repoSkills: false` and keeps offering Codex's built-in skills.
90
+ - [Build a tool runner image for a Claude Code agent](build-claude-code-image.md)
91
+ to give a Claude Code agent's commands the tools your project needs.
@@ -37,6 +37,16 @@ still running. Clicking **Re-run** on the review check isn't counted as a
37
37
  round itself; if the re-run's review requests changes, that starts a round
38
38
  like any other review.
39
39
 
40
+ With Wardby 0.6.0 or later, a round whose agent makes no change — it decided
41
+ the review's finding was wrong, rather than pushing a fix — doesn't leave the
42
+ failed review check standing with nothing to replace it: wardby starts one
43
+ fresh review of the pull request's unchanged head instead, run by the same
44
+ reviewer that requested the changes, with the round's own summary passed
45
+ along as untrusted context. This happens once per review that requested
46
+ changes and still counts as one of the round cap's rounds; if the cap has
47
+ already been reached, wardby posts the usual cap comment instead of
48
+ re-reviewing.
49
+
40
50
  Rounds are tracked with labels on the pull request:
41
51
 
42
52
  - `wardby-autofix-<N>` — one per round, added before that round's run
@@ -0,0 +1,62 @@
1
+ ---
2
+ id: slack-notifications
3
+ title: Send workflow updates to Slack
4
+ summary: Link a Slack channel to a Jira project or an agent to follow cards from pickup to merge, one thread per card.
5
+ audience: operator
6
+ tags: [slack, notifications, channels, jira, pull-requests, link_notification_channel]
7
+ appliesTo: >=0.6.0
8
+ ---
9
+
10
+ # Send workflow updates to Slack
11
+
12
+ Link a Slack channel to a Jira project or to an agent (native or coding) and wardby posts
13
+ that project's or agent's workflow updates there — a card picked up, a pull
14
+ request opened, a review verdict, fix rounds, and the merge — with one thread
15
+ per card. This is outbound only: nothing in Slack starts or affects a run.
16
+
17
+ ## Setup checklist
18
+
19
+ 1. Create the Slack app from [`deploy/slack/app-manifest.yaml`](../deploy/slack/app-manifest.yaml)
20
+ and install it to your workspace.
21
+ 2. Copy the Bot User OAuth Token (`xoxb-…`).
22
+ 3. Set `WARDBY_SLACK_BOT_TOKEN` (store it like any other provider credential)
23
+ and restart wardby.
24
+ 4. Link a channel with `link_notification_channel` — to a Jira project
25
+ (`projectKey`) or to an agent (`agentId`).
26
+ 5. Call `test_notification_channel` and confirm "✅ wardby is connected to
27
+ this channel." posts there.
28
+
29
+ ## Events
30
+
31
+ `issue_picked_up`, `run_failed` (top-level runs only), `pr_opened`,
32
+ `review_posted` (approve / changes requested / comment), `review_fix` (round
33
+ started, or stopped at the cap), and `pr_closed` (merged or closed, with any
34
+ Jira status move). `events` on a link narrows which of these post; omitted
35
+ means all six. `includeCost` appends the run's spend line.
36
+
37
+ wardby never posts code, diffs, review text, or run output to Slack.
38
+
39
+ ## If something isn't posting
40
+
41
+ - The link's `lastError` (from `list_notification_channels`) names the
42
+ problem. A channel error means the bot can't write there — see
43
+ [`errors/slack-channel-unreachable`](errors/slack-channel-unreachable.md).
44
+ - No deliveries at all, for every channel, usually means the bot token is
45
+ invalid, revoked, or missing a scope — see
46
+ [`errors/slack-auth-failed`](errors/slack-auth-failed.md).
47
+ - A channel that recovers gets new events again right away; deliveries that
48
+ already failed are not resent.
49
+ - Linking or testing refused outright means Slack isn't configured yet — see
50
+ [`errors/slack-not-configured`](errors/slack-not-configured.md).
51
+
52
+ ## Related
53
+
54
+ - [Run Jira agents](jira.md) — link a channel to the same project a Jira
55
+ agent is linked to, to see its cards move end to end.
56
+ - [Automatic review fix rounds](review-fix-rounds.md) — the `review_fix`
57
+ event covers these rounds.
58
+ - [Connect GitHub repositories](github.md) — pull-request events come from
59
+ the same App your coding and review agents already use.
60
+
61
+ For the full guide, including scopes, threads, and failure modes, see
62
+ [`docs/slack-notifications.md`](../docs/slack-notifications.md).
@@ -23,6 +23,27 @@ Review the deployment guide for your target before assigning a coding profile.
23
23
 
24
24
  For the specific isolation refusal, read [Coding-worker isolation unavailable](../errors/docker-isolation-unsupported.md).
25
25
 
26
+ ## Cluster preflight at start-up (Kubernetes)
27
+
28
+ With `JOB_LAUNCHER=kubernetes`, a long-running server process (`wardby
29
+ serve`, `wardby mcp` over either transport, or `wardby scheduler`) starts
30
+ the cluster preflight as soon as it starts, instead of waiting for the
31
+ first coding run. Check the process's start-up log for the result: an info
32
+ line when the preflight passes, or a warning naming the failure code (the
33
+ same `kubernetes_isolation_unsupported:<check>` codes `wardby coding
34
+ preflight` reports) when it does not.
35
+
36
+ A failed start-up preflight is logged and retried on the next coding run,
37
+ not left failing until a restart: fix the underlying configuration and the
38
+ next run checks the cluster again on its own. If a run was already
39
+ starting at the moment the start-up preflight failed, that one run still
40
+ fails with the logged error — it was waiting on that same check — but the
41
+ run after it retries. This differs from a preflight failure a coding run
42
+ triggers itself (no start-up check ran, or the cluster is still broken when
43
+ the next run checks it): that failure does stick, failing every subsequent
44
+ run in that process until it is restarted. Run `wardby coding preflight` at
45
+ any time for a one-off check against the same cluster.
46
+
26
47
  ## Runs that stop at the turn limit
27
48
 
28
49
  A Claude Code run whose failure category is `turn_limit` reached its agent's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wardby/cli",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Self-hosted control plane for budget-guarded AI agents.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/wardby/wardby#readme",
@@ -61,13 +61,16 @@
61
61
  "build": "npm run build:vendor && PRISMA_HIDE_UPDATE_MESSAGE=1 prisma generate && tsc -p tsconfig.build.json && npm run build:help",
62
62
  "prepare": "npm run build:vendor && PRISMA_HIDE_UPDATE_MESSAGE=1 prisma generate",
63
63
  "prepack": "npm run build",
64
- "cli": "tsx --conditions=wardby-source src/cli.ts",
64
+ "cli": "tsx --conditions=wardby-source src/wardby-bin.ts",
65
65
  "codex:rerecord": "tsx --conditions=wardby-source src/tools/codex-rerecord.ts",
66
66
  "capture:autopilot": "tsx --conditions=wardby-source src/tools/capture-autopilot-dry-run.ts",
67
67
  "test": "npm run build:vendor && vitest run",
68
68
  "test:package": "node scripts/npm-package-acceptance.mjs",
69
69
  "test:contract": "vitest run --config vitest.contract.config.ts",
70
70
  "test:kubernetes": "WARDBY_KUBERNETES_TEST=1 vitest run src/providers/jobs/kubernetes.integration.test.ts",
71
+ "test:native-docker": "WARDBY_NATIVE_DOCKER_TEST=1 vitest run src/native-worker/docker.acceptance.test.ts",
72
+ "test:native-kind": "WARDBY_NATIVE_KIND_TEST=1 vitest run src/native-worker/kubernetes.acceptance.test.ts",
73
+ "test:native-cluster": "WARDBY_NATIVE_CLUSTER_TEST=1 vitest run src/native-worker/kubernetes-cluster.acceptance.test.ts",
71
74
  "prisma:generate": "PRISMA_HIDE_UPDATE_MESSAGE=1 prisma generate",
72
75
  "prisma:migrate": "prisma migrate deploy",
73
76
  "dbos:migrate": "dbos schema \"$DATABASE_URL\"",
@@ -79,13 +82,14 @@
79
82
  "observability:smoke": "node scripts/grafana-smoke.mjs",
80
83
  "observability:down": "docker compose --env-file .env.local -f deploy/local/docker-compose.yml -f deploy/local/docker-compose.phase5.yml -f deploy/observability/docker-compose.grafana.yml down",
81
84
  "worker:image:local": "node scripts/build-local-coding-worker.mjs",
85
+ "native-worker:image:local": "docker build -f src/native-worker/Dockerfile -t wardby-native-worker:local .",
82
86
  "test:phase5": "vitest run src/coding/observability.test.ts src/coding/profile.test.ts src/coding/protocol.test.ts src/providers/coding-proxy/proxy.test.ts src/providers/coding-proxy/secure-fetch.test.ts src/providers/coding-proxy/metering.test.ts src/providers/coding-proxy/runtime.test.ts src/providers/executor/container.test.ts src/providers/jobs/docker.test.ts src/providers/jobs/docker-isolation.test.ts src/providers/jobs/fake.test.ts src/providers/vcs/github.test.ts src/mcp/tools/trigger.test.ts src/core/webhooks.test.ts src/claude-coding-worker/driver.test.ts src/claude-coding-worker/sdk.test.ts src/claude-coding-worker/image-policy.test.ts src/claude-tool-runner/command.test.mjs src/claude-tool-runner/main.test.mjs src/claude-tool-runner/image-policy.test.ts",
83
87
  "test:phase5:database": "vitest run src/coding/schema.database.test.ts src/providers/coding-proxy/prisma-ledger.database.test.ts src/providers/executor/container.database.test.ts src/core/coding-concurrency.database.test.ts src/core/scheduler.test.ts src/mcp/integration.test.ts",
84
88
  "verify:phase5": "npm run typecheck && npm run test:phase5 && npm run build && npm run worker:image:policy",
85
89
  "test:docker-isolation": "node scripts/docker-isolation-acceptance.mjs",
86
90
  "test:docker-job": "node scripts/docker-job-acceptance.mjs",
87
91
  "test:docker-services": "node scripts/docker-services-acceptance.mjs",
88
- "claude:images:local": "docker build -f src/claude-coding-worker/Dockerfile -t wardby-claude-coding-worker:phase5 . && docker build -f src/claude-tool-runner/Dockerfile -t wardby-claude-tool-runner:phase5 . && docker build -f src/claude-tool-runner/Dockerfile --target node-python -t wardby-claude-tool-runner:phase5-node-python .",
92
+ "claude:images:local": "docker build -f src/claude-coding-worker/Dockerfile -t wardby-claude-coding-worker:phase5 . && docker build -f src/claude-tool-runner/Dockerfile -t wardby-claude-tool-runner:phase5 . && docker build -f src/claude-tool-runner/Dockerfile --target node-python -t wardby-claude-tool-runner:phase5-node-python . && docker build -f src/claude-tool-runner/Dockerfile.custom-example -t wardby-claude-tool-runner-custom:phase5 .",
89
93
  "test:claude-compatibility": "docker build -f src/claude-coding-worker/Dockerfile.compatibility -t wardby-claude-compat:phase5 . && docker run --rm wardby-claude-compat:phase5",
90
94
  "test:claude-docker": "node scripts/claude-docker-acceptance.mjs",
91
95
  "test:production-boundary": "node scripts/production-boundary-policy.mjs",
@@ -95,6 +99,8 @@
95
99
  "dependencies": {
96
100
  "@anthropic-ai/bedrock-sdk": "^0.33.4",
97
101
  "@anthropic-ai/sdk": "^0.124.0",
102
+ "@aws-crypto/sha256-js": "4.0.0",
103
+ "@aws-sdk/rds-signer": "3.1140.0",
98
104
  "@dbos-inc/dbos-sdk": "4.27.6",
99
105
  "@kubernetes/client-node": "^2.0.0",
100
106
  "@modelcontextprotocol/client": "^2.3.1",
@@ -104,6 +110,7 @@
104
110
  "@prisma/client": "7.10.0",
105
111
  "@prometheus-io/client": "^0.16.1",
106
112
  "@renovatebot/pep440": "^5.0.1",
113
+ "@smithy/signature-v4": "5.7.4",
107
114
  "croner": "^10.0.1",
108
115
  "dotenv-flow": "^4.1.0",
109
116
  "fast-xml-parser": "^5.11.1",
@@ -125,7 +132,7 @@
125
132
  },
126
133
  "devDependencies": {
127
134
  "@eslint/js": "^10.0.1",
128
- "@openai/codex-sdk": "0.159.2",
135
+ "@openai/codex-sdk": "0.160.1",
129
136
  "@types/node": "^24.0.0",
130
137
  "@types/papaparse": "^5.5.2",
131
138
  "@types/pg": "8.23.1",
@@ -0,0 +1,12 @@
1
+ -- Additive: per-agent native execution mode (control-plane or sandbox) and the
2
+ -- per-run snapshot the executor routes on. Existing agents default to
3
+ -- control-plane; existing runs keep a null snapshot (legacy = control plane).
4
+
5
+ -- CreateEnum
6
+ CREATE TYPE "NativeExecutionMode" AS ENUM ('control-plane', 'sandbox');
7
+
8
+ -- AlterTable
9
+ ALTER TABLE "Agent" ADD COLUMN "nativeExecutionMode" "NativeExecutionMode" NOT NULL DEFAULT 'control-plane';
10
+
11
+ -- AlterTable
12
+ ALTER TABLE "Run" ADD COLUMN "nativeExecutionMode" "NativeExecutionMode";
@@ -0,0 +1,65 @@
1
+ -- Additive: the native sandbox gateway's session and call ledger. A session
2
+ -- authenticates a sandbox worker by capability hash and pins what its run
3
+ -- loaded; calls reserve and settle model spend and keep replayable results.
4
+
5
+ -- CreateEnum
6
+ CREATE TYPE "NativeGatewaySessionStatus" AS ENUM ('active', 'finished', 'cancelled');
7
+
8
+ -- CreateEnum
9
+ CREATE TYPE "NativeGatewayCallStatus" AS ENUM ('reserved', 'completed', 'released', 'uncertain', 'pending', 'waiting_budget');
10
+
11
+ -- CreateTable
12
+ CREATE TABLE "NativeGatewaySession" (
13
+ "id" TEXT NOT NULL,
14
+ "runId" TEXT NOT NULL,
15
+ "capabilityHash" TEXT NOT NULL,
16
+ "status" "NativeGatewaySessionStatus" NOT NULL DEFAULT 'active',
17
+ "deadlineAt" TIMESTAMP(3) NOT NULL,
18
+ "budgetUsd" DECIMAL(18,10) NOT NULL,
19
+ "snapshot" JSONB NOT NULL,
20
+ "budgetExhaustedAt" TIMESTAMP(3),
21
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
22
+ "updatedAt" TIMESTAMP(3) NOT NULL,
23
+
24
+ CONSTRAINT "NativeGatewaySession_pkey" PRIMARY KEY ("id")
25
+ );
26
+
27
+ -- CreateTable
28
+ CREATE TABLE "NativeGatewayCall" (
29
+ "id" TEXT NOT NULL,
30
+ "sessionId" TEXT NOT NULL,
31
+ "callId" TEXT NOT NULL,
32
+ "method" TEXT NOT NULL,
33
+ "status" "NativeGatewayCallStatus" NOT NULL,
34
+ "reservationUsd" DECIMAL(18,10),
35
+ "actualCostUsd" DECIMAL(18,10),
36
+ "inputTokens" INTEGER,
37
+ "outputTokens" INTEGER,
38
+ "cachedInputTokens" INTEGER,
39
+ "cacheWriteTokens" INTEGER,
40
+ "result" JSONB,
41
+ "childRunId" TEXT,
42
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
43
+ "updatedAt" TIMESTAMP(3) NOT NULL,
44
+ "completedAt" TIMESTAMP(3),
45
+
46
+ CONSTRAINT "NativeGatewayCall_pkey" PRIMARY KEY ("id")
47
+ );
48
+
49
+ -- CreateIndex
50
+ CREATE UNIQUE INDEX "NativeGatewaySession_runId_key" ON "NativeGatewaySession"("runId");
51
+
52
+ -- CreateIndex
53
+ CREATE UNIQUE INDEX "NativeGatewaySession_capabilityHash_key" ON "NativeGatewaySession"("capabilityHash");
54
+
55
+ -- CreateIndex
56
+ CREATE INDEX "NativeGatewayCall_sessionId_status_idx" ON "NativeGatewayCall"("sessionId", "status");
57
+
58
+ -- CreateIndex
59
+ CREATE UNIQUE INDEX "NativeGatewayCall_sessionId_callId_key" ON "NativeGatewayCall"("sessionId", "callId");
60
+
61
+ -- AddForeignKey
62
+ ALTER TABLE "NativeGatewaySession" ADD CONSTRAINT "NativeGatewaySession_runId_fkey" FOREIGN KEY ("runId") REFERENCES "Run"("id") ON DELETE CASCADE ON UPDATE CASCADE;
63
+
64
+ -- AddForeignKey
65
+ ALTER TABLE "NativeGatewayCall" ADD CONSTRAINT "NativeGatewayCall_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "NativeGatewaySession"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
1
+ -- Additive: a delegation's sub-agent on its gateway call row, so a delegation
2
+ -- waiting for budget holds its place in the per-run delegation limit.
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "NativeGatewayCall" ADD COLUMN "childAgentId" TEXT;
@@ -0,0 +1,14 @@
1
+ -- Additive: runs dispatched (or asked to stop) by a process that holds no
2
+ -- executor -- the native sandbox gateway -- are started (or stopped) by the
3
+ -- scheduler leader through the server's executor.
4
+
5
+ -- AlterTable
6
+ ALTER TABLE "Run" ADD COLUMN "startDeferredAt" TIMESTAMP(3),
7
+ ADD COLUMN "stopRequestedAt" TIMESTAMP(3),
8
+ ADD COLUMN "stopRequestReason" TEXT;
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "Run_startDeferredAt_idx" ON "Run"("startDeferredAt");
12
+
13
+ -- CreateIndex
14
+ CREATE INDEX "Run_stopRequestedAt_idx" ON "Run"("stopRequestedAt");
@@ -0,0 +1,5 @@
1
+ -- Additive: when a native sandbox worker's network isolation was proven. The
2
+ -- gateway serves a session only once this is set.
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "NativeGatewaySession" ADD COLUMN "networkReadyAt" TIMESTAMP(3);
@@ -0,0 +1,99 @@
1
+ -- Workflow notifications (Slack): channel links, the event outbox, per-channel
2
+ -- deliveries, and thread parents. Additive only.
3
+
4
+ CREATE TABLE "NotificationChannel" (
5
+ "id" TEXT NOT NULL,
6
+ "provider" TEXT NOT NULL,
7
+ "channelId" TEXT NOT NULL,
8
+ "channelName" TEXT,
9
+ "issueProvider" TEXT,
10
+ "projectKey" TEXT,
11
+ "agentId" TEXT,
12
+ "events" TEXT[] DEFAULT ARRAY[]::TEXT[],
13
+ "includeCost" BOOLEAN NOT NULL DEFAULT false,
14
+ "lastError" TEXT,
15
+ "lastErrorAt" TIMESTAMP(3),
16
+ "authorizedById" TEXT NOT NULL,
17
+ "authorizedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
18
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
19
+ CONSTRAINT "NotificationChannel_pkey" PRIMARY KEY ("id"),
20
+ CONSTRAINT "NotificationChannel_one_subject" CHECK (
21
+ ("agentId" IS NOT NULL AND "issueProvider" IS NULL AND "projectKey" IS NULL)
22
+ OR ("agentId" IS NULL AND "issueProvider" IS NOT NULL AND "projectKey" IS NOT NULL)
23
+ )
24
+ );
25
+
26
+ -- Name truncated the way Prisma does for PostgreSQL's 63-byte identifier limit,
27
+ -- so `migrate diff` sees it as the @@unique([provider, channelId, issueProvider, projectKey]).
28
+ -- The one-subject CHECK above has no schema.prisma equivalent; migrate diff ignores it.
29
+ CREATE UNIQUE INDEX "NotificationChannel_provider_channelId_issueProvider_projec_key"
30
+ ON "NotificationChannel"("provider", "channelId", "issueProvider", "projectKey");
31
+ CREATE UNIQUE INDEX "NotificationChannel_provider_channelId_agentId_key"
32
+ ON "NotificationChannel"("provider", "channelId", "agentId");
33
+ CREATE INDEX "NotificationChannel_issueProvider_projectKey_idx"
34
+ ON "NotificationChannel"("issueProvider", "projectKey");
35
+ CREATE INDEX "NotificationChannel_agentId_idx" ON "NotificationChannel"("agentId");
36
+
37
+ ALTER TABLE "NotificationChannel" ADD CONSTRAINT "NotificationChannel_agentId_fkey"
38
+ FOREIGN KEY ("agentId") REFERENCES "Agent"("id") ON DELETE CASCADE ON UPDATE CASCADE;
39
+
40
+ CREATE TABLE "WorkflowEvent" (
41
+ "id" TEXT NOT NULL,
42
+ "kind" TEXT NOT NULL,
43
+ "dedupeKey" TEXT NOT NULL,
44
+ "runId" TEXT,
45
+ "agentId" TEXT,
46
+ "workItemProvider" TEXT,
47
+ "workItemKey" TEXT,
48
+ "codeProvider" TEXT,
49
+ "repository" TEXT,
50
+ "prNumber" INTEGER,
51
+ "payload" JSONB NOT NULL,
52
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
53
+ CONSTRAINT "WorkflowEvent_pkey" PRIMARY KEY ("id")
54
+ );
55
+
56
+ CREATE UNIQUE INDEX "WorkflowEvent_dedupeKey_key" ON "WorkflowEvent"("dedupeKey");
57
+ CREATE INDEX "WorkflowEvent_createdAt_idx" ON "WorkflowEvent"("createdAt");
58
+
59
+ CREATE TABLE "NotificationDelivery" (
60
+ "id" TEXT NOT NULL,
61
+ "eventId" TEXT NOT NULL,
62
+ "provider" TEXT NOT NULL,
63
+ "channelId" TEXT NOT NULL,
64
+ "threadKey" TEXT NOT NULL,
65
+ "includeCost" BOOLEAN NOT NULL DEFAULT false,
66
+ "state" TEXT NOT NULL DEFAULT 'pending',
67
+ "attempts" INTEGER NOT NULL DEFAULT 0,
68
+ "nextAttemptAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
69
+ "lastError" TEXT,
70
+ "messageTs" TEXT,
71
+ "deliveredAt" TIMESTAMP(3),
72
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
73
+ CONSTRAINT "NotificationDelivery_pkey" PRIMARY KEY ("id")
74
+ );
75
+
76
+ CREATE UNIQUE INDEX "NotificationDelivery_eventId_provider_channelId_key"
77
+ ON "NotificationDelivery"("eventId", "provider", "channelId");
78
+ CREATE INDEX "NotificationDelivery_state_nextAttemptAt_idx"
79
+ ON "NotificationDelivery"("state", "nextAttemptAt");
80
+ CREATE INDEX "NotificationDelivery_provider_channelId_threadKey_createdAt_idx"
81
+ ON "NotificationDelivery"("provider", "channelId", "threadKey", "createdAt");
82
+
83
+ ALTER TABLE "NotificationDelivery" ADD CONSTRAINT "NotificationDelivery_eventId_fkey"
84
+ FOREIGN KEY ("eventId") REFERENCES "WorkflowEvent"("id") ON DELETE CASCADE ON UPDATE CASCADE;
85
+
86
+ CREATE TABLE "NotificationThread" (
87
+ "id" TEXT NOT NULL,
88
+ "provider" TEXT NOT NULL,
89
+ "channelId" TEXT NOT NULL,
90
+ "threadKey" TEXT NOT NULL,
91
+ "parentTs" TEXT NOT NULL,
92
+ "status" TEXT NOT NULL,
93
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
94
+ "updatedAt" TIMESTAMP(3) NOT NULL,
95
+ CONSTRAINT "NotificationThread_pkey" PRIMARY KEY ("id")
96
+ );
97
+
98
+ CREATE UNIQUE INDEX "NotificationThread_provider_channelId_threadKey_key"
99
+ ON "NotificationThread"("provider", "channelId", "threadKey");
@@ -0,0 +1,2 @@
1
+ -- NATIVE_SANDBOX_MAX_CONCURRENT counts the active native gateway sessions on every sandbox start.
2
+ CREATE INDEX "NativeGatewaySession_status_idx" ON "NativeGatewaySession"("status");
@@ -0,0 +1,32 @@
1
+ -- Additive: the native sandbox warm pool. One row per pool worker, inserted
2
+ -- before the worker exists; a run claims an idle row with a conditional update.
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "NativeWarmWorkerStatus" AS ENUM ('warming', 'idle', 'claimed', 'retiring');
6
+
7
+ -- CreateTable
8
+ CREATE TABLE "NativeWarmWorker" (
9
+ "id" TEXT NOT NULL,
10
+ "name" TEXT NOT NULL,
11
+ "status" "NativeWarmWorkerStatus" NOT NULL DEFAULT 'warming',
12
+ "specHash" TEXT NOT NULL,
13
+ "runId" TEXT,
14
+ "readyAt" TIMESTAMP(3),
15
+ "claimedAt" TIMESTAMP(3),
16
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
17
+ "updatedAt" TIMESTAMP(3) NOT NULL,
18
+
19
+ CONSTRAINT "NativeWarmWorker_pkey" PRIMARY KEY ("id")
20
+ );
21
+
22
+ -- CreateIndex
23
+ CREATE UNIQUE INDEX "NativeWarmWorker_name_key" ON "NativeWarmWorker"("name");
24
+
25
+ -- CreateIndex
26
+ CREATE UNIQUE INDEX "NativeWarmWorker_runId_key" ON "NativeWarmWorker"("runId");
27
+
28
+ -- CreateIndex
29
+ CREATE INDEX "NativeWarmWorker_status_specHash_idx" ON "NativeWarmWorker"("status", "specHash");
30
+
31
+ -- AddForeignKey
32
+ ALTER TABLE "NativeWarmWorker" ADD CONSTRAINT "NativeWarmWorker_runId_fkey" FOREIGN KEY ("runId") REFERENCES "Run"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- Additive: the merge step a delegating agent assigned to this coding run.
2
+ ALTER TABLE "CodingRun" ADD COLUMN "mergeOrder" INTEGER;