@aviaratech/ai-delivery 0.3.35 → 0.3.37

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 +56 -554
  3. package/dist/agent.d.ts +1 -3
  4. package/dist/agent.js +74 -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 +1651 -1590
  9. package/dist/boardReconcile.test.js.map +7 -1
  10. package/dist/build.test.js +130 -0
  11. package/dist/build.test.js.map +7 -0
  12. package/dist/callerErrors.test.js +91 -0
  13. package/dist/callerErrors.test.js.map +7 -0
  14. package/dist/cli.js +389 -517
  15. package/dist/cli.js.map +7 -1
  16. package/dist/cliResult.d.ts +2 -2
  17. package/dist/cliResult.js +42 -45
  18. package/dist/cliResult.js.map +7 -1
  19. package/dist/cliResult.test.js +424 -369
  20. package/dist/cliResult.test.js.map +7 -1
  21. package/dist/config/deliveryConfig.d.ts +288 -14
  22. package/dist/config/deliveryConfig.js +472 -390
  23. package/dist/config/deliveryConfig.js.map +7 -1
  24. package/dist/config/deliveryConfig.test.js +773 -649
  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 -479
  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.js +649 -0
  53. package/dist/deliveryBoard.test.js.map +7 -0
  54. package/dist/deliveryHealth.test.js +179 -155
  55. package/dist/deliveryHealth.test.js.map +7 -1
  56. package/dist/dependencyCompatibility.test.js +154 -140
  57. package/dist/dependencyCompatibility.test.js.map +7 -1
  58. package/dist/directoryIndependent.test.js +417 -383
  59. package/dist/directoryIndependent.test.js.map +7 -1
  60. package/dist/dispatch.d.ts +16 -11
  61. package/dist/dispatch.js +316 -354
  62. package/dist/dispatch.js.map +7 -1
  63. package/dist/errors.d.ts +3 -3
  64. package/dist/errors.js +103 -96
  65. package/dist/errors.js.map +7 -1
  66. package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
  67. package/dist/fixtures/deliveryBoardReplay.js +617 -0
  68. package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
  69. package/dist/fixtures/discovery.d.ts +63 -23
  70. package/dist/fixtures/discovery.js +96 -90
  71. package/dist/fixtures/discovery.js.map +7 -1
  72. package/dist/fixtures/inertEntrypointChild.js +57 -56
  73. package/dist/fixtures/inertEntrypointChild.js.map +7 -1
  74. package/dist/fixtures/inertEntrypoints.d.ts +1 -1
  75. package/dist/fixtures/inertEntrypoints.js +321 -276
  76. package/dist/fixtures/inertEntrypoints.js.map +7 -1
  77. package/dist/fixtures/inertTarget.d.ts +78 -7
  78. package/dist/fixtures/inertTarget.js +769 -691
  79. package/dist/fixtures/inertTarget.js.map +7 -1
  80. package/dist/fixtures/issue63.d.ts +4 -3
  81. package/dist/fixtures/issue63.js +260 -274
  82. package/dist/fixtures/issue63.js.map +7 -1
  83. package/dist/fixtures/issueProjectItems.d.ts +20 -0
  84. package/dist/fixtures/issueProjectItems.js +15 -0
  85. package/dist/fixtures/issueProjectItems.js.map +7 -0
  86. package/dist/fixtures/readView.d.ts +120 -0
  87. package/dist/fixtures/readView.js +172 -0
  88. package/dist/fixtures/readView.js.map +7 -0
  89. package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
  90. package/dist/fixtures/recordedGitHubFlows.js +109 -0
  91. package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
  92. package/dist/genericCompatibility.test.js +64 -55
  93. package/dist/genericCompatibility.test.js.map +7 -1
  94. package/dist/git.d.ts +0 -3
  95. package/dist/git.js +59 -76
  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 +42 -52
  104. package/dist/github/commandIdentityPolicy.js.map +7 -1
  105. package/dist/github/discovery.d.ts +1 -0
  106. package/dist/github/discovery.js +197 -215
  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 +18 -2
  121. package/dist/github/projectDelivery.js +615 -557
  122. package/dist/github/projectDelivery.js.map +7 -1
  123. package/dist/github/relationships.js +433 -389
  124. package/dist/github/relationships.js.map +7 -1
  125. package/dist/github/repo.d.ts +1 -0
  126. package/dist/github/repo.js +123 -96
  127. package/dist/github/repo.js.map +7 -1
  128. package/dist/index.js +3 -3
  129. package/dist/index.js.map +7 -1
  130. package/dist/issue.d.ts +40 -9
  131. package/dist/issue.js +2102 -1742
  132. package/dist/issue.js.map +7 -1
  133. package/dist/issue63History.test.js +40 -42
  134. package/dist/issue63History.test.js.map +7 -1
  135. package/dist/issue63Routes.test.js +154 -143
  136. package/dist/issue63Routes.test.js.map +7 -1
  137. package/dist/issueBatchUpdate.test.js +989 -885
  138. package/dist/issueBatchUpdate.test.js.map +7 -1
  139. package/dist/issueBlockerGuard.test.js +262 -226
  140. package/dist/issueBlockerGuard.test.js.map +7 -1
  141. package/dist/issueContract.d.ts +23 -4
  142. package/dist/issueContract.js +416 -395
  143. package/dist/issueContract.js.map +7 -1
  144. package/dist/issueContract.test.d.ts +4 -3
  145. package/dist/issueContract.test.js +358 -321
  146. package/dist/issueContract.test.js.map +7 -1
  147. package/dist/issueDates.test.js +235 -233
  148. package/dist/issueDates.test.js.map +7 -1
  149. package/dist/issueInfoReadback.test.js +304 -190
  150. package/dist/issueInfoReadback.test.js.map +7 -1
  151. package/dist/issueIntake.test.js +1938 -1732
  152. package/dist/issueIntake.test.js.map +7 -1
  153. package/dist/issueJournal.d.ts +40 -19
  154. package/dist/issueJournal.js +229 -138
  155. package/dist/issueJournal.js.map +7 -1
  156. package/dist/issueJournal.test.js +605 -422
  157. package/dist/issueJournal.test.js.map +7 -1
  158. package/dist/issueRollup.test.d.ts +1 -0
  159. package/dist/issueRollup.test.js +476 -0
  160. package/dist/issueRollup.test.js.map +7 -0
  161. package/dist/issueTracking.test.js +1059 -989
  162. package/dist/issueTracking.test.js.map +7 -1
  163. package/dist/issueWriteRecovery.test.d.ts +1 -0
  164. package/dist/issueWriteRecovery.test.js +260 -0
  165. package/dist/issueWriteRecovery.test.js.map +7 -0
  166. package/dist/lifecycle.test.js +112 -441
  167. package/dist/lifecycle.test.js.map +7 -1
  168. package/dist/logger.js +80 -74
  169. package/dist/logger.js.map +7 -1
  170. package/dist/mcp/index.js +116 -94
  171. package/dist/mcp/index.js.map +7 -1
  172. package/dist/mcp/tools.d.ts +252 -310
  173. package/dist/mcp/tools.js +235 -342
  174. package/dist/mcp/tools.js.map +7 -1
  175. package/dist/pluginAuthProbe.js +63 -52
  176. package/dist/pluginAuthProbe.js.map +7 -1
  177. package/dist/pluginAuthProbe.test.js +85 -62
  178. package/dist/pluginAuthProbe.test.js.map +7 -1
  179. package/dist/pluginCredentials.test.js +282 -259
  180. package/dist/pluginCredentials.test.js.map +7 -1
  181. package/dist/pluginDoctor.test.js +653 -588
  182. package/dist/pluginDoctor.test.js.map +7 -1
  183. package/dist/pluginInstaller.d.ts +7 -5
  184. package/dist/pluginInstaller.js +1173 -1229
  185. package/dist/pluginInstaller.js.map +7 -1
  186. package/dist/pluginInstaller.test.js +1842 -1423
  187. package/dist/pluginInstaller.test.js.map +7 -1
  188. package/dist/pluginPackaging.test.js +417 -413
  189. package/dist/pluginPackaging.test.js.map +7 -1
  190. package/dist/pr.d.ts +114 -131
  191. package/dist/pr.js +1314 -1327
  192. package/dist/pr.js.map +7 -1
  193. package/dist/pr.test.js +967 -653
  194. package/dist/pr.test.js.map +7 -1
  195. package/dist/prAssociation.test.js +2419 -1788
  196. package/dist/prAssociation.test.js.map +7 -1
  197. package/dist/prDispatch.test.js +123 -89
  198. package/dist/prDispatch.test.js.map +7 -1
  199. package/dist/readView.d.ts +184 -0
  200. package/dist/readView.js +218 -0
  201. package/dist/readView.js.map +7 -0
  202. package/dist/readView.test.d.ts +1 -0
  203. package/dist/readView.test.js +146 -0
  204. package/dist/readView.test.js.map +7 -0
  205. package/dist/releaseReconciliation.test.js +267 -288
  206. package/dist/releaseReconciliation.test.js.map +7 -1
  207. package/dist/releaseWorkflow.test.js +2493 -422
  208. package/dist/releaseWorkflow.test.js.map +7 -1
  209. package/dist/review.d.ts +738 -2
  210. package/dist/review.js +601 -348
  211. package/dist/review.js.map +7 -1
  212. package/dist/review.test.js +1218 -812
  213. package/dist/review.test.js.map +7 -1
  214. package/dist/reviewSubmit.test.d.ts +1 -0
  215. package/dist/reviewSubmit.test.js +747 -0
  216. package/dist/reviewSubmit.test.js.map +7 -0
  217. package/dist/services/agentReadinessService.js +42 -37
  218. package/dist/services/agentReadinessService.js.map +7 -1
  219. package/dist/services/blockerGuardService.js +188 -188
  220. package/dist/services/blockerGuardService.js.map +7 -1
  221. package/dist/services/boardReconcileService.d.ts +125 -125
  222. package/dist/services/boardReconcileService.js +1295 -1421
  223. package/dist/services/boardReconcileService.js.map +7 -1
  224. package/dist/services/deliveryHealthService.js +197 -199
  225. package/dist/services/deliveryHealthService.js.map +7 -1
  226. package/dist/services/legacyIssueMigration.js +263 -277
  227. package/dist/services/legacyIssueMigration.js.map +7 -1
  228. package/dist/stagedChecks.test.js +396 -194
  229. package/dist/stagedChecks.test.js.map +7 -1
  230. package/dist/start.test.js +99 -95
  231. package/dist/start.test.js.map +7 -1
  232. package/dist/stdoutRegression.test.js +321 -358
  233. package/dist/stdoutRegression.test.js.map +7 -1
  234. package/dist/targetPolicyDiscovery.test.js +141 -143
  235. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  236. package/dist/targetPolicyEntrypoints.test.js +308 -269
  237. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  238. package/dist/targetPolicyLocal.test.js +580 -1051
  239. package/dist/targetPolicyLocal.test.js.map +7 -1
  240. package/dist/targetPolicyRoutes.test.js +274 -281
  241. package/dist/targetPolicyRoutes.test.js.map +7 -1
  242. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  243. package/dist/targetRepositoryExecution.test.js +451 -0
  244. package/dist/targetRepositoryExecution.test.js.map +7 -0
  245. package/dist/terminalMessages.js +41 -35
  246. package/dist/terminalMessages.js.map +7 -1
  247. package/dist/toolOutput.d.ts +2 -0
  248. package/dist/toolOutput.js +36 -0
  249. package/dist/toolOutput.js.map +7 -0
  250. package/dist/toolOutput.test.d.ts +1 -0
  251. package/dist/toolOutput.test.js +240 -0
  252. package/dist/toolOutput.test.js.map +7 -0
  253. package/dist/utils/atomicJson.d.ts +0 -2
  254. package/dist/utils/atomicJson.js +81 -77
  255. package/dist/utils/atomicJson.js.map +7 -1
  256. package/dist/utils/filesystem.d.ts +0 -8
  257. package/dist/utils/filesystem.js +5 -19
  258. package/dist/utils/filesystem.js.map +7 -1
  259. package/dist/utils/lockfile.js +68 -71
  260. package/dist/utils/lockfile.js.map +7 -1
  261. package/dist/verification.d.ts +1 -54
  262. package/dist/verification.js +976 -1941
  263. package/dist/verification.js.map +7 -1
  264. package/dist/verificationGate.test.js +127 -117
  265. package/dist/verificationGate.test.js.map +7 -1
  266. package/dist/version.js +45 -24
  267. package/dist/version.js.map +7 -1
  268. package/package.json +9 -8
  269. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  270. package/plugins/ai-delivery/README.md +47 -156
  271. package/plugins/ai-delivery/plugin.json +1 -1
  272. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +238 -44
  273. package/plugins/ai-delivery/runtime/dist/cli.js +351 -115
  274. package/plugins/ai-delivery/runtime/package.json +1 -1
  275. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  276. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  277. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  278. package/dist/investigationCompletion.test.js +0 -728
  279. package/dist/investigationCompletion.test.js.map +0 -1
  280. package/dist/services/deliveryAdmission.d.ts +0 -49
  281. package/dist/services/deliveryAdmission.js +0 -165
  282. package/dist/services/deliveryAdmission.js.map +0 -1
  283. package/dist/services/worktreeRegistry.d.ts +0 -434
  284. package/dist/services/worktreeRegistry.js +0 -1248
  285. package/dist/services/worktreeRegistry.js.map +0 -1
  286. package/dist/setup.d.ts +0 -60
  287. package/dist/setup.js +0 -585
  288. package/dist/setup.js.map +0 -1
  289. package/dist/setup.test.js +0 -3329
  290. package/dist/setup.test.js.map +0 -1
  291. package/dist/worktree.d.ts +0 -28
  292. package/dist/worktree.js +0 -188
  293. package/dist/worktree.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 → build.test.d.ts} +0 -0
  300. /package/dist/{setup.test.d.ts → callerErrors.test.d.ts} +0 -0
  301. /package/dist/{worktreeTransition.test.d.ts → deliveryBoard.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 and independent reviews** 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,579 +45,74 @@ 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
+ gh pr merge 23 --repo example/widget --squash --match-head-commit <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
+ GitHub deletes the merged head branch; the host removes its own worktree.
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. 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
- | Reconcile Project membership / Status | `board_reconcile` | `board:reconcile --repositories <owner/repo...> [--dry-run]`; retained plan and result JSON for apply/recovery |
307
- | Record a typed journal | `issue_comment` | See the [typed journal contract](#typed-issue-journals); the MCP call returns the authored comment identity and readback |
308
- | Close with a reason | `issue_update` | `update --issue N --state closed --close-reason not_planned --superseded-by S` |
309
-
310
- 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.
311
-
312
- `issue_create` and `issue_update` also accept optional native `startDate` and
313
- `targetDate` values, including in CLI `--fields-file` JSON. They resolve the
314
- organization fields named **Start date** and **Target date** without caller IDs.
315
- Dates must be calendar-valid `YYYY-MM-DD` strings. Omit a property to preserve
316
- its current value; use `null` to clear only that date. For example, an update
317
- file containing `{"startDate":"2028-02-29","targetDate":null}` sets the start
318
- date and clears the target. Missing, duplicate or incompatible requested date
319
- fields refuse before mutation; calls without date properties do not require
320
- those organization fields. Existing Points/Priority and other field values
321
- are preserved. This adds no date fields to the organization.
322
-
323
- `issue_info.fields` returns the same supported organization field names and
324
- values as `issue_list`, including text, number, date and named single/multi-select
325
- values; unset fields are `null`. The existing top-level Points/Priority readback
326
- remains, with `startDate`/`targetDate` aliases when their date fields exist.
327
- Setting fields uses additive native updates; clearing an already unset date is
328
- idempotent. A creation failure after a native issue exists reports that known
329
- issue so recovery never creates a replacement.
330
-
331
- Batch input is a UTF-8 JSON array of **1–50** complete `issue_update` inputs;
332
- MCP takes `{repo, items, dryRun}`. All items use the selected repository, including
333
- any per-item `repo`. Close, defer/undefer, parent, blockers, typed contract,
334
- status and history/render-retention fields keep their existing validation and
335
- configured author requirements. Dry run performs reads and returns `planned`,
336
- `unchanged` or `failed` results with the desired `changes` and current `readback`;
337
- it writes no issue fields, metadata, relationships, Project state or comments.
338
-
339
- Execution is serial and returns every item in input order as `applied`,
340
- `unchanged` or `failed`, plus readback and summary counts. Failure can follow a
341
- partial native write: inspect its readback before retrying. An unavailable
342
- readback is explicit, never evidence that nothing changed. Rerun the same inputs
343
- to reconcile actual state; already satisfied fields and related outcomes are
344
- unchanged, and authored comments/history are deduplicated. This operation has no
345
- cross-repository transaction or rollback. CLI prints the complete JSON and exits
346
- nonzero if any item failed. A positively identified GitHub rate limit stops
347
- further writes and gives every remaining item an explicit failure reason;
348
- `summary.rateLimits` contains only available numeric retry-after/reset/remaining
349
- observations. No uncertain mutation is automatically replayed.
350
-
351
- Creation includes five status fields: Ready or Draft, last updated in UTC,
352
- next milestone (default `Not started`), native blocker numbers (or `None`),
353
- and latest journal (`None yet`). Supply `status: {"nextMilestone":"Run checks"}`
354
- on `issue_create`; `issue_update` also accepts display-only `status.blockers`
355
- and `status.latestJournal`. The same objects work in CLI `--fields-file` JSON.
356
- Status values are single lines rendered as literal text. Status-only patches
357
- preserve every byte outside Status, including canonical data and start markers;
358
- no-op patches keep the timestamp. Display blockers create no dependency edges:
359
- use native `blockedBy` for those, and do not combine it with `status.blockers`.
360
- Convert handwritten legacy bodies explicitly before applying a status-only patch.
361
- The nonblocking body-length warning counts readable text, excludes embedded
362
- issue-data, and triggers strictly above 4,000 characters.
363
-
364
- `preserveHistory` controls an authored, exactly read-back snapshot of the prior
365
- title/body before a rewrite. `retainLegacyBody` independently controls whether
366
- legacy text appears in the current readable body; it never erases the embedded
367
- legacy record or native comments. Both may be specified in update field files.
368
- By default, legacy conversion or first omission preserves native history before
369
- hiding retired text. Incoming legacy bytes absent from that history stay visible.
370
- With `preserveHistory: false`, unpreserved legacy text stays visible; an explicit
371
- `retainLegacyBody: false` deliberately hides it without requesting a history
372
- comment. `retainLegacyBody: true` keeps it visible even when history is written.
373
- Repeated unchanged updates reuse the body and existing exact authored history;
374
- failed history readback or concurrent content drift refuses the rewrite.
375
-
376
- `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.
377
-
378
- ## Deferral and work-in-progress admission
379
-
380
- `issue_update` accepts `defer: { until?: "YYYY-MM-DD", trigger?: "condition" }`
381
- or `undefer: true`. An empty `defer: {}` means indefinite manual deferral.
382
- These inputs are mutually exclusive. Conditions are recorded text and dates:
383
- passing the date or satisfying the trigger never automatically resumes work.
384
- Only explicit `undefer` clears deferral; body replacements and unrelated updates
385
- retain it. `issue_info` and `issue_list` return `deferred` with the recorded
386
- conditions, or `null` for known undeferred content. If canonical content is
387
- invalid or a listing omits its body, the field is omitted rather than claiming
388
- that deferral is absent; inspect the body and readiness diagnostics.
389
-
390
- Deferral is independent of `draft` and `park`. `park` still pauses execution as
391
- a draft, retains host-owned worktree custody, and uses the existing Todo/Blocked
392
- Project presentation. `undefer` does not clear a parked draft. Deferral alone
393
- does not release an existing In Progress slot. Readiness and supported `start`
394
- refuse deferred work, including a past date, before creating a branch or journal.
395
- The removed `develop` workflow remains removed. Repository labels continue to
396
- 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
+ | Delivery support: plugin | `plugin install`, `plugin doctor`, `plugin preview`, `plugin update`, `plugin rollback`, `plugin remove` | — |
95
+ | Issues: offline migration plan | `migrate:legacy-issues` | — |
96
+ | All: setup/transport | `config:resolve`, `mcp:serve` | — |
397
97
 
398
- ```sh
399
- ai-delivery --repo example/widget update --issue 17 --defer --defer-trigger 'Upstream ships'
400
- ai-delivery --repo example/widget update --issue 17 --defer-until 2026-12-01
401
- ai-delivery --repo example/widget update --issue 17 --undefer
402
- ```
98
+ 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.
403
99
 
404
- Optional `wipLimits` in the existing operator-owned user JSON declares lanes.
405
- No target-repository configuration is loaded, and the tool never writes these
406
- settings. Without this option, capacity admission is unchanged. Each lane names
407
- its repository, a name unique within that repository, a nonnegative integer
408
- limit, and exactly one native label or named native issue-field value:
100
+ ## Upgrade a host
409
101
 
410
- ```json
411
- {
412
- "wipLimits": [
413
- { "repository": "example/widget", "name": "Review", "match": { "label": "Needs Review" }, "limit": 2 },
414
- { "repository": "example/widget", "name": "Urgent", "match": { "field": "Priority", "value": "High" }, "limit": 1 }
415
- ]
416
- }
417
- ```
102
+ 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.
418
103
 
419
- Label matching follows native case-insensitive label names. Field names and
420
- string values match exactly; numeric fields compare numbers and multi-select
421
- fields match a member. Unknown labels/fields, changed identities, malformed or
422
- unreadable data, repeated/nonadvancing pages and incomplete bounded readback
423
- refuse admission. Counts include open issues in the selected repository with
424
- the configured Project's In Progress status. Verified absent membership or an
425
- explicitly unset native Status consumes no slot; omitted Status evidence refuses. Every matching lane must have
426
- capacity. An already In Progress target consumes no additional slot on retry.
427
-
428
- `start --override-reason <reason>` / `issue_start.overrideReason` can override
429
- capacity only. The configured authenticated author must record and verify the
430
- exact issue, Project, native field identity, lane counts/limits and reason in
431
- an issue comment before advancement. The reason cannot bypass deferral, draft,
432
- native blockers, tracking-parent eligibility, access or review requirements.
433
- An uncertain comment acknowledgment is reconciled against the same authored
434
- comment; a changed observation refuses advancement and requires fresh readback.
435
-
436
- Capacity is read completely before branch creation and rechecked immediately
437
- before Project advancement. GitHub exposes no conditional cross-writer Project
438
- capacity transaction: these are fresh observed-capacity guards, with no global
439
- atomic WIP guarantee against concurrent native writers. A later refusal can
440
- leave the already-linked branch intact; use the returned `safeResume.arguments`
441
- with its reason and preserve that native identity. Refusals publish no Started
442
- journal. `src/issueIntake.test.ts` exercises current CLI/MCP/SDK deferral and WIP
443
- paths with synthetic native ports; it makes no live override or deployment claim.
444
-
445
- ## Blocker overrides and delivery health
446
-
447
- `create`, `start` and `update` accept `--blocks <issue-numbers>` to add the
448
- selected issue as a native blocker of named dependents. This preserves those
449
- dependents' other blockers. `--blocked-by` retains its exact-set replacement
450
- semantics. The corresponding MCP inputs are `blocks` and `blockedBy`.
451
-
452
- A genuinely new blocker on configured-Project **In Progress** work requires
453
- `--override-reason <reason>` / `overrideReason` (1–2,000 trimmed characters).
454
- The configured author must authenticate, and an author-verified comment must
455
- precede the native edge. Existing edges and removals require no override.
456
- Unresolved dependent status refuses additions. Creation preflights existing
457
- dependents before creating the new issue. A retry reuses the same verified
458
- comment for the same native removal episode; a later remove/re-add records a
459
- new episode. Comments record intent, not successful dependency writes.
460
-
461
- GitHub does not atomically lock status, comments and relationships. Every actual
462
- addition is rechecked at its write boundary. A later failure can follow earlier
463
- writes; inspect native state and resume the known issue rather than recreate it.
464
- If creation partially succeeds, the existing known-created recovery identifies
465
- that issue. Low-level exported relationship primitives remain available to
466
- callers that own their own policy; the guard applies to canonical issue writes.
104
+ 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.
467
105
 
468
- ```sh
469
- ai-delivery --repo example/widget update --issue 17 --blocked-by 18 --override-reason 'Await prerequisite validation'
470
- ai-delivery --repo example/widget health --from 2026-10-01T00:00:00Z --to 2026-10-08T00:00:00Z
471
- ```
472
-
473
- `delivery_health` / `health` requires an explicit repository and UTC `[from,to)`
474
- window. It reports distinct issues opened and closed, current open In Progress
475
- work in that repository lane of the configured Project, oldest active issues by
476
- creation time, and distinct native blocker additions classified by proven
477
- historical Project membership and status. Reopen/reclose counts one closed issue
478
- per window. Unknown history is separate and never a violation verdict. Age is
479
- since issue creation, not time spent in progress.
480
-
481
- The window must end at or before collection time. The read-only snapshot is non-atomic and records collection timestamps. Defaults
482
- are 200 issues, five timeline pages per issue, five Project item pages per
483
- status read and ten oldest issues; bounds are 500 issues, 20 pages per read
484
- and 20 oldest issues. `--max-project-pages` bounds Project status collection. Limits and read failures
485
- produce explicit partial **observed** counts, not complete zeroes. Issues whose
486
- current Project status cannot be resolved have a separate unknown count.
487
-
488
- ## Scoped Project reconciliation
489
-
490
- `board_reconcile` uses the same dispatcher as the library's existing `executeTool`
491
- and CLI `board:reconcile`. Supply 1–10 explicit `repositories`; the command never
492
- infers this scope from launch-directory Git. An optional singular `repo` must agree
493
- with the sole selected repository. Dry-run is the default and requires read access
494
- through the configured author. Apply requires fresh write access through that same
495
- author and refuses the legacy development-token override.
496
-
497
- The dry-run `ai-delivery.board-reconcile-plan@1` includes every selected native
498
- issue, current membership/Status, native facts, gaps, metadata suggestions and
499
- deterministic operations. These operation artifacts remain under `ai-delivery.mcp@2`.
500
- Bounds are 500 native issues per repository, 20 requests per logical prerequisite
501
- collection (including its completion page), and 16 MiB UTF-8 for retained JSON
502
- inputs and structured output. An overflow or unreadable inventory produces an
503
- incomplete report; it never authorizes a truncated-scope apply. These bounds do not
504
- claim an HTTP response-byte or process-memory ceiling.
505
-
506
- Open issues may receive missing membership independently of Status. Status follows
507
- proven native closure, open blockers, canonical draft/deferral, then positive local
508
- checkout evidence with readiness and WIP admission. `checkouts` (CLI
509
- `--checkouts-file`) selects absolute physical checkouts for native-linked current
510
- branches inside configured roots. A checkout does not prove a running task, and
511
- missing activity evidence does not prove inactivity. Unknown Status remains
512
- unresolved, archived items stay preserved, and metadata/duplicate-label suggestions
513
- never repair native fields or labels.
514
-
515
- Retain the exact original plan. Apply supplies `mode: "apply"` and `plan` (CLI
516
- `--apply --plan-file`); optional `priorResult` (`--prior-result-file`) preserves known
517
- item IDs and historical attempts on that same plan. Files contain regular UTF-8
518
- JSON data. Scope, artifact bytes, configuration, destinations, inventory and author
519
- are revalidated before writes; operation-specific native and item facts are checked
520
- at both write boundaries and afterward. A compatible exact postimage is satisfied
521
- without repeating the write. A deleted known item or unexpected automatic/human
522
- Status requires a fresh plan. Recovery adds no journal store or automatic rollback.
523
- Plans identify the executing package manifest/dist bytes independently of cwd;
524
- the root library and bundled plugin layouts need fresh plans even at equal versions.
525
-
526
- The apply `ai-delivery.board-reconcile-result@1` preserves applied, satisfied,
527
- failed, drifted/refused and unknown-after-attempt evidence. A failed shared Project
528
- group stops its dependents; independent groups may finish. Global cancellation,
529
- authentication or rate-limit failure stops remaining writes. The CLI prints complete
530
- compact JSON before exiting nonzero for incomplete scope or unresolved apply work.
531
- A complete dry-run can exit zero with explicit issue gaps and metadata suggestions.
532
- GitHub provides no expected-current-value predicate for these mutations: observable
533
- drift is detected, while races with outside writers can remain ambiguous.
534
-
535
- ## Typed issue journals
536
-
537
- `issue_comment` posts a typed journal through the configured author role. The public
538
- `commentIssue(context, input)` API uses the same implementation. The returned
539
- `commentId`, `url`, `body` and `reused` come from a fresh GitHub comment readback;
540
- the author, issue target and body must agree. Historical rewrites and reasoned
541
- issue closure call this same writer through `issue_update`.
542
-
543
- The public agent API also accepts `commentIssue(context, {issueNumber, body})`
544
- for exact raw comments, such as an already-rendered history snapshot. It preserves
545
- leading/trailing whitespace, line endings and content beyond the journal template
546
- limits, and appends no wrapper or marker. Exact authored-body retries reuse the
547
- existing comment and still require fresh readback. Blank bodies and complete
548
- payloads exceeding `ISSUE_COMMENT_BODY_LIMIT` (65,536 UTF-16 code units, matching
549
- [GitHub's first-party JavaScript validation](https://github.com/github/gh-aw/blob/3ead8042c7b1edc2128ba1b28b1b80d00b7f4c22/actions/setup/js/comment_limit_helpers.cjs))
550
- fail before authentication or mutation. This supported client bound also applies
551
- after typed-journal rendering; it does not truncate content. The MCP
552
- `issue_comment` input remains the typed journal contract below. History rendering
553
- and ordering of later issue rewrites belong to the caller.
554
-
555
- Every kind requires `issueNumber`, a one-line `summary`, `status`, `keyNumbers`
556
- (an array, empty when no numbers are known), `evidence` (HTTPS links), `nextStep`
557
- and `nextDate` (`YYYY-MM-DD`, or `null` when unscheduled). The summary is the first
558
- visible line, numbers stay inline, and evidence should be reachable outside the
559
- operator's machine. Validation requires HTTPS with a DNS hostname; it rejects
560
- file paths, credential-bearing URLs, IP literals, localhost and `.local` names.
561
- It does not probe remote reachability. Each kind also requires these fields:
562
-
563
- | Kind | Required fields |
564
- | ---------- | ----------------------------------------------------------------------------------------- |
565
- | `start` | `outcome` |
566
- | `progress` | `done` (nonempty list), `decisionNeeded`; at least one evidence link |
567
- | `decision` | `decision`, `rationale` |
568
- | `blocker` | `blocker`, `resolution` |
569
- | `closeout` | `acceptance` (nonempty `{criterion, evidence}` list), `followUps` (list; empty when none) |
570
-
571
- Optional `details` adds supporting prose. `lengthCap` (600–10,000 characters,
572
- default 1,800) limits the expanded journal: excess fields move into one collapsed
573
- details section, without truncating acceptance evidence. Keep bulky inventories
574
- in linked evidence instead of the summary.
575
-
576
- ```json
577
- {
578
- "issueNumber": 17,
579
- "kind": "progress",
580
- "summary": "Input validation is implemented and ready for review.",
581
- "status": "In progress",
582
- "done": ["Added malformed-input handling and regression coverage"],
583
- "keyNumbers": ["7 focused tests passed"],
584
- "decisionNeeded": "None",
585
- "evidence": ["https://github.com/example/widget/pull/23"],
586
- "nextStep": "Complete independent review",
587
- "nextDate": "2026-10-09"
588
- }
589
- ```
106
+ ## Plugin installation
590
107
 
591
- Successful tracked `issue_start` calls publish one start
592
- journal. Scratch work, failed readiness and failed development do not claim a
593
- start. `issue_finish` publishes closeout only after its existing merge, closure,
594
- Project and cleanup contracts succeed, with each checkbox acceptance criterion
595
- linked to the merged PR and a follow-up field. The PR carries the verification
596
- and review evidence; the comment does not create another acceptance gate.
597
-
598
- Exact manual retries reuse the same authored comment. Automatic retries find the
599
- original start or exact-merge closeout even after a lost response or worktree
600
- cleanup. Markers from another author never establish reuse. Operations from the
601
- same local controller serialize their comment writes; independently configured
602
- controllers still require one issue owner. A failed journal write/readback is
603
- reported and the same lifecycle call can recover it. Created-issue failures
604
- return the exact issue identity and `safeResume.arguments`. Incomplete tracking
605
- uses `resumeCreated: true`; later start recovery preserves the current native
606
- body and eligibility without replaying the original tracking fields. Historical comments are
607
- preserved. Generated issue Status blocks and general readability warnings are
608
- owned by the separate issue-contract work.
108
+ 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.
609
109
 
610
110
  ## Contributor checks and release
611
111
 
612
- 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.
112
+ [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.
113
+
114
+ 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.
613
115
 
614
- 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.
116
+ 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.
615
117
 
616
- Installing the package does not switch an existing consumer. Run `npm run checks`, `npm run build`, and `npm pack --dry-run` before release.
118
+ Source version **0.3.37** 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).