@aviaratech/ai-delivery 0.3.22 → 0.3.24
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.
- package/CONTRIBUTING.md +9 -0
- package/README.md +77 -442
- package/dist/agent.d.ts +5 -11
- package/dist/agent.js +4 -8
- package/dist/agent.js.map +1 -1
- package/dist/cli.js +59 -107
- package/dist/cli.js.map +1 -1
- package/dist/config/deliveryConfig.d.ts +44 -55
- package/dist/config/deliveryConfig.js +85 -88
- package/dist/config/deliveryConfig.js.map +1 -1
- package/dist/config/deliveryConfig.test.js +13 -5
- package/dist/config/deliveryConfig.test.js.map +1 -1
- package/dist/delivery/common.d.ts +4 -1
- package/dist/delivery/common.js +56 -8
- package/dist/delivery/common.js.map +1 -1
- package/dist/delivery/delivery.test.js +2 -3
- package/dist/delivery/delivery.test.js.map +1 -1
- package/dist/delivery/index.d.ts +0 -6
- package/dist/delivery/index.js +0 -3
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/legacy.d.ts +8 -0
- package/dist/delivery/legacy.js +5 -0
- package/dist/delivery/legacy.js.map +1 -0
- package/dist/delivery/policy.js +2 -13
- package/dist/delivery/policy.js.map +1 -1
- package/dist/delivery/stage.d.ts +6 -0
- package/dist/delivery/stage.js +11 -2
- package/dist/delivery/stage.js.map +1 -1
- package/dist/directoryIndependent.test.d.ts +1 -0
- package/dist/directoryIndependent.test.js +262 -0
- package/dist/directoryIndependent.test.js.map +1 -0
- package/dist/dispatch.d.ts +29 -3
- package/dist/dispatch.js +160 -457
- package/dist/dispatch.js.map +1 -1
- package/dist/genericCompatibility.test.js +0 -35
- package/dist/genericCompatibility.test.js.map +1 -1
- package/dist/git.js +10 -3
- package/dist/git.js.map +1 -1
- package/dist/gitProcess.d.ts +6 -0
- package/dist/gitProcess.js +56 -0
- package/dist/gitProcess.js.map +1 -0
- package/dist/github/discovery.d.ts +1 -0
- package/dist/github/discovery.js +1 -1
- package/dist/github/discovery.js.map +1 -1
- package/dist/github/discovery.test.js +25 -20
- package/dist/github/discovery.test.js.map +1 -1
- package/dist/github/nativeIssueMetadata.d.ts +2 -2
- package/dist/github/nativeIssueMetadata.js.map +1 -1
- package/dist/github/projectDelivery.d.ts +1 -1
- package/dist/github/projectDelivery.js.map +1 -1
- package/dist/github/repo.d.ts +7 -1
- package/dist/github/repo.js +58 -2
- package/dist/github/repo.js.map +1 -1
- package/dist/issue.d.ts +11 -6
- package/dist/issue.js +136 -319
- package/dist/issue.js.map +1 -1
- package/dist/issueJournal.d.ts +1 -1
- package/dist/lifecycle.test.js +40 -7371
- package/dist/lifecycle.test.js.map +1 -1
- package/dist/logger.js +4 -4
- package/dist/logger.js.map +1 -1
- package/dist/mcp/index.js +2 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools.d.ts +27 -42
- package/dist/mcp/tools.js +34 -42
- package/dist/mcp/tools.js.map +1 -1
- package/dist/pluginInstaller.d.ts +51 -0
- package/dist/pluginInstaller.js +774 -0
- package/dist/pluginInstaller.js.map +1 -0
- package/dist/pluginInstaller.test.d.ts +1 -0
- package/dist/pluginInstaller.test.js +543 -0
- package/dist/pluginInstaller.test.js.map +1 -0
- package/dist/pluginPackaging.test.d.ts +1 -0
- package/dist/pluginPackaging.test.js +245 -0
- package/dist/pluginPackaging.test.js.map +1 -0
- package/dist/pr.d.ts +66 -114
- package/dist/pr.js +288 -1108
- package/dist/pr.js.map +1 -1
- package/dist/pr.test.js +295 -237
- package/dist/pr.test.js.map +1 -1
- package/dist/releaseReconciliation.test.d.ts +1 -0
- package/dist/releaseReconciliation.test.js +314 -0
- package/dist/releaseReconciliation.test.js.map +1 -0
- package/dist/review.d.ts +37 -7
- package/dist/review.js +106 -45
- package/dist/review.js.map +1 -1
- package/dist/review.test.js +30 -71
- package/dist/review.test.js.map +1 -1
- package/dist/services/agentReadinessService.d.ts +1 -1
- package/dist/services/agentReadinessService.js +2 -0
- package/dist/services/agentReadinessService.js.map +1 -1
- package/dist/services/deliveryAdmission.d.ts +4 -4
- package/dist/services/deliveryAdmission.js.map +1 -1
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +71 -10
- package/dist/setup.js.map +1 -1
- package/dist/setup.test.js +594 -204
- package/dist/setup.test.js.map +1 -1
- package/dist/start.test.d.ts +1 -0
- package/dist/start.test.js +72 -0
- package/dist/start.test.js.map +1 -0
- package/dist/stdoutRegression.test.d.ts +1 -0
- package/dist/stdoutRegression.test.js +326 -0
- package/dist/stdoutRegression.test.js.map +1 -0
- package/dist/verification.d.ts +62 -27
- package/dist/verification.js +172 -1337
- package/dist/verification.js.map +1 -1
- package/dist/worktree.d.ts +1 -31
- package/dist/worktree.js +5 -200
- package/dist/worktree.js.map +1 -1
- package/dist/worktreeTransition.d.ts +1 -1
- package/dist/worktreeTransition.js +10 -5
- package/dist/worktreeTransition.js.map +1 -1
- package/dist/worktreeTransition.test.js +2 -3
- package/dist/worktreeTransition.test.js.map +1 -1
- package/package.json +4 -4
- package/plugins/ai-delivery/.claude-plugin/plugin.json +6 -1
- package/plugins/ai-delivery/LICENSE +21 -0
- package/plugins/ai-delivery/README.md +4 -2
- package/plugins/ai-delivery/dist/mcp-launcher.js +19 -8
- package/plugins/ai-delivery/mcp.json +10 -0
- package/plugins/ai-delivery/plugin.json +10 -0
- package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +1010 -0
- package/plugins/ai-delivery/runtime/dist/cli.js +276 -0
- package/plugins/ai-delivery/runtime/package.json +13 -0
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +1 -1
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +14 -21
- package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +12 -23
- package/dist/services/deliveryRecordService.d.ts +0 -47
- package/dist/services/deliveryRecordService.js +0 -199
- package/dist/services/deliveryRecordService.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,204 +1,102 @@
|
|
|
1
1
|
# ai-delivery
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation and runtime
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Install the versioned package from npm or a reviewed package archive. The
|
|
10
|
-
consuming repository must run its own configuration and runtime-admission
|
|
11
|
-
procedure before any lifecycle write.
|
|
12
|
-
|
|
13
|
-
The selected CLI, MCP server and verification controller use Node 24.21.0 and
|
|
14
|
-
npm 11.19.0. The public library exports also support Node 26.2.0 consumers.
|
|
15
|
-
Package checks run the Node 24 controller against actual npm-packed Node 26
|
|
16
|
-
consumers, including filesystem fixture contention, reader and link rejection,
|
|
17
|
-
success/failure teardown, cancellation, leaked fixtures and positive byte limits.
|
|
18
|
-
For package development, set `AI_DELIVERY_NODE26_EXECUTABLE` to the absolute
|
|
19
|
-
Node 26.2.0 executable before `npm run checks`; CI retains that executable while
|
|
20
|
-
selecting Node 24 for the canonical commands.
|
|
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.
|
|
21
8
|
|
|
22
9
|
```sh
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
npm install --save-dev @aviaratech/ai-delivery@0.3.4
|
|
26
|
-
npx ai-delivery --help
|
|
27
|
-
npx ai-delivery --repo-root /absolute/path/to/consumer --identity configured-author info --issue 17
|
|
28
|
-
npx ai-delivery --repo-root /absolute/path/to/consumer --identity configured-author mcp:serve
|
|
10
|
+
ai-delivery --repo example/widget info --issue 17
|
|
11
|
+
ai-delivery mcp:serve
|
|
29
12
|
```
|
|
30
13
|
|
|
31
|
-
|
|
32
|
-
are lifecycle writes. The CLI and MCP server enforce the same admission and
|
|
33
|
-
identity rules. The [plugin guide](plugins/ai-delivery/README.md) covers host
|
|
34
|
-
installation.
|
|
35
|
-
|
|
36
|
-
## Configure a consuming repository
|
|
37
|
-
|
|
38
|
-
Keep the repository's delivery policy in `ai-delivery.policy.mjs` at its Git
|
|
39
|
-
root. Its default export remains `RepositoryDeliveryPolicy@1`, implementing
|
|
40
|
-
`classifyExactRange` and `validateBoundary` with the repository's actual required
|
|
41
|
-
checks, stages, risk and publication/merge constraints. There is no permissive
|
|
42
|
-
default policy. Add a named `deliverySettings` export for explicit authentication
|
|
43
|
-
roles and command settings:
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
export const deliverySettings = {
|
|
47
|
-
roles: {
|
|
48
|
-
author: {
|
|
49
|
-
identity: 'delivery-author',
|
|
50
|
-
credentialEnv: {
|
|
51
|
-
appId: 'DELIVERY_AUTHOR_APP_ID',
|
|
52
|
-
installationId: 'DELIVERY_AUTHOR_INSTALLATION_ID',
|
|
53
|
-
privateKeyPath: 'DELIVERY_AUTHOR_KEY_PATH',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
reviewer: {
|
|
57
|
-
identity: 'delivery-reviewer',
|
|
58
|
-
credentialEnv: {
|
|
59
|
-
appId: 'DELIVERY_REVIEWER_APP_ID',
|
|
60
|
-
installationId: 'DELIVERY_REVIEWER_INSTALLATION_ID',
|
|
61
|
-
privateKeyPath: 'DELIVERY_REVIEWER_KEY_PATH',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
commandPolicy: {
|
|
66
|
-
checks: { format: 'REQUIRED', gitClean: 'REQUIRED', lint: 'REQUIRED', test: 'REQUIRED', typecheck: 'REQUIRED' },
|
|
67
|
-
timeoutsMs: { lint: 60000, test: 60000, typecheck: 60000 },
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
// Retain the default RepositoryDeliveryPolicy@1 export with real stage commands.
|
|
71
|
-
```
|
|
14
|
+
## User configuration
|
|
72
15
|
|
|
73
|
-
|
|
74
|
-
checkout's single GitHub remote, verifies its repository identity with GitHub,
|
|
75
|
-
and discovers repository issue types and inherited organization issue fields.
|
|
76
|
-
The standard field names are `Points`, `Priority` and `Status`, with workflow
|
|
77
|
-
options `Todo`, `In Progress`, `Blocked` and `Done`. Points and Priority must be
|
|
78
|
-
native organization single-select issue fields bound into the Project; unrelated
|
|
79
|
-
Project-owned fields are rejected. This release supports github.com organization
|
|
80
|
-
repositories, matching the existing native metadata contract.
|
|
81
|
-
|
|
82
|
-
The default Project is the one compatible open Project linked to that repository
|
|
83
|
-
and visible to the configured discovery identity. All pages are read before
|
|
84
|
-
selection. Zero or multiple compatible Projects require an explicit choice.
|
|
85
|
-
API failures, null/partial results, and an unwritable compatible Project fail
|
|
86
|
-
without falling back to another destination. No Project is inferred from issue
|
|
87
|
-
history, its name, or organization-wide availability. GitHub's Project-to-default-
|
|
88
|
-
repository setting does not define a repository's default Project. Linked
|
|
89
|
-
Projects must belong to the repository organization.
|
|
90
|
-
|
|
91
|
-
For exceptions, commit a small `ai-delivery.config.json`, for example:
|
|
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.
|
|
92
17
|
|
|
93
18
|
```json
|
|
94
19
|
{
|
|
95
|
-
"schemaVersion": "ai-delivery.
|
|
96
|
-
"
|
|
20
|
+
"schemaVersion": "ai-delivery.user@1",
|
|
21
|
+
"roles": {
|
|
22
|
+
"author": {
|
|
23
|
+
"identity": "host-author",
|
|
24
|
+
"authSource": "personal",
|
|
25
|
+
"credentialEnv": { "token": "DELIVERY_AUTHOR_TOKEN" }
|
|
26
|
+
},
|
|
27
|
+
"reviewer": {
|
|
28
|
+
"identity": "delivery-reviewer",
|
|
29
|
+
"credentialEnv": {
|
|
30
|
+
"appId": "DELIVERY_REVIEWER_APP_ID",
|
|
31
|
+
"installationId": "DELIVERY_REVIEWER_INSTALLATION_ID",
|
|
32
|
+
"privateKeyPath": "DELIVERY_REVIEWER_KEY_PATH"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
97
36
|
"project": 7,
|
|
98
|
-
"
|
|
37
|
+
"checkoutRoots": ["/absolute/path/to/clones"]
|
|
99
38
|
}
|
|
100
39
|
```
|
|
101
40
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
also grants the App real code-write capability; grant it only when that review
|
|
125
|
-
route is intended. Accept the App's new permissions on its installation and
|
|
126
|
-
obtain fresh installation credentials before relying on the changed grant.
|
|
127
|
-
Existing App author configurations remain valid.
|
|
128
|
-
|
|
129
|
-
To use the host user's GitHub identity for publication, replace only the author
|
|
130
|
-
role in `deliverySettings`:
|
|
131
|
-
|
|
132
|
-
```js
|
|
133
|
-
author: {
|
|
134
|
-
identity: 'host-author',
|
|
135
|
-
authSource: 'personal',
|
|
136
|
-
credentialEnv: { token: 'DELIVERY_AUTHOR_TOKEN' },
|
|
137
|
-
},
|
|
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 only its named token variable. 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; publication requires the configured author.
|
|
42
|
+
|
|
43
|
+
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.
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
## GitHub-gated lifecycle
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
ai-delivery --repo example/widget config:resolve
|
|
53
|
+
ai-delivery --repo example/widget ready:check --issue 17
|
|
54
|
+
ai-delivery --repo example/widget start --issue 17
|
|
55
|
+
# Prepare a host-owned worktree, implement, run repository checks, commit and push.
|
|
56
|
+
ai-delivery --repo example/widget pr:create --issue 17 --body-file ./pr-body.md --dry-run
|
|
57
|
+
ai-delivery --repo example/widget pr:create --issue 17 --body-file ./pr-body.md
|
|
58
|
+
# Obtain an independent review of the exact remote PR head and diff.
|
|
59
|
+
ai-delivery --repo example/widget pr:review --issue 17 --pr 23 --artifact ./review-artifact.json
|
|
60
|
+
ai-delivery --repo example/widget pr:create --issue 17 --ready
|
|
61
|
+
ai-delivery --repo example/widget pr:checks --pr 23
|
|
62
|
+
ai-delivery --repo example/widget finish --issue 17 --pr 23 --reviewed-head <reviewed-sha>
|
|
138
63
|
```
|
|
139
64
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
does not use an ambient `gh` session or another environment token. The legacy
|
|
144
|
-
`--identity personal --personal-auth` override remains explicit for development
|
|
145
|
-
and `config:resolve`; configure the personal author role above for complete PR
|
|
146
|
-
delivery with matching review artifacts and policy evidence.
|
|
65
|
+
`start` creates or reuses a GitHub-linked branch from the repository's default branch. 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. 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.
|
|
66
|
+
|
|
67
|
+
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.
|
|
147
68
|
|
|
148
|
-
|
|
149
|
-
| --- | --- | --- |
|
|
150
|
-
| Configured personal author + reviewer App | One App submits the exact-head independent review. | With Contents write accepted on the App installation, confirm that GitHub counts it; an eligible independent human may still need to approve if another rule blocks it. |
|
|
151
|
-
| Author App + reviewer App | Existing separate App roles keep their credential and review bindings. | With Contents write accepted on the reviewer App installation, confirm that GitHub counts its approval. |
|
|
152
|
-
| Author App + eligible human reviewer | A valid GitHub route for a repository that requires human approval; the current package still needs its configured reviewer App for the formal artifact receipt. | The human reviews and approves in GitHub. |
|
|
69
|
+
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 full artifact and its digest so merge can verify the original binding even if GitHub remaps a review's commit ID after a rebase. A matching remote review is reused; conflicting actor, head, state or duplicate artifact markers refuse. 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.
|
|
153
70
|
|
|
154
|
-
|
|
71
|
+
An App approval does not prove that GitHub counted it. `pr:checks` exposes the live required-review decision. Merge requires one independent exact-head App review, its current readback, satisfied GitHub review requirements, no unresolved native blockers, and fresh CLEAN eligibility at the reviewed head and current base. BLOCKED, BEHIND, DIRTY, UNSTABLE, unknown state or moved head/base refuses. The server merge mutation includes the reviewed SHA. Finish confirms the intended PR merged before closing its issue, and retries from remote readback without local receipts.
|
|
155
72
|
|
|
156
|
-
The local
|
|
157
|
-
the push and PR creation; `issue_pr_info.authorLogin` confirms the actual PR
|
|
158
|
-
author. The independent artifact records its reviewer identity and effective
|
|
159
|
-
model, while the submitted review receipt records the GitHub actor. Keep these
|
|
160
|
-
identities separate when diagnosing a blocked PR.
|
|
73
|
+
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.
|
|
161
74
|
|
|
162
|
-
|
|
163
|
-
|
|
75
|
+
## Standalone plugin and explicit runtime setup
|
|
76
|
+
|
|
77
|
+
Manage the native plugin with an explicit package version:
|
|
164
78
|
|
|
165
79
|
```sh
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
80
|
+
ai-delivery plugin install --host codex --scope user --version <published-version> --json
|
|
81
|
+
ai-delivery plugin doctor --host codex --scope user --json
|
|
82
|
+
ai-delivery plugin update --host codex --scope user --version <published-version> --json
|
|
83
|
+
ai-delivery plugin rollback --host codex --scope user --json
|
|
84
|
+
ai-delivery plugin remove --host codex --scope user --json
|
|
169
85
|
```
|
|
170
86
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
requires the configured author credential.
|
|
185
|
-
Before publication, use `pr:create --issue 17 --dry-run` to inspect the current
|
|
186
|
-
route again. After `issue_pr_review`, inspect its
|
|
187
|
-
`reviewState` and `pr:checks`. If GitHub still reports `REVIEW_REQUIRED`, inspect
|
|
188
|
-
the active rule and obtain a qualifying independent approval; repeating the
|
|
189
|
-
same App review cannot resolve that state. CLI and MCP use the same asynchronous
|
|
190
|
-
`loadDeliveryConfig` resolver. `issue_create` and `issue_info` also expose the
|
|
191
|
-
resolved routing. An MCP server stays bound to its startup checkout; use separate
|
|
192
|
-
bindings or explicit CLI checkout selection for multiple repositories.
|
|
193
|
-
|
|
194
|
-
Public runtime setup has two explicit operations: `runtime:stage` and
|
|
195
|
-
`runtime:admit` (MCP: `runtime_stage` and `runtime_admit`; API:
|
|
196
|
-
`stageRuntime` and `admitRuntime` from `@aviaratech/ai-delivery/agent`). Both
|
|
197
|
-
require the clean primary consumer checkout, its expected Git HEAD, the actual
|
|
198
|
-
`loadDeliveryConfig` digest, an explicit configured author identity and separate
|
|
199
|
-
operation authority. The authenticated author and distinct reviewer App must
|
|
200
|
-
pass the existing repository-access preflight. Unknown rule visibility or
|
|
201
|
-
approval eligibility remains unknown; setup does not establish counted approval.
|
|
87
|
+
Use `--host claude-code` for Claude Code. Its supported scopes are `user`,
|
|
88
|
+
`project`, and `local`; select the project directory with the global
|
|
89
|
+
`--repo-root` option. Codex currently supports `user`. Install and update require
|
|
90
|
+
a literal version. Rollback selects the recorded previous version. The commands
|
|
91
|
+
keep verified version units in a private directory and use the native host's
|
|
92
|
+
marketplace and plugin commands to select that exact local source. Removal keeps
|
|
93
|
+
the managed version units for recovery and uses Claude Code's `--keep-data`.
|
|
94
|
+
|
|
95
|
+
Every command supports `--dry-run` and `--json`. Dry-run reports the target
|
|
96
|
+
without fetching an archive, running a native command, or writing configuration.
|
|
97
|
+
Doctor reports managed installation and source integrity, skills, and a direct
|
|
98
|
+
stdio startup check of the selected bundled MCP server. Restart the native host
|
|
99
|
+
after changing a plugin so it reloads that selection. Installing a plugin does not admit a consumer controller. Ordinary remote GitHub delivery uses user configuration; explicit controller staging and admission remain separate operations.
|
|
202
100
|
|
|
203
101
|
First read `config:resolve` with the configured author, then stage a reviewed
|
|
204
102
|
local archive using its independently accepted SHA-256 and package version:
|
|
@@ -268,276 +166,13 @@ same stage to reconcile. Conflicting third-party bytes are preserved. The
|
|
|
268
166
|
consuming installer's reviewed host activation and rollback determine when this
|
|
269
167
|
final write occurs.
|
|
270
168
|
|
|
271
|
-
The resolver
|
|
272
|
-
effective roles and checks, optional overrides and discovered routing;
|
|
273
|
-
**do not substitute a JSON-file hash**. Drift invalidates admission and
|
|
274
|
-
verification receipts. Ordinary lifecycle operations never refresh admission
|
|
275
|
-
implicitly, and candidate issue configuration is never activated by setup.
|
|
276
|
-
|
|
277
|
-
To migrate from 0.1: move `roles` and `commandPolicy` into the existing policy's
|
|
278
|
-
`deliverySettings` export; replace the old JSON with only necessary overrides
|
|
279
|
-
(or remove it when using the default policy filename); await `loadDeliveryConfig`
|
|
280
|
-
in installer integrations; review the resolved destination and reissue capability-2
|
|
281
|
-
admission using its digest. Do not upgrade old receipts into approvals. Existing
|
|
282
|
-
rows in `.issue-cli/worktrees.json` remain with their original runtime unless
|
|
283
|
-
they already have an exact `ai-delivery.worktree-owner@1` witness. Installing this
|
|
284
|
-
package never adopts or switches an active legacy writer.
|
|
285
|
-
|
|
286
|
-
Legacy worktree transitions are explicit and separate from installation. Use
|
|
287
|
-
`worktree:transition:inspect` (`issue_worktree_transition_inspect`) with the issue
|
|
288
|
-
and purpose `active-resume` or `merged-cleanup`. Inspection reads the canonical
|
|
289
|
-
row, clean source, native PR lineage, original evidence and writer inventory. It
|
|
290
|
-
returns an exact plan or specific closure gaps without writing ownership or
|
|
291
|
-
running the retained producer.
|
|
292
|
-
|
|
293
|
-
The supported operational closure family is the retained official public
|
|
294
|
-
`@aviaratech/ai-delivery@0.3.5` archive and installed bytes, its private
|
|
295
|
-
`ai-delivery.runtime-admission@2`, producer-bound `ai-delivery.run@3`, and
|
|
296
|
-
`ai-delivery.verification-writer@1` on supported POSIX hosts. Supply
|
|
297
|
-
`--retained-admission` and `--retained-archive`. Operative `issue-cli`
|
|
298
|
-
verification-stages v1/v2, unknown process ownership, external resource families
|
|
299
|
-
or incomplete inventory refuse apply. Historical producer identity may remain
|
|
300
|
-
`UNKNOWN`; its original schemas, bytes, failed diagnostics and accounting are
|
|
301
|
-
preserved without becoming current verification, review or retirement authority.
|
|
302
|
-
|
|
303
|
-
The configured authenticated personal operator must publish the returned whole
|
|
304
|
-
relinquishment body as a native comment on the terminal PR, or on the issue for
|
|
305
|
-
active resume. The distinct configured reviewer App must independently accept
|
|
306
|
-
the same complete plan and relinquishment comment ID through a native exact-body
|
|
307
|
-
acceptance comment. A caller-authored local receipt does not supply this
|
|
308
|
-
authority. Changed/deleted comments, wrong actors or subjects, and an authenticated
|
|
309
|
-
exact relinquishment revocation invalidate acceptance. These comments have their
|
|
310
|
-
own acceptance semantics; they do not count as a GitHub PR review.
|
|
311
|
-
The bodies bind the complete saved plan and inventory by their recomputed IDs;
|
|
312
|
-
the operator and reviewer must inspect that complete plan before accepting it.
|
|
313
|
-
|
|
314
|
-
Save the returned `plan` object, then call `worktree:transition:apply`
|
|
315
|
-
(`issue_worktree_transition_apply`) with `--plan`, `--plan-id`,
|
|
316
|
-
`--relinquishment-comment`, `--acceptance-comment`, and
|
|
317
|
-
`--authorize-transition`. Apply preserves immutable original copies and records
|
|
318
|
-
intent before ownership changes. Repeat the same plan and authority IDs after
|
|
319
|
-
interruption; pending intent blocks ordinary resume, verification, publication,
|
|
320
|
-
review, merge and re-registration. Active resume requires fresh current
|
|
321
|
-
verification and review. Terminal transition witnesses permanently restrict
|
|
322
|
-
ordinary source operations.
|
|
323
|
-
|
|
324
|
-
When a ready issue remains open after a prerequisite PR merges, `develop` or
|
|
325
|
-
`issue_develop` can continue its existing worktree under the same preparing owner.
|
|
326
|
-
It requires the clean original branch and exact prior verified publication,
|
|
327
|
-
merge intent and native merged-PR lineage. Continuation preserves the ownership
|
|
328
|
-
witness and all prior receipts, clears the prior PR from the active registry row,
|
|
329
|
-
and resumes Project synchronization idempotently. Commit the continuation changes
|
|
330
|
-
before verification; the already-merged HEAD cannot produce replacement evidence.
|
|
331
|
-
A closed issue, different owner, stale lineage or pending/terminal transition is
|
|
332
|
-
refused. Source holds and runtime admission remain in force.
|
|
333
|
-
|
|
334
|
-
A clean committed descendant can also continue when the configured personal
|
|
335
|
-
author is the authenticated native author of the prior merged PR. The historical
|
|
336
|
-
preparing label remains evidence. `develop` first saves an exact private plan and
|
|
337
|
-
refuses to change custody until the native issue contains the complete operator
|
|
338
|
-
authority body and independent configured reviewer-App acceptance. The saved
|
|
339
|
-
templates bind the current source, configuration, installed runtime admission,
|
|
340
|
-
original row, historical receipts and new owner. Set the acceptance template's `authorityCommentId` to the operator
|
|
341
|
-
comment's native ID. The operator attests that all other launchers and writers
|
|
342
|
-
are quiescent and remain excluded through recovery. The existing writer slot
|
|
343
|
-
must be absent; this flow never recovers or terminates an unknown writer.
|
|
344
|
-
|
|
345
|
-
For this committed-descendant case only, a complete empty native closing-issue
|
|
346
|
-
connection may instead bind an explicit `Refs #<issue>` reference, with optional
|
|
347
|
-
explanatory text, to complete native issue-timeline cross-reference evidence for
|
|
348
|
-
the same PR, repository and authenticated historical author before the merge. The PR body alone is
|
|
349
|
-
insufficient. Missing, incomplete or mismatched native evidence is refused;
|
|
350
|
-
other worktree transition purposes retain their closing-issue requirement.
|
|
351
|
-
|
|
352
|
-
Repeat `develop` or existing-issue `start` after interruption. Recovery checks
|
|
353
|
-
the same pinned native comments, revocation, original bytes and exact original
|
|
354
|
-
or replacement row before completing. Other mutations, including metadata
|
|
355
|
-
resume, remain fenced while intent is pending. Completion retains the old
|
|
356
|
-
witness and receipts, creates a distinct owner witness when identity changes,
|
|
357
|
-
and permits fresh verification of the descendant and later ordinary commits.
|
|
358
|
-
Historical approval supplies no current verification, review or hold release.
|
|
359
|
-
|
|
360
|
-
Native issue metadata updates may target a legacy registered issue without
|
|
361
|
-
adopting its worktree. The authenticated author and admitted runtime still apply,
|
|
362
|
-
and canonical registry/schema, duplicate-owner and complete transition checks
|
|
363
|
-
remain mandatory. Metadata updates preserve source, registry, ownership witnesses
|
|
364
|
-
and delivery receipts; source lifecycle operations still require attested custody.
|
|
365
|
-
|
|
366
|
-
Terminal disposition defaults to `retain`, preserving source and all holds.
|
|
367
|
-
Supply native retained-hold comment IDs with `--retained-holds`. `remove` requires
|
|
368
|
-
an independently accepted personal assertion that no holds remain, exact native
|
|
369
|
-
merged-result lineage and the existing non-force clean-source cleanup proof.
|
|
370
|
-
Source delivery never releases a hold, retires a legacy protocol, changes a host
|
|
371
|
-
launcher or admits a shared runtime. Transition artifacts remain under the
|
|
372
|
-
existing private Git `ai-delivery/worktree-owners` evidence directory; no second
|
|
373
|
-
worktree registry is introduced.
|
|
374
|
-
|
|
375
|
-
`verify` classifies a clean Git base/head range, runs only the stages selected by the repository policy, and persists content-addressed private checkpoints under the Git common directory. It reuses compatible complete stages and rejects corrupt or stale inputs. Selected stage commands run asynchronously without a total-duration deadline. Bounded JSON status lines on stderr show the current stage and command, completed/reused/remaining stage and command counts, elapsed time, captured output bytes, executed-command throughput, command age and time since completed work. They appear when a command starts and every five seconds while it runs; bounded resource observations are reported at each sample. A quiet command remains cancellable and diagnosable from its age and unchanged completion counts. Process activity and output do not establish useful progress; only complete receipts and the exact-source aggregate are checkpoints.
|
|
376
|
-
|
|
377
|
-
For independent component reuse, export `schemaVersion: "RepositoryDeliveryPolicy@2"` from the existing policy. Each selected stage supplies both its ordered `semanticInputKeys` and matching explicit `semanticInputs`, for example:
|
|
378
|
-
|
|
379
|
-
```js
|
|
380
|
-
{
|
|
381
|
-
id: "unit",
|
|
382
|
-
commands: [{ label: "unit", argv: ["npm", "run", "test:unit"] }],
|
|
383
|
-
dependsOn: [],
|
|
384
|
-
resourceClass: "focused_node",
|
|
385
|
-
semanticInputKeys: ["unit-source"],
|
|
386
|
-
semanticInputs: [{ key: "unit-source", digest: unitSourceDigest }],
|
|
387
|
-
}
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
The classifier owns the digest values and must include every relevant source, configuration, schema, dependency and input artifact for that stage. The runtime never derives component values from key names. Version 2 stage inputs also bind the selected commands and dependencies, policy/configuration bytes, policy producer, installed runner code and resolved dependency manifests, runtime environment, worktree identity, upstream receipt IDs and selected attestation artifacts. Unchanged compatible stages can survive an unrelated Git commit; a changed component invalidates its stage and dependents. Every final aggregate binds the current exact classification and verifies all selected stage proofs. `RepositoryDeliveryPolicy@1` remains supported with its original whole-range reuse contract; its receipts are never upgraded into component evidence. Classification, stage input, receipt and aggregate version 2 evidence uses separate stage/aggregate storage. Immutable command output remains content addressed.
|
|
391
|
-
|
|
392
|
-
Verification holds one file lease per worktree and durably records its writer and observed command process identities. A second writer in the same worktree is rejected before execution. Separate worktrees can overlap, including at the same head, with separate stage inputs and mutable manifests. Callers must first qualify their commands' CPU, memory, disk, I/O and shared-file/service requirements; a resource class alone grants no shared-resource exclusivity. The runtime adds no global executor cap. On retry after writer interruption, it refuses live or unknown ownership and reconciles only the recorded command group and observed descendants before reusing compatible completed stages. A launch interrupted before command identity was recorded requires explicit reconciliation. Process identity observation is required on supported POSIX hosts; unavailable or ambiguous observation fails closed.
|
|
393
|
-
|
|
394
|
-
The `--admit` flag explicitly admits additional resource classes for execution. Compatible complete stages are reused only after their existing stage, artifact, command-output and applicable resource proofs are fully validated, without admitting execution of those classes. Missing or incompatible proof requires the current invocation's admission for the actual stage class before any command runs; corrupt proof remains a hard failure. This permits serial `source_only`, `model`, then `postgres_docker` invocations to reuse prior completed stages while admitting only the next class to execute. Publication creates a draft PR only after exact-head verification; a high-risk policy also requires a prepublication review artifact. Ready promotion and merge require a submitted formal review. Merge checks live blockers, checks, base/head coordinates, and the policy boundary. Repositories may require an exact base/head lease for merge.
|
|
395
|
-
|
|
396
|
-
For a bounded run, pass `--max-aggregate-rss-bytes`, `--min-free-disk-bytes`, and optionally `--max-new-output-bytes` with one or more `--output-root` paths to `verify`. `issue_verify` accepts the same values in `resourceBounds`. RSS is sampled across the observed child process tree, including observed detached descendants; free disk is checked before commands and during execution on the worktree and declared output filesystems. Positive file-size growth is sampled under the declared roots, with previously measured completed stages carried across a resume. The caller must declare every output root relevant to its allowance; aliases must resolve within those roots. The roots are relative to the issue worktree unless absolute. Unix-domain IPC sockets inside declared roots are observed as endpoints with zero regular-file payload bytes and remain counted toward the scan entry limit. Regular-file growth in every root is still measured; FIFOs and device entries remain unsupported. Output growth is separate from the 8 MiB captured stdout/stderr limit. Resource limits are opt in and do not impose a total runtime deadline.
|
|
169
|
+
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.
|
|
397
170
|
|
|
398
|
-
|
|
171
|
+
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.
|
|
399
172
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
```js
|
|
403
|
-
import { withVerificationFilesystemFixture } from '@aviaratech/ai-delivery';
|
|
404
|
-
|
|
405
|
-
await withVerificationFilesystemFixture(async () => {
|
|
406
|
-
// Create the real negative fixture inside a declared output root.
|
|
407
|
-
try {
|
|
408
|
-
// Assert the actual reader rejects it without blocking.
|
|
409
|
-
} finally {
|
|
410
|
-
// Remove every negative fixture before returning or throwing.
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
```
|
|
173
|
+
## CLI and MCP contract
|
|
414
174
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
Bounded stage checkpoints bind the limits and sampled observations. Older unmeasured stages and stages with different limits rerun. Current manifests use `ai-delivery.run@3`, bind the worktree and producer, and live under `runs@2/<worktree-digest>/<head>.json`. Bounded manifests also record limits, sample count, and sampled RSS, output, and disk extrema. Historical run versions 1 and 2 remain historical and are available for merged-issue recovery; current publication requires current-producer verification. `processCoverage: "observed-processes-only"` means a passing aggregate is not proof that every detached descendant was drained. A descendant that detaches and closes inherited pipes between samples can evade observation; a pipe holder that prevents command closure fails with unverified cleanup and no checkpoint. Output roots must be canonical and nonoverlapping. Resolvable aliases such as npm `.bin` links may point only within the declared roots; aliases are not traversed or counted twice, and growth of their physical targets remains measured. Escaping, broken and cyclic links fail closed. Output baselines are retained across retries, including failed stages. They are range scoped: a changed baseline regenerates the measured stage proof. Consumers must confirm their command graph remains observable and declare all relevant output roots; this contract does not assert ownership of undeclared output locations or other concurrent writers.
|
|
418
|
-
|
|
419
|
-
A reviewed policy transition can be verified and published before activating
|
|
420
|
-
its new configuration. For `verify`, issue-bound PR operations, and `finish`,
|
|
421
|
-
invoke from the primary checkout or the exact registered issue checkout. The
|
|
422
|
-
dispatcher selects that issue's witnessed, clean source for operation policy,
|
|
423
|
-
configuration and author/reviewer roles. Runtime admission continues to bind
|
|
424
|
-
the unchanged primary controller configuration and installed CLI/MCP bytes.
|
|
425
|
-
Controller metadata discovery uses the configured source author; a review
|
|
426
|
-
operation still authenticates independently as the configured reviewer App.
|
|
427
|
-
Both contexts must select the same repository and share its Git common
|
|
428
|
-
directory. Tracking and worktree preparation continue to use their caller's
|
|
429
|
-
configuration and admission.
|
|
430
|
-
|
|
431
|
-
Use the candidate's configured identities and obtain fresh verification and,
|
|
432
|
-
when required, prepublication review for its exact base, head, tree and
|
|
433
|
-
configuration. Formal review and ready promotion recheck that candidate
|
|
434
|
-
configuration against the verified classification. Source drift, a changed
|
|
435
|
-
remote base, missing ownership or
|
|
436
|
-
unadmitted controller bytes/configuration reject the operation. The selected
|
|
437
|
-
author credential makes the normal push and PR; formal review, counted approval
|
|
438
|
-
and exact-head merge checks remain required. Publication does not activate the
|
|
439
|
-
candidate configuration or rewrite runtime admission. After merge, the
|
|
440
|
-
consumer's supported installation/admission process owns that transition.
|
|
441
|
-
If cleanup has removed the checkout or registry row, merge/finish recovery uses
|
|
442
|
-
the admitted primary context and retained terminal receipts with remote
|
|
443
|
-
readback; it does not reconstruct source configuration or issue another merge.
|
|
444
|
-
|
|
445
|
-
For recovery, inspect the original issue/PR, worktree registry and exact source
|
|
446
|
-
head before retrying. A `created-not-started` response includes `safeResume`
|
|
447
|
-
arguments; use those arguments unchanged to resume the known issue. `verify`
|
|
448
|
-
reuses compatible stage checkpoints after interruption. If code, config, policy,
|
|
449
|
-
the selected stage inputs or a checkpoint changes, regenerate the affected
|
|
450
|
-
proof. A stopped or failed publish/finish must be read back before retrying;
|
|
451
|
-
never infer completion from a timed-out command. Task assignment and model
|
|
452
|
-
routing belong to a separate orchestrator, not this CLI.
|
|
453
|
-
|
|
454
|
-
## Bounded issue source phases
|
|
455
|
-
|
|
456
|
-
The root and `@aviaratech/ai-delivery/agent` exports provide
|
|
457
|
-
`withIssueSourcePhase(input, async context => { ... })` for an expressly
|
|
458
|
-
authorized source graph in an existing registered issue worktree. The input
|
|
459
|
-
binds its exact row and ownership witness, configured authenticated author,
|
|
460
|
-
admitted executing SDK, primary controller HEAD/configuration, and separate
|
|
461
|
-
candidate HEAD/index/dirty files/configuration. Declare frozen caller and input
|
|
462
|
-
artifact digests, resolved command executables/argv/cwd, effective environment
|
|
463
|
-
digest and overrides, completion artifacts, disjoint output roots and fixed
|
|
464
|
-
RSS/output/disk bounds. Environment values stay in memory; records contain its
|
|
465
|
-
digest. The selected SDK's producer commit and the consumer controller HEAD
|
|
466
|
-
are separate identities.
|
|
467
|
-
|
|
468
|
-
`identity` selects the configured authenticated author. Historical worktree
|
|
469
|
-
custody may name a different principal: the exact canonical row digest and
|
|
470
|
-
ownership witness remain bound and unchanged throughout the phase. The receipt
|
|
471
|
-
binds that row separately from its authenticated actor; entering a source phase
|
|
472
|
-
does not transfer custody or alias those principals.
|
|
473
|
-
|
|
474
|
-
Inside the callback, prepare owned metadata and `await context.run(index)` for
|
|
475
|
-
every command, in order, once. The context exposes read-only source,
|
|
476
|
-
controller, authenticated actor and input identities. It permits one active
|
|
477
|
-
command and expires when the callback settles. An unawaited command cancels
|
|
478
|
-
the phase and triggers identity-bound descendant cleanup. This is a trusted
|
|
479
|
-
cooperative callback: use its AbortSignal and issue all subprocesses through
|
|
480
|
-
`run`. JavaScript is not sandboxed. Source must preserve the exact initial
|
|
481
|
-
snapshot or produce the one declared commit with its exact parent/tree and
|
|
482
|
-
clean postconditions. Normal commit hooks remain enabled.
|
|
483
|
-
|
|
484
|
-
For a declared candidate policy change, set the optional
|
|
485
|
-
`source.effect.configDigest` on `commitOnce` to the final resolved candidate
|
|
486
|
-
configuration digest. `source.configDigest` binds the initial configuration;
|
|
487
|
-
the final digest applies only to the exact declared clean child commit. Resolve
|
|
488
|
-
both digests through the SDK's configuration loader; a policy file hash is not
|
|
489
|
-
a resolved configuration digest. Omitting the final digest requires the initial
|
|
490
|
-
configuration throughout and preserves existing record identities. `preserve`
|
|
491
|
-
does not accept a final digest. The controller configuration remains fixed.
|
|
492
|
-
|
|
493
|
-
The existing writer fence is published before lengthy validation/scans. The
|
|
494
|
-
same runner accounts for the controller and owned descendants, captured logs,
|
|
495
|
-
callback output and SDK metadata under one original cumulative physical
|
|
496
|
-
baseline. New command calls cannot replace the graph, environment, roots or
|
|
497
|
-
allocation. Cancellation and lock compromise cancel owned work; process
|
|
498
|
-
cleanup, output accounting, writer release and lock release failures remain
|
|
499
|
-
distinct. Completion is sealed only after accounting and confirmed release.
|
|
500
|
-
The shared writer admission check continues to exclude other worktree writers
|
|
501
|
-
while this source-phase record is unsealed, including the release-to-seal interval.
|
|
502
|
-
|
|
503
|
-
The finite private `ai-delivery.source-phase@1` record is stored beneath the
|
|
504
|
-
Git common directory's `ai-delivery/receipts/source-phase@1`, keyed by worktree
|
|
505
|
-
and complete input digests. A compatible completed record can be returned
|
|
506
|
-
without entering the callback or replaying commands after validating source,
|
|
507
|
-
producer, admission and artifacts. A terminal `failed-quiescent` or
|
|
508
|
-
`rejected-before-work` attempt can be followed only by an expressly authorized
|
|
509
|
-
new input naming its exact predecessor phaseId/recordId, original baselineId
|
|
510
|
-
when present, and authorization digest in `reconciliation`. Retain original
|
|
511
|
-
source/runtime/input and allocation bindings and all output/bootstrap charges;
|
|
512
|
-
corrected rejected inputs supply no reusable proof. Intermediate command
|
|
513
|
-
results are never replay checkpoints. A missing or mistyped predecessor can be
|
|
514
|
-
corrected without discarding its rejected record: validated retention edges
|
|
515
|
-
carry every rejected sibling's bootstrap charge, separately from the requested
|
|
516
|
-
reconciliation and any reusable source/runtime proof. Every attempt inherits
|
|
517
|
-
the retained original allocation and charges prior attempts before checking
|
|
518
|
-
work authorization. Rejected requests cannot enlarge that allocation or change
|
|
519
|
-
its roots. Exhaustion remains unresolved and refuses another record or writer
|
|
520
|
-
claim. Interrupted intent, uncertain commits,
|
|
521
|
-
changed frozen inputs or unconfirmed release remain unresolved and refuse a
|
|
522
|
-
new attempt; the API supplies no previous-process recovery or force-unblock.
|
|
523
|
-
|
|
524
|
-
Its receipt proves this bounded operation only. Canonical verification,
|
|
525
|
-
independent acceptance, scientific holds and receiving runtime selection keep
|
|
526
|
-
their existing owners and checks.
|
|
527
|
-
|
|
528
|
-
## Compatibility contract
|
|
529
|
-
|
|
530
|
-
The MCP input and result contract is `ai-delivery.mcp@1`, exported as `AI_DELIVERY_MCP_CONTRACT_VERSION`. Existing `issue_*` tools remain available, with typed `issue_comment`, `issue_list` and `issue_search` added. Each tool rejects unknown fields at the request boundary. `issue_create` accepts a title with optional body, Issue Type, Points, Priority, taxonomy labels, milestone, parent and blockers; it returns `{body, created: {number, title, url}, routing}`. A linked parent is read back and cleared of Points. `issue_start({issueNumber})` always checks readiness and prepares that existing issue; `develop` gates only preparation of a newly created issue. New starts default to 2 Points. `resumeCreated` requires `issueNumber` and an explicit `develop` boolean and never creates a second issue; `develop: false` recovers creation-only registration and journaling. Immediate creation and development preflights readiness before creation and returns `ai-delivery.issue-start-registration@1` with `status: "started"` or a `created-not-started` failure and exact `safeResume` arguments. The CLI prints that recovery JSON and exits nonzero for `created-not-started`. Scratch starts derive safe names from the request or title and return the branch and worktree path. `repo` on create, start and ready check, or global CLI `--repo`, must match the repository selected by the checkout's validated Git remote; a mismatch fails before a GitHub call.
|
|
531
|
-
|
|
532
|
-
`issue_list` and `issue_search` return a bounded GitHub page with `{issues, page, perPage, nextPage}`. Both accept state, labels, parent issue, Issue Type, Project status, updated-since timestamp, page and per-page filters. Search requires literal text in `query`; list accepts it optionally. Text containing quotes, backslashes or newlines is rejected so search cannot replace the selected repository. Search fails on incomplete results or more than GitHub's 1,000-result window; narrow the query. Parent and Project filters apply to the fetched page, so an empty `issues` array can still have a `nextPage`. Continue until `nextPage` is null. Results include number, title, state, labels, Issue Type, parent, all native blockers, Project status, URL, update time and organization issue `fields` keyed by their actual names, including custom Points/Priority names and configured Effort/date fields. Unset fields are null. Field, option, relationship and Project item IDs stay internal. CLI `list` and `search` use these same tools.
|
|
533
|
-
|
|
534
|
-
`issue_update` returns authoritative issue readback and synchronizes configured Project status from live native blockers. Closed issues and Done items remain Done; removing the last unresolved blocker returns to Todo. To park execution while retaining a worktree, use `ai-delivery update --issue 17 --park` or `issue_update({issueNumber: 17, park: true})`; status becomes Todo, or Blocked while native blockers remain. Unrelated metadata edits preserve parked presentation. Resume explicitly with `develop`/`issue_develop` or an existing-issue start, which still requires readiness; worktree presence never establishes active execution. `issue_info` returns current native metadata, parent, blockers, Project state and registered worktree; `issue_ready_check` returns deterministic admission and reasons; `issue_develop` and `issue_worktree_create` return registered worktree rows. `issue_verify` returns classification, aggregate, manifest and publication evidence IDs, plus the sampled resource summary when limits were supplied. `issue_pr_create` returns the PR number, URL and bound publication evidence ID, plus route evidence or the live review state on ready promotion; `issue_pr_info` returns number, state, exact head/base, draft flag, author login and URL. `issue_pr_review` returns an exact-head submitted review receipt and live required-review state, `issue_pr_merge` a durable merge receipt, and `issue_finish` returns the merge SHA and successful issue/cleanup readback. CLI and MCP call the same owners for these tools.
|
|
535
|
-
|
|
536
|
-
`issue_update({issueNumber: 17, title: "New title", body: "New body", preserveHistory: true})` posts the complete previous title and body in a collapsed comment and confirms that comment before rewriting. HTML escaping preserves the prior text, whitespace and line endings. The result includes `historyComment` with its id, URL, exact body and retry status. Unchanged title/body adds no comment. An oversized complete history or failed comment readback prevents the rewrite; concurrent content edits detected after preservation also fail and require retrying against the current content. GitHub does not provide an atomic title/body compare-and-set, so edits made after that final read can still race with the update. CLI uses `--preserve-history`.
|
|
537
|
-
|
|
538
|
-
Closing with `issue_update({issueNumber: 17, state: "closed", closeReason: "duplicate", supersededBy: 18})` validates the same-repository superseding issue, records the requested reason and supersession through the canonical comment writer, then reads back GitHub's native closure. Reasons are `completed`, `not_planned` and `duplicate`; `supersededBy` is optional and defaults the reason to `completed` when no reason is supplied. Duplicate closure also sets and verifies the native duplicate relationship. The result includes `closure` with native state, `closeReason`, repository-qualified `duplicateOf`, recorded `supersededBy` and the authoritative `comment` readback. Closure details require `state: "closed"`. Exact retries reuse the authored comment; a different reason or duplicate target on an already closed issue fails, because GitHub ignores reason changes without a state transition. Reopen explicitly before changing those native closure details. Comments record intent and remain available if a later mutation fails. CLI uses `--state closed --close-reason duplicate --superseded-by 18`.
|
|
539
|
-
|
|
540
|
-
The CLI also exposes native relationship reads (`parent`, `subissues`, `blockers`), registry reads and clean registered PR/standalone cleanup (`worktrees:list`, `worktrees:status`, `worktrees:cleanup`), and PR reads and exact-head selected-author checkout (`pr:list`, `pr:checks`, `pr:checkout`). `pr:checks` includes GitHub's current review decision. A cleaned PR worktree can be reopened when its retained branch still matches the remote head. `migrate:legacy-issues --input-file` produces an offline `ai-delivery.legacy-issue-migration@1` plan without live writes. `metrics velocity --json` reads completed local delivery records and returns `ai-delivery.velocity-report@1` with buckets for configured Points; unknown blocker and review measurements remain null. `finish` can confirm completion after a lost response by matching the exact merge receipts, delivery record and live issue/Project state. Installing the package never migrates active runtime state automatically.
|
|
175
|
+
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.
|
|
541
176
|
|
|
542
177
|
## Typed issue journals
|
|
543
178
|
|