@wardby/cli 0.6.0 → 0.7.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 (576) hide show
  1. package/deploy/local/docker-compose.quickstart-coding.yml +13 -0
  2. package/dist/claude-coding-worker/driver.d.ts +21 -3
  3. package/dist/claude-coding-worker/driver.js +125 -17
  4. package/dist/claude-coding-worker/main.js +34 -6
  5. package/dist/claude-coding-worker/sdk.js +12 -1
  6. package/dist/claude-coding-worker/tool-socket.d.ts +27 -0
  7. package/dist/claude-coding-worker/tool-socket.js +111 -0
  8. package/dist/claude-coding-worker/transcript.d.ts +18 -0
  9. package/dist/claude-coding-worker/transcript.js +77 -0
  10. package/dist/cli-help.d.ts +1 -1
  11. package/dist/cli-help.js +1 -0
  12. package/dist/cli.js +24 -10
  13. package/dist/coding/continuation-wording.d.ts +35 -0
  14. package/dist/coding/continuation-wording.js +73 -0
  15. package/dist/coding/linked-issue-note.d.ts +23 -0
  16. package/dist/coding/linked-issue-note.js +47 -0
  17. package/dist/coding/merge-wording.d.ts +28 -0
  18. package/dist/coding/merge-wording.js +78 -0
  19. package/dist/coding/pr-description-note.d.ts +9 -0
  20. package/dist/coding/pr-description-note.js +32 -0
  21. package/dist/coding/profile.d.ts +46 -126
  22. package/dist/coding/profile.js +45 -4
  23. package/dist/coding/protected-path-wording.d.ts +8 -0
  24. package/dist/coding/protected-path-wording.js +1 -1
  25. package/dist/coding/protocol.d.ts +264 -346
  26. package/dist/coding/protocol.js +235 -12
  27. package/dist/coding/redact.d.ts +3 -0
  28. package/dist/coding/redact.js +12 -0
  29. package/dist/coding/registry/allowlist.d.ts +12 -0
  30. package/dist/coding/registry/allowlist.js +14 -1
  31. package/dist/coding/registry/audit-mode.d.ts +153 -0
  32. package/dist/coding/registry/audit-mode.js +304 -0
  33. package/dist/coding/registry/lockfile-shared.d.ts +36 -0
  34. package/dist/coding/registry/lockfile-shared.js +128 -0
  35. package/dist/coding/registry/lockfiles.js +1 -1
  36. package/dist/coding/registry/npm-lockfile-formats.d.ts +11 -0
  37. package/dist/coding/registry/npm-lockfile-formats.js +41 -0
  38. package/dist/coding/registry/npm-lockfile.d.ts +8 -4
  39. package/dist/coding/registry/npm-lockfile.js +4 -6
  40. package/dist/coding/registry/npm.js +78 -8
  41. package/dist/coding/registry/pnpm-lockfile.d.ts +17 -0
  42. package/dist/coding/registry/pnpm-lockfile.js +189 -0
  43. package/dist/coding/registry/pypi-plan.d.ts +50 -0
  44. package/dist/coding/registry/pypi-plan.js +406 -0
  45. package/dist/coding/registry/pypi-requirements.d.ts +58 -0
  46. package/dist/coding/registry/pypi-requirements.js +155 -0
  47. package/dist/coding/registry/pypi.d.ts +3 -27
  48. package/dist/coding/registry/pypi.js +40 -154
  49. package/dist/coding/registry/refusal-hints.d.ts +20 -0
  50. package/dist/coding/registry/refusal-hints.js +61 -0
  51. package/dist/coding/registry/refusal-wording.d.ts +11 -0
  52. package/dist/coding/registry/refusal-wording.js +56 -0
  53. package/dist/coding/registry/report.d.ts +70 -8
  54. package/dist/coding/registry/report.js +112 -5
  55. package/dist/coding/registry/types.d.ts +58 -8
  56. package/dist/coding/registry/yarn-lockfile.d.ts +30 -0
  57. package/dist/coding/registry/yarn-lockfile.js +367 -0
  58. package/dist/coding/services/catalog.d.ts +37 -351
  59. package/dist/coding/transcript/claude-code.d.ts +13 -0
  60. package/dist/coding/transcript/claude-code.js +273 -0
  61. package/dist/coding/transcript/download-protocol.d.ts +30 -0
  62. package/dist/coding/transcript/download-protocol.js +18 -0
  63. package/dist/coding/transcript/format.d.ts +20 -0
  64. package/dist/coding/transcript/format.js +32 -0
  65. package/dist/coding/transcript/recorder.d.ts +51 -0
  66. package/dist/coding/transcript/recorder.js +225 -0
  67. package/dist/coding/transcript/resume/checkout.d.ts +31 -0
  68. package/dist/coding/transcript/resume/checkout.js +203 -0
  69. package/dist/coding/transcript/resume/command.d.ts +17 -0
  70. package/dist/coding/transcript/resume/command.js +176 -0
  71. package/dist/coding/transcript/resume/download.d.ts +20 -0
  72. package/dist/coding/transcript/resume/download.js +153 -0
  73. package/dist/coding/transcript/resume/launch.d.ts +38 -0
  74. package/dist/coding/transcript/resume/launch.js +128 -0
  75. package/dist/coding/transcript/resume/session-file.d.ts +13 -0
  76. package/dist/coding/transcript/resume/session-file.js +79 -0
  77. package/dist/coding/transcript/resume/stand-in.d.ts +11 -0
  78. package/dist/coding/transcript/resume/stand-in.js +49 -0
  79. package/dist/coding-worker/artifact.d.ts +8 -3
  80. package/dist/coding-worker/artifact.js +3 -1
  81. package/dist/coding-worker/debug-trace.d.ts +6 -5
  82. package/dist/coding-worker/debug-trace.js +13 -18
  83. package/dist/coding-worker/dependency-cache.d.mts +229 -0
  84. package/dist/coding-worker/dependency-cache.mjs +2123 -0
  85. package/dist/coding-worker/driver.d.ts +4 -3
  86. package/dist/coding-worker/driver.js +116 -38
  87. package/dist/coding-worker/errors.d.ts +1 -0
  88. package/dist/coding-worker/errors.js +32 -0
  89. package/dist/coding-worker/task-note.d.ts +11 -0
  90. package/dist/coding-worker/task-note.js +13 -0
  91. package/dist/coding-worker/types.d.ts +11 -0
  92. package/dist/config/dependency-cache.d.ts +23 -0
  93. package/dist/config/dependency-cache.js +32 -0
  94. package/dist/config/providers.d.ts +12 -3
  95. package/dist/config/providers.js +55 -5
  96. package/dist/config/test-simulators.d.ts +82 -0
  97. package/dist/config/test-simulators.js +305 -0
  98. package/dist/core/async-context.d.ts +2 -0
  99. package/dist/core/async-context.js +12 -0
  100. package/dist/core/budget-events.d.ts +108 -0
  101. package/dist/core/budget-events.js +346 -0
  102. package/dist/core/budget-groups.d.ts +50 -1
  103. package/dist/core/budget-groups.js +236 -27
  104. package/dist/core/budget-stopped-head.d.ts +46 -0
  105. package/dist/core/budget-stopped-head.js +81 -0
  106. package/dist/core/budget-topup.d.ts +51 -0
  107. package/dist/core/budget-topup.js +156 -0
  108. package/dist/core/budget-wording.d.ts +16 -2
  109. package/dist/core/budget-wording.js +40 -2
  110. package/dist/core/coding-queue.d.ts +2 -1
  111. package/dist/core/coding-queue.js +7 -0
  112. package/dist/core/cron.d.ts +19 -1
  113. package/dist/core/cron.js +17 -0
  114. package/dist/core/datastores.js +1 -1
  115. package/dist/core/deferred-coding.d.ts +14 -0
  116. package/dist/core/deferred-coding.js +62 -0
  117. package/dist/core/delegation-child.d.ts +25 -0
  118. package/dist/core/delegation-child.js +37 -0
  119. package/dist/core/dispatch.d.ts +42 -0
  120. package/dist/core/dispatch.js +131 -56
  121. package/dist/core/engine-native.js +1 -1
  122. package/dist/core/error-code.d.ts +38 -0
  123. package/dist/core/error-code.js +168 -0
  124. package/dist/core/grants.d.ts +19 -6
  125. package/dist/core/grants.js +55 -6
  126. package/dist/core/host-events.d.ts +18 -2
  127. package/dist/core/host-events.js +284 -24
  128. package/dist/core/host-status.d.ts +85 -3
  129. package/dist/core/host-status.js +298 -20
  130. package/dist/core/issue-bridge.d.ts +50 -6
  131. package/dist/core/issue-bridge.js +124 -33
  132. package/dist/core/issue-events.d.ts +1 -1
  133. package/dist/core/issue-events.js +4 -10
  134. package/dist/core/issue-status.d.ts +1 -1
  135. package/dist/core/issue-status.js +54 -26
  136. package/dist/core/logger.d.ts +5 -0
  137. package/dist/core/logger.js +14 -1
  138. package/dist/core/lost-run-children.d.ts +6 -0
  139. package/dist/core/lost-run-children.js +32 -0
  140. package/dist/core/mark-ready.d.ts +34 -0
  141. package/dist/core/mark-ready.js +152 -0
  142. package/dist/core/markdown-code.d.ts +8 -0
  143. package/dist/core/markdown-code.js +107 -0
  144. package/dist/core/memory-tools.js +7 -0
  145. package/dist/core/merge-order-check.d.ts +2 -1
  146. package/dist/core/merge-order-check.js +8 -1
  147. package/dist/core/notification-templates.d.ts +1 -7
  148. package/dist/core/notification-templates.js +36 -2
  149. package/dist/core/pull-request-state-sync.js +2 -2
  150. package/dist/core/reconciler.d.ts +4 -3
  151. package/dist/core/reconciler.js +8 -1
  152. package/dist/core/related-pull-requests.d.ts +11 -3
  153. package/dist/core/related-pull-requests.js +27 -14
  154. package/dist/core/reply-parts.d.ts +21 -0
  155. package/dist/core/reply-parts.js +73 -0
  156. package/dist/core/review-fix.d.ts +1 -1
  157. package/dist/core/review-fix.js +2 -1
  158. package/dist/core/review-host-checks.d.ts +1 -1
  159. package/dist/core/review-host-tools.d.ts +3 -0
  160. package/dist/core/review-host-tools.js +99 -13
  161. package/dist/core/review-reads.d.ts +55 -0
  162. package/dist/core/review-reads.js +233 -0
  163. package/dist/core/run-status.d.ts +12 -0
  164. package/dist/core/run-status.js +12 -0
  165. package/dist/core/runner.d.ts +80 -34
  166. package/dist/core/runner.js +439 -144
  167. package/dist/core/schedule-start.d.ts +12 -0
  168. package/dist/core/schedule-start.js +14 -0
  169. package/dist/core/secret-broker-config.d.ts +10 -74
  170. package/dist/core/secret-guard.d.ts +46 -0
  171. package/dist/core/secret-guard.js +104 -0
  172. package/dist/core/secret-guarded-stores.d.ts +12 -0
  173. package/dist/core/secret-guarded-stores.js +41 -0
  174. package/dist/core/secret-spans.d.ts +50 -0
  175. package/dist/core/secret-spans.js +94 -0
  176. package/dist/core/stop-run.d.ts +46 -0
  177. package/dist/core/stop-run.js +61 -0
  178. package/dist/core/workflow-events.d.ts +14 -2
  179. package/dist/core/workflow-events.js +4 -0
  180. package/dist/core/workflow-run-events.d.ts +5 -3
  181. package/dist/core/workflow-run-events.js +43 -8
  182. package/dist/core/zod-json-schema.d.ts +4 -0
  183. package/dist/core/zod-json-schema.js +39 -0
  184. package/dist/core/zod3-window.d.ts +35 -0
  185. package/dist/core/zod3-window.js +124 -0
  186. package/dist/generated/prisma/browser.d.ts +34 -3
  187. package/dist/generated/prisma/client.d.ts +34 -3
  188. package/dist/generated/prisma/commonInputTypes.d.ts +220 -60
  189. package/dist/generated/prisma/enums.d.ts +10 -0
  190. package/dist/generated/prisma/enums.js +8 -0
  191. package/dist/generated/prisma/internal/class.d.ts +44 -0
  192. package/dist/generated/prisma/internal/class.js +4 -4
  193. package/dist/generated/prisma/internal/prismaNamespace.d.ts +428 -9
  194. package/dist/generated/prisma/internal/prismaNamespace.js +92 -1
  195. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +95 -0
  196. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +92 -1
  197. package/dist/generated/prisma/models/Agent.d.ts +106 -8
  198. package/dist/generated/prisma/models/AgentRepository.d.ts +42 -1
  199. package/dist/generated/prisma/models/CodingAgentProfile.d.ts +229 -1
  200. package/dist/generated/prisma/models/CodingProxyRequest.d.ts +207 -3
  201. package/dist/generated/prisma/models/CodingProxySession.d.ts +114 -1
  202. package/dist/generated/prisma/models/CodingRun.d.ts +1637 -1
  203. package/dist/generated/prisma/models/DependencySnapshot.d.ts +1668 -0
  204. package/dist/generated/prisma/models/DependencySnapshot.js +1 -0
  205. package/dist/generated/prisma/models/IssuePullRequest.d.ts +6 -2
  206. package/dist/generated/prisma/models/LocalReview.d.ts +40 -1
  207. package/dist/generated/prisma/models/NativeGatewayCall.d.ts +39 -1
  208. package/dist/generated/prisma/models/NativeGatewaySession.d.ts +35 -1
  209. package/dist/generated/prisma/models/RegistryAllowance.d.ts +41 -1
  210. package/dist/generated/prisma/models/RegistryApprovedVersion.d.ts +75 -1
  211. package/dist/generated/prisma/models/RegistryAuditRecord.d.ts +1364 -0
  212. package/dist/generated/prisma/models/RegistryAuditRecord.js +1 -0
  213. package/dist/generated/prisma/models/Run.d.ts +738 -2
  214. package/dist/generated/prisma/models/RunBudgetEvent.d.ts +1211 -0
  215. package/dist/generated/prisma/models/RunBudgetEvent.js +1 -0
  216. package/dist/generated/prisma/models/RunTranscript.d.ts +1339 -0
  217. package/dist/generated/prisma/models/RunTranscript.js +1 -0
  218. package/dist/generated/prisma/models.d.ts +4 -0
  219. package/dist/help-index.json +1320 -69
  220. package/dist/import/create.js +32 -3
  221. package/dist/import/neutral-schema.d.ts +50 -281
  222. package/dist/import/neutral-schema.js +5 -4
  223. package/dist/knowledge/check.d.ts +1 -1
  224. package/dist/knowledge/cli.d.ts +11 -1
  225. package/dist/knowledge/cli.js +37 -4
  226. package/dist/knowledge/concept.d.ts +3 -19
  227. package/dist/knowledge/location.d.ts +31 -0
  228. package/dist/knowledge/location.js +78 -0
  229. package/dist/mcp/auth/access.d.ts +10 -2
  230. package/dist/mcp/auth/access.js +15 -1
  231. package/dist/mcp/auth/ownership.d.ts +7 -7
  232. package/dist/mcp/auth/self-hosted/credentials.d.ts +3 -3
  233. package/dist/mcp/auth/self-hosted/session.d.ts +2 -2
  234. package/dist/mcp/host-events/github-ingress.d.ts +2 -0
  235. package/dist/mcp/host-events/github-ingress.js +2 -1
  236. package/dist/mcp/index.d.ts +6 -0
  237. package/dist/mcp/index.js +58 -10
  238. package/dist/mcp/server.d.ts +13 -0
  239. package/dist/mcp/server.js +33 -14
  240. package/dist/mcp/tools/agents.d.ts +4 -0
  241. package/dist/mcp/tools/agents.js +198 -16
  242. package/dist/mcp/tools/datastore.js +17 -8
  243. package/dist/mcp/tools/grants.js +9 -3
  244. package/dist/mcp/tools/memory.js +11 -1
  245. package/dist/mcp/tools/notification-channels.js +2 -2
  246. package/dist/mcp/tools/packages.d.ts +2 -0
  247. package/dist/mcp/tools/packages.js +195 -0
  248. package/dist/mcp/tools/repositories.js +18 -5
  249. package/dist/mcp/tools/run-access.d.ts +16 -0
  250. package/dist/mcp/tools/run-access.js +25 -0
  251. package/dist/mcp/tools/run-transcript-download.d.ts +30 -0
  252. package/dist/mcp/tools/run-transcript-download.js +129 -0
  253. package/dist/mcp/tools/run-transcript.d.ts +19 -0
  254. package/dist/mcp/tools/run-transcript.js +70 -0
  255. package/dist/mcp/tools/runs.js +34 -12
  256. package/dist/mcp/tools/scheduling.js +3 -1
  257. package/dist/mcp/tools/secret-elicitation-form.js +5 -0
  258. package/dist/mcp/tools/secret-elicitation-server.d.ts +6 -0
  259. package/dist/mcp/tools/secret-elicitation-server.js +10 -61
  260. package/dist/mcp/tools/secrets.js +2 -2
  261. package/dist/mcp/tools/stop-run.d.ts +2 -0
  262. package/dist/mcp/tools/stop-run.js +82 -0
  263. package/dist/mcp/tools/subagents.js +2 -2
  264. package/dist/mcp/tools/tools.d.ts +1 -1
  265. package/dist/mcp/tools/tools.js +25 -9
  266. package/dist/mcp/transport/stdio-link-host.d.ts +20 -0
  267. package/dist/mcp/transport/stdio-link-host.js +67 -0
  268. package/dist/mcp/transport/streamable-http.d.ts +13 -0
  269. package/dist/mcp/transport/streamable-http.js +41 -1
  270. package/dist/native-worker/docker-launcher.d.ts +38 -2
  271. package/dist/native-worker/docker-launcher.js +65 -5
  272. package/dist/native-worker/gateway-server.d.ts +41 -3
  273. package/dist/native-worker/gateway-server.js +124 -27
  274. package/dist/native-worker/gateway.d.ts +27 -1
  275. package/dist/native-worker/gateway.js +70 -4
  276. package/dist/native-worker/http-server.d.ts +3 -1
  277. package/dist/native-worker/http-server.js +11 -7
  278. package/dist/native-worker/http-transport.js +1 -1
  279. package/dist/native-worker/kubernetes-launcher.d.ts +7 -3
  280. package/dist/native-worker/kubernetes-launcher.js +43 -3
  281. package/dist/native-worker/launch.d.ts +18 -1
  282. package/dist/native-worker/launch.js +6 -1
  283. package/dist/native-worker/ledger.d.ts +18 -2
  284. package/dist/native-worker/ledger.js +57 -4
  285. package/dist/native-worker/loopback.js +3 -8
  286. package/dist/native-worker/main.d.ts +2 -1
  287. package/dist/native-worker/main.js +14 -3
  288. package/dist/native-worker/protocol.d.ts +129 -577
  289. package/dist/native-worker/protocol.js +47 -1
  290. package/dist/native-worker/sandbox-executor.d.ts +17 -2
  291. package/dist/native-worker/sandbox-executor.js +78 -4
  292. package/dist/native-worker/stderr-redaction.d.ts +77 -0
  293. package/dist/native-worker/stderr-redaction.js +237 -0
  294. package/dist/native-worker/stdio.d.ts +1 -1
  295. package/dist/native-worker/stdio.js +6 -5
  296. package/dist/native-worker/warm-pool.d.ts +2 -2
  297. package/dist/native-worker/warm-pool.js +4 -4
  298. package/dist/native-worker/worker.js +28 -2
  299. package/dist/observability/metrics.js +6 -1
  300. package/dist/providers/auth/self-hosted.d.ts +1 -1
  301. package/dist/providers/coding-proxy/dependency-cache/eviction.d.ts +29 -0
  302. package/dist/providers/coding-proxy/dependency-cache/eviction.js +87 -0
  303. package/dist/providers/coding-proxy/dependency-cache/key.d.ts +33 -0
  304. package/dist/providers/coding-proxy/dependency-cache/key.js +86 -0
  305. package/dist/providers/coding-proxy/dependency-cache/model-request-seal.d.ts +18 -0
  306. package/dist/providers/coding-proxy/dependency-cache/model-request-seal.js +40 -0
  307. package/dist/providers/coding-proxy/dependency-cache/prisma-store.d.ts +25 -0
  308. package/dist/providers/coding-proxy/dependency-cache/prisma-store.js +131 -0
  309. package/dist/providers/coding-proxy/dependency-cache/service.d.ts +70 -0
  310. package/dist/providers/coding-proxy/dependency-cache/service.js +409 -0
  311. package/dist/providers/coding-proxy/dependency-cache/store.d.ts +85 -0
  312. package/dist/providers/coding-proxy/dependency-cache/store.js +95 -0
  313. package/dist/providers/coding-proxy/hold.d.ts +32 -0
  314. package/dist/providers/coding-proxy/hold.js +86 -0
  315. package/dist/providers/coding-proxy/interrupted.d.ts +70 -0
  316. package/dist/providers/coding-proxy/interrupted.js +104 -0
  317. package/dist/providers/coding-proxy/memory-ledger.d.ts +15 -2
  318. package/dist/providers/coding-proxy/memory-ledger.js +84 -8
  319. package/dist/providers/coding-proxy/metering.d.ts +16 -0
  320. package/dist/providers/coding-proxy/metering.js +27 -4
  321. package/dist/providers/coding-proxy/prisma-ledger.d.ts +15 -2
  322. package/dist/providers/coding-proxy/prisma-ledger.js +179 -67
  323. package/dist/providers/coding-proxy/proxy.d.ts +14 -1
  324. package/dist/providers/coding-proxy/proxy.js +166 -14
  325. package/dist/providers/coding-proxy/registry/audit.d.ts +53 -10
  326. package/dist/providers/coding-proxy/registry/audit.js +94 -17
  327. package/dist/providers/coding-proxy/registry/lockfile-parse-worker.d.ts +36 -0
  328. package/dist/providers/coding-proxy/registry/lockfile-parse-worker.js +67 -0
  329. package/dist/providers/coding-proxy/registry/lockfile-parse.d.ts +16 -0
  330. package/dist/providers/coding-proxy/registry/lockfile-parse.js +110 -0
  331. package/dist/providers/coding-proxy/registry/plan.d.ts +9 -0
  332. package/dist/providers/coding-proxy/registry/plan.js +201 -48
  333. package/dist/providers/coding-proxy/registry/prisma-store.d.ts +11 -5
  334. package/dist/providers/coding-proxy/registry/prisma-store.js +120 -17
  335. package/dist/providers/coding-proxy/registry/service.d.ts +97 -16
  336. package/dist/providers/coding-proxy/registry/service.js +579 -112
  337. package/dist/providers/coding-proxy/registry/store.d.ts +84 -9
  338. package/dist/providers/coding-proxy/registry/store.js +54 -1
  339. package/dist/providers/coding-proxy/runtime.d.ts +4 -0
  340. package/dist/providers/coding-proxy/runtime.js +78 -16
  341. package/dist/providers/coding-proxy/server.d.ts +6 -1
  342. package/dist/providers/coding-proxy/server.js +45 -1
  343. package/dist/providers/coding-proxy/types.d.ts +65 -1
  344. package/dist/providers/datastore/types.d.ts +5 -0
  345. package/dist/providers/engine/types.d.ts +17 -2
  346. package/dist/providers/engine/types.js +17 -0
  347. package/dist/providers/executor/composition.d.ts +10 -3
  348. package/dist/providers/executor/composition.js +47 -7
  349. package/dist/providers/executor/container.d.ts +361 -8
  350. package/dist/providers/executor/container.js +1136 -91
  351. package/dist/providers/executor/dbos-status.d.ts +31 -0
  352. package/dist/providers/executor/dbos-status.js +64 -0
  353. package/dist/providers/executor/dbos.d.ts +50 -1
  354. package/dist/providers/executor/dbos.js +207 -20
  355. package/dist/providers/executor/deferred.d.ts +12 -24
  356. package/dist/providers/executor/deferred.js +10 -29
  357. package/dist/providers/executor/in-process.d.ts +9 -1
  358. package/dist/providers/executor/in-process.js +14 -4
  359. package/dist/providers/executor/linked-issue-reader.d.ts +16 -0
  360. package/dist/providers/executor/linked-issue-reader.js +30 -0
  361. package/dist/providers/executor/routing.d.ts +2 -0
  362. package/dist/providers/executor/routing.js +4 -0
  363. package/dist/providers/executor/types.d.ts +13 -0
  364. package/dist/providers/index.d.ts +2 -1
  365. package/dist/providers/issue-tracker/types.d.ts +17 -0
  366. package/dist/providers/issue-tracker/types.js +39 -1
  367. package/dist/providers/jobs/claude-tool-setup.d.ts +4 -0
  368. package/dist/providers/jobs/claude-tool-setup.js +5 -2
  369. package/dist/providers/jobs/docker-isolation.d.ts +8 -0
  370. package/dist/providers/jobs/docker-isolation.js +17 -0
  371. package/dist/providers/jobs/docker.d.ts +1 -0
  372. package/dist/providers/jobs/docker.js +27 -2
  373. package/dist/providers/jobs/fake-kubernetes-api.d.ts +2 -0
  374. package/dist/providers/jobs/fake-kubernetes-api.js +3 -0
  375. package/dist/providers/jobs/kubernetes-api.d.ts +8 -0
  376. package/dist/providers/jobs/kubernetes-api.js +10 -0
  377. package/dist/providers/jobs/kubernetes-client.js +10 -1
  378. package/dist/providers/jobs/kubernetes-isolation.d.ts +2 -0
  379. package/dist/providers/jobs/kubernetes-isolation.js +17 -1
  380. package/dist/providers/jobs/kubernetes.d.ts +6 -1
  381. package/dist/providers/jobs/kubernetes.js +105 -16
  382. package/dist/providers/jobs/types.d.ts +33 -0
  383. package/dist/providers/jobs/types.js +13 -1
  384. package/dist/providers/llm/anthropic.js +5 -1
  385. package/dist/providers/llm/bedrock.d.ts +0 -12
  386. package/dist/providers/llm/bedrock.js +4 -0
  387. package/dist/providers/llm/claude-messages.d.ts +3 -1
  388. package/dist/providers/llm/claude-messages.js +4 -1
  389. package/dist/providers/llm/claude-provider.d.ts +2 -2
  390. package/dist/providers/llm/claude-provider.js +2 -2
  391. package/dist/providers/llm/openai.d.ts +2 -2
  392. package/dist/providers/llm/openai.js +6 -2
  393. package/dist/providers/llm/routing.d.ts +2 -2
  394. package/dist/providers/llm/routing.js +2 -2
  395. package/dist/providers/llm/types.d.ts +12 -2
  396. package/dist/providers/review-host/github-events.d.ts +9 -1
  397. package/dist/providers/review-host/github-events.js +34 -12
  398. package/dist/providers/review-host/github.d.ts +29 -2
  399. package/dist/providers/review-host/github.js +224 -29
  400. package/dist/providers/review-host/local.d.ts +8 -4
  401. package/dist/providers/review-host/local.js +49 -31
  402. package/dist/providers/review-host/patch-pages.d.ts +41 -0
  403. package/dist/providers/review-host/patch-pages.js +176 -0
  404. package/dist/providers/review-host/review-format.d.ts +19 -1
  405. package/dist/providers/review-host/review-format.js +38 -7
  406. package/dist/providers/review-host/types.d.ts +134 -2
  407. package/dist/providers/review-host/types.js +8 -0
  408. package/dist/providers/storage/gcs.d.ts +63 -0
  409. package/dist/providers/storage/gcs.js +69 -0
  410. package/dist/providers/storage/index.d.ts +15 -0
  411. package/dist/providers/storage/index.js +14 -0
  412. package/dist/providers/storage/local.d.ts +24 -0
  413. package/dist/providers/storage/local.js +92 -0
  414. package/dist/providers/storage/meter.d.ts +14 -0
  415. package/dist/providers/storage/meter.js +34 -0
  416. package/dist/providers/storage/s3.d.ts +41 -0
  417. package/dist/providers/storage/s3.js +107 -0
  418. package/dist/providers/storage/types.d.ts +37 -3
  419. package/dist/providers/storage/types.js +21 -4
  420. package/dist/providers/vcs/git.d.ts +33 -2
  421. package/dist/providers/vcs/git.js +324 -22
  422. package/dist/providers/vcs/github-remote.d.ts +26 -3
  423. package/dist/providers/vcs/github-remote.js +124 -14
  424. package/dist/providers/vcs/github.d.ts +214 -6
  425. package/dist/providers/vcs/github.js +447 -45
  426. package/dist/providers/vcs/index.js +8 -1
  427. package/dist/providers/vcs/pr-description.d.ts +127 -0
  428. package/dist/providers/vcs/pr-description.js +270 -0
  429. package/dist/providers/vcs/remote.d.ts +33 -1
  430. package/dist/providers/vcs/routing.d.ts +4 -2
  431. package/dist/providers/vcs/routing.js +6 -0
  432. package/dist/providers/vcs/types.d.ts +80 -3
  433. package/dist/quickstart/coding-seed.d.ts +14 -3
  434. package/dist/quickstart/coding-seed.js +213 -4
  435. package/dist/quickstart/reviewer-prompt.d.ts +1 -1
  436. package/dist/quickstart/reviewer-prompt.js +6 -6
  437. package/dist/quickstart-images.json +1 -1
  438. package/dist/sandbox/generated/zod.bundle.js +62 -1
  439. package/dist/sandbox/generated/zod3.bundle.js +5 -0
  440. package/dist/sandbox/host-functions.d.ts +1 -0
  441. package/dist/sandbox/host-functions.js +6 -11
  442. package/dist/sandbox/secret-broker.js +3 -4
  443. package/dist/sandbox/tool-capabilities.d.ts +10 -30
  444. package/dist/sandbox/zod-params.d.ts +37 -5
  445. package/dist/sandbox/zod-params.js +181 -26
  446. package/dist/serve.js +8 -1
  447. package/dist/viewer/api-schema.d.ts +349 -2627
  448. package/dist/viewer/api-schema.js +7 -0
  449. package/dist/viewer/build-schemas.js +6 -2
  450. package/dist/viewer/openapi.js +2 -4
  451. package/dist/wardby-bin.js +10 -0
  452. package/docs/agent-recipes.md +58 -20
  453. package/docs/code-review-agents.md +551 -41
  454. package/docs/coding-agent-setup.md +489 -7
  455. package/docs/coding-packages.md +1033 -90
  456. package/docs/coding-services.md +27 -12
  457. package/docs/coding-worker-byo-images.md +20 -0
  458. package/docs/coding-worker-isolation.md +105 -30
  459. package/docs/getting-started-gke.md +124 -137
  460. package/docs/getting-started-identity-provider.md +10 -1
  461. package/docs/getting-started.md +9 -0
  462. package/docs/jira-agents.md +17 -8
  463. package/docs/knowledge/blob-not-found-semantics.md +41 -0
  464. package/docs/knowledge/bounded-file-descriptor.md +52 -0
  465. package/docs/knowledge/delegation-admission-slots.md +52 -0
  466. package/docs/knowledge/http-dispatcher-bootstrap.md +61 -0
  467. package/docs/knowledge/import-rename-target.md +52 -0
  468. package/docs/knowledge/index.md +57 -0
  469. package/docs/knowledge/log.md +9 -0
  470. package/docs/knowledge/mcp-cancelled-task-precedence.md +41 -0
  471. package/docs/knowledge/mcp-http-prompt-discovery.md +41 -0
  472. package/docs/knowledge/mcp-schema-module-boundary.md +41 -0
  473. package/docs/knowledge/nullable-tool-uniqueness.md +52 -0
  474. package/docs/knowledge/overview-cli.md +74 -0
  475. package/docs/knowledge/overview-coding-proxy.md +72 -0
  476. package/docs/knowledge/overview-coding.md +72 -0
  477. package/docs/knowledge/overview-config.md +60 -0
  478. package/docs/knowledge/overview-core.md +72 -0
  479. package/docs/knowledge/overview-deploy.md +83 -0
  480. package/docs/knowledge/overview-mcp.md +61 -0
  481. package/docs/knowledge/overview-prisma.md +72 -0
  482. package/docs/knowledge/overview-providers.md +89 -0
  483. package/docs/knowledge/overview-sandbox.md +83 -0
  484. package/docs/knowledge/overview-surfaces.md +83 -0
  485. package/docs/knowledge/private-datastore-shared-boundary.md +54 -0
  486. package/docs/knowledge/proxy-settlement-projections.md +41 -0
  487. package/docs/knowledge/run-pricing-first-writer.md +43 -0
  488. package/docs/knowledge/schedule-claim-transaction.md +41 -0
  489. package/docs/knowledge/secret-entry-replica-contract.md +52 -0
  490. package/docs/knowledge/terminal-run-first-writer.md +41 -0
  491. package/docs/knowledge/transactional-agent-authorization.md +52 -0
  492. package/docs/knowledge/viewer-notify-write-isolation.md +30 -0
  493. package/docs/knowledge/warm-input-publication.md +30 -0
  494. package/docs/knowledge/workspace-staging-failure.md +54 -0
  495. package/docs/knowledge.md +54 -14
  496. package/docs/native-sandbox.md +119 -23
  497. package/docs/observability.md +4 -0
  498. package/docs/security-deployment.md +33 -2
  499. package/docs/slack-notifications.md +35 -19
  500. package/docs/tool-secrets.md +42 -10
  501. package/docs/viewer-api.openapi.yml +1 -1
  502. package/help/admin-viewer.md +24 -2
  503. package/help/architecture-agent.md +11 -6
  504. package/help/build-worker-image.md +3 -1
  505. package/help/builder-agent.md +19 -6
  506. package/help/code-review-agents.md +177 -6
  507. package/help/coding-packages.md +156 -6
  508. package/help/cost-attribution.md +9 -5
  509. package/help/creating-agents.md +14 -1
  510. package/help/dependency-cache.md +143 -0
  511. package/help/deploy-gke.md +15 -8
  512. package/help/errors/budget-exhausted.md +187 -0
  513. package/help/errors/budget-group-exhausted.md +5 -1
  514. package/help/errors/coding-stream-quota-exceeded.md +33 -0
  515. package/help/errors/coding-workspace-disk-exceeds-limit.md +39 -0
  516. package/help/errors/continuation-closed.md +9 -12
  517. package/help/errors/delegation-conflict.md +24 -0
  518. package/help/errors/file-list-truncated.md +45 -0
  519. package/help/errors/full-read-required.md +49 -0
  520. package/help/errors/github-account-not-allowed.md +4 -0
  521. package/help/errors/graph-incomplete.md +43 -0
  522. package/help/errors/graph-limit.md +43 -0
  523. package/help/errors/merge-conflict.md +49 -0
  524. package/help/errors/native-sandbox-gateway-error.md +20 -0
  525. package/help/errors/native-sandbox-launch-abandoned.md +21 -0
  526. package/help/errors/native-sandbox-worker-exited.md +3 -2
  527. package/help/errors/package-not-allowed-pending.md +52 -0
  528. package/help/errors/package-not-allowed.md +51 -0
  529. package/help/errors/package-refusals.md +43 -0
  530. package/help/errors/patch-cursor-malformed.md +31 -0
  531. package/help/errors/run-lost.md +39 -0
  532. package/help/errors/run-transcript-download.md +44 -0
  533. package/help/errors/secret-in-value.md +69 -0
  534. package/help/errors/target-merge.md +40 -0
  535. package/help/fix-merge-conflicts.md +73 -0
  536. package/help/github-app-setup.md +132 -0
  537. package/help/github.md +22 -0
  538. package/help/identity-and-access.md +2 -0
  539. package/help/jira.md +23 -6
  540. package/help/knowledge.md +16 -7
  541. package/help/local-repositories.md +1 -1
  542. package/help/low-power-mode.md +7 -1
  543. package/help/merge-order-check.md +5 -0
  544. package/help/native-capabilities.md +29 -1
  545. package/help/native-sandbox.md +15 -1
  546. package/help/operating-agents.md +5 -0
  547. package/help/package-audit-mode.md +91 -0
  548. package/help/related-pull-requests.md +10 -7
  549. package/help/resume-runs-locally.md +131 -0
  550. package/help/review-fix-rounds.md +33 -1
  551. package/help/sharing-agents.md +59 -0
  552. package/help/slack-notifications.md +19 -5
  553. package/help/status-comments.md +31 -0
  554. package/help/stop-run.md +58 -0
  555. package/help/troubleshooting/budgets.md +28 -0
  556. package/help/troubleshooting/coding-workers.md +78 -7
  557. package/package.json +17 -10
  558. package/prisma/migrations/20261016000000_registry_approved_accepted_advisories/migration.sql +3 -0
  559. package/prisma/migrations/20261016000001_mark_ready_when_passing/migration.sql +3 -0
  560. package/prisma/migrations/20261017000000_debug_trace_max_mb/migration.sql +4 -0
  561. package/prisma/migrations/20261018000000_dependency_cache/migration.sql +53 -0
  562. package/prisma/migrations/20261019000000_claude_max_output_tokens/migration.sql +5 -0
  563. package/prisma/migrations/20261021000000_pr_description_hash/migration.sql +4 -0
  564. package/prisma/migrations/20261022000000_dependency_snapshot_validation_metadata/migration.sql +4 -0
  565. package/prisma/migrations/20261023000000_package_audit_mode/migration.sql +27 -0
  566. package/prisma/migrations/20261024000000_budget_events/migration.sql +26 -0
  567. package/prisma/migrations/20261025000000_cache_aware_holds/migration.sql +9 -0
  568. package/prisma/migrations/20261026000000_budget_overrun/migration.sql +4 -0
  569. package/prisma/migrations/20261027000000_coding_run_request/migration.sql +1 -0
  570. package/prisma/migrations/20261028000000_native_gateway_review_reads/migration.sql +6 -0
  571. package/prisma/migrations/20261029000000_lead_survives_deploy/migration.sql +6 -0
  572. package/prisma/migrations/20261030000000_local_review_covered_sha/migration.sql +2 -0
  573. package/prisma/migrations/20261031000000_coding_run_budget_limit/migration.sql +9 -0
  574. package/prisma/migrations/20261101000000_run_transcripts/migration.sql +22 -0
  575. package/prisma/schema.prisma +311 -97
  576. package/dist/sandbox/generated/zod-to-json-schema.bundle.js +0 -5
@@ -50,6 +50,7 @@ Install and authenticate:
50
50
  - `kubectl`
51
51
  - Helm 3 or later (installs External Secrets Operator)
52
52
  - Node.js 24 and npm
53
+ - `curl`, `openssl` and `base64` (the database grants step uses them)
53
54
 
54
55
  You also need:
55
56
 
@@ -200,7 +201,9 @@ refuses to start with either one set and no token.
200
201
  `WARDBY_GITHUB_ALLOWED_ACCOUNTS` (optional, not a secret) adds GitHub accounts
201
202
  the App serves besides its owner. Pass it to `up.sh` on every run, for example
202
203
  `WARDBY_GITHUB_ALLOWED_ACCOUNTS=acme-labs WARDBY_HOSTNAME=app.example.com deploy/gke/up.sh`;
203
- a run without it serves only the App's owner. See
204
+ a run without it serves only the App's owner. `up.sh` gives the same value to
205
+ the control plane and to the native sandbox gateway, which runs sandboxed
206
+ agents' repository tools. See
204
207
  [Which accounts the App serves](code-review-agents.md#which-accounts-the-app-serves-wardby_github_allowed_accounts).
205
208
 
206
209
  `WARDBY_MOBILE_ENABLED=true` (optional, not a secret) lets the Wardby mobile app
@@ -210,6 +213,11 @@ sign-in off. It works for normal and low-power deploys. White-label builds that
210
213
  use their own redirect URI add `WARDBY_MOBILE_REDIRECT_URI` to the control
211
214
  plane's `env` themselves. See the help article `mobile-app`.
212
215
 
216
+ `WARDBY_MENTION_EXPLANATIONS=false` (optional, not a secret) stops the GitHub
217
+ App replying to say why a mention started nothing; pass it to `up.sh` on every
218
+ run, the same way. See
219
+ [What a linked review agent does](code-review-agents.md#what-a-linked-review-agent-does).
220
+
213
221
  Generate `SECRET_APP_KEY` with:
214
222
 
215
223
  ```sh
@@ -315,10 +323,9 @@ Allow DNS and the managed certificate to converge before treating an HTTPS
315
323
  failure as an application failure.
316
324
 
317
325
  On a brand-new project, run `terraform apply` and then
318
- `bootstrap-database-iam.sh` before `up.sh`: the bootstrap has to grant the
319
- migrator before any migration can run. See "Database login" below for the
320
- exact order, including the database check `up.sh` doesn't pass until a second
321
- bootstrap run has granted the coding proxy too.
326
+ `bootstrap-database-iam.sh` once before the first `up.sh`: the bootstrap has to
327
+ grant the migrator before any migration can run. See "Database login" below
328
+ for the exact order.
322
329
 
323
330
  ### Database login
324
331
 
@@ -327,20 +334,19 @@ through the Cloud SQL Auth Proxy, via Workload Identity from one Kubernetes
327
334
  service account. What each may do inside the database comes from a `NOLOGIN`
328
335
  group role in `deploy/gke/database-grants.sql`:
329
336
 
330
- | Workload | Google service account | Kubernetes service account | May do |
331
- | -------------- | ------------------------ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
332
- | Control plane | `<name_prefix>-app` | `wardby-control-plane` | `wardby_app`: read/write every table, including the durable executor's in schema `dbos`; never change a schema |
333
- | Coding proxy | `<name_prefix>-proxy` | `wardby-coding-proxy` | `wardby_proxy`: only its budget ledger — `CodingProxySession`/`CodingProxyRequest`/`RunModelUsage`, plus update `tokensIn`, `tokensOut`, `costUsd` and `turns` on `Run`, and read only its `id` |
334
- | Native gateway | `<name_prefix>-gateway` | `wardby-native-gateway` | Member of `wardby_app`: the same data access as the control plane, under its own login (see [Native sandbox](#native-sandbox)) |
335
- | Migrations | `<name_prefix>-migrator` | `wardby-migrator` | Acts as the table owner (`SET ROLE`), so `prisma migrate deploy` and `dbos schema` can alter and create tables |
337
+ | Workload | Google service account | Kubernetes service account | May do |
338
+ | -------------- | ------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
339
+ | Control plane | `<name_prefix>-app` | `wardby-control-plane` | `wardby_app`: read/write every table, including the durable executor's in schema `dbos`; never change a schema |
340
+ | Coding proxy | `<name_prefix>-proxy` | `wardby-coding-proxy` | `wardby_proxy`: its budget ledger (`CodingProxySession`/`CodingProxyRequest`/`RunModelUsage`: read, insert, update), the package registry's tables (`RegistryAllowance`, `RegistryFetch`, `RegistryAuditRecord`, `RegistryVersionFact`, `RegistryApprovedVersion`, `RegistryPlanRefusal`: read and insert only), the dependency cache's `DependencySnapshot` (read, insert, update, delete), update `tokensIn`, `tokensOut`, `costUsd` and `turns` on `Run` and read only its `id`, and read only the `runId`, `packageAllowlist`, `packagePolicy`, `repository`, `workerImage`, `toolImage`, `dependencyCache` and `packageAuditMode` columns of `CodingRun` |
341
+ | Native gateway | `<name_prefix>-gateway` | `wardby-native-gateway` | Member of `wardby_app`: the same data access as the control plane, under its own login (see [Native sandbox](#native-sandbox)) |
342
+ | Migrations | `<name_prefix>-migrator` | `wardby-migrator` | Acts as the table owner (`SET ROLE`), so `prisma migrate deploy` and `dbos schema` can alter and create tables |
336
343
 
337
344
  `deploy/gke/bootstrap-database-iam.sh` applies the grants as the built-in
338
- owner, from a short-lived Job inside the cluster. Run it whenever
339
- `database-grants.sql` changes, before deploying the release that needs the new
340
- grants (`bootstrap-database-iam.sh --check`, then `bootstrap-database-iam.sh`,
341
- then `up.sh`), and as part of the orders below. A release deployed ahead of its
342
- grants fails with "permission denied" wherever it uses one it doesn't have yet.
343
- The grants run in one transaction, so a statement the database refuses leaves
345
+ owner, from a short-lived Job inside the cluster. `up.sh` runs it on every
346
+ deploy, after the migrations and before the rollout (see
347
+ [Upgrading an existing deployment](#upgrading-an-existing-deployment)); you
348
+ run it by hand only on a brand-new project, below, or with `--check`. The
349
+ grants run in one transaction, so a statement the database refuses leaves
344
350
  nothing applied.
345
351
 
346
352
  The built-in owner is not a Terraform resource: `bootstrap-database-iam.sh`
@@ -349,119 +355,28 @@ SQL Admin API, uses that password once to apply the grants, and resets it to
349
355
  a value nobody holds on every exit, including a failed grant. No password is
350
356
  ever stored, printed, or passed as a process argument.
351
357
 
352
- A deployment that already runs and then gains the native gateway identity from
353
- `terraform apply` runs `deploy/gke/bootstrap-database-iam.sh` once, so the
354
- gateway's user gets its `wardby_app` membership, and then `deploy/gke/up.sh`.
355
- `up.sh`'s database check also tests the native gateway and says so if the
356
- grant is missing.
357
-
358
358
  A brand-new project runs, in this order:
359
359
 
360
360
  1. `terraform -chdir=deploy/gke apply` — creates the cluster, the instance
361
361
  and the four IAM database users. Run it yourself rather than through
362
362
  `up.sh`, which would go on to the migrations before the migrator has its
363
363
  grants.
364
- 2. `deploy/gke/bootstrap-database-iam.sh` (default mode) — fetches the
365
- cluster's kubectl credentials if you don't have them yet, creates the
366
- owner, and applies the migrator's (and the app's) grants. The coding
367
- proxy's ledger tables don't exist yet, so its grants are skipped: expected.
368
- 3. `deploy/gke/up.sh` — applies the migrations and rolls out, then stops at
369
- the database check: the coding proxy's grants are on tables that did not
370
- exist in step 2.
371
- 4. `deploy/gke/bootstrap-database-iam.sh` again — now that the tables exist,
372
- also applies the coding proxy's ledger grants.
373
- 5. `deploy/gke/up.sh` — rolls out again and passes every check.
374
-
375
- Two bootstrap runs, not one: a grant on a named table can't apply before the
376
- migration that creates that table has run.
377
-
378
- The same applies to every later release that adds a table the coding proxy
379
- uses: run `bootstrap-database-iam.sh` again after its migration. `up.sh`
380
- checks this for you. After the rollout it asks the database, as the proxy's
381
- own role, for every privilege `database-grants.sql` gives `wardby_proxy`
382
- (`deploy/gke/proxy-grant-checks.mjs`), and stops with the list of missing
383
- grants instead of letting the proxy fail registry requests with "permission
384
- denied".
385
-
386
- After upgrading an existing deployment to a release with cost attribution,
387
- re-run `bootstrap-database-iam.sh` so the coding proxy can record per-model
388
- usage for coding runs (used by the `cost_report` tool's `model` grouping).
389
- Until then coding runs still work, but their per-model breakdown isn't
390
- recorded.
364
+ 2. `deploy/gke/bootstrap-database-iam.sh` — fetches the cluster's kubectl
365
+ credentials if you don't have them yet, creates the owner, and applies the
366
+ migrator's (and the app's) grants. Grants on tables that don't exist yet
367
+ are skipped: expected.
368
+ 3. `deploy/gke/up.sh` — applies the migrations, then the grants again (now
369
+ that every table exists), then rolls out and passes every check.
391
370
 
392
371
  `bootstrap-database-iam.sh --check` runs the grants inside a transaction that
393
372
  is then rolled back, and reports success or the exact statement the database
394
- refused, without changing anything. Run it before the real run on a live
395
- deployment.
373
+ refused, without changing any grant. Use it to see why a grants step failed.
396
374
 
397
375
  `connector_enforcement` (the Cloud SQL instance setting) defaults to
398
376
  `REQUIRED`: it refuses any connection that does not come through the Auth
399
377
  Proxy or a Cloud SQL connector, and with port 5432 to the instance closed in
400
378
  every NetworkPolicy, there's no route left for a plain Postgres connection to
401
- even attempt. Leave it at the default; an older deployment still on password
402
- login moves off it on an earlier revision of this module, below.
403
-
404
- ### Moving an older deployment
405
-
406
- A deployment still on password login — from before this module retired it —
407
- can't adopt this revision directly: this revision no longer syncs the
408
- password `DATABASE_URL`, closes port 5432 and refuses non-Auth-Proxy
409
- connections, which would cut off pods still logging in with the password.
410
- It moves over in stages, because real pods are already serving traffic
411
- throughout.
412
-
413
- **1–2. Cut the running pods to IAM login, on the revision before this one.**
414
- Check out the revision of this module that added IAM login, before the
415
- password was retired: the merge of pull request #83 into `main`.
416
- `git log --oneline --first-parent main -- deploy/gke` lists the merges that
417
- changed this module, newest first; it's the one titled
418
- `Merge pull request #83 ...`, just below the merge that retired the password
419
- (`git log --oneline --merges --grep='#83' main` finds it directly). Then
420
- `git checkout <that commit>` and follow that revision's own
421
- `docs/getting-started-gke.md`, "Database login", and its order for "an
422
- existing deployment still on password login": `bootstrap-database-iam.sh
423
- --password-from-stdin --check`, the same without `--check`, then `up.sh`.
424
- That rolls out password-less pods while the password still works as a
425
- fallback, and proves the control plane and the coding proxy each read the
426
- database through their own IAM login. That revision's
427
- `connector_enforcement` default is still `NOT_REQUIRED`, so nothing that
428
- still uses the password is cut off. Then return to this revision
429
- (`git checkout main`) for the last stage.
430
-
431
- **3. Retire the password**, once every pod speaks IAM login and this change
432
- has merged to `main`:
433
-
434
- 1. Confirm nothing still uses the password: both Deployments' pods log in as
435
- IAM users, and no pod has a password `DATABASE_URL` in its effective env.
436
- 2. Delete the `database-url` Secret Manager secret:
437
- `gcloud secrets delete <name_prefix>-database-url --quiet` — this module no
438
- longer creates or reads it. Deleting it by hand first, before the next
439
- step, is what lets Terraform drop it from state instead of trying to
440
- destroy it.
441
- 3. Remove any `connector_enforcement` line from `terraform.tfvars` (or set
442
- it to `REQUIRED`), so the new default takes effect. Then `terraform plan`:
443
- expect the generated password destroyed, the `database-url` secret and
444
- its IAM binding gone from state (already deleted by hand), the old
445
- password-login user forgotten (not destroyed), `connector_enforcement`
446
- moving to `REQUIRED` on the instance (updated in place, not replaced),
447
- and no other destroy. Review
448
- the plan, then apply only once it matches that. If apply still fails
449
- trying to destroy the `database-url` secret, the secret wasn't actually
450
- deleted in step 2 — delete it and re-apply. Never turn off
451
- `secrets_deletion_protection` to get past that error: it unprotects every
452
- other secret in the same set, including `SECRET_APP_KEY` and the auth
453
- keys, and losing `SECRET_APP_KEY` makes every credential already stored
454
- in the database unreadable.
455
- 4. `deploy/gke/up.sh` — new ExternalSecrets carry no `DATABASE_URL`,
456
- NetworkPolicies no longer allow 5432, migrations, rollout, and the
457
- database and endpoint checks.
458
- 5. `deploy/gke/bootstrap-database-iam.sh` (default mode) — the guard now
459
- passes, since the Secret no longer has a `DATABASE_URL`: it sets a
460
- one-time owner password, reapplies the grants, and resets the password to
461
- a value nobody holds.
462
- 6. Verify: a direct password connection is refused (NetworkPolicy blocks
463
- 5432, and the instance refuses it too), the pods still log in through
464
- IAM, and the Terraform state holds no database password.
379
+ even attempt. Leave it at the default.
465
380
 
466
381
  ## 7. Verify
467
382
 
@@ -552,6 +467,38 @@ roll; if it fails, `up.sh` prints the `migrate` and `cloud-sql-proxy` container
552
467
  logs (and, if those are empty or the Job timed out, the Job's and pod's
553
468
  events), then stops.
554
469
 
470
+ ### Upgrading an existing deployment
471
+
472
+ To upgrade, check out the new release and re-run `deploy/gke/up.sh`. No
473
+ manual database step is needed: `up.sh` applies the migrations, then the
474
+ database grants (`deploy/gke/bootstrap-database-iam.sh`, which applies
475
+ `deploy/gke/database-grants.sql`), and only then rolls out the new pods. A
476
+ release that adds a table, a column, or a workload that needs a new grant
477
+ therefore never runs without it.
478
+
479
+ - **If the migrations fail**, `up.sh` stops before the grants and the
480
+ rollout; the running version is untouched.
481
+ - **If the grants fail**, `up.sh` stops before the rollout with a non-zero
482
+ exit; the running version keeps serving. The migrations already applied
483
+ are additive, so the running version tolerates them. Run
484
+ `deploy/gke/bootstrap-database-iam.sh --check` to see the exact statement
485
+ the database refused without changing anything, fix the cause, and re-run
486
+ `up.sh`.
487
+ - **After the rollout**, `up.sh` checks that each new pod can read the
488
+ database, and asks the database, as the coding proxy's own role, for every
489
+ privilege `database-grants.sql` gives it
490
+ (`deploy/gke/proxy-grant-checks.mjs`). A missing grant stops the deploy
491
+ with a non-zero exit and the list of what's missing, rather than letting
492
+ the proxy fail registry requests with "permission denied".
493
+
494
+ Never run two `up.sh` deploys against the same project at once: both would
495
+ run migrations, set and reset the database owner's password, and roll out
496
+ over each other. Nothing locks against it, so wait for one to finish.
497
+
498
+ You run `bootstrap-database-iam.sh` by hand only on a brand-new project,
499
+ between `terraform apply` and the first `up.sh` (see
500
+ [Database login](#database-login)), or as `--check` for a dry run.
501
+
555
502
  ### Durable executor
556
503
 
557
504
  The control plane runs native runs on the durable executor (`EXECUTOR=dbos`):
@@ -576,24 +523,33 @@ the step that was in flight runs again. Coding runs are Kubernetes Jobs and are
576
523
  `up.sh` re-run whose source did not change, runs continue. When you deploy
577
524
  new code, the old pod first **drains**: after its 30-second `preStop` it
578
525
  stops the scheduler and waits for the runs it is executing to finish, up to
579
- `SHUTDOWN_DRAIN_SECONDS` (default 600), while the new pod serves traffic.
580
- An idle pod exits at once. A run still going after that limit is marked
581
- `lost`; if an `@`-mention started it, its status comment on GitHub says the
582
- request was interrupted and should be repeated. The manifest's
583
- `terminationGracePeriodSeconds` (720) must stay above the drain limit plus
584
- the `preStop` delay.
526
+ `SHUTDOWN_DRAIN_SECONDS` (540 in the GKE manifest), while the new pod
527
+ serves traffic. Open HTTP connections, such as a connected MCP client's
528
+ stream, get 10 seconds to finish and are then closed; clients reconnect to
529
+ the new pod.
530
+ An idle pod exits at once. A native run that is waiting in a `delegate_to_*`
531
+ call on a coding sub-agent or a sandbox-mode native sub-agent is taken over
532
+ by the new version: it continues when the sub-agent finishes, without
533
+ repeating the turns it already took. A run that was mid-turn, waiting on
534
+ another tool, or waiting on a control-plane native sub-agent is marked
535
+ `lost` rather than taken over, as is a taken-over run whose recorded steps
536
+ no longer match the new code, and a run still going after the drain limit.
537
+ The sub-agent runs a lost run started are stopped (reason
538
+ `parent run lost`). If an `@`-mention started a lost run, its status comment
539
+ on GitHub says the request was interrupted and should be repeated. The
540
+ manifest's `terminationGracePeriodSeconds` (600) must stay above the drain
541
+ limit plus the `preStop` delay. Autopilot does not allow more than 600: a
542
+ larger value is lowered to 600, so to change the budget, lower
543
+ `SHUTDOWN_DRAIN_SECONDS` rather than raising the grace period.
585
544
  - **Data at rest and retention.** `dbos.operation_outputs` holds every step's
586
545
  output — prompts, model responses and full tool results — with no retention
587
546
  limit. Pruning finished workflows is the operator's job; see
588
547
  [Durable executor](security-deployment.md#durable-executor) for what is
589
548
  stored and how to prune it with `DBOS.deleteWorkflow`.
590
549
 
591
- **Enabling it on an existing deployment.** The grants changed, so apply them
592
- before deploying: run `deploy/gke/bootstrap-database-iam.sh --check`, then
593
- `deploy/gke/bootstrap-database-iam.sh`, then `deploy/gke/up.sh`. Without the
594
- grants the new control-plane pod crash-loops with "permission denied" while
595
- the old one keeps serving, and `up.sh` stops at the rollout. On a brand-new
596
- project the order under "Database login" already covers it.
550
+ **Enabling it on an existing deployment.** Re-run `deploy/gke/up.sh`: it
551
+ applies the durable executor's grants before the rollout (see
552
+ [Upgrading an existing deployment](#upgrading-an-existing-deployment)).
597
553
 
598
554
  **Switching back** to the in-process executor: set `EXECUTOR` to `in-process`
599
555
  in `deploy/kind-coding/manifests/overlays/gke-autopilot/control-plane.yaml`
@@ -643,10 +599,10 @@ control plane is configured with `NATIVE_SANDBOX_LAUNCHER=kubernetes`,
643
599
  `NATIVE_SANDBOX_ENFORCEMENT_TIMEOUT_MS=60000`. Worker pods use the gVisor runtime
644
600
  class, `KUBERNETES_PLATFORM=gke-autopilot`, and the run priority class.
645
601
 
646
- - **One-time bootstrap.** The gateway has its own database login. After
647
- `terraform apply` adds its identity to an existing deployment, run
648
- `deploy/gke/bootstrap-database-iam.sh` once, then `deploy/gke/up.sh`; see
649
- [Database login](#database-login).
602
+ - **Database login.** The gateway has its own database login. `up.sh`
603
+ applies its `wardby_app` membership before the rollout, so adding its
604
+ identity to an existing deployment needs no manual step; see
605
+ [Upgrading an existing deployment](#upgrading-an-existing-deployment).
650
606
  - **Enable per agent.** Nothing runs in the sandbox until you opt an agent in:
651
607
  set its `nativeExecutionMode` to `sandbox` with the `update_agent` MCP tool
652
608
  (native agents only).
@@ -723,6 +679,13 @@ low-power mode until its rollout ends, and the mark stops it scaling them back
723
679
  down. With the mode on they stay up through the deploy (its database checks
724
680
  need them) and sleep one idle window later if nothing uses them.
725
681
 
682
+ **Failed replicas.** Without the headroom placeholder, a rollout is more likely
683
+ to hit Autopilot's admission race: the node rejects a new pod with `OutOfcpu`
684
+ and the Deployment starts a replacement. The rejected pod stays behind as a
685
+ Failed pod. After the rollouts, `up.sh` deletes Failed pods of the control
686
+ plane, coding proxy and native gateway (never coding-run or sandbox pods), and
687
+ the Viewer shows any such leftover as an old replica rather than a failure.
688
+
726
689
  **Sleeping now.** To skip the idle window (for example right after a test), an
727
690
  admin calls the MCP tool `power_sleep`, optionally with `target` set to `proxy`
728
691
  or `gateway` (default both). It scales the target to 0 at once, but never stops
@@ -792,6 +755,32 @@ that schedules onto a fresh node — one that has never pulled the image before
792
755
  cached. Raise `KUBERNETES_READY_TIMEOUT_MS` if you see runs fail
793
756
  `service_unready` only on new nodes.
794
757
 
758
+ ### Run dependency cache
759
+
760
+ Off by default. To keep npm `node_modules` snapshots for coding runs
761
+ (see [Dependency cache](coding-packages.md#dependency-cache)), set
762
+ `dependency_cache_enabled = true` and a unique `dependency_cache_bucket_name` in
763
+ `terraform.tfvars`, and deploy with `WARDBY_DEPENDENCY_CACHE=true
764
+ deploy/gke/up.sh` (it grants the coding proxy's role the `DependencySnapshot`
765
+ table before the rollout; see
766
+ [Upgrading an existing deployment](#upgrading-an-existing-deployment)). Keep
767
+ `dependency_cache_max_age_days` equal to the proxy's
768
+ `WARDBY_DEPENDENCY_CACHE_MAX_AGE_DAYS` (default 14). Details:
769
+ [`deploy/gke/README.md`](../deploy/gke/README.md#run-dependency-cache).
770
+
771
+ ### Session transcripts
772
+
773
+ Off by default. To keep the transcripts of Claude Code agents with
774
+ `sessionResume` on (see
775
+ [Resume a run locally](coding-agent-setup.md#resume-a-run-locally)), set
776
+ `session_transcripts_enabled = true` and a unique
777
+ `session_transcripts_bucket_name` in `terraform.tfvars`, and deploy with
778
+ `WARDBY_SESSION_TRANSCRIPTS=true deploy/gke/up.sh`. The bucket is separate from
779
+ the dependency cache bucket and only the control plane can use it; its
780
+ lifecycle rule and the control plane's `RUN_TRANSCRIPT_RETENTION_DAYS` both
781
+ come from `session_transcripts_retention_days` (default 30). Details:
782
+ [`deploy/gke/README.md`](../deploy/gke/README.md#session-transcripts).
783
+
795
784
  ### Roll back
796
785
 
797
786
  Images are pinned by digest, so undoing a rollout restores exactly what ran
@@ -803,11 +792,9 @@ kubectl -n wardby-coding rollout undo deploy/wardby-coding-proxy
803
792
  kubectl -n wardby-coding rollout undo deploy/wardby-native-gateway
804
793
  ```
805
794
 
806
- `rollout undo` restores only the Deployments' images and pod templates — there
807
- is no password path to fall back to any more, so a rollback is safe only for
808
- a version that still speaks IAM login. It does not touch any NetworkPolicy: a
809
- change to the database egress rules themselves is not undone by `rollout
810
- undo`.
795
+ `rollout undo` restores only the Deployments' images and pod templates. It
796
+ does not touch the database grants or any NetworkPolicy: a change to the
797
+ database egress rules themselves is not undone by `rollout undo`.
811
798
 
812
799
  Database migrations only go forward: a rollback does not undo a schema change.
813
800
  That is safe while every migration is additive (new tables, nullable columns,
@@ -190,7 +190,10 @@ that case, register the MCP client manually as a **public/native application**:
190
190
 
191
191
  - require authorization code flow with PKCE S256;
192
192
  - do not issue or embed a client secret in a desktop client;
193
- - register the client's exact loopback callback URI; and
193
+ - register the client's exact loopback callback URI;
194
+ - enable the refresh-token grant and allow the `offline_access` scope, so the
195
+ client receives a refresh token (desktop clients need one to keep a session);
196
+ and
194
197
  - allow it to request the Wardby audience and scopes.
195
198
 
196
199
  To let the Wardby mobile app sign in, also register its private-use redirect
@@ -212,6 +215,12 @@ public client ID. If a client supports only dynamic registration, either enable
212
215
  that feature with suitable provider-side restrictions or use Wardby's
213
216
  self-hosted authentication mode.
214
217
 
218
+ The Wardby viewer desktop app signs in on a fixed loopback callback,
219
+ `http://127.0.0.1:8585/callback`; register that exact URI on its public/native
220
+ client. Some providers match a loopback redirect by its exact port rather than
221
+ the port-agnostic rule of RFC 8252 §7.3 — for those, this precise port must be
222
+ registered, because a port-less or wildcard loopback entry will not match it.
223
+
215
224
  ## 4. Configure Wardby
216
225
 
217
226
  Inject these settings through the deployment's secret/configuration mechanism:
@@ -422,6 +422,15 @@ along with the database. See
422
422
  run does, its requirements (the server must run on the same machine as the
423
423
  folders) and its limits (no submodules or Git LFS).
424
424
 
425
+ #### Faster installs: the dependency cache
426
+
427
+ For an npm repository, the coding proxy can keep `node_modules` snapshots so a
428
+ run starts with its dependencies already installed. Add
429
+ `WARDBY_DEPENDENCY_CACHE=true` to `.wardby/.env`, restart the stack, then set
430
+ `codingProfile.dependencyCache` to `true` on the agent with `update_agent`. This
431
+ needs wardby 0.7.0 or later; snapshots live on a Docker volume that
432
+ `down -v` removes. See [Dependency cache](coding-packages.md#dependency-cache).
433
+
425
434
  ## Your first agents
426
435
 
427
436
  [Agent recipes](agent-recipes.md) gives two complete, copyable setups: an
@@ -466,9 +466,12 @@ What happens:
466
466
  the same branch instead of opening a second pull request. The run message
467
467
  lists up to ten open pull requests recorded for the issue this way — any
468
468
  agent's, not only the triggered agent's own — each with its own run id, so
469
- a follow-up can continue every one the change touches.
469
+ a follow-up can continue every one the change touches. GitHub issues behave
470
+ the same way; see
471
+ [Follow-ups on an issue](code-review-agents.md#follow-ups-on-an-issue).
470
472
  - **Several repositories.** When the issue leads to pull requests in more
471
- than one repository (in the same run, or in later runs for the same issue),
473
+ than one repository (in the same run, or in later runs for the same issue,
474
+ Jira or GitHub),
472
475
  each pull request's description gets a **Related pull requests** section
473
476
  naming the issue and every pull request recorded for it, merged and closed
474
477
  ones included as context; see
@@ -574,8 +577,16 @@ A run is attributed when:
574
577
  - its parent run is attributed (sub-agents and coding runs inherit, and cannot
575
578
  change it).
576
579
 
580
+ GitHub issues are attributed the same way, to a work item with provider
581
+ `github` and key `owner/repo#N`: a run started by a mention on the issue (and
582
+ every sub-agent and coding run it starts), and runs on a pull request opened
583
+ from it. `cost_report` lists them like any other work item
584
+ (`provider: "github"` narrows to them).
585
+
577
586
  When a run is attributed to an issue, whatever the source, coding runs it
578
- starts name that issue in their pull request's title and body. The issue total
587
+ starts name that issue in their pull request's title and body. A GitHub issue
588
+ is named only in the body, as `From issue #N`, on a pull request in the
589
+ issue's own repository. The issue total
579
590
  in a Jira comment's spend line covers every run attributed to that issue,
580
591
  whichever agent ran it.
581
592
 
@@ -602,11 +613,9 @@ How to read the numbers:
602
613
  - You see the runs of agents you own and runs you triggered, the same as
603
614
  `list_runs` and `get_run`.
604
615
 
605
- On GKE, existing deployments must re-run the database grants bootstrap
606
- (`deploy/gke/bootstrap-database-iam.sh`) after upgrading, so the coding proxy
607
- can write per-model usage for coding runs. Until then coding runs still work,
608
- but their per-model breakdown isn't recorded. See
609
- [Getting started on GKE](getting-started-gke.md).
616
+ On GKE, the coding proxy needs a database grant to write per-model usage for
617
+ coding runs; `deploy/gke/up.sh` applies it when you upgrade. See
618
+ [Upgrading an existing deployment](getting-started-gke.md#upgrading-an-existing-deployment).
610
619
 
611
620
  ### Company-managed projects using Epic Link
612
621
 
@@ -0,0 +1,41 @@
1
+ ---
2
+ type: invariant
3
+ title: Blob absence must distinguish missing infrastructure
4
+ description: Mapping a storage outage to not_found can delete valid dependency snapshot metadata.
5
+ tags: [storage, cache, providers]
6
+ status: stable
7
+ generated: { by: wardby-architect/gpt-6.1-sol, at: 2026-10-16T18:34:00.557Z }
8
+ sources:
9
+ - id: missing
10
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/providers/storage/s3.ts#L26-L32
11
+ - id: cleanup
12
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/providers/coding-proxy/dependency-cache/service.ts#L275-L295
13
+ wardby:
14
+ schema: 1
15
+ roles: [builder, reviewer]
16
+ affects: ["src/providers/storage/**", "src/providers/coding-proxy/dependency-cache/service.ts"]
17
+ citations:
18
+ - id: missing
19
+ repo: github:wardby/wardby
20
+ path: src/providers/storage/s3.ts
21
+ lines: [26, 32]
22
+ symbol: isNotFound
23
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
24
+ spanHash: sha256:686cdad150c8c0d58e6b9acc5a2cd0bdf2e65b07b5ce8740938f43747f1408b7
25
+ - id: cleanup
26
+ repo: github:wardby/wardby
27
+ path: src/providers/coding-proxy/dependency-cache/service.ts
28
+ lines: [275, 295]
29
+ symbol: download
30
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
31
+ spanHash: sha256:02d4e058438d562ba55b6681e0267e890eed1ef82159a3b332d214f2fd066427
32
+ confidence: high
33
+ ---
34
+
35
+ The cache deletes snapshot metadata when getStream raises BlobStoreError with code not_found. The S3 adapter therefore maps missing keys, including the bare HeadObject NotFound response, but leaves NoSuchBucket and other failures as errors.[^missing][^cleanup]
36
+
37
+ **Why:** not_found authorizes metadata cleanup; it is not a generic unavailable response. New storage adapters must preserve this distinction so an infrastructure failure cannot masquerade as a dangling snapshot.
38
+
39
+ [^missing]: src/providers/storage/s3.ts, lines 26-32.
40
+
41
+ [^cleanup]: src/providers/coding-proxy/dependency-cache/service.ts, lines 275-295.
@@ -0,0 +1,52 @@
1
+ ---
2
+ type: invariant
3
+ title: Untrusted file bounds belong to the open descriptor
4
+ description: Checking a path before reading it leaves file substitution and growth races across worker boundaries.
5
+ tags: [coding, isolation, files]
6
+ status: stable
7
+ generated: { by: wardby-architect/gpt-6.1-sol, at: 2026-10-16T18:34:00.557Z }
8
+ sources:
9
+ - id: read
10
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/coding-worker/artifact.ts#L12-L48
11
+ - id: skills
12
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/coding-worker/skills.ts#L43-L54
13
+ - id: result
14
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/providers/jobs/docker.ts#L1263-L1277
15
+ wardby:
16
+ schema: 1
17
+ roles: [builder, reviewer]
18
+ affects: ["src/coding-worker/artifact.ts", "src/coding-worker/skills.ts", "src/providers/jobs/docker.ts"]
19
+ citations:
20
+ - id: read
21
+ repo: github:wardby/wardby
22
+ path: src/coding-worker/artifact.ts
23
+ lines: [12, 48]
24
+ symbol: readBoundedRegularFile
25
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
26
+ spanHash: sha256:ce5173dc2723b798c03e33fcb780c5c4da5b2dd15f2b517c4db77fec841f788d
27
+ - id: skills
28
+ repo: github:wardby/wardby
29
+ path: src/coding-worker/skills.ts
30
+ lines: [43, 54]
31
+ symbol: skillNameFromFile
32
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
33
+ spanHash: sha256:022ed743f1ccb279f73e4520bf458ad28eeace035ae695853c9e5f7ee52087d4
34
+ - id: result
35
+ repo: github:wardby/wardby
36
+ path: src/providers/jobs/docker.ts
37
+ lines: [1263, 1277]
38
+ symbol: readResultArtifact
39
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
40
+ spanHash: sha256:da6466b5dc44b1de79f473668648048b3f3ef3f82a6cce61516e8bfa76efb996
41
+ confidence: high
42
+ ---
43
+
44
+ The bounded reader opens without following a final symlink and without blocking on a FIFO, checks the opened descriptor against the path inode, and reads at most one byte beyond the limit to detect growth. Both repository skill scanning and Docker result collection use it.[^read][^skills][^result]
45
+
46
+ **What to do:** preserve descriptor checks and the bounded read together. Replacing them with a path stat followed by readFile reopens substitution and growth races even when the initial size was safe.
47
+
48
+ [^read]: src/coding-worker/artifact.ts, lines 12-48.
49
+
50
+ [^skills]: src/coding-worker/skills.ts, lines 43-54.
51
+
52
+ [^result]: src/providers/jobs/docker.ts, lines 1263-1277.
@@ -0,0 +1,52 @@
1
+ ---
2
+ type: invariant
3
+ title: Budget-waiting delegations retain admission slots
4
+ description: Releasing the delegation gate during a budget wait must preserve duplicate-child and delegation-limit accounting.
5
+ tags: [delegation, concurrency, budgets]
6
+ status: stable
7
+ generated: { by: wardby-architect/gpt-6.1-sol, at: 2026-10-15T10:20:14.397Z }
8
+ sources:
9
+ - id: admission
10
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/core/runner.ts#L1071-L1089
11
+ - id: wait
12
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/core/runner.ts#L1098-L1121
13
+ - id: persist
14
+ url: https://github.com/wardby/wardby/blob/744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be/src/core/runner.ts#L1175-L1182
15
+ wardby:
16
+ schema: 1
17
+ roles: [builder, reviewer]
18
+ affects: ["src/core/runner.ts", "src/core/serial-gate.ts", "src/core/delegation*", "src/core/dispatch.ts"]
19
+ citations:
20
+ - id: admission
21
+ repo: github:wardby/wardby
22
+ path: src/core/runner.ts
23
+ lines: [1071, 1089]
24
+ symbol: createNativeRunTools
25
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
26
+ spanHash: sha256:3b01bdf1c2104b1ce1256bff22b131b94943ce8fae5ff755da9b1ecabb225734
27
+ - id: wait
28
+ repo: github:wardby/wardby
29
+ path: src/core/runner.ts
30
+ lines: [1098, 1121]
31
+ symbol: createNativeRunTools
32
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
33
+ spanHash: sha256:095375a8e7a54af34aa1e4661fce4b44a2e500487c164d1c5c4dcd8d577e9bd5
34
+ - id: persist
35
+ repo: github:wardby/wardby
36
+ path: src/core/runner.ts
37
+ lines: [1175, 1182]
38
+ symbol: onPersisted
39
+ sha: 744d27eb926ccf7eafe52c98ac2af7f9bcd5c1be
40
+ spanHash: sha256:dbee201f976e3b74fffa64b5812e39c55bf86481e47abba414772f2deeb3c085
41
+ confidence: high
42
+ ---
43
+
44
+ Parallel delegation uses a per-attempt admission gate to keep the prior-child and delegation-limit checks together with child creation. Waiting child IDs participate in those checks even before they have a persisted run.[^admission] A budget waiter registers its child ID before releasing the gate, then reacquires the gate before removing that registration.[^wait] Coding dispatch releases the gate when the child row is persisted, allowing execution to overlap without overlapping admission.[^persist]
45
+
46
+ **What to do:** preserve the waiting-child reservation when changing retry or dispatch paths; releasing it early can admit the same child twice or exceed the delegation count. Holding the gate through child execution instead serializes the batch. [Coding-agent setup, budgets](../coding-agent-setup.md) already describes sibling budget waits; this concept records the admission consequence rather than repeating that behavior.
47
+
48
+ [^admission]: src/core/runner.ts, lines 1071-1089.
49
+
50
+ [^wait]: src/core/runner.ts, lines 1098-1121.
51
+
52
+ [^persist]: src/core/runner.ts, lines 1175-1182.