@aviaratech/ai-delivery 0.3.25 → 0.3.26

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 (145) hide show
  1. package/README.md +104 -9
  2. package/dist/agent.d.ts +2 -0
  3. package/dist/agent.js +1 -0
  4. package/dist/agent.js.map +1 -1
  5. package/dist/agentReadiness.test.js +61 -123
  6. package/dist/agentReadiness.test.js.map +1 -1
  7. package/dist/cli.js +121 -32
  8. package/dist/cli.js.map +1 -1
  9. package/dist/config/deliveryConfig.js +5 -1
  10. package/dist/config/deliveryConfig.js.map +1 -1
  11. package/dist/deliveryHealth.test.d.ts +1 -0
  12. package/dist/deliveryHealth.test.js +167 -0
  13. package/dist/deliveryHealth.test.js.map +1 -0
  14. package/dist/dispatch.d.ts +1 -0
  15. package/dist/dispatch.js +47 -4
  16. package/dist/dispatch.js.map +1 -1
  17. package/dist/fixtures/inertEntrypointChild.d.ts +1 -0
  18. package/dist/fixtures/inertEntrypointChild.js +62 -0
  19. package/dist/fixtures/inertEntrypointChild.js.map +1 -0
  20. package/dist/fixtures/inertEntrypoints.d.ts +49 -0
  21. package/dist/fixtures/inertEntrypoints.js +276 -0
  22. package/dist/fixtures/inertEntrypoints.js.map +1 -0
  23. package/dist/fixtures/inertTarget.d.ts +643 -0
  24. package/dist/fixtures/inertTarget.js +713 -0
  25. package/dist/fixtures/inertTarget.js.map +1 -0
  26. package/dist/fixtures/issue63.d.ts +68 -0
  27. package/dist/fixtures/issue63.js +272 -0
  28. package/dist/fixtures/issue63.js.map +1 -0
  29. package/dist/github/client.d.ts +2 -0
  30. package/dist/github/client.js +94 -12
  31. package/dist/github/client.js.map +1 -1
  32. package/dist/github/issueHistory.d.ts +40 -0
  33. package/dist/github/issueHistory.js +144 -0
  34. package/dist/github/issueHistory.js.map +1 -0
  35. package/dist/github/machineAuth.d.ts +9 -0
  36. package/dist/github/machineAuth.js +135 -0
  37. package/dist/github/machineAuth.js.map +1 -0
  38. package/dist/github/machineAuth.test.d.ts +1 -0
  39. package/dist/github/machineAuth.test.js +409 -0
  40. package/dist/github/machineAuth.test.js.map +1 -0
  41. package/dist/github/projectDelivery.d.ts +2 -0
  42. package/dist/github/projectDelivery.js +6 -0
  43. package/dist/github/projectDelivery.js.map +1 -1
  44. package/dist/github/relationships.d.ts +9 -2
  45. package/dist/github/relationships.js +6 -2
  46. package/dist/github/relationships.js.map +1 -1
  47. package/dist/investigationCompletion.test.d.ts +1 -0
  48. package/dist/investigationCompletion.test.js +728 -0
  49. package/dist/investigationCompletion.test.js.map +1 -0
  50. package/dist/issue.d.ts +22 -6
  51. package/dist/issue.js +152 -21
  52. package/dist/issue.js.map +1 -1
  53. package/dist/issue63History.test.d.ts +1 -0
  54. package/dist/issue63History.test.js +45 -0
  55. package/dist/issue63History.test.js.map +1 -0
  56. package/dist/issue63Routes.test.d.ts +1 -0
  57. package/dist/issue63Routes.test.js +153 -0
  58. package/dist/issue63Routes.test.js.map +1 -0
  59. package/dist/issueBlockerGuard.test.d.ts +1 -0
  60. package/dist/issueBlockerGuard.test.js +162 -0
  61. package/dist/issueBlockerGuard.test.js.map +1 -0
  62. package/dist/issueContract.d.ts +230 -0
  63. package/dist/issueContract.js +341 -0
  64. package/dist/issueContract.js.map +1 -0
  65. package/dist/issueContract.test.d.ts +27 -0
  66. package/dist/issueContract.test.js +314 -0
  67. package/dist/issueContract.test.js.map +1 -0
  68. package/dist/issueIntake.test.d.ts +1 -0
  69. package/dist/issueIntake.test.js +649 -0
  70. package/dist/issueIntake.test.js.map +1 -0
  71. package/dist/issueJournal.d.ts +1 -1
  72. package/dist/issueTracking.test.js +16 -8
  73. package/dist/issueTracking.test.js.map +1 -1
  74. package/dist/mcp/tools.d.ts +135 -11
  75. package/dist/mcp/tools.js +85 -33
  76. package/dist/mcp/tools.js.map +1 -1
  77. package/dist/pluginAuthProbe.d.ts +6 -0
  78. package/dist/pluginAuthProbe.js +53 -0
  79. package/dist/pluginAuthProbe.js.map +1 -0
  80. package/dist/pluginAuthProbe.test.d.ts +1 -0
  81. package/dist/pluginAuthProbe.test.js +66 -0
  82. package/dist/pluginAuthProbe.test.js.map +1 -0
  83. package/dist/pluginCredentials.test.d.ts +1 -0
  84. package/dist/pluginCredentials.test.js +277 -0
  85. package/dist/pluginCredentials.test.js.map +1 -0
  86. package/dist/pluginDoctor.test.d.ts +1 -0
  87. package/dist/pluginDoctor.test.js +627 -0
  88. package/dist/pluginDoctor.test.js.map +1 -0
  89. package/dist/pluginInstaller.d.ts +36 -0
  90. package/dist/pluginInstaller.js +231 -10
  91. package/dist/pluginInstaller.js.map +1 -1
  92. package/dist/pluginInstaller.test.js +29 -0
  93. package/dist/pluginInstaller.test.js.map +1 -1
  94. package/dist/pluginPackaging.test.js +23 -3
  95. package/dist/pluginPackaging.test.js.map +1 -1
  96. package/dist/pr.d.ts +70 -0
  97. package/dist/pr.js +238 -1
  98. package/dist/pr.js.map +1 -1
  99. package/dist/services/agentReadinessService.d.ts +9 -8
  100. package/dist/services/agentReadinessService.js +32 -224
  101. package/dist/services/agentReadinessService.js.map +1 -1
  102. package/dist/services/blockerGuardService.d.ts +17 -0
  103. package/dist/services/blockerGuardService.js +194 -0
  104. package/dist/services/blockerGuardService.js.map +1 -0
  105. package/dist/services/deliveryAdmission.js +22 -19
  106. package/dist/services/deliveryAdmission.js.map +1 -1
  107. package/dist/services/deliveryHealthService.d.ts +84 -0
  108. package/dist/services/deliveryHealthService.js +206 -0
  109. package/dist/services/deliveryHealthService.js.map +1 -0
  110. package/dist/services/worktreeRegistry.d.ts +84 -0
  111. package/dist/services/worktreeRegistry.js +265 -1
  112. package/dist/services/worktreeRegistry.js.map +1 -1
  113. package/dist/setup.test.js +97 -3
  114. package/dist/setup.test.js.map +1 -1
  115. package/dist/start.test.js +30 -3
  116. package/dist/start.test.js.map +1 -1
  117. package/dist/stdoutRegression.test.js +36 -6
  118. package/dist/stdoutRegression.test.js.map +1 -1
  119. package/dist/targetPolicyEntrypoints.test.d.ts +1 -0
  120. package/dist/targetPolicyEntrypoints.test.js +275 -0
  121. package/dist/targetPolicyEntrypoints.test.js.map +1 -0
  122. package/dist/targetPolicyLocal.test.d.ts +1 -0
  123. package/dist/targetPolicyLocal.test.js +707 -0
  124. package/dist/targetPolicyLocal.test.js.map +1 -0
  125. package/dist/targetPolicyRoutes.test.d.ts +1 -0
  126. package/dist/targetPolicyRoutes.test.js +298 -0
  127. package/dist/targetPolicyRoutes.test.js.map +1 -0
  128. package/dist/verification.js +48 -12
  129. package/dist/verification.js.map +1 -1
  130. package/dist/verificationGate.test.d.ts +1 -0
  131. package/dist/verificationGate.test.js +106 -0
  132. package/dist/verificationGate.test.js.map +1 -0
  133. package/dist/worktree.d.ts +6 -1
  134. package/dist/worktree.js +90 -3
  135. package/dist/worktree.js.map +1 -1
  136. package/dist/worktreeTransition.test.js +1 -1
  137. package/dist/worktreeTransition.test.js.map +1 -1
  138. package/package.json +1 -1
  139. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  140. package/plugins/ai-delivery/README.md +160 -1
  141. package/plugins/ai-delivery/plugin.json +1 -1
  142. package/plugins/ai-delivery/runtime/dist/cli.js +83 -49
  143. package/plugins/ai-delivery/runtime/package.json +1 -1
  144. package/plugins/ai-delivery/skills/intake-create/SKILL.md +45 -30
  145. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +20 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaratech/ai-delivery",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ai-delivery": "./dist/cli.js"
@@ -1,49 +1,64 @@
1
1
  ---
2
- name: "ai-delivery:intake-create"
3
- description: Create or inspect a GitHub tracking issue and check whether it is ready for development.
2
+ name: 'ai-delivery:intake-create'
3
+ description: Create or inspect a native GitHub issue validated by the ai-delivery.issue@1 contract.
4
4
  ---
5
5
 
6
6
  # Issue intake
7
7
 
8
- Use the native GitHub issue as the source of truth for its details and relationships. Keep one current contract in its title and body: the problem and evidence, outcome, scope, concise necessary non-goals, acceptance criteria, and relevant verification. Each criterion should name a result an owner or reviewer can observe and the proof that will demonstrate it. A generic "done", "verified", or "reviewed" checkbox, or an unrelated executable command, is insufficient even when `issue_ready_check` reports ready. That check establishes structural readiness; the owner and reviewer still assess whether the criteria and proof establish the requested outcome.
8
+ 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.
9
9
 
10
- When an authorized requirement changes, use `issue_update` to revise the current outcome, scope, criteria, and verification in place. Retire conflicting requirements from the active body, retain the reason for the change in native issue history or a comment, and update actual parent, child, or blocked-by relationships if the revision changes dependencies. Read the issue back before development to confirm the contract and relationships agree. Open a fresh ticket and owner context only when the objective has materially changed or inherited context obstructs delivery; age, commit count, and context compaction alone do not require replacement.
10
+ 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.
11
11
 
12
- For example, suppose a synthetic CLI issue originally required JSON as the default status output. If the authorized requirement becomes opt-in JSON while the default stays text, replace the old criterion rather than append another one. The current issue could say:
12
+ 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.
13
13
 
14
- ```markdown
15
- ## Outcome
16
- Add opt-in JSON status output while preserving the text default.
14
+ ## Typed MCP workflow
17
15
 
18
- ## Scope
19
- - `src/cli.ts`
20
- - `src/cli.test.ts`
16
+ 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.
17
+ 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.
18
+ 3. Inspect the native readback and warnings. More than seven criteria, absent edge/regression/context, only machine-local evidence or a body over about 3,000 characters warn without blocking. Consider a smaller scope or better proof.
19
+ 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`.
20
+ 5. Bodies use `<!-- ai-delivery:issue@1 -->` with a generated Status block and canonical field data. Update typed fields rather than editing only one generated copy. Legacy handwritten bodies convert leniently on update, preserving the complete original in history and the body, and returning the prior/canonical body diff. Missing proof is reported, never invented. Review that diff and exact native readback.
21
21
 
22
- ## Acceptance Criteria
23
- - [ ] `sample-cli status --format json` emits parseable JSON with a `state` field; a CLI test parses and asserts the field.
24
- - [ ] `sample-cli status` still emits the documented text form; a CLI test asserts the default output.
22
+ 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.
25
23
 
26
- ## Verification
27
- Run `npm test -- src/cli.test.ts` to check both commands.
28
- ```
29
-
30
- The earlier default-JSON requirement remains in issue history, not in the active criteria. "Change is verified" and `node --version` would meet neither criterion's proof, regardless of a structural ready result.
24
+ ## Worked example
31
25
 
32
- ## MCP tools first
26
+ Save this UTF-8 typed field object as `/owned/issue.json` in your task-owned directory:
33
27
 
34
- 1. Use `issue_create` to create one coherent tracking issue with the applicable native issue metadata and relationships.
35
- 2. Use `issue_info` to inspect a known issue and `issue_update` for authoritative metadata, relationship, or lifecycle changes.
36
- 3. Run `issue_ready_check` before development. Resolve any reported gaps in the issue before proceeding.
37
- 4. Continue with `issue_start` and an explicit repository when the issue is ready; prepare its worktree through the host.
28
+ ```json
29
+ {
30
+ "title": "Reject invalid widget identifiers before persistence",
31
+ "issueType": "Task",
32
+ "points": 2,
33
+ "problem": "Malformed identifiers currently reach widget persistence.",
34
+ "outcome": "Reject malformed identifiers before any persistence call.",
35
+ "acceptanceCriteria": [
36
+ {
37
+ "behavior": "An invalid identifier returns a typed error without a persistence call.",
38
+ "verifiedBy": "A synthetic persistence regression asserts the error and zero calls."
39
+ }
40
+ ],
41
+ "outOfScope": ["Changing the storage engine."],
42
+ "openQuestions": [],
43
+ "context": {
44
+ "components": ["widget intake"],
45
+ "files": ["src/widget.ts"],
46
+ "evidence": ["A portable synthetic malformed identifier fixture."]
47
+ },
48
+ "draft": false
49
+ }
50
+ ```
38
51
 
39
52
  ## CLI fallback
40
53
 
41
- When MCP is unavailable, use the installed `ai-delivery` command:
54
+ Use the installed CLI when MCP is unavailable. 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:
42
55
 
43
56
  ```bash
44
- ai-delivery create
45
- ai-delivery info --issue <number>
46
- ai-delivery update --issue <number> --body-file <current-issue.md>
47
- ai-delivery ready:check --issue <number>
48
- ai-delivery develop --issue <number>
57
+ ai-delivery --identity host-author --repo example/widget create --title 'Reject invalid widget identifiers before persistence' --fields-file /owned/issue.json
58
+ ai-delivery --identity host-author --repo example/widget info --issue 17
59
+ ai-delivery --identity host-author --repo example/widget update --issue 17 --fields-file /owned/issue.json --preserve-history
60
+ ai-delivery --identity host-author --repo example/widget ready:check --issue 17
61
+ ai-delivery --identity host-author --repo example/widget start --issue 17
49
62
  ```
63
+
64
+ 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.
@@ -5,6 +5,26 @@ description: Publish a GitHub-linked change, submit exact-head independent App r
5
5
 
6
6
  # Pull request handoff
7
7
 
8
+ ## Before delegated PR mutations
9
+
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 CLEAN guards. Changed source requires fresh verification/review and reconciliation of authority scope.
26
+
27
+
8
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.
9
29
 
10
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.