@aviaratech/ai-delivery 0.3.34 → 0.3.36

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 (301) hide show
  1. package/CONTRIBUTING.md +12 -206
  2. package/README.md +57 -506
  3. package/dist/agent.d.ts +0 -2
  4. package/dist/agent.js +76 -16
  5. package/dist/agent.js.map +7 -1
  6. package/dist/agentReadiness.test.js +73 -67
  7. package/dist/agentReadiness.test.js.map +7 -1
  8. package/dist/boardReconcile.test.js +1746 -0
  9. package/dist/boardReconcile.test.js.map +7 -0
  10. package/dist/build.test.js +130 -0
  11. package/dist/build.test.js.map +7 -0
  12. package/dist/callerErrors.test.js +105 -0
  13. package/dist/callerErrors.test.js.map +7 -0
  14. package/dist/cli.js +406 -485
  15. package/dist/cli.js.map +7 -1
  16. package/dist/cliResult.d.ts +2 -2
  17. package/dist/cliResult.js +42 -25
  18. package/dist/cliResult.js.map +7 -1
  19. package/dist/cliResult.test.js +434 -297
  20. package/dist/cliResult.test.js.map +7 -1
  21. package/dist/config/deliveryConfig.d.ts +320 -14
  22. package/dist/config/deliveryConfig.js +472 -385
  23. package/dist/config/deliveryConfig.js.map +7 -1
  24. package/dist/config/deliveryConfig.test.js +775 -584
  25. package/dist/config/deliveryConfig.test.js.map +7 -1
  26. package/dist/contributorChecks.test.js +1694 -916
  27. package/dist/contributorChecks.test.js.map +7 -1
  28. package/dist/currentConsumer.test.js +819 -737
  29. package/dist/currentConsumer.test.js.map +7 -1
  30. package/dist/currentTrackingScenario.test.js +499 -477
  31. package/dist/currentTrackingScenario.test.js.map +7 -1
  32. package/dist/delivery/common.js +160 -172
  33. package/dist/delivery/common.js.map +7 -1
  34. package/dist/delivery/delivery.test.js +509 -431
  35. package/dist/delivery/delivery.test.js.map +7 -1
  36. package/dist/delivery/evidence.d.ts +2 -2
  37. package/dist/delivery/evidence.js +133 -120
  38. package/dist/delivery/evidence.js.map +7 -1
  39. package/dist/delivery/index.js +7 -2
  40. package/dist/delivery/index.js.map +7 -1
  41. package/dist/delivery/legacy.js +65 -5
  42. package/dist/delivery/legacy.js.map +7 -1
  43. package/dist/delivery/policy.d.ts +10 -10
  44. package/dist/delivery/policy.js +211 -238
  45. package/dist/delivery/policy.js.map +7 -1
  46. package/dist/delivery/stage.d.ts +18 -18
  47. package/dist/delivery/stage.js +220 -235
  48. package/dist/delivery/stage.js.map +7 -1
  49. package/dist/deliveryBoard.d.ts +74 -0
  50. package/dist/deliveryBoard.js +644 -0
  51. package/dist/deliveryBoard.js.map +7 -0
  52. package/dist/deliveryBoard.test.d.ts +1 -0
  53. package/dist/deliveryBoard.test.js +649 -0
  54. package/dist/deliveryBoard.test.js.map +7 -0
  55. package/dist/deliveryHealth.test.js +179 -155
  56. package/dist/deliveryHealth.test.js.map +7 -1
  57. package/dist/dependencyCompatibility.test.js +154 -140
  58. package/dist/dependencyCompatibility.test.js.map +7 -1
  59. package/dist/directoryIndependent.test.js +417 -383
  60. package/dist/directoryIndependent.test.js.map +7 -1
  61. package/dist/dispatch.d.ts +17 -12
  62. package/dist/dispatch.js +330 -322
  63. package/dist/dispatch.js.map +7 -1
  64. package/dist/errors.d.ts +16 -3
  65. package/dist/errors.js +104 -82
  66. package/dist/errors.js.map +7 -1
  67. package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
  68. package/dist/fixtures/deliveryBoardReplay.js +617 -0
  69. package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
  70. package/dist/fixtures/discovery.d.ts +59 -19
  71. package/dist/fixtures/discovery.js +96 -90
  72. package/dist/fixtures/discovery.js.map +7 -1
  73. package/dist/fixtures/inertEntrypointChild.js +57 -56
  74. package/dist/fixtures/inertEntrypointChild.js.map +7 -1
  75. package/dist/fixtures/inertEntrypoints.d.ts +1 -1
  76. package/dist/fixtures/inertEntrypoints.js +321 -276
  77. package/dist/fixtures/inertEntrypoints.js.map +7 -1
  78. package/dist/fixtures/inertTarget.d.ts +78 -7
  79. package/dist/fixtures/inertTarget.js +769 -691
  80. package/dist/fixtures/inertTarget.js.map +7 -1
  81. package/dist/fixtures/issue63.d.ts +4 -3
  82. package/dist/fixtures/issue63.js +260 -274
  83. package/dist/fixtures/issue63.js.map +7 -1
  84. package/dist/fixtures/issueProjectItems.d.ts +20 -0
  85. package/dist/fixtures/issueProjectItems.js +15 -0
  86. package/dist/fixtures/issueProjectItems.js.map +7 -0
  87. package/dist/fixtures/readView.d.ts +120 -0
  88. package/dist/fixtures/readView.js +172 -0
  89. package/dist/fixtures/readView.js.map +7 -0
  90. package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
  91. package/dist/fixtures/recordedGitHubFlows.js +109 -0
  92. package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
  93. package/dist/genericCompatibility.test.js +64 -55
  94. package/dist/genericCompatibility.test.js.map +7 -1
  95. package/dist/git.js +73 -67
  96. package/dist/git.js.map +7 -1
  97. package/dist/gitProcess.d.ts +1 -1
  98. package/dist/gitProcess.js +58 -53
  99. package/dist/gitProcess.js.map +7 -1
  100. package/dist/github/client.d.ts +2 -2
  101. package/dist/github/client.js +484 -379
  102. package/dist/github/client.js.map +7 -1
  103. package/dist/github/commandIdentityPolicy.js +44 -51
  104. package/dist/github/commandIdentityPolicy.js.map +7 -1
  105. package/dist/github/discovery.d.ts +3 -0
  106. package/dist/github/discovery.js +197 -201
  107. package/dist/github/discovery.js.map +7 -1
  108. package/dist/github/discovery.test.js +223 -177
  109. package/dist/github/discovery.test.js.map +7 -1
  110. package/dist/github/issueHistory.d.ts +2 -2
  111. package/dist/github/issueHistory.js +117 -125
  112. package/dist/github/issueHistory.js.map +7 -1
  113. package/dist/github/machineAuth.d.ts +1 -1
  114. package/dist/github/machineAuth.js +126 -117
  115. package/dist/github/machineAuth.js.map +7 -1
  116. package/dist/github/machineAuth.test.js +755 -639
  117. package/dist/github/machineAuth.test.js.map +7 -1
  118. package/dist/github/nativeIssueMetadata.js +286 -273
  119. package/dist/github/nativeIssueMetadata.js.map +7 -1
  120. package/dist/github/projectDelivery.d.ts +53 -1
  121. package/dist/github/projectDelivery.js +623 -460
  122. package/dist/github/projectDelivery.js.map +7 -1
  123. package/dist/github/relationships.d.ts +5 -2
  124. package/dist/github/relationships.js +434 -333
  125. package/dist/github/relationships.js.map +7 -1
  126. package/dist/github/repo.d.ts +1 -0
  127. package/dist/github/repo.js +123 -96
  128. package/dist/github/repo.js.map +7 -1
  129. package/dist/index.js +3 -3
  130. package/dist/index.js.map +7 -1
  131. package/dist/issue.d.ts +103 -7
  132. package/dist/issue.js +2104 -1547
  133. package/dist/issue.js.map +7 -1
  134. package/dist/issue63History.test.js +40 -42
  135. package/dist/issue63History.test.js.map +7 -1
  136. package/dist/issue63Routes.test.js +154 -143
  137. package/dist/issue63Routes.test.js.map +7 -1
  138. package/dist/issueBatchUpdate.test.js +1004 -683
  139. package/dist/issueBatchUpdate.test.js.map +7 -1
  140. package/dist/issueBlockerGuard.test.js +262 -226
  141. package/dist/issueBlockerGuard.test.js.map +7 -1
  142. package/dist/issueContract.d.ts +23 -4
  143. package/dist/issueContract.js +416 -395
  144. package/dist/issueContract.js.map +7 -1
  145. package/dist/issueContract.test.d.ts +4 -3
  146. package/dist/issueContract.test.js +358 -321
  147. package/dist/issueContract.test.js.map +7 -1
  148. package/dist/issueDates.test.js +235 -233
  149. package/dist/issueDates.test.js.map +7 -1
  150. package/dist/issueInfoReadback.test.js +304 -190
  151. package/dist/issueInfoReadback.test.js.map +7 -1
  152. package/dist/issueIntake.test.js +1945 -1732
  153. package/dist/issueIntake.test.js.map +7 -1
  154. package/dist/issueJournal.d.ts +40 -19
  155. package/dist/issueJournal.js +229 -138
  156. package/dist/issueJournal.js.map +7 -1
  157. package/dist/issueJournal.test.js +605 -422
  158. package/dist/issueJournal.test.js.map +7 -1
  159. package/dist/issueRollup.test.d.ts +1 -0
  160. package/dist/issueRollup.test.js +476 -0
  161. package/dist/issueRollup.test.js.map +7 -0
  162. package/dist/issueTracking.test.js +1088 -593
  163. package/dist/issueTracking.test.js.map +7 -1
  164. package/dist/issueWriteRecovery.test.d.ts +1 -0
  165. package/dist/issueWriteRecovery.test.js +260 -0
  166. package/dist/issueWriteRecovery.test.js.map +7 -0
  167. package/dist/lifecycle.test.js +112 -441
  168. package/dist/lifecycle.test.js.map +7 -1
  169. package/dist/logger.js +80 -74
  170. package/dist/logger.js.map +7 -1
  171. package/dist/mcp/index.js +116 -90
  172. package/dist/mcp/index.js.map +7 -1
  173. package/dist/mcp/tools.d.ts +790 -220
  174. package/dist/mcp/tools.js +267 -333
  175. package/dist/mcp/tools.js.map +7 -1
  176. package/dist/pluginAuthProbe.js +63 -52
  177. package/dist/pluginAuthProbe.js.map +7 -1
  178. package/dist/pluginAuthProbe.test.js +85 -62
  179. package/dist/pluginAuthProbe.test.js.map +7 -1
  180. package/dist/pluginCredentials.test.js +282 -259
  181. package/dist/pluginCredentials.test.js.map +7 -1
  182. package/dist/pluginDoctor.test.js +653 -588
  183. package/dist/pluginDoctor.test.js.map +7 -1
  184. package/dist/pluginInstaller.d.ts +7 -5
  185. package/dist/pluginInstaller.js +1173 -1231
  186. package/dist/pluginInstaller.js.map +7 -1
  187. package/dist/pluginInstaller.test.js +1822 -1283
  188. package/dist/pluginInstaller.test.js.map +7 -1
  189. package/dist/pluginPackaging.test.js +485 -305
  190. package/dist/pluginPackaging.test.js.map +7 -1
  191. package/dist/pr.d.ts +132 -94
  192. package/dist/pr.js +1521 -1323
  193. package/dist/pr.js.map +7 -1
  194. package/dist/pr.test.js +1678 -632
  195. package/dist/pr.test.js.map +7 -1
  196. package/dist/prAssociation.test.js +2419 -1788
  197. package/dist/prAssociation.test.js.map +7 -1
  198. package/dist/prDispatch.test.js +150 -89
  199. package/dist/prDispatch.test.js.map +7 -1
  200. package/dist/readView.d.ts +183 -0
  201. package/dist/readView.js +217 -0
  202. package/dist/readView.js.map +7 -0
  203. package/dist/readView.test.d.ts +1 -0
  204. package/dist/readView.test.js +119 -0
  205. package/dist/readView.test.js.map +7 -0
  206. package/dist/releaseReconciliation.test.js +267 -288
  207. package/dist/releaseReconciliation.test.js.map +7 -1
  208. package/dist/releaseWorkflow.test.js +2493 -422
  209. package/dist/releaseWorkflow.test.js.map +7 -1
  210. package/dist/review.d.ts +738 -2
  211. package/dist/review.js +601 -348
  212. package/dist/review.js.map +7 -1
  213. package/dist/review.test.js +1218 -812
  214. package/dist/review.test.js.map +7 -1
  215. package/dist/reviewSubmit.test.d.ts +1 -0
  216. package/dist/reviewSubmit.test.js +747 -0
  217. package/dist/reviewSubmit.test.js.map +7 -0
  218. package/dist/services/agentReadinessService.js +42 -37
  219. package/dist/services/agentReadinessService.js.map +7 -1
  220. package/dist/services/blockerGuardService.js +188 -188
  221. package/dist/services/blockerGuardService.js.map +7 -1
  222. package/dist/services/boardReconcileService.d.ts +1204 -0
  223. package/dist/services/boardReconcileService.js +1445 -0
  224. package/dist/services/boardReconcileService.js.map +7 -0
  225. package/dist/services/deliveryAdmission.d.ts +2 -0
  226. package/dist/services/deliveryAdmission.js +129 -152
  227. package/dist/services/deliveryAdmission.js.map +7 -1
  228. package/dist/services/deliveryHealthService.js +197 -199
  229. package/dist/services/deliveryHealthService.js.map +7 -1
  230. package/dist/services/legacyIssueMigration.js +263 -277
  231. package/dist/services/legacyIssueMigration.js.map +7 -1
  232. package/dist/services/worktreeRegistry.d.ts +27 -119
  233. package/dist/services/worktreeRegistry.js +765 -1182
  234. package/dist/services/worktreeRegistry.js.map +7 -1
  235. package/dist/stagedChecks.test.js +396 -194
  236. package/dist/stagedChecks.test.js.map +7 -1
  237. package/dist/start.test.js +99 -95
  238. package/dist/start.test.js.map +7 -1
  239. package/dist/stdoutRegression.test.js +354 -350
  240. package/dist/stdoutRegression.test.js.map +7 -1
  241. package/dist/targetPolicyDiscovery.test.js +141 -143
  242. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  243. package/dist/targetPolicyEntrypoints.test.js +308 -269
  244. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  245. package/dist/targetPolicyLocal.test.js +580 -1051
  246. package/dist/targetPolicyLocal.test.js.map +7 -1
  247. package/dist/targetPolicyRoutes.test.js +305 -281
  248. package/dist/targetPolicyRoutes.test.js.map +7 -1
  249. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  250. package/dist/targetRepositoryExecution.test.js +463 -0
  251. package/dist/targetRepositoryExecution.test.js.map +7 -0
  252. package/dist/terminalMessages.js +41 -35
  253. package/dist/terminalMessages.js.map +7 -1
  254. package/dist/toolOutput.d.ts +2 -0
  255. package/dist/toolOutput.js +36 -0
  256. package/dist/toolOutput.js.map +7 -0
  257. package/dist/toolOutput.test.d.ts +1 -0
  258. package/dist/toolOutput.test.js +240 -0
  259. package/dist/toolOutput.test.js.map +7 -0
  260. package/dist/utils/atomicJson.js +84 -76
  261. package/dist/utils/atomicJson.js.map +7 -1
  262. package/dist/utils/filesystem.js +15 -18
  263. package/dist/utils/filesystem.js.map +7 -1
  264. package/dist/utils/lockfile.js +68 -71
  265. package/dist/utils/lockfile.js.map +7 -1
  266. package/dist/verification.d.ts +1 -19
  267. package/dist/verification.js +1020 -1929
  268. package/dist/verification.js.map +7 -1
  269. package/dist/verificationGate.test.js +127 -117
  270. package/dist/verificationGate.test.js.map +7 -1
  271. package/dist/version.d.ts +6 -0
  272. package/dist/version.js +24 -10
  273. package/dist/version.js.map +7 -1
  274. package/dist/worktree.d.ts +3 -15
  275. package/dist/worktree.js +97 -177
  276. package/dist/worktree.js.map +7 -1
  277. package/package.json +10 -8
  278. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  279. package/plugins/ai-delivery/README.md +47 -156
  280. package/plugins/ai-delivery/plugin.json +1 -1
  281. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +261 -43
  282. package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
  283. package/plugins/ai-delivery/runtime/package.json +1 -1
  284. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  285. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  286. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  287. package/dist/investigationCompletion.test.js +0 -728
  288. package/dist/investigationCompletion.test.js.map +0 -1
  289. package/dist/setup.d.ts +0 -60
  290. package/dist/setup.js +0 -585
  291. package/dist/setup.js.map +0 -1
  292. package/dist/setup.test.js +0 -3058
  293. package/dist/setup.test.js.map +0 -1
  294. package/dist/worktreeTransition.d.ts +0 -211
  295. package/dist/worktreeTransition.js +0 -1037
  296. package/dist/worktreeTransition.js.map +0 -1
  297. package/dist/worktreeTransition.test.js +0 -1191
  298. package/dist/worktreeTransition.test.js.map +0 -1
  299. /package/dist/{investigationCompletion.test.d.ts → boardReconcile.test.d.ts} +0 -0
  300. /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
  301. /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
package/README.md CHANGED
@@ -1,19 +1,26 @@
1
1
  # ai-delivery
2
2
 
3
- GitHub issue and pull request delivery through a CLI, a stdio MCP server and a self-contained Codex/Claude Code plugin. Explicit repository calls work from any directory. The runtime reads operator-owned JSON and GitHub metadata; it never imports a consuming repository's policy or runs its checks. Run contributor checks and prepare worktrees through the host's normal tools.
3
+ ai-delivery handles **GitHub issues, pull requests, independent reviews and guarded merges** through a CLI, stdio MCP server and Codex/Claude Code plugin. GitHub owns relationships, Project tracking, checks and review eligibility. Hosts prepare worktrees, run checks, commit, push and clean up.
4
+
5
+ Explicit `--repo owner/name` or MCP `repo: "owner/name"` works outside Git. Without it, the checkout's `origin` selects the repository. Only `github.com` is supported. The runtime reads operator-owned JSON; it never executes a consuming repository's policy or checks.
4
6
 
5
7
  ## Installation and runtime
6
8
 
7
- Use Node 24.21.0 and npm 11.19.0 for the CLI, MCP server and contributor checks. Public library consumers also support Node 26.2.0. Set `AI_DELIVERY_NODE26_EXECUTABLE` to that actual executable for contributor checks. Install a qualified published version or reviewed archive, then use the [plugin guide](plugins/ai-delivery/README.md) for native installation.
9
+ Use Node **24.21.0** and npm **11.19.0** for CLI/MCP and contributor checks; public library consumers also support Node **26.2.0**. Install a qualified published version or reviewed archive. The [complete plugin](plugins/ai-delivery/README.md) is the canonical native installation; CLI/SDK/MCP entrypoints remain available.
8
10
 
9
11
  ```sh
12
+ npm install --global @aviaratech/ai-delivery@<qualified-version>
13
+ ai-delivery plugin install --host codex --scope user --version <qualified-version> --json
14
+ ai-delivery plugin doctor --host codex --scope user --json
10
15
  ai-delivery --repo example/widget info --issue 17
11
16
  ai-delivery mcp:serve
12
17
  ```
13
18
 
19
+ Use `--host claude-code` for Claude Code, which supports `user`, `project` and `local` scopes; Codex supports `user`. Select a project with `--repo-root`. Preserve managed state on recovery errors; never substitute another version silently.
20
+
14
21
  ## User configuration
15
22
 
16
- Create `~/.config/aviaratech-ai/ai-delivery.json`, or set `AI_DELIVERY_CONFIG` to an absolute operator-owned JSON path. Required settings are `schemaVersion`, `roles.author`, `roles.reviewer`, `project`, and `checkoutRoots`; validation errors name the missing setting. A consuming repository needs no ai-delivery files.
23
+ Use `~/.config/aviaratech-ai/ai-delivery.json`, or an absolute `AI_DELIVERY_CONFIG` path. A consuming repository needs no ai-delivery files. Illustrative settings:
17
24
 
18
25
  ```json
19
26
  {
@@ -26,11 +33,11 @@ Create `~/.config/aviaratech-ai/ai-delivery.json`, or set `AI_DELIVERY_CONFIG` t
26
33
  },
27
34
  "reviewer": {
28
35
  "identity": "delivery-reviewer",
29
- "credentialEnv": {
30
- "appId": "DELIVERY_REVIEWER_APP_ID",
31
- "installationId": "DELIVERY_REVIEWER_INSTALLATION_ID",
32
- "privateKeyPath": "DELIVERY_REVIEWER_KEY_PATH"
33
- }
36
+ "authSource": "app",
37
+ "appId": 12345,
38
+ "installationId": 67890,
39
+ "actorLogin": "your-reviewer-app[bot]",
40
+ "provider": "openai"
34
41
  }
35
42
  },
36
43
  "project": 7,
@@ -38,531 +45,75 @@ Create `~/.config/aviaratech-ai/ai-delivery.json`, or set `AI_DELIVERY_CONFIG` t
38
45
  }
39
46
  ```
40
47
 
41
- An App author uses the same `credentialEnv` shape as the reviewer. Roles and credential environment names must be distinct. Credential values and private keys remain outside source control. A configured personal author uses its named token variable. With the conventional `GH_TOKEN` reference **absent**, it instead uses the existing active personal account from GitHub CLI `gh` for `github.com`. A present empty, malformed or expired token fails without switching accounts. A custom reference such as `DELIVERY_AUTHOR_TOKEN` always requires that exact value; its absence does not select a machine session. Unrelated `GITHUB_TOKEN` values do not satisfy either configured reference. The optional `--identity` or `AI_DELIVERY_IDENTITY` override must select the command's configured role; neither is needed for normal operation. The explicit legacy `--identity personal --personal-auth` override is limited to development access diagnosis under an App author configuration; it requires an explicit token and does not use a missing-token machine fallback. Publication requires the configured author.
42
-
43
- The machine route uses `gh auth status --hostname github.com --active --json hosts`, validates the selected account's state, then privately obtains that exact user's credential through `gh auth token --hostname github.com --user <active-user>`. An actual authenticated user read must match the selection. Repository discovery and command execution retain that account; failed identity/access never selects another account. Inactive accounts with errors do not invalidate a healthy active user. Only required non-secret home/PATH/gh configuration selectors reach `gh`; token overrides, debug flags and unrelated credentials are excluded. No login, switch, refresh, credential-store scraping or persistent configuration change occurs. The reviewer still uses its distinct configured App, with no personal-session fallback.
44
-
45
- `gh` must be executable on the running process's PATH and able to access its existing session. A terminal login does not prove that a Codex or Claude GUI process can find `gh` or use its keyring. `config:resolve` reports the selected route/executable and authenticated actor, or a safe actionable refusal. Default plugin doctor does not inspect or authenticate the session. This package currently supports `github.com` repositories; enterprise URLs or a conflicting `GH_HOST` refuse rather than silently using another host. No write probe or permission grant is performed, and a successful identity/repository read does not guarantee every later write or counted App approval.
48
+ Keep credentials outside source control. An absent conventional `GH_TOKEN` selects the existing active `gh` personal session; an empty/invalid value fails without switching accounts. Custom token references require their exact value. The reviewer uses its distinct configured App, with no personal fallback. Read [credentials and readiness](plugins/ai-delivery/README.md#credentials-and-readiness), including GUI environment limits, legacy App references and selected key sources.
46
49
 
47
- The explicit organization Project number selects a compatible writable Project. Optional `pointsField`, `priorityField`, `statusField`, four `statuses` names (`todo`, `inProgress`, `blocked`, `done`), and `issueTypes` customize discovered metadata. Defaults are Points, Priority, Status and Todo/In Progress/Blocked/Done. IDs, option catalogs and issue types come from GitHub. This runtime supports github.com organization repositories and native organization single-select Points/Priority fields bound into the selected Project.
50
+ The illustrated reviewer profile reads unencrypted RSA PEM from `GH_PRIVATE_KEY_DELIVERY_REVIEWER` when `credentialSource` is omitted. Supply it through your existing secret mechanism. Optional env/file/command sources follow the [configuration schema](src/config/deliveryConfig.ts); a failed source never selects another.
48
51
 
49
- Every remote MCP tool accepts `repo: "owner/name"`; the CLI uses global `--repo`. Without a selector, the launch checkout's `origin` supplies the destination. Explicit remote calls never probe launch-directory Git or checkoutRoots. One MCP server can switch A → B → A without restart. Tool and server selectors that disagree are refused.
52
+ ## Five-minute reviewer setup
50
53
 
51
- Local runtime setup and legacy transition calls select a matching `origin` per invocation. A matching current checkout wins; otherwise `checkoutRoots` may contain exact clone roots or parents whose immediate directories contain clones. Duplicate physical matches are collapsed. Zero or multiple matches refuse with a specific diagnostic; use `--repo-root` to select the intended matching clone. Git probes disable repository hooks, filters, fsmonitor and external diff/text conversion. Remote delivery never performs a checkout, push, or worktree mutation.
54
+ Configure a distinct installed App with `contents:read` and `pull_requests:write`, its actual identity/provider, and one supported credential source. Authentication does not prove counted approval. Follow the [independent reviewer command](plugins/ai-delivery/README.md#independent-reviewer-command) and [review schemas](src/review.ts). Strict `review submit` requires requested/effective model metadata and provider compatibility; never fabricate unexposed metadata. Established integrations retain the `pr:review --artifact` route.
52
55
 
53
56
  ## GitHub-gated lifecycle
54
57
 
58
+ Create/update a typed issue with problem, outcome, acceptance/proof, non-goals, native Issue Type and Points. Preserve history when rewriting. Ready, open, unblocked issues can start; readiness alone does not activate work.
59
+
55
60
  ```sh
56
- ai-delivery --repo example/widget config:resolve
57
61
  ai-delivery --repo example/widget ready:check --issue 17
58
62
  ai-delivery --repo example/widget start --issue 17
59
- # Prepare a host-owned worktree, implement, run repository checks, commit and push.
60
- ai-delivery --repo example/widget pr:create --issue 17 --body-file ./pr-body.md --dry-run
61
- ai-delivery --repo example/widget pr:create --issue 17 --body-file ./pr-body.md
62
- # Obtain an independent review of the exact remote PR head and diff.
63
- ai-delivery --repo example/widget pr:review --issue 17 --pr 23 --artifact ./review-artifact.json
63
+ # Host: prepare worktree, implement, check, commit and push.
64
+ ai-delivery --repo example/widget pr:create --issue 17 --body-file pr-body.md
65
+ # Independent reviewer submits its own exact-head verdict/artifact.
64
66
  ai-delivery --repo example/widget pr:create --issue 17 --ready
65
67
  ai-delivery --repo example/widget pr:checks --pr 23
66
- ai-delivery --repo example/widget finish --issue 17 --pr 23 --reviewed-head <reviewed-sha>
67
- ```
68
-
69
- `start` creates or reuses a GitHub-linked branch from the repository's default branch. A ready open issue with no unresolved native blockers is explicitly activated: the selected Project item becomes In Progress (using configured field/option names), with exact readback before the Started journal. An already active item is reused; missing membership is added only for that issue. Closed issues, parked drafts, unresolved blockers and archived Project items refuse activation. Info, body-only edits, PR dry runs and host worktree preparation do not activate work.
70
-
71
- It can create a tracking issue first, or resume a known partially created issue with `--resume-created`; recovery returns the exact known issue and safe arguments without creating another issue.
72
-
73
- If an existing issue's branch, Project status or journal operation fails or its response is uncertain, `start-incomplete` returns the known issue, failure phase and `safeResume.arguments`; CLI exits nonzero. Retry those arguments through `issue_start` (or `start --issue <number> --branch <branch>` when returned). Recovery rechecks current readiness, linked branches, Project membership/status and the authored journal before continuing, without creating another issue, branch or journal. Newly created issues retain `created-not-started` recovery. Only incomplete tracking returns `resumeCreated: true` with tracking fields; later start-stage recovery selects the known issue/branch and preserves subsequent native edits and parking.
74
-
75
- Hosts own local worktree preparation and cleanup. PR creation accepts any non-empty body, appends the issue closing reference when absent, and reuses the matching remote branch/PR. Merged completion uses GitHub issue association even after branch deletion. Existing repository labels are accepted; an unknown label is refused before issue mutation.
76
-
77
- For a new read-only investigation, the host first creates the linked `issue/N` worktree at the matching clone's exact `.worktrees/issue-N` path. Before investigating, explicitly register its unchanged current default commit:
78
-
79
- ```sh
80
- ai-delivery --repo example/widget --repo-root /clone start --issue 17 \
81
- --investigation-worktree /clone/.worktrees/issue-17 --expected-head <initial-sha>
82
- ```
83
-
84
- This author operation records prospective commit/tree, physical worktree identity, canonical registry custody and a native preparation acknowledgement. It creates no branch or worktree and refuses existing legacy custody. Historical investigations without this preparation cannot be adopted retrospectively.
85
-
86
- After independently reviewing the complete result, preserve it in a private regular file outside the worktree. The issue must already be closed with reason `completed`, with no PR associated with its linked branch. Inspection prints the exact operator authority body and, when its comment ID is supplied, the configured-App acceptance body:
87
-
88
- ```sh
89
- ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
90
- --investigation --result /retained/result.txt --dry-run
91
- ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
92
- --investigation --result /retained/result.txt --authority-comment <operator-comment> --dry-run
93
- ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
94
- --investigation --result /retained/result.txt \
95
- --authority-comment <operator-comment> --acceptance-comment <app-comment>
96
- ```
97
-
98
- Completion consumes existing whole native comments from the configured personal operator and distinct configured reviewer App. These bind the preparation, exact result bytes, unchanged commit/tree and removal scope, including producer quiescence and continued exclusion of writers. This path supplies no non-PR App acceptance writer; unavailable authentic acceptance is a refusal, never a local approval substitute. Keep the result, native acceptance and producer exclusion available through interruption and resume.
99
-
100
- Run completion from outside the investigation worktree. Dirty, untracked or ignored files, `assume-unchanged` or `skip-worktree` index entries, new commits (including same-tree commits), changed native refs, ambiguous or foreign custody and retained verification writers refuse removal. PR/merge options are incompatible with investigation mode. A durable intent preserves the result, native authority and exact registry beforeimage before non-force Git removal. Resume the same command and evidence after an interruption; unexplained absence or recreated worktrees refuse. Exact disk/Git/registry postconditions seal completion. The branch, private evidence and unrelated registry entries remain retained; ordinary source delivery still requires its full merged-PR proof.
101
-
102
- Use explicit `--non-closing` on each PR command when delivering a partial fix while its issue remains OPEN. The default closing lifecycle above is unchanged. A non-closing body begins with exactly `References owner/repository#number` on its first line. Creation adds this line to the supplied body; inspection, review, promotion and merge require it to remain unchanged in meaning.
103
-
104
- ```sh
105
- # An existing author-owned PR can transition its body only with an exact selector.
106
- ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --body-file ./partial-body.md --dry-run
107
- ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --body-file ./partial-body.md
108
- ai-delivery --repo example/widget pr:info --issue 17 --pr 23 --non-closing
109
- ai-delivery --repo example/widget pr:review --issue 17 --pr 23 --non-closing --artifact ./review-artifact.json
110
- ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --ready
111
- ai-delivery --repo example/widget pr:merge --issue 17 --pr 23 --non-closing --strategy squash --reviewed-head <reviewed-sha> --dry-run
112
- ```
113
-
114
- This mode requires complete native GitHub cross-reference evidence from the configured author, identifying the exact canonical issue and PR with `willCloseTarget: false`, plus complete empty native closing associations and the OPEN issue's unchanged title/body. The event establishes a server-recorded historical mention; it does not prove a current revocable Development link. Current body intent supplements that evidence and never replaces it. Missing, unauthorized, conflicting, truncated or moved evidence refuses delivery. Equivalent duplicate observations do not create additional ownership. New PRs still require native issue-branch linkage; `--pr` selects only an existing PR and never creates a replacement.
115
-
116
- A closing-to-non-closing metadata transition is a narrow exception: with explicit issue/PR/body selection, the author may remove a fully proven intended-only native closing association by updating the body once. Exact PR identity, title, draft/open state, head/ref/base and OPEN issue criteria must remain unchanged; the post-readback must establish native non-closing reference proof and empty closing associations before any delivery action. Dry-run reports a pending transition, not verified non-closing state. Missing closing proof or an already-empty stale body cannot use this exception. An already valid non-closing PR is reused without another body update.
117
-
118
- Non-closing delivery refuses closing directives in the current PR title/body and every introduced commit message, including other issues/repositories. Squash is required, with explicit safe title/message sent to GitHub. GitHub’s active required reviews and checks, native blockers, current default base and expected-head merge guards still apply. `finish --non-closing` refuses before any lifecycle call; this mode never closes the retained issue or changes its Project to Done. GitHub does not atomically lock issue intent or external edits with promotion/body/merge: failed acknowledgements or post-read drift require read-only reconciliation, never a blind mutation retry or reopening an issue.
119
-
120
- If GitHub creates a draft but association verification fails, the diagnostic reports the created PR identity and the unresolved post-publication phase. Inspect that exact PR read-only before any further action; creation is not repeated to repair an association. A body containing closing words alone never proves the native association.
121
-
122
- For a new issue, `start --request-id <stable-id>` records inert retry markers in its body. Retry the same request after an unknown response; matching remote state is recovered, while conflicting intent or duplicate matches refuse. Without an explicit ID, identical tracking inputs share a deterministic retry identity. Supply a new ID for a separate issue with identical inputs. A retry search beyond 2,000 issues refuses and asks for the known issue number. `pr:create --head <branch>` selects an existing linked branch when an issue has several.
123
-
124
- Formal review requires a validated independent artifact and the configured reviewer App. The artifact binds author/reviewer identities, exact commit/tree and complete changed-path digest. The review body retains the original artifact and digest for submission integrity and audit. GitHub owns subsequent review eligibility and stale-review dismissal; merge does not compare historical artifact, tree, diff or publication lineage against the current PR. A matching remote review is reused; conflicting actor, head, state or duplicate claims for that same artifact refuse. An older approval does not prevent submission of a new independently validated exact-head artifact. Submission reads back the exact review ID and artifact. Reviews containing only a historical marker require a fresh review. Its new `ai-delivery.github-review@1` receipt is separate from historical local-evidence receipts. CLI `--artifact` reads a UTF-8 JSON file; MCP takes its JSON content.
125
-
126
- An App submission does not prove that GitHub counted it. `pr:checks` exposes GitHub’s live review decision, merge state, configured required check names and head check observations. Required names come from applicable native rules and classic branch protection, so checks that have never reported remain visible. Partial requirement discovery is labelled explicitly; head observations do not override GitHub’s eligibility decision. Merge uses GitHub’s eligibility for the exact PR head and current base, including active rulesets, required checks, required reviews and configured up-to-date requirements. A repository requiring zero reviews does not acquire an extra App approval requirement. CLEAN and HAS_HOOKS are eligible; UNSTABLE follows GitHub’s mergeable decision with non-passing commit status; GitHub decides which check results and requirements apply. BLOCKED, BEHIND, DIRTY, unknown or incomplete eligibility and moved head/base refuse with native state and required-check diagnostics. No unresolved native issue blockers may remain. The server merge mutation includes the expected head SHA. Finish confirms the intended PR merged before closing its issue, and retries from remote readback without local receipts.
127
-
128
- The removed `develop`, `verify`, `pr:checkout`, worktree creation/cleanup and local velocity record commands are no longer public CLI/MCP workflows. Preserve existing consumer checks, controller admissions and historical custody records. Their original schemas, digest identities, writer locks and operational closure rules remain separate. The legacy transition commands remain exposed, but this runtime cannot reproduce their historical repository-policy configuration binding: CLI/MCP inspection and apply refuse without executing policy or converting records. Complete those transitions with the original controller. Explicit runtime stage/admit remain supported.
129
-
130
- ## Plugin installation and explicit runtime setup
131
-
132
- The complete plugin is the canonical public installation for Codex and Claude
133
- Code. It ships the skills and one MCP runtime together. Standalone MCP server
134
- registration is a legacy setup; avoid adding a second registration alongside the
135
- plugin. The CLI, SDK exports and underlying MCP transport remain available.
136
-
137
- Legacy support will remain for **at least two subsequent stable releases and at
138
- least 90 days after a qualified migration path first ships**. That release/date
139
- anchor is currently unknown. Diagnostics and preview do not constitute qualified
140
- migration, start the clock, or withdraw legacy support. Live migration and native
141
- manifest qualification remain separate work under [#116](https://github.com/aviaratech/ai-delivery/issues/116).
142
-
143
- Manage the native plugin with an explicit package version:
144
-
145
- ```sh
146
- ai-delivery plugin install --host codex --scope user --version <published-version> --json
147
- ai-delivery plugin doctor --host codex --scope user --json
148
- ai-delivery plugin preview --host codex --scope user --json
149
- ai-delivery plugin update --host codex --scope user --version <published-version> --json
150
- ai-delivery plugin rollback --host codex --scope user --json
151
- ai-delivery plugin remove --host codex --scope user --json
152
- ```
153
-
154
- Use `--host claude-code` for Claude Code. Its supported scopes are `user`,
155
- `project`, and `local`; select the project directory with the global
156
- `--repo-root` option. Codex currently supports `user`. Install and update require
157
- a literal version. Rollback selects the recorded previous version. The commands
158
- keep verified version units in a private directory and use the native host's
159
- marketplace and plugin commands to select that exact local source. Removal keeps
160
- the managed version units for recovery and uses Claude Code's `--keep-data`.
161
-
162
- Every command supports `--dry-run` and `--json`. Dry-run reports the target
163
- without fetching an archive, running a native command, or writing configuration.
164
- `preview` makes bounded configuration observations without native commands,
165
- server startup, authentication, settings changes, backups, locks or checkpoints.
166
- It exposes no launcher arguments, URLs, environments or permission values.
167
- `plannedChanges` is empty and migration is refused. Unknown provenance and
168
- unavailable configuration remain explicit; Codex table-header observations do
169
- not resolve TOML, profiles or managed/CLI overrides. Claude custom-profile
170
- configuration is likewise unverified. Preview never adopts an external plugin
171
- or restores/removes a tool preference.
172
-
173
- Doctor can also observe native-marketplace plugins when managed state is absent.
174
- That observation does not establish ownership or permit startup of unknown
175
- bytes. It reports bounded registration candidates and incomplete scope evidence;
176
- the verified managed selection retains its separate integrity checks. Doctor
177
- reports managed installation and source integrity, skills, and a direct
178
- credential-free stdio startup check of the selected bundled MCP server. Startup
179
- means that the server initialized and listed its tools; it does not validate
180
- user settings, receive GitHub credentials, or authenticate either delivery role.
181
- For an opt-in authentication check, select a repository explicitly:
182
-
183
- ```sh
184
- ai-delivery --repo example/widget plugin doctor --host codex --scope user --check-auth --json
185
- ```
186
-
187
- This checks settings and required process references before running the verified,
188
- enabled plugin's selected CLI `config:resolve`. It reports authenticated actors,
189
- repository access and visible review rules separately. Only configured credential
190
- names and required runtime selectors reach that subprocess; an absent default
191
- `GH_TOKEN` may use the selected machine session. Unrelated tokens and
192
- legacy personal overrides do not. Missing or invalid inputs stop before key
193
- access or network authentication. An eligible machine route is explicitly
194
- authenticated through `gh` and the selected client after those gates. Dry-run
195
- performs none of these checks.
196
- The readback is labelled `selected_runtime_cli`; it does not prove GUI credential
197
- propagation or counted exact-head approval. `config:resolve` remains available
198
- for direct CLI readback; check an actual native tool call separately. The
199
- [credential and readiness guide](plugins/ai-delivery/README.md#credentials-and-readiness)
200
- explains the environment boundary and the evidence to retain without secrets.
201
- Installed-version observations, a separately launched startup check and the
202
- native conversation's loaded server version are distinct. The latter remains
203
- unverified unless observed in that host. Use the host's surface-specific
204
- activation guidance: [Claude Code plugin management](https://code.claude.com/docs/en/discover-plugins)
205
- and [Codex MCP configuration](https://learn.chatgpt.com/docs/extend/mcp).
206
- There is no blanket restart requirement or automatic activation. Installing a
207
- plugin does not admit a consumer controller. Ordinary remote GitHub delivery
208
- uses user configuration; explicit controller staging and admission remain
209
- separate operations.
210
-
211
- Migration apply, registration retirement and settings rollback are unavailable
212
- here. They require exact authorized ownership, lossless settings preservation
213
- and native writer exclusion/transactional guarantees. A matching name, missing
214
- preference, changed registration or incomplete inventory cannot satisfy those
215
- gates. No npm lifecycle cleanup or mandatory hook performs migration. Public npm
216
- publication or a local catalog does not establish public plugin-directory admission.
217
-
218
- First read `config:resolve` with the configured author, then stage a reviewed
219
- local archive using its independently accepted SHA-256 and package version:
220
-
221
- ```sh
222
- ai-delivery --repo-root /absolute/consumer --identity configured-author config:resolve
223
- ai-delivery --repo-root /absolute/consumer --identity configured-author runtime:stage \
224
- --authorize-stage --archive /absolute/reviewed-package.tgz \
225
- --archive-sha256 sha256:<reviewed-archive-digest> --package-version 0.3.5 \
226
- --source-commit <clean-primary-consumer-head> --config-digest sha256:<resolver-digest> \
227
- --runtime-directory /absolute/private-runtimes/ai-delivery-0.3.5 \
228
- --max-aggregate-rss-bytes 536870912 --max-new-output-bytes 1073741824 \
229
- --min-free-disk-bytes 68719476736 --max-captured-output-bytes 1048576
230
- ```
231
-
232
- Stage captures and hashes the exact reviewed archive bytes, durably retains a
233
- private copy in its owned directory, and gives that copy to npm. The snapshot
234
- counts toward the stage output allowance and is revalidated on completion,
235
- reuse and admission. Stage installs production dependencies with scripts, audit
236
- and funding disabled.
237
- The existing setup writer samples controller-plus-children RSS throughout
238
- preflight, installation and final validation, with checks at each awaited
239
- preflight boundary and cancellation passed to in-flight GitHub requests.
240
- These are sampled stop thresholds, not OS-enforced hard
241
- ceilings. npm runs from the owned stage with explicit cache, log, user/global
242
- configuration and temporary destinations there; lifecycle scripts cannot write
243
- elsewhere because they are disabled. Filesystem accounting also covers the
244
- consumer's delivery metadata and retained command evidence. The archive and
245
- captured command output consume the output allowance. Retained command logs
246
- default to 1 MiB; `maxCapturedOutputBytes` in the existing MCP/API resource
247
- bounds, or the CLI flag above, selects a positive cap up to the evidence store's
248
- 8 MiB maximum. A failed command retains at most that cap. Default memory,
249
- output and free-disk bounds remain 1 GiB, 512 MiB and 256 MiB.
250
- Normalized bounds are part of the stage intent: changing them requires a fresh
251
- stage directory and never replaces a completed stage silently.
252
- It validates actual CLI, full distribution, package manifest, bundled MCP launcher
253
- and plugin bytes and capability 2. Its private completion record binds these
254
- bytes to the reviewed archive and primary controller; `sourceCommit` means the
255
- consumer/controller HEAD, not the public package's release commit. Matching
256
- completed stages are read back and reused without npm. Incomplete recovery uses
257
- the existing durable verification writer and identity-checked command cleanup.
258
- A live or stopped owner remains busy; ambiguous command ownership fails closed.
259
- Failure or cancellation removes only owned incomplete output after confirmed
260
- quiescence. Stage returns actual CLI/MCP launch descriptors and leaves host
261
- references and current links for the consuming installer to manage.
262
-
263
- Admission is the separate explicitly authorized final binding. Use the returned
264
- stage ID and either explicit absence or the SHA-256 of the exact prior admission
265
- file bytes:
266
-
267
- ```sh
268
- ai-delivery --repo-root /absolute/consumer --identity configured-author runtime:admit \
269
- --authorize-admit --stage-id sha256:<returned-stage-id> --expected-absent \
270
- --source-commit <clean-primary-consumer-head> --config-digest sha256:<resolver-digest> \
271
- --runtime-directory /absolute/private-runtimes/ai-delivery-0.3.5
272
- # For replacement, use --expected-prior sha256:<current-admission-byte-digest>
68
+ ai-delivery --repo example/widget finish --issue 17 --pr 23 --reviewed-head <sha>
273
69
  ```
274
70
 
275
- The operation rechecks archive, installed bytes, primary source, resolver routing
276
- and configured actors before atomically publishing the existing private
277
- `ai-delivery.runtime-admission@2` record at
278
- `<git-common-dir>/ai-delivery/runtime-admission.json`, mode 0600. Precommit
279
- failures preserve the prior record. A lost response or post-rename failure is
280
- reconciled against exact desired bytes and confirmed file/directory durability.
281
- A `commit-status-unknown` error identifies the admission and stage; retry the
282
- same stage to reconcile. Conflicting third-party bytes are preserved. The
283
- consuming installer's reviewed host activation and rollback determine when this
284
- final write occurs.
71
+ GitHub's current required checks, counted reviews, blockers and merge eligibility govern the exact head/current base. The builder never approves its own work. Read back uncertain writes before retrying; a dry run grants no authority. Respect explicit provider/read-only requests and actual host refusals.
285
72
 
286
- The new resolver digest binds user settings, validated roles and discovered routing. Historical policy/configuration digests are not rewritten or relabeled as new bindings. Setup preserves source, archive, installed-byte and prior-admission compare-and-swap checks; a mismatched historical binding requires its original controller. No private runtime is activated by ordinary issue or PR calls.
73
+ After verified `finish`, cleanup removes only the exact clean registered worktree and local branch with retained-source proof. Run outside that worktree; unregistered or unsafe source stays in place with a reason.
287
74
 
288
- Legacy transitions remain explicit preservation operations. Inspection returns exact closure gaps for unsupported bindings. Applying a supported plan still requires its immutable inventory, authenticated native personal-operator relinquishment and independent configured App acceptance, exact plan/comment IDs, writer quiescence and runtime admission. Installing this package does not adopt legacy custody or release retained holds.
75
+ For partial delivery, `--non-closing` requires a canonical `References owner/repo#number` body and complete native evidence; a new linked-branch draft requires a separately authorized exact reference action. `finish` refuses nonclosing delivery. A complete executable child can close normally while its parent stays open.
289
76
 
290
- ## CLI and MCP contract
77
+ ## Command and tool map
291
78
 
292
- The remote contract is `ai-delivery.mcp@2`. CLI and MCP call the same owners. Issue listing/search preserve native filters, pagination, literal search boundaries and repository-qualified relationships. Issue updates preserve typed journals, history-before-rewrite and native reasoned closure. `issue_info.worktree` is null. Offline `migrate:legacy-issues --input-file` remains a read-only plan. Public exports expose remote delivery, metadata, digest utilities and explicit setup; removed executable policy/stage/evidence APIs are not exported.
79
+ These are all executable routes; groups/help flags are omitted. A dash means no matching surface. Use each route's `--help` and the published MCP schema for inputs.
293
80
 
294
- ### Synthetic tracking replay and quick reference
295
-
296
- Pass `repo: "owner/name"` to MCP calls or global `--repo owner/name` to the CLI, including outside Git. The following operations are shipped:
297
-
298
- | Operation | MCP tool | CLI command and key inputs |
81
+ | Charter/job | CLI | MCP |
299
82
  | --- | --- | --- |
300
- | List / search | `issue_list` / `issue_search` | `list` / `search --query <literal-text>`; native filters and pagination |
301
- | Read / check readiness | `issue_info` / `issue_ready_check` | `info --issue N` / `ready:check --issue N` |
302
- | Create a sized child | `issue_create` | `create --title <title> --fields-file <typed.json> --parent P --priority P2` |
303
- | Rewrite with prior history | `issue_update` | `update --issue N --fields-file <typed.json> --preserve-history` |
304
- | Reparent one issue | `issue_update` | `update --issue N --parent P` |
305
- | Plan / apply a batch | `issue_batch_update` | `batch:update --items-file <items.json> [--dry-run]` |
306
- | Record a typed journal | `issue_comment` | See the [typed journal contract](#typed-issue-journals); the MCP call returns the authored comment identity and readback |
307
- | Close with a reason | `issue_update` | `update --issue N --state closed --close-reason not_planned --superseded-by S` |
308
-
309
- Typed JSON contains the issue contract fields, including Issue Type, Points, problem, outcome, acceptance and non-goals. CLI repository, parent and priority selectors use their documented flags. Inspect each result: rewrites return the preserved history comment; creation and reparenting return native readback. Reasoned closure returns `closure` evidence, supersession and the authored comment from `issue_update`; `issue_info` supplies state and Project status without the closure-reason evidence. A successful readiness check does not start an issue.
310
-
311
- `issue_create` and `issue_update` also accept optional native `startDate` and
312
- `targetDate` values, including in CLI `--fields-file` JSON. They resolve the
313
- organization fields named **Start date** and **Target date** without caller IDs.
314
- Dates must be calendar-valid `YYYY-MM-DD` strings. Omit a property to preserve
315
- its current value; use `null` to clear only that date. For example, an update
316
- file containing `{"startDate":"2028-02-29","targetDate":null}` sets the start
317
- date and clears the target. Missing, duplicate or incompatible requested date
318
- fields refuse before mutation; calls without date properties do not require
319
- those organization fields. Existing Points/Priority and other field values
320
- are preserved. This adds no date fields to the organization.
321
-
322
- `issue_info.fields` returns the same supported organization field names and
323
- values as `issue_list`, including text, number, date and named single/multi-select
324
- values; unset fields are `null`. The existing top-level Points/Priority readback
325
- remains, with `startDate`/`targetDate` aliases when their date fields exist.
326
- Setting fields uses additive native updates; clearing an already unset date is
327
- idempotent. A creation failure after a native issue exists reports that known
328
- issue so recovery never creates a replacement.
329
-
330
- Batch input is a UTF-8 JSON array of **1–50** complete `issue_update` inputs;
331
- MCP takes `{repo, items, dryRun}`. All items use the selected repository, including
332
- any per-item `repo`. Close, defer/undefer, parent, blockers, typed contract,
333
- status and history/render-retention fields keep their existing validation and
334
- configured author requirements. Dry run performs reads and returns `planned`,
335
- `unchanged` or `failed` results with the desired `changes` and current `readback`;
336
- it writes no issue fields, metadata, relationships, Project state or comments.
337
-
338
- Execution is serial and returns every item in input order as `applied`,
339
- `unchanged` or `failed`, plus readback and summary counts. Failure can follow a
340
- partial native write: inspect its readback before retrying. An unavailable
341
- readback is explicit, never evidence that nothing changed. Rerun the same inputs
342
- to reconcile actual state; already satisfied fields and related outcomes are
343
- unchanged, and authored comments/history are deduplicated. This operation has no
344
- cross-repository transaction or rollback. CLI prints the complete JSON and exits
345
- nonzero if any item failed. A positively identified GitHub rate limit stops
346
- further writes and gives every remaining item an explicit failure reason;
347
- `summary.rateLimits` contains only available numeric retry-after/reset/remaining
348
- observations. No uncertain mutation is automatically replayed.
349
-
350
- Creation includes five status fields: Ready or Draft, last updated in UTC,
351
- next milestone (default `Not started`), native blocker numbers (or `None`),
352
- and latest journal (`None yet`). Supply `status: {"nextMilestone":"Run checks"}`
353
- on `issue_create`; `issue_update` also accepts display-only `status.blockers`
354
- and `status.latestJournal`. The same objects work in CLI `--fields-file` JSON.
355
- Status values are single lines rendered as literal text. Status-only patches
356
- preserve every byte outside Status, including canonical data and start markers;
357
- no-op patches keep the timestamp. Display blockers create no dependency edges:
358
- use native `blockedBy` for those, and do not combine it with `status.blockers`.
359
- Convert handwritten legacy bodies explicitly before applying a status-only patch.
360
- The nonblocking body-length warning counts readable text, excludes embedded
361
- issue-data, and triggers strictly above 4,000 characters.
362
-
363
- `preserveHistory` controls an authored, exactly read-back snapshot of the prior
364
- title/body before a rewrite. `retainLegacyBody` independently controls whether
365
- legacy text appears in the current readable body; it never erases the embedded
366
- legacy record or native comments. Both may be specified in update field files.
367
- By default, legacy conversion or first omission preserves native history before
368
- hiding retired text. Incoming legacy bytes absent from that history stay visible.
369
- With `preserveHistory: false`, unpreserved legacy text stays visible; an explicit
370
- `retainLegacyBody: false` deliberately hides it without requesting a history
371
- comment. `retainLegacyBody: true` keeps it visible even when history is written.
372
- Repeated unchanged updates reuse the body and existing exact authored history;
373
- failed history readback or concurrent content drift refuses the rewrite.
374
-
375
- `src/currentTrackingScenario.test.ts` composes these operations through one real SDK client/server session outside Git. Only external GitHub/auth ports are synthetic; settings, discovery, schemas, dispatch and owners run normally. Stored issue fields, parent membership, exact escaped history whitespace, comments, explicit deferral/undeferral, closure and configured Project Done are checked after writes. Invalid schemas and unsupported `issue_batch` alias or standalone `issue_defer` requests leave stored state and native write counts unchanged. This synthetic replay does not complete the broader tracking parent or prove a live backlog replay.
376
-
377
- ## Deferral and work-in-progress admission
378
-
379
- `issue_update` accepts `defer: { until?: "YYYY-MM-DD", trigger?: "condition" }`
380
- or `undefer: true`. An empty `defer: {}` means indefinite manual deferral.
381
- These inputs are mutually exclusive. Conditions are recorded text and dates:
382
- passing the date or satisfying the trigger never automatically resumes work.
383
- Only explicit `undefer` clears deferral; body replacements and unrelated updates
384
- retain it. `issue_info` and `issue_list` return `deferred` with the recorded
385
- conditions, or `null` for known undeferred content. If canonical content is
386
- invalid or a listing omits its body, the field is omitted rather than claiming
387
- that deferral is absent; inspect the body and readiness diagnostics.
388
-
389
- Deferral is independent of `draft` and `park`. `park` still pauses execution as
390
- a draft, retains host-owned worktree custody, and uses the existing Todo/Blocked
391
- Project presentation. `undefer` does not clear a parked draft. Deferral alone
392
- does not release an existing In Progress slot. Readiness and supported `start`
393
- refuse deferred work, including a past date, before creating a branch or journal.
394
- The removed `develop` workflow remains removed. Repository labels continue to
395
- accept any existing native label; unknown labels are refused.
83
+ | Issues: create/start | `create`, `start` | `issue_create`, `issue_start` |
84
+ | Issues: find/read | `list`, `search`, `info`, `ready:check` | `issue_list`, `issue_search`, `issue_info`, `issue_ready_check` |
85
+ | Issues: edit/batch | `update`, `batch:update` | `issue_update`, `issue_batch_update` |
86
+ | Issues: relationships | `parent`, `blockers`, `subissues` | — |
87
+ | Issues: journals | — | `issue_comment` |
88
+ | Issues: attention/health | `board`, `health` | `delivery_board`, `delivery_health` |
89
+ | Issues: Project reconciliation | `board:reconcile` | `board_reconcile` |
90
+ | Pull requests | `pr:create`, `pr:info` | `issue_pr_create`, `issue_pr_info` |
91
+ | Pull requests: observations | `pr:list`, `pr:checks` | — |
92
+ | Reviews: artifact | `pr:review` | `issue_pr_review` |
93
+ | Reviews: profile/verdict | `review doctor`, `review submit` | — |
94
+ | Merges/completion | `pr:merge`, `finish` | `issue_pr_merge`, `issue_finish` |
95
+ | Delivery support: plugin | `plugin install`, `plugin doctor`, `plugin preview`, `plugin update`, `plugin rollback`, `plugin remove` | — |
96
+ | Issues: offline migration plan | `migrate:legacy-issues` | — |
97
+ | All: setup/transport | `config:resolve`, `mcp:serve` | — |
396
98
 
397
- ```sh
398
- ai-delivery --repo example/widget update --issue 17 --defer --defer-trigger 'Upstream ships'
399
- ai-delivery --repo example/widget update --issue 17 --defer-until 2026-12-01
400
- ai-delivery --repo example/widget update --issue 17 --undefer
401
- ```
99
+ The contract is `ai-delivery.mcp@2`; [tool schemas](src/mcp/tools.ts) and CLI `--help` supply complete inputs. Results retain warnings, history and recovery fields; MCP `verbose: true` or CLI `--json --verbose` requests full payloads. Journal `status` is prose, separate from Project Status.
402
100
 
403
- Optional `wipLimits` in the existing operator-owned user JSON declares lanes.
404
- No target-repository configuration is loaded, and the tool never writes these
405
- settings. Without this option, capacity admission is unchanged. Each lane names
406
- its repository, a name unique within that repository, a nonnegative integer
407
- limit, and exactly one native label or named native issue-field value:
101
+ ## Upgrade a host
408
102
 
409
- ```json
410
- {
411
- "wipLimits": [
412
- { "repository": "example/widget", "name": "Review", "match": { "label": "Needs Review" }, "limit": 2 },
413
- { "repository": "example/widget", "name": "Urgent", "match": { "field": "Priority", "value": "High" }, "limit": 1 }
414
- ]
415
- }
416
- ```
103
+ Choose an explicitly qualified version; the historical **0.3.35** example was checked on **2026-10-22**, not a promise of today's latest. Preserving updates qualify Claude Code **2.1.296** and Codex CLI **0.162.1** only. Claude downgrades remain unqualified; Codex rollback selects its recorded previous version.
417
104
 
418
- Label matching follows native case-insensitive label names. Field names and
419
- string values match exactly; numeric fields compare numbers and multi-select
420
- fields match a member. Unknown labels/fields, changed identities, malformed or
421
- unreadable data, repeated/nonadvancing pages and incomplete bounded readback
422
- refuse admission. Counts include open issues in the selected repository with
423
- the configured Project's In Progress status. Verified absent membership or an
424
- explicitly unset native Status consumes no slot; omitted Status evidence refuses. Every matching lane must have
425
- capacity. An already In Progress target consumes no additional slot on retry.
426
-
427
- `start --override-reason <reason>` / `issue_start.overrideReason` can override
428
- capacity only. The configured authenticated author must record and verify the
429
- exact issue, Project, native field identity, lane counts/limits and reason in
430
- an issue comment before advancement. The reason cannot bypass deferral, draft,
431
- native blockers, tracking-parent eligibility, access or review requirements.
432
- An uncertain comment acknowledgment is reconciled against the same authored
433
- comment; a changed observation refuses advancement and requires fresh readback.
434
-
435
- Capacity is read completely before branch creation and rechecked immediately
436
- before Project advancement. GitHub exposes no conditional cross-writer Project
437
- capacity transaction: these are fresh observed-capacity guards, with no global
438
- atomic WIP guarantee against concurrent native writers. A later refusal can
439
- leave the already-linked branch intact; use the returned `safeResume.arguments`
440
- with its reason and preserve that native identity. Refusals publish no Started
441
- journal. `src/issueIntake.test.ts` exercises current CLI/MCP/SDK deferral and WIP
442
- paths with synthetic native ports; it makes no live override or deployment claim.
443
-
444
- ## Blocker overrides and delivery health
445
-
446
- `create`, `start` and `update` accept `--blocks <issue-numbers>` to add the
447
- selected issue as a native blocker of named dependents. This preserves those
448
- dependents' other blockers. `--blocked-by` retains its exact-set replacement
449
- semantics. The corresponding MCP inputs are `blocks` and `blockedBy`.
450
-
451
- A genuinely new blocker on configured-Project **In Progress** work requires
452
- `--override-reason <reason>` / `overrideReason` (1–2,000 trimmed characters).
453
- The configured author must authenticate, and an author-verified comment must
454
- precede the native edge. Existing edges and removals require no override.
455
- Unresolved dependent status refuses additions. Creation preflights existing
456
- dependents before creating the new issue. A retry reuses the same verified
457
- comment for the same native removal episode; a later remove/re-add records a
458
- new episode. Comments record intent, not successful dependency writes.
459
-
460
- GitHub does not atomically lock status, comments and relationships. Every actual
461
- addition is rechecked at its write boundary. A later failure can follow earlier
462
- writes; inspect native state and resume the known issue rather than recreate it.
463
- If creation partially succeeds, the existing known-created recovery identifies
464
- that issue. Low-level exported relationship primitives remain available to
465
- callers that own their own policy; the guard applies to canonical issue writes.
105
+ Installed metadata, separate doctor startup and the active conversation's loaded MCP version are distinct. Record unexposed loaded versions as unverified. Follow the host's activation guidance and preserve active jobs before an operator-approved restart. Windows command credential sources and protected-file permission equivalence remain unqualified.
466
106
 
467
- ```sh
468
- ai-delivery --repo example/widget update --issue 17 --blocked-by 18 --override-reason 'Await prerequisite validation'
469
- ai-delivery --repo example/widget health --from 2026-10-01T00:00:00Z --to 2026-10-08T00:00:00Z
470
- ```
471
-
472
- `delivery_health` / `health` requires an explicit repository and UTC `[from,to)`
473
- window. It reports distinct issues opened and closed, current open In Progress
474
- work in that repository lane of the configured Project, oldest active issues by
475
- creation time, and distinct native blocker additions classified by proven
476
- historical Project membership and status. Reopen/reclose counts one closed issue
477
- per window. Unknown history is separate and never a violation verdict. Age is
478
- since issue creation, not time spent in progress.
479
-
480
- The window must end at or before collection time. The read-only snapshot is non-atomic and records collection timestamps. Defaults
481
- are 200 issues, five timeline pages per issue, five Project item pages per
482
- status read and ten oldest issues; bounds are 500 issues, 20 pages per read
483
- and 20 oldest issues. `--max-project-pages` bounds Project status collection. Limits and read failures
484
- produce explicit partial **observed** counts, not complete zeroes. Issues whose
485
- current Project status cannot be resolved have a separate unknown count.
486
-
487
- ## Typed issue journals
488
-
489
- `issue_comment` posts a typed journal through the configured author role. The public
490
- `commentIssue(context, input)` API uses the same implementation. The returned
491
- `commentId`, `url`, `body` and `reused` come from a fresh GitHub comment readback;
492
- the author, issue target and body must agree. Historical rewrites and reasoned
493
- issue closure call this same writer through `issue_update`.
494
-
495
- The public agent API also accepts `commentIssue(context, {issueNumber, body})`
496
- for exact raw comments, such as an already-rendered history snapshot. It preserves
497
- leading/trailing whitespace, line endings and content beyond the journal template
498
- limits, and appends no wrapper or marker. Exact authored-body retries reuse the
499
- existing comment and still require fresh readback. Blank bodies and complete
500
- payloads exceeding `ISSUE_COMMENT_BODY_LIMIT` (65,536 UTF-16 code units, matching
501
- [GitHub's first-party JavaScript validation](https://github.com/github/gh-aw/blob/3ead8042c7b1edc2128ba1b28b1b80d00b7f4c22/actions/setup/js/comment_limit_helpers.cjs))
502
- fail before authentication or mutation. This supported client bound also applies
503
- after typed-journal rendering; it does not truncate content. The MCP
504
- `issue_comment` input remains the typed journal contract below. History rendering
505
- and ordering of later issue rewrites belong to the caller.
506
-
507
- Every kind requires `issueNumber`, a one-line `summary`, `status`, `keyNumbers`
508
- (an array, empty when no numbers are known), `evidence` (HTTPS links), `nextStep`
509
- and `nextDate` (`YYYY-MM-DD`, or `null` when unscheduled). The summary is the first
510
- visible line, numbers stay inline, and evidence should be reachable outside the
511
- operator's machine. Validation requires HTTPS with a DNS hostname; it rejects
512
- file paths, credential-bearing URLs, IP literals, localhost and `.local` names.
513
- It does not probe remote reachability. Each kind also requires these fields:
514
-
515
- | Kind | Required fields |
516
- | ---------- | ----------------------------------------------------------------------------------------- |
517
- | `start` | `outcome` |
518
- | `progress` | `done` (nonempty list), `decisionNeeded`; at least one evidence link |
519
- | `decision` | `decision`, `rationale` |
520
- | `blocker` | `blocker`, `resolution` |
521
- | `closeout` | `acceptance` (nonempty `{criterion, evidence}` list), `followUps` (list; empty when none) |
522
-
523
- Optional `details` adds supporting prose. `lengthCap` (600–10,000 characters,
524
- default 1,800) limits the expanded journal: excess fields move into one collapsed
525
- details section, without truncating acceptance evidence. Keep bulky inventories
526
- in linked evidence instead of the summary.
527
-
528
- ```json
529
- {
530
- "issueNumber": 17,
531
- "kind": "progress",
532
- "summary": "Input validation is implemented and ready for review.",
533
- "status": "In progress",
534
- "done": ["Added malformed-input handling and regression coverage"],
535
- "keyNumbers": ["7 focused tests passed"],
536
- "decisionNeeded": "None",
537
- "evidence": ["https://github.com/example/widget/pull/23"],
538
- "nextStep": "Complete independent review",
539
- "nextDate": "2026-10-09"
540
- }
541
- ```
107
+ ## Plugin installation
542
108
 
543
- Successful tracked `issue_start` calls publish one start
544
- journal. Scratch work, failed readiness and failed development do not claim a
545
- start. `issue_finish` publishes closeout only after its existing merge, closure,
546
- Project and cleanup contracts succeed, with each checkbox acceptance criterion
547
- linked to the merged PR and a follow-up field. The PR carries the verification
548
- and review evidence; the comment does not create another acceptance gate.
549
-
550
- Exact manual retries reuse the same authored comment. Automatic retries find the
551
- original start or exact-merge closeout even after a lost response or worktree
552
- cleanup. Markers from another author never establish reuse. Operations from the
553
- same local controller serialize their comment writes; independently configured
554
- controllers still require one issue owner. A failed journal write/readback is
555
- reported and the same lifecycle call can recover it. Created-issue failures
556
- return the exact issue identity and `safeResume.arguments`. Incomplete tracking
557
- uses `resumeCreated: true`; later start recovery preserves the current native
558
- body and eligibility without replaying the original tracking fields. Historical comments are
559
- preserved. Generated issue Status blocks and general readability warnings are
560
- owned by the separate issue-contract work.
109
+ Legacy standalone MCP support lasts at least **two subsequent stable releases and 90 days** after a qualified migration first ships; that anchor remains unknown. Preview/doctor do not qualify migration or start that clock. Migration apply, registration retirement and settings rollback remain unavailable; see [#116](https://github.com/aviaratech/ai-delivery/issues/116). Public npm/local-catalog distribution does not establish plugin-directory admission.
561
110
 
562
111
  ## Contributor checks and release
563
112
 
564
- Use Node 24.21.0 and npm 11.19.0. `npm ci` installs the single committed lockfile; `npm run checks` is the canonical local gate and runs Oxfmt, native Oxlint with `oxlint-tsgolint`, strict TypeScript, a compiled build, and Vitest over the emitted `dist/**/*.test.js` files. The compiled test target preserves CLI child-process and package-file assertions. `npm run build` can be run separately before packing. Tests cover discovery, identity, admission drift, lifecycle receipts, interruption/recovery, cleanup, and plugin boundaries with synthetic repositories. See [CONTRIBUTING.md](CONTRIBUTING.md) for the local commands and release prerequisites.
113
+ [CONTRIBUTING.md](CONTRIBUTING.md) owns pinned tooling, focused local checks, full GitHub checks and release procedures. Ordinary PR checks exclude release installations/archive cases; fast/focused success never qualifies a package. Supply the actual Node26 consumer executable through `AI_DELIVERY_NODE26_EXECUTABLE` where required.
114
+
115
+ Release still requires the exact mandatory archive inventory, complete release/consumer/cleanup proof, confidentiality review and TruffleHog scanning. A dry inventory, fixture install, inert repack or wrapper is not current archive/native-adoption proof. Publication consumes the independently accepted source/version/digest and original successful artifact; verify actual registry bytes, integrity, cryptographic provenance and `latest` afterward. Never replace missing proof with a later rerun.
565
116
 
566
- The standalone lint config enables native error, promise, unsafe-value, and explicit-type checks. TypeScript uses exact optional properties, checked indexed access, explicit overrides, return/fallthrough, and unused-symbol checks. Tests and review cover the delivery behavior boundary.
117
+ Release is manual, main-only and uses npm trusted publishing. A packaged README edit changes the release candidate: retain accepted archives and independently qualify the new exact source/archive before dispatching.
567
118
 
568
- Installing the package does not switch an existing consumer. Run `npm run checks`, `npm run build`, and `npm pack --dry-run` before release.
119
+ Source version **0.3.36** and green PR checks do not establish its qualification; see [#199](https://github.com/aviaratech/ai-delivery/issues/199). Wrappers and workflow definitions do not prove [#200](https://github.com/aviaratech/ai-delivery/issues/200)'s **under-60-second regular checks / under-five-minute qualification** targets. Functional removals and remaining documentation obligations stay with [#201](https://github.com/aviaratech/ai-delivery/issues/201).