@aviaratech/ai-delivery 0.3.35 → 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 (297) hide show
  1. package/CONTRIBUTING.md +12 -206
  2. package/README.md +57 -554
  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 +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 +105 -0
  13. package/dist/callerErrors.test.js.map +7 -0
  14. package/dist/cli.js +402 -515
  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 +329 -353
  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 +59 -19
  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.js +73 -67
  95. package/dist/git.js.map +7 -1
  96. package/dist/gitProcess.d.ts +1 -1
  97. package/dist/gitProcess.js +58 -53
  98. package/dist/gitProcess.js.map +7 -1
  99. package/dist/github/client.d.ts +2 -2
  100. package/dist/github/client.js +484 -379
  101. package/dist/github/client.js.map +7 -1
  102. package/dist/github/commandIdentityPolicy.js +44 -52
  103. package/dist/github/commandIdentityPolicy.js.map +7 -1
  104. package/dist/github/discovery.d.ts +1 -0
  105. package/dist/github/discovery.js +197 -215
  106. package/dist/github/discovery.js.map +7 -1
  107. package/dist/github/discovery.test.js +223 -177
  108. package/dist/github/discovery.test.js.map +7 -1
  109. package/dist/github/issueHistory.d.ts +2 -2
  110. package/dist/github/issueHistory.js +117 -125
  111. package/dist/github/issueHistory.js.map +7 -1
  112. package/dist/github/machineAuth.d.ts +1 -1
  113. package/dist/github/machineAuth.js +126 -117
  114. package/dist/github/machineAuth.js.map +7 -1
  115. package/dist/github/machineAuth.test.js +755 -639
  116. package/dist/github/machineAuth.test.js.map +7 -1
  117. package/dist/github/nativeIssueMetadata.js +286 -273
  118. package/dist/github/nativeIssueMetadata.js.map +7 -1
  119. package/dist/github/projectDelivery.d.ts +18 -2
  120. package/dist/github/projectDelivery.js +615 -557
  121. package/dist/github/projectDelivery.js.map +7 -1
  122. package/dist/github/relationships.js +433 -389
  123. package/dist/github/relationships.js.map +7 -1
  124. package/dist/github/repo.d.ts +1 -0
  125. package/dist/github/repo.js +123 -96
  126. package/dist/github/repo.js.map +7 -1
  127. package/dist/index.js +3 -3
  128. package/dist/index.js.map +7 -1
  129. package/dist/issue.d.ts +40 -9
  130. package/dist/issue.js +2102 -1742
  131. package/dist/issue.js.map +7 -1
  132. package/dist/issue63History.test.js +40 -42
  133. package/dist/issue63History.test.js.map +7 -1
  134. package/dist/issue63Routes.test.js +154 -143
  135. package/dist/issue63Routes.test.js.map +7 -1
  136. package/dist/issueBatchUpdate.test.js +989 -885
  137. package/dist/issueBatchUpdate.test.js.map +7 -1
  138. package/dist/issueBlockerGuard.test.js +262 -226
  139. package/dist/issueBlockerGuard.test.js.map +7 -1
  140. package/dist/issueContract.d.ts +23 -4
  141. package/dist/issueContract.js +416 -395
  142. package/dist/issueContract.js.map +7 -1
  143. package/dist/issueContract.test.d.ts +4 -3
  144. package/dist/issueContract.test.js +358 -321
  145. package/dist/issueContract.test.js.map +7 -1
  146. package/dist/issueDates.test.js +235 -233
  147. package/dist/issueDates.test.js.map +7 -1
  148. package/dist/issueInfoReadback.test.js +304 -190
  149. package/dist/issueInfoReadback.test.js.map +7 -1
  150. package/dist/issueIntake.test.js +1945 -1732
  151. package/dist/issueIntake.test.js.map +7 -1
  152. package/dist/issueJournal.d.ts +40 -19
  153. package/dist/issueJournal.js +229 -138
  154. package/dist/issueJournal.js.map +7 -1
  155. package/dist/issueJournal.test.js +605 -422
  156. package/dist/issueJournal.test.js.map +7 -1
  157. package/dist/issueRollup.test.d.ts +1 -0
  158. package/dist/issueRollup.test.js +476 -0
  159. package/dist/issueRollup.test.js.map +7 -0
  160. package/dist/issueTracking.test.js +1059 -989
  161. package/dist/issueTracking.test.js.map +7 -1
  162. package/dist/issueWriteRecovery.test.d.ts +1 -0
  163. package/dist/issueWriteRecovery.test.js +260 -0
  164. package/dist/issueWriteRecovery.test.js.map +7 -0
  165. package/dist/lifecycle.test.js +112 -441
  166. package/dist/lifecycle.test.js.map +7 -1
  167. package/dist/logger.js +80 -74
  168. package/dist/logger.js.map +7 -1
  169. package/dist/mcp/index.js +116 -94
  170. package/dist/mcp/index.js.map +7 -1
  171. package/dist/mcp/tools.d.ts +264 -286
  172. package/dist/mcp/tools.js +267 -340
  173. package/dist/mcp/tools.js.map +7 -1
  174. package/dist/pluginAuthProbe.js +63 -52
  175. package/dist/pluginAuthProbe.js.map +7 -1
  176. package/dist/pluginAuthProbe.test.js +85 -62
  177. package/dist/pluginAuthProbe.test.js.map +7 -1
  178. package/dist/pluginCredentials.test.js +282 -259
  179. package/dist/pluginCredentials.test.js.map +7 -1
  180. package/dist/pluginDoctor.test.js +653 -588
  181. package/dist/pluginDoctor.test.js.map +7 -1
  182. package/dist/pluginInstaller.d.ts +7 -5
  183. package/dist/pluginInstaller.js +1173 -1229
  184. package/dist/pluginInstaller.js.map +7 -1
  185. package/dist/pluginInstaller.test.js +1842 -1423
  186. package/dist/pluginInstaller.test.js.map +7 -1
  187. package/dist/pluginPackaging.test.js +460 -409
  188. package/dist/pluginPackaging.test.js.map +7 -1
  189. package/dist/pr.d.ts +132 -94
  190. package/dist/pr.js +1521 -1323
  191. package/dist/pr.js.map +7 -1
  192. package/dist/pr.test.js +1678 -632
  193. package/dist/pr.test.js.map +7 -1
  194. package/dist/prAssociation.test.js +2419 -1788
  195. package/dist/prAssociation.test.js.map +7 -1
  196. package/dist/prDispatch.test.js +150 -89
  197. package/dist/prDispatch.test.js.map +7 -1
  198. package/dist/readView.d.ts +183 -0
  199. package/dist/readView.js +217 -0
  200. package/dist/readView.js.map +7 -0
  201. package/dist/readView.test.d.ts +1 -0
  202. package/dist/readView.test.js +119 -0
  203. package/dist/readView.test.js.map +7 -0
  204. package/dist/releaseReconciliation.test.js +267 -288
  205. package/dist/releaseReconciliation.test.js.map +7 -1
  206. package/dist/releaseWorkflow.test.js +2493 -422
  207. package/dist/releaseWorkflow.test.js.map +7 -1
  208. package/dist/review.d.ts +738 -2
  209. package/dist/review.js +601 -348
  210. package/dist/review.js.map +7 -1
  211. package/dist/review.test.js +1218 -812
  212. package/dist/review.test.js.map +7 -1
  213. package/dist/reviewSubmit.test.d.ts +1 -0
  214. package/dist/reviewSubmit.test.js +747 -0
  215. package/dist/reviewSubmit.test.js.map +7 -0
  216. package/dist/services/agentReadinessService.js +42 -37
  217. package/dist/services/agentReadinessService.js.map +7 -1
  218. package/dist/services/blockerGuardService.js +188 -188
  219. package/dist/services/blockerGuardService.js.map +7 -1
  220. package/dist/services/boardReconcileService.d.ts +125 -125
  221. package/dist/services/boardReconcileService.js +1295 -1421
  222. package/dist/services/boardReconcileService.js.map +7 -1
  223. package/dist/services/deliveryAdmission.js +131 -154
  224. package/dist/services/deliveryAdmission.js.map +7 -1
  225. package/dist/services/deliveryHealthService.js +197 -199
  226. package/dist/services/deliveryHealthService.js.map +7 -1
  227. package/dist/services/legacyIssueMigration.js +263 -277
  228. package/dist/services/legacyIssueMigration.js.map +7 -1
  229. package/dist/services/worktreeRegistry.d.ts +27 -119
  230. package/dist/services/worktreeRegistry.js +765 -1182
  231. package/dist/services/worktreeRegistry.js.map +7 -1
  232. package/dist/stagedChecks.test.js +396 -194
  233. package/dist/stagedChecks.test.js.map +7 -1
  234. package/dist/start.test.js +99 -95
  235. package/dist/start.test.js.map +7 -1
  236. package/dist/stdoutRegression.test.js +353 -352
  237. package/dist/stdoutRegression.test.js.map +7 -1
  238. package/dist/targetPolicyDiscovery.test.js +141 -143
  239. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  240. package/dist/targetPolicyEntrypoints.test.js +308 -269
  241. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  242. package/dist/targetPolicyLocal.test.js +580 -1051
  243. package/dist/targetPolicyLocal.test.js.map +7 -1
  244. package/dist/targetPolicyRoutes.test.js +305 -281
  245. package/dist/targetPolicyRoutes.test.js.map +7 -1
  246. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  247. package/dist/targetRepositoryExecution.test.js +463 -0
  248. package/dist/targetRepositoryExecution.test.js.map +7 -0
  249. package/dist/terminalMessages.js +41 -35
  250. package/dist/terminalMessages.js.map +7 -1
  251. package/dist/toolOutput.d.ts +2 -0
  252. package/dist/toolOutput.js +36 -0
  253. package/dist/toolOutput.js.map +7 -0
  254. package/dist/toolOutput.test.d.ts +1 -0
  255. package/dist/toolOutput.test.js +240 -0
  256. package/dist/toolOutput.test.js.map +7 -0
  257. package/dist/utils/atomicJson.js +84 -76
  258. package/dist/utils/atomicJson.js.map +7 -1
  259. package/dist/utils/filesystem.js +15 -18
  260. package/dist/utils/filesystem.js.map +7 -1
  261. package/dist/utils/lockfile.js +68 -71
  262. package/dist/utils/lockfile.js.map +7 -1
  263. package/dist/verification.d.ts +1 -19
  264. package/dist/verification.js +1020 -1939
  265. package/dist/verification.js.map +7 -1
  266. package/dist/verificationGate.test.js +127 -117
  267. package/dist/verificationGate.test.js.map +7 -1
  268. package/dist/version.js +23 -24
  269. package/dist/version.js.map +7 -1
  270. package/dist/worktree.d.ts +3 -15
  271. package/dist/worktree.js +97 -177
  272. package/dist/worktree.js.map +7 -1
  273. package/package.json +9 -8
  274. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  275. package/plugins/ai-delivery/README.md +47 -156
  276. package/plugins/ai-delivery/plugin.json +1 -1
  277. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +238 -44
  278. package/plugins/ai-delivery/runtime/dist/cli.js +358 -115
  279. package/plugins/ai-delivery/runtime/package.json +1 -1
  280. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  281. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  282. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  283. package/dist/investigationCompletion.test.js +0 -728
  284. package/dist/investigationCompletion.test.js.map +0 -1
  285. package/dist/setup.d.ts +0 -60
  286. package/dist/setup.js +0 -585
  287. package/dist/setup.js.map +0 -1
  288. package/dist/setup.test.js +0 -3329
  289. package/dist/setup.test.js.map +0 -1
  290. package/dist/worktreeTransition.d.ts +0 -211
  291. package/dist/worktreeTransition.js +0 -1037
  292. package/dist/worktreeTransition.js.map +0 -1
  293. package/dist/worktreeTransition.test.js +0 -1191
  294. package/dist/worktreeTransition.test.js.map +0 -1
  295. /package/dist/{investigationCompletion.test.d.ts → build.test.d.ts} +0 -0
  296. /package/dist/{setup.test.d.ts → callerErrors.test.d.ts} +0 -0
  297. /package/dist/{worktreeTransition.test.d.ts → deliveryBoard.test.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaratech/ai-delivery",
3
- "version": "0.3.35",
3
+ "version": "0.3.36",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ai-delivery": "./dist/cli.js"
@@ -5,96 +5,32 @@ description: Use ai-delivery MCP to read, list, search, create or update GitHub
5
5
 
6
6
  # GitHub issue work
7
7
 
8
- ## Read first through the requested MCP provider
8
+ 1. Discover requested installed MCP provider/schema; pass explicit `repo`. Prefixes aren't portable; remote calls need no checkout. Honor read-only/MCP-only/provider/“no other GitHub tool” restrictions. Missing/incompatible providers stop; no tool/actor/credential/permission/config substitution. CLI fallback requires unavailable MCP and permitted restrictions. Tools grant no authority; never evade refusals.
9
9
 
10
- For an ordinary request such as “Use the ai-delivery MCP issue_info tool to read owner/name issue N,” discover the intended installed ai-delivery provider, inspect the tool schema, and pass the user's repository as `repo`. Ordinary remote issue/PR tools work from a non-Git directory when `repo` is explicit. Do not ask the user to move into a checkout for a remote read.
10
+ 2. Reads use requested `issue_info`/`issue_list`/`issue_search` only. Before authorized updates inspect full native issue/metadata/relationships; use configured author, not Git identity. Preserve requirements/history; exclude secrets.
11
11
 
12
- In Claude Code, when both bare and plugin-qualified ai-delivery tools are listed, select the installed plugin's compatible tool before calling. The observed Claude example is `mcp__plugin_ai-delivery_ai-delivery__issue_info`, with required `issueNumber` and optional `repo`. Other hosts may expose a different qualified name: use the discovered provider and schema rather than hardcoding Claude's prefix everywhere. A tool with only `issueNumber`/`cached` and no `repo` has a different contract; do not send it an unsupported repository field or assume its origin from its name.
12
+ 3. Typed intake requires problem/outcome, `behavior`/`verifiedBy`, non-goals, resolved questions/portable context, edge behavior and Bug regression/steps/expected/actual/reproducibility/environment. Native Type/Points: configured 1–8; split13. Blocked/tracking parents cannot autonomously start.
13
13
 
14
- For example, a fictional remote read takes this MCP argument object:
14
+ 4. Ready defaults; Draft requires explicitly parked incomplete work and secret checks. Inspect warnings; fix blocking `code`/`field`/`fixHint`. Read `issue_info`/`issue_ready_check` before `issue_start`. [Schemas](https://github.com/aviaratech/ai-delivery/blob/main/src/mcp/tools.ts)/[status fields](https://github.com/aviaratech/ai-delivery/blob/main/src/issueContract.ts), drafts/publication prove neither readiness/review/merge/adoption.
15
15
 
16
- ```json
17
- {"repo": "example/widget", "issueNumber": 17}
18
- ```
19
-
20
- Use the repository and issue actually requested. Reading needs no typed intake fields, readiness check or start action. A read-only request stays read-only: call `issue_info` for that read, or the requested `issue_list`/`issue_search` for finding work, without `issue_create`, `issue_update` or `issue_start`. Honor an explicitly selected provider and any “MCP only” or “no other GitHub tool” constraint. If the requested compatible provider is unavailable or its schema differs, report that limitation and stop; do not silently use another provider/CLI or change registrations, permissions, actors, credentials or host configuration.
21
-
22
- ## Issue intake and authorized updates
23
-
24
- Use the complete native GitHub issue and its live relationships as the current contract. Select the intended repository explicitly and use its configured author identity; Git commit authors are not authentication. Inspect the current title, body, Issue Type, Points, Project status, parent and blockers before updating an existing issue. Preserve every agreed requirement and original history when correcting intake.
25
-
26
- Gather the concrete problem, intended outcome, affected components/files, and portable evidence. Write each acceptance criterion as `behavior` plus `verifiedBy`: observable input/result plus the proof that establishes it. Include failure or edge behavior, and a regression test for a Bug. State at least one non-goal. Resolve `openQuestions` before proceeding. For Bugs gather ordered steps, expected and actual results, reproducibility and environment. Keep credentials and private keys out of every public field.
27
-
28
- Choose native Points from the configured values within 1–8. Split a 13-point issue into executable children. Native Issue Type and Points remain authoritative; changing relationships must preserve the intended endpoints and native Project tracking. Tracking parents and issues with open blockers cannot start autonomously.
29
-
30
- ## Typed MCP workflow
16
+ 5. Preserve [status/history/legacy retention](https://github.com/aviaratech/ai-delivery/blob/main/src/issue.ts); display blockers aren't native edges; status-only edits preserve other bytes. Validation rejects without writes. Reconcile partial/uncertain writes through native readback before retry; never duplicate creation.
31
17
 
32
- 1. Call `issue_create` or `issue_update` with typed problem/outcome/acceptanceCriteria/outOfScope/openQuestions/context/bug fields, title, configured Issue Type and Points. Ready is the default. Each blocking diagnostic includes `code`, `field`, and `fixHint`: fix every reported field and retry only the rejected write. Do not retry an uncertain native mutation without authoritative readback.
33
- 2. Use `draft: true` only for explicitly parked, incomplete work. It produces a Draft status; resolve fields and set `draft: false` to resume Ready intake. Drafts still reject secrets. Existing `park` also retains execution as a draft.
34
- 3. Inspect the native readback and warnings. More than seven criteria, absent edge/regression/context, only machine-local evidence or readable text strictly over 4,000 characters warn without blocking. Embedded issue-data is excluded. Consider a smaller scope or better proof.
35
- 4. Read `issue_info` and `issue_ready_check` before `issue_start`. Readiness validates the typed contract and live Points/blockers/tracking/draft state, without local path checks or a runnable-command requirement. Mentioning the Project Todo column is ordinary prose; unresolved decisions belong in `openQuestions`.
36
- 5. Bodies use `<!-- ai-delivery:issue@1 -->` with canonical field data and five status fields: Ready/Draft, last updated in UTC, next milestone (default `Not started`), native blockers (or `None`), and latest journal (`None yet`). Create accepts `status.nextMilestone`; update also accepts display-only `status.blockers` and `status.latestJournal`. These single-line fields work in CLI field files. A status-only patch preserves every byte outside Status, including issue-data/start markers, and an unchanged patch keeps its timestamp. Display blockers do not mutate native dependencies; use `blockedBy` separately. Update typed fields rather than editing one generated copy. Legacy conversion preserves exact prior native history before default render omission, returning the prior/canonical diff. Incoming legacy bytes absent from history remain visible. `preserveHistory` controls history snapshots; `retainLegacyBody` independently controls readable legacy text and does not erase its embedded record or comments. Explicit `retainLegacyBody: false` is a deliberate render drop; with `preserveHistory: false`, the default retains unpreserved legacy text. Retention true keeps text visible even with history preservation. Repeated unchanged updates do not grow the body or duplicate history. Failed history readback or content drift refuses rewriting. Missing proof is reported, never invented. Review the diff and exact native readback.
18
+ 6. Batches: 1–50 complete same-repository updates; dry runs write nothing. Inspect ordered results. Reconcile partial/unavailable state; resume skips satisfied outcomes/reuses comments. Rate exhaustion stops remaining writes. No transaction/rollback/automatic replay. CLI `--fields-file`: same patch; explicit flags override, omitted preserve.
37
19
 
38
- The Draft/Ready structural JSON Schemas ship on the existing exported `AI_DELIVERY_MCP_TOOLS` issue-create definition as `issueContract`. Zod runtime validation also enforces semantic refinements (specific wording, bug evidence and secrets); portable structural JSON Schema alone does not prove readiness.
39
-
40
- ## Worked example
41
-
42
- Save this UTF-8 typed field object as `/owned/issue.json` in your task-owned directory:
20
+ Read example:
43
21
 
44
22
  ```json
45
- {
46
- "title": "Reject invalid widget identifiers before persistence",
47
- "issueType": "Task",
48
- "points": 2,
49
- "problem": "Malformed identifiers currently reach widget persistence.",
50
- "outcome": "Reject malformed identifiers before any persistence call.",
51
- "acceptanceCriteria": [
52
- {
53
- "behavior": "An invalid identifier returns a typed error without a persistence call.",
54
- "verifiedBy": "A synthetic persistence regression asserts the error and zero calls."
55
- }
56
- ],
57
- "outOfScope": ["Changing the storage engine."],
58
- "openQuestions": [],
59
- "context": {
60
- "components": ["widget intake"],
61
- "files": ["src/widget.ts"],
62
- "evidence": ["A portable synthetic malformed identifier fixture."]
63
- },
64
- "draft": false
65
- }
23
+ {"repo":"example/widget","issueNumber":17}
66
24
  ```
67
25
 
68
- ## Batch tracking updates
69
-
70
- For an authorized list of 1–50 current-repository updates, use
71
- `issue_batch_update({repo, items, dryRun})`, or the CLI
72
- `batch:update --items-file <UTF-8-JSON-array> [--dry-run]`. Each item supports the
73
- complete `issue_update` contract, including close, defer/undefer, parent,
74
- blockers, status, typed contract and history/render-retention fields. A per-item
75
- repository must match the selected repository. Existing author and native guards
76
- still apply; this tool adds no authority or live fixture permission.
77
-
78
- Use dry run for read-only intent: it performs no writes, including journals,
79
- history, metadata, Project or related-issue changes. Inspect each ordered plan
80
- and current readback. Execution returns applied/unchanged/failed results for all
81
- items and a summary; CLI retains complete JSON and exits nonzero for any failure.
82
- Partial writes remain failed with observed state or an explicit unavailable
83
- readback. Reconcile that existing state before retrying; a rerun skips satisfied
84
- outcomes and reuses authored comments. Rate exhaustion stops remaining writes,
85
- reports every remaining item and exposes only numeric rate-limit observations.
86
- No cross-repository transaction, rollback or automatic mutation replay is implied.
26
+ Ready `/owned/issue.json`:
87
27
 
88
- ## CLI fallback
89
-
90
- Use the installed CLI when MCP is unavailable only if the user's requested tool/provider restrictions permit that fallback. An MCP-only request, “no other GitHub tool,” or unavailable/incompatible requested-provider stop above does not authorize CLI substitution. Substitute your configured author identity, intended repository, owned JSON path and actual issue number. Explicit CLI values override the corresponding field-file values; omitted flags preserve them. `--fields-file` accepts the same typed field patch used by MCP. These commands perform real native operations only under your already authorized lifecycle:
28
+ ```json
29
+ {"title":"Reject invalid widget identifiers before persistence","issueType":"Task","points":2,"problem":"Malformed identifiers currently reach widget persistence.","outcome":"Reject malformed identifiers before persistence.","acceptanceCriteria":[{"behavior":"Invalid identifiers cause no persistence call.","verifiedBy":"Synthetic invalid-ID fixture asserts zero persistence calls."}],"outOfScope":["Changing storage."],"openQuestions":[],"context":{"components":["widget intake"],"files":["src/widget.ts"],"evidence":["Portable synthetic invalid-identifier fixture."]},"draft":false}
30
+ ```
91
31
 
92
- ```bash
32
+ ```sh
93
33
  ai-delivery --identity host-author --repo example/widget create --title 'Reject invalid widget identifiers before persistence' --fields-file /owned/issue.json
94
- ai-delivery --identity host-author --repo example/widget info --issue 17
95
- ai-delivery --identity host-author --repo example/widget update --issue 17 --fields-file /owned/issue.json --preserve-history
96
- ai-delivery --identity host-author --repo example/widget ready:check --issue 17
97
- ai-delivery --identity host-author --repo example/widget start --issue 17
98
34
  ```
99
35
 
100
- A rejected validation writes nothing. A partial creation reports the already-created native issue; reconcile it and resume that issue rather than creating another. Do not treat a structural pass, directory publication, or draft state as independent review, merged delivery or native consumer adoption.
36
+ Canonical marker: `<!-- ai-delivery:issue@1 -->`.
@@ -1,46 +1,45 @@
1
1
  ---
2
2
  name: "ai-delivery:pr-handoff"
3
- description: Publish a GitHub-linked change, submit exact-head independent App review and complete guarded delivery.
3
+ description: Open a PR for a GitHub issue, get it independently reviewed through a reviewer App, and merge it.
4
4
  ---
5
5
 
6
- # Pull request handoff
6
+ # PR handoff
7
7
 
8
- ## Before delegated PR mutations
8
+ Use this after your change is committed and pushed on the issue branch. The
9
+ target repo's own rules (its `AGENTS.md` or `CONTRIBUTING.md`) decide which
10
+ checks run and whether review is required.
9
11
 
10
- Identify the intended operation and side effects, repository, issue/PR, branch, reviewed head, current base, and configured author/reviewer route before sending its mutation instruction. Keep original operator authorization, communication permission, technical admission, configured access, independent review, counted approval, and actual execution receipts separate.
11
-
12
- Preserve the original native operator instruction and its scope. Reuse a verified grant that already covers the action; ordinary phase admission does not require another operator approval. Label quotations and cross-task relays honestly, including whether the original was inspected directly or verified by another task. A relay, registry match, START, role flag, successful checks, App permissions or dry-run adds no operator authorization. Inspect the original through an authorized route when needed to resolve origin or scope. Use the existing orchestration workflow for provenance and recipient binding; this skill adds no coordination or permission mechanism.
13
-
14
- Missing or ambiguous authority leaves the affected mutation pending while independent authorized work continues. Request only the concrete missing scope through the appropriate authorized native user context, naming the operation, repository/PR/head/actor route and any hold or rejection. Already authorized actions need no redundant request. A host refusal remains a refusal even when standing authority exists; these instructions do not guarantee platform acceptance.
15
-
16
- Preserve each attempted, delivered and executed state, exact rejection reason and actually admitted retry. A denied delegation delivers no instruction and stops its dependent mutations; do not switch actors, use indirect execution or another route to evade it. After an admitted retry is refused, make one concise action-specific native-user request identifying the refusal and its source. The request itself admits no retry: reconcile the concrete cause and current authority before any permitted continuation. Retain earlier failed attempts as failed. Do not repeat successful preflight merely to restate evidence; refresh the live safeguards required by the pending action.
17
-
18
- A failed or uncertain mutation acknowledgement can follow server success. Reconcile the original operation through supported read-only receipts and the same PR's native state before deciding what remains pending. Record confirmed success once; unknown state admits no duplicate mutation. A read-only network failure alone establishes neither an authorization refusal nor invalid credentials.
19
-
20
- Fictional `example/widget` PR23 at reviewed head H and base B illustrates these boundaries; these are decisions, not platform tests:
21
-
22
- - A lead quotes approval with a source ID: retain it as relayed evidence and resolve original scope when needed; the quote is neither local authentication nor an execution receipt.
23
- - Checks, App access and review dry-run pass with no verified operator grant: submission remains pending and no approval has counted.
24
- - Delegation and its admitted retry are refused: preserve both undelivered attempts, stop dependent writes and make the single precise native-user request without changing actor or route.
25
- - The original operator grant covers App submission and promotion: resume only pending admitted operations, read back the exact review and counted approval before promotion, and reconcile an uncertain acknowledgement before retrying. Merge needs its own coverage within the grant and the existing exact-head, current-base, protection, checks, association, serial-lane and native GitHub eligibility guards. Changed source requires fresh verification/review and reconciliation of authority scope.
26
-
27
-
28
- Run contributor checks through the repository's normal workflow. Keep the resulting commit unchanged through publication and independent review; a changed head requires fresh checks and review.
29
-
30
- Call `issue_pr_create` with explicit `repo`, issue number, a non-empty body and `dryRun: true`. Inspect configured actor and rule evidence, then create a draft from the GitHub-linked branch. Hosts own commits and pushes. Resolve missing credentials or same-actor routes; unknown approval eligibility is not approval.
31
-
32
- Obtain a read-only independent review of the exact remote commit, tree and complete diff. Submit its artifact with `issue_pr_review` using the configured reviewer App. A matching review is reused. Inspect GitHub's live required-review decision and checks; submission alone does not prove the approval counted. Resolve stale/dismissed reviews, blockers, failed required checks and moved heads or bases without relaxing protection.
12
+ ```sh
13
+ # Open the PR as a draft.
14
+ ai-delivery --repo <owner/name> pr:create --issue <n> --body-file pr-body.md
33
15
 
34
- Promote the unchanged PR using `issue_pr_create` with `draft: false`. Finish only with fresh native GitHub eligibility at the exact head and current base. GitHub owns required checks, review counts, stale-review dismissal and configured up-to-date rules. `pr:checks` reports native required check names/statuses; resolve BLOCKED, BEHIND, conflicts, unknown or incomplete evidence before mutation. A zero-review rule does not require an extra App approval; an optional failed check does not become required. The merge mutation uses the independently reviewed SHA; finish confirms the intended PR merged before closing its issue. Hosts retain responsibility for local worktree cleanup.
16
+ # The reviewer reads the exact head and diff, writes verdict.json, then submits it.
17
+ ai-delivery review submit --pr <pr> --head <sha> --identity <reviewer-profile> \
18
+ --verdict verdict.json --repo <owner/name>
35
19
 
36
- ```sh
37
- ai-delivery --repo <owner/name> pr:create --issue <number> --body-file ./pr-body.md --dry-run
38
- ai-delivery --repo <owner/name> pr:create --issue <number> --body-file ./pr-body.md
39
- # Obtain independent exact-head review.
40
- ai-delivery --repo <owner/name> pr:review --issue <number> --pr <number> --artifact ./review-artifact.json
41
- ai-delivery --repo <owner/name> pr:create --issue <number> --ready
42
- ai-delivery --repo <owner/name> pr:checks --pr <number>
43
- ai-delivery --repo <owner/name> finish --issue <number> --pr <number> --reviewed-head <reviewed-sha>
20
+ # Mark it ready, check it, and merge.
21
+ ai-delivery --repo <owner/name> pr:create --issue <n> --ready
22
+ ai-delivery --repo <owner/name> pr:checks --pr <pr>
23
+ ai-delivery --repo <owner/name> finish --issue <n> --pr <pr> --reviewed-head <sha>
44
24
  ```
45
25
 
46
- CLI `--artifact` is a UTF-8 JSON file path. MCP takes the JSON content. Never fabricate effective model metadata or historical policy/evidence receipts. Validate the supplied artifact against the exact remote commit/tree/diff before App submission and verify its review readback. Merge then follows GitHub’s current eligibility without rechecking historical embedded artifact identities or publication lineage. Repository-specific independent review requirements still apply.
26
+ ## Rules
27
+
28
+ - **Review.** The builder never submits its own review. A separate reviewer
29
+ agent writes the `ai-delivery.review-verdict@1` file, which holds:
30
+ - the verdict, approve or request-changes;
31
+ - its findings, each marked blocking or non-blocking.
32
+
33
+ The reviewer submits that file itself.
34
+ - **New head.** If the head changes after review, the reviewer reviews the new
35
+ head before merge.
36
+ - **Merging.** `finish` merges only when GitHub says the PR can merge at the
37
+ reviewed head with its required checks green. If it refuses, fix the reason
38
+ it gives. Don't merge another way.
39
+ - **Unclear results.** If a command times out or its result is unclear, run
40
+ `pr:info` before retrying, so you don't create a duplicate.
41
+ - **Reviewer setup.** To check a reviewer App's setup without posting
42
+ anything, run `ai-delivery review doctor --identity <profile>`.
43
+ - **Credentials.** Never print them.
44
+ - **Partial fixes.** For a fix that should leave the issue open, see the
45
+ README's `--non-closing` notes. This is rare.
@@ -1,22 +1,21 @@
1
1
  ---
2
- name: "ai-delivery:worktree-lifecycle"
3
- description: Start a GitHub-linked issue branch, prepare a host-owned worktree and verify its change through repository contributor checks.
2
+ name: 'ai-delivery:worktree-lifecycle'
3
+ description: Start a GitHub-linked issue branch and prepare a host-owned worktree.
4
4
  ---
5
5
 
6
- # Host-owned worktree lifecycle
6
+ # Worktree lifecycle
7
7
 
8
- Read user configuration and inspect `ai-delivery --repo <owner/name> config:resolve`. Confirm configured author and independent reviewer actors and repository access. Unknown GitHub rule visibility remains unknown.
8
+ Read the target repository's `AGENTS.md` and `CONTRIBUTING.md` before changing it.
9
+ Use `issue_info` and `issue_ready_check` with an explicit `repo`, then
10
+ `issue_start` to create or reuse the existing issue's GitHub-linked branch.
9
11
 
10
- Use `issue_info` and `issue_ready_check` with an explicit `repo`, then `issue_start` with the existing issue number to create or reuse its GitHub-linked branch. Prepare the local worktree using the host's supported worktree tools. Run the repository's own contributor checks, commit and push through its normal workflow. The ai-delivery runtime never executes repository policy modules or checks, or creates local worktrees. Continue to pull request handoff at the unchanged remote head.
12
+ Prepare one isolated worktree with the host's supported tools. ai-delivery
13
+ manages GitHub state; the host owns local files, checks and cleanup.
11
14
 
12
- ```sh
13
- ai-delivery --repo <owner/name> ready:check --issue <number>
14
- ai-delivery --repo <owner/name> start --issue <number>
15
- # Prepare a host-owned worktree, implement, run contributor checks, commit and push.
16
- ```
15
+ Implement the smallest change and run the checks required by that repository.
16
+ Commit and push through the normal host workflow, then use the PR handoff skill.
17
17
 
18
- Parking an issue with `issue_update({repo, issueNumber, park: true})` retains its remote tracking presentation. Worktree cleanup remains with the host owner.
19
-
20
- Legacy `issue_worktree_transition_inspect` and `issue_worktree_transition_apply` preserve their separate custody contract. Preserve original bytes and accounting; unsupported configuration or closure bindings fail closed. Apply only an exact independently accepted plan with native personal-operator relinquishment, distinct reviewer-App acceptance, complete immutable inventory, runtime admission and quiescent writer proof. This skill grants no private adoption, hold release, launcher change, shared admission or protocol retirement authority.
21
-
22
- This runtime's CLI/MCP cannot reconstruct the historical repository-policy binding, so those transition commands refuse. Use the original controller for their successful execution; retained engine tests do not imply compatibility of the new public entrypoint.
18
+ If a call fails or its result is unclear, read the current issue and branch
19
+ state before retrying. Report refusals without changing actors or permissions.
20
+ Parking an issue preserves its remote tracking; clean up only your own local
21
+ resources.