@aviaratech/ai-delivery 0.3.24 → 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.
- package/CONTRIBUTING.md +157 -16
- package/README.md +124 -9
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +1 -0
- package/dist/agent.js.map +1 -1
- package/dist/agentReadiness.test.d.ts +1 -0
- package/dist/agentReadiness.test.js +77 -0
- package/dist/agentReadiness.test.js.map +1 -0
- package/dist/cli.js +136 -36
- package/dist/cli.js.map +1 -1
- package/dist/config/deliveryConfig.js +5 -1
- package/dist/config/deliveryConfig.js.map +1 -1
- package/dist/contributorChecks.test.d.ts +1 -0
- package/dist/contributorChecks.test.js +1010 -0
- package/dist/contributorChecks.test.js.map +1 -0
- package/dist/currentConsumer.test.d.ts +1 -0
- package/dist/currentConsumer.test.js +832 -0
- package/dist/currentConsumer.test.js.map +1 -0
- package/dist/deliveryHealth.test.d.ts +1 -0
- package/dist/deliveryHealth.test.js +167 -0
- package/dist/deliveryHealth.test.js.map +1 -0
- package/dist/dependencyCompatibility.test.d.ts +1 -0
- package/dist/dependencyCompatibility.test.js +175 -0
- package/dist/dependencyCompatibility.test.js.map +1 -0
- package/dist/directoryIndependent.test.js +91 -1
- package/dist/directoryIndependent.test.js.map +1 -1
- package/dist/dispatch.d.ts +1 -0
- package/dist/dispatch.js +53 -4
- package/dist/dispatch.js.map +1 -1
- package/dist/fixtures/inertEntrypointChild.d.ts +1 -0
- package/dist/fixtures/inertEntrypointChild.js +62 -0
- package/dist/fixtures/inertEntrypointChild.js.map +1 -0
- package/dist/fixtures/inertEntrypoints.d.ts +49 -0
- package/dist/fixtures/inertEntrypoints.js +276 -0
- package/dist/fixtures/inertEntrypoints.js.map +1 -0
- package/dist/fixtures/inertTarget.d.ts +643 -0
- package/dist/fixtures/inertTarget.js +713 -0
- package/dist/fixtures/inertTarget.js.map +1 -0
- package/dist/fixtures/issue63.d.ts +68 -0
- package/dist/fixtures/issue63.js +272 -0
- package/dist/fixtures/issue63.js.map +1 -0
- package/dist/github/client.d.ts +2 -0
- package/dist/github/client.js +94 -12
- package/dist/github/client.js.map +1 -1
- package/dist/github/issueHistory.d.ts +40 -0
- package/dist/github/issueHistory.js +144 -0
- package/dist/github/issueHistory.js.map +1 -0
- package/dist/github/machineAuth.d.ts +9 -0
- package/dist/github/machineAuth.js +135 -0
- package/dist/github/machineAuth.js.map +1 -0
- package/dist/github/machineAuth.test.d.ts +1 -0
- package/dist/github/machineAuth.test.js +409 -0
- package/dist/github/machineAuth.test.js.map +1 -0
- package/dist/github/projectDelivery.d.ts +2 -0
- package/dist/github/projectDelivery.js +6 -0
- package/dist/github/projectDelivery.js.map +1 -1
- package/dist/github/relationships.d.ts +9 -2
- package/dist/github/relationships.js +6 -2
- package/dist/github/relationships.js.map +1 -1
- package/dist/investigationCompletion.test.d.ts +1 -0
- package/dist/investigationCompletion.test.js +728 -0
- package/dist/investigationCompletion.test.js.map +1 -0
- package/dist/issue.d.ts +29 -6
- package/dist/issue.js +153 -22
- package/dist/issue.js.map +1 -1
- package/dist/issue63History.test.d.ts +1 -0
- package/dist/issue63History.test.js +45 -0
- package/dist/issue63History.test.js.map +1 -0
- package/dist/issue63Routes.test.d.ts +1 -0
- package/dist/issue63Routes.test.js +153 -0
- package/dist/issue63Routes.test.js.map +1 -0
- package/dist/issueBlockerGuard.test.d.ts +1 -0
- package/dist/issueBlockerGuard.test.js +162 -0
- package/dist/issueBlockerGuard.test.js.map +1 -0
- package/dist/issueContract.d.ts +230 -0
- package/dist/issueContract.js +341 -0
- package/dist/issueContract.js.map +1 -0
- package/dist/issueContract.test.d.ts +27 -0
- package/dist/issueContract.test.js +314 -0
- package/dist/issueContract.test.js.map +1 -0
- package/dist/issueIntake.test.d.ts +1 -0
- package/dist/issueIntake.test.js +649 -0
- package/dist/issueIntake.test.js.map +1 -0
- package/dist/issueJournal.d.ts +1 -1
- package/dist/issueJournal.test.js +88 -6
- package/dist/issueJournal.test.js.map +1 -1
- package/dist/issueTracking.test.js +16 -8
- package/dist/issueTracking.test.js.map +1 -1
- package/dist/mcp/tools.d.ts +142 -12
- package/dist/mcp/tools.js +104 -34
- package/dist/mcp/tools.js.map +1 -1
- package/dist/pluginAuthProbe.d.ts +6 -0
- package/dist/pluginAuthProbe.js +53 -0
- package/dist/pluginAuthProbe.js.map +1 -0
- package/dist/pluginAuthProbe.test.d.ts +1 -0
- package/dist/pluginAuthProbe.test.js +66 -0
- package/dist/pluginAuthProbe.test.js.map +1 -0
- package/dist/pluginCredentials.test.d.ts +1 -0
- package/dist/pluginCredentials.test.js +277 -0
- package/dist/pluginCredentials.test.js.map +1 -0
- package/dist/pluginDoctor.test.d.ts +1 -0
- package/dist/pluginDoctor.test.js +627 -0
- package/dist/pluginDoctor.test.js.map +1 -0
- package/dist/pluginInstaller.d.ts +36 -0
- package/dist/pluginInstaller.js +238 -11
- package/dist/pluginInstaller.js.map +1 -1
- package/dist/pluginInstaller.test.js +242 -2
- package/dist/pluginInstaller.test.js.map +1 -1
- package/dist/pluginPackaging.test.js +123 -9
- package/dist/pluginPackaging.test.js.map +1 -1
- package/dist/pr.d.ts +90 -13
- package/dist/pr.js +875 -66
- package/dist/pr.js.map +1 -1
- package/dist/pr.test.js +166 -7
- package/dist/pr.test.js.map +1 -1
- package/dist/prAssociation.test.d.ts +1 -0
- package/dist/prAssociation.test.js +1336 -0
- package/dist/prAssociation.test.js.map +1 -0
- package/dist/prDispatch.test.d.ts +1 -0
- package/dist/prDispatch.test.js +96 -0
- package/dist/prDispatch.test.js.map +1 -0
- package/dist/releaseReconciliation.test.js +6 -2
- package/dist/releaseReconciliation.test.js.map +1 -1
- package/dist/releaseWorkflow.test.d.ts +1 -0
- package/dist/releaseWorkflow.test.js +447 -0
- package/dist/releaseWorkflow.test.js.map +1 -0
- package/dist/services/agentReadinessService.d.ts +9 -8
- package/dist/services/agentReadinessService.js +32 -223
- package/dist/services/agentReadinessService.js.map +1 -1
- package/dist/services/blockerGuardService.d.ts +17 -0
- package/dist/services/blockerGuardService.js +194 -0
- package/dist/services/blockerGuardService.js.map +1 -0
- package/dist/services/deliveryAdmission.js +22 -19
- package/dist/services/deliveryAdmission.js.map +1 -1
- package/dist/services/deliveryHealthService.d.ts +84 -0
- package/dist/services/deliveryHealthService.js +206 -0
- package/dist/services/deliveryHealthService.js.map +1 -0
- package/dist/services/worktreeRegistry.d.ts +84 -0
- package/dist/services/worktreeRegistry.js +265 -1
- package/dist/services/worktreeRegistry.js.map +1 -1
- package/dist/setup.test.js +97 -3
- package/dist/setup.test.js.map +1 -1
- package/dist/stagedChecks.test.d.ts +1 -0
- package/dist/stagedChecks.test.js +228 -0
- package/dist/stagedChecks.test.js.map +1 -0
- package/dist/start.test.js +30 -3
- package/dist/start.test.js.map +1 -1
- package/dist/stdoutRegression.test.js +36 -6
- package/dist/stdoutRegression.test.js.map +1 -1
- package/dist/targetPolicyEntrypoints.test.d.ts +1 -0
- package/dist/targetPolicyEntrypoints.test.js +275 -0
- package/dist/targetPolicyEntrypoints.test.js.map +1 -0
- package/dist/targetPolicyLocal.test.d.ts +1 -0
- package/dist/targetPolicyLocal.test.js +707 -0
- package/dist/targetPolicyLocal.test.js.map +1 -0
- package/dist/targetPolicyRoutes.test.d.ts +1 -0
- package/dist/targetPolicyRoutes.test.js +298 -0
- package/dist/targetPolicyRoutes.test.js.map +1 -0
- package/dist/verification.js +48 -12
- package/dist/verification.js.map +1 -1
- package/dist/verificationGate.test.d.ts +1 -0
- package/dist/verificationGate.test.js +106 -0
- package/dist/verificationGate.test.js.map +1 -0
- package/dist/worktree.d.ts +6 -1
- package/dist/worktree.js +90 -3
- package/dist/worktree.js.map +1 -1
- package/dist/worktreeTransition.test.js +1 -1
- package/dist/worktreeTransition.test.js.map +1 -1
- package/package.json +9 -6
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/README.md +160 -1
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +83 -49
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +45 -30
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +20 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -1,22 +1,153 @@
|
|
|
1
1
|
# Contributing to ai-delivery
|
|
2
2
|
|
|
3
|
-
Use Node 24.21.0
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Use an isolated checkout and controller Node **24.21.0** with npm **11.19.0**.
|
|
4
|
+
Node **26.2.0** is a separate public-library consumer prerequisite, not a
|
|
5
|
+
CLI/controller replacement. Provision with your existing runtime manager and
|
|
6
|
+
read back the actual executables (tool installation is a separate action):
|
|
6
7
|
|
|
7
8
|
```sh
|
|
8
|
-
|
|
9
|
+
nvm use 26.2.0
|
|
10
|
+
export AI_DELIVERY_NODE26_EXECUTABLE="$(node -p 'process.execPath')"
|
|
11
|
+
nvm use 24.21.0
|
|
12
|
+
node -p 'JSON.stringify({version:process.version,execPath:process.execPath})'
|
|
13
|
+
npm --version
|
|
14
|
+
"$AI_DELIVERY_NODE26_EXECUTABLE" -p 'JSON.stringify({version:process.version,execPath:process.execPath})'
|
|
15
|
+
npm ci --ignore-scripts --no-audit --no-fund
|
|
9
16
|
npm run checks
|
|
10
|
-
npm run build
|
|
11
|
-
npm pack --dry-run
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
The runner fails before gates for missing, wrong or inaccessible prerequisites.
|
|
20
|
+
It resolves existing temporary-directory aliases to their physical paths so
|
|
21
|
+
macOS synthetic fixtures do not mistake `/var` or `/tmp` aliases for managed
|
|
22
|
+
plugin symlinks; this creates no new destination or host setting.
|
|
23
|
+
Local and CI full entry `npm run checks` runs `scripts/current-qualification.mjs`:
|
|
24
|
+
the canonical six-gate producer, one actual scripts-disabled pack, then an owned,
|
|
25
|
+
credential-free production-only consumer installation of that exact archive.
|
|
26
|
+
The producer in `scripts/checks.mjs` runs formatting, native type-aware lint,
|
|
27
|
+
strict TypeScript, a **clean single build**, all intended compiled Vitest files
|
|
28
|
+
with one worker, and complete dry inventory validation. The immutable
|
|
29
|
+
`contributor-checks@1` snapshot records those six gates; its `fullSuccess` means
|
|
30
|
+
producer success. Overall `ai-delivery.current-qualification@1` requires the
|
|
31
|
+
exact archive, resolved production closure, installed byte/mode checks, CLI,
|
|
32
|
+
exports, packaged stdio MCP schemas, skills, actual Node26 library use, and owned
|
|
33
|
+
quiescent removal. Its `qualified: true` and exit 0 are full contributor proof.
|
|
34
|
+
A producer pass alone reports `artifactQualified: false`.
|
|
35
|
+
Source names, compiled names and actual Vitest selection must agree;
|
|
36
|
+
deleted/renamed tests cannot survive in stale `dist`. Actual artifact qualification
|
|
37
|
+
requires a clean committed source including untracked files. Results must be
|
|
38
|
+
outside the checkout. CI retains required jobs `checks` and `secrets` and uploads
|
|
39
|
+
partial/final evidence, immutable producer logs, and the actual archive.
|
|
40
|
+
|
|
41
|
+
A serial artifact handoff uses `npm run checks:producer -- --results-dir
|
|
42
|
+
/an/owned/new/result-directory`. It runs the producer and actual pack once,
|
|
43
|
+
retains `contract.json` and `checkpoint.json`, and returns exit **2** with overall
|
|
44
|
+
`incomplete` and the consumer omissions. Resume without rebuilding or repacking:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm run checks:resume -- --resume /owned/original/checkpoint.json --results-dir /owned/new/resume-results
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Resume revalidates clean HEAD/tree, source fingerprint, manifest/lock, all archive
|
|
51
|
+
bytes/modes against member SHA256s captured inside the successful producer,
|
|
52
|
+
immutable producer digest, six gates, counts, reviewed skips and
|
|
53
|
+
pack quiescence before installation and again before completion. A changed or
|
|
54
|
+
incomplete checkpoint fails. Consumer launch is supervised and reserves one
|
|
55
|
+
checkpoint-wide `consumer-attempt.json` before starting a child. It retains the
|
|
56
|
+
command, observed PID/birth identities, logs and owned temporary root during
|
|
57
|
+
execution. An unresolved attempt blocks another install even with fresh overall
|
|
58
|
+
results storage. After controller loss, `--reconcile-consumer` joins an already
|
|
59
|
+
qualified retained receipt only after every observed identity is absent; it
|
|
60
|
+
does not launch or kill a process. Missing launch identity, incomplete receipts,
|
|
61
|
+
active processes or leftover temporary contents require owner reconciliation.
|
|
62
|
+
A completed retained consumer is reused without installation. For an admitted
|
|
63
|
+
separate consumer owner, prefer the supervised resume entry. If its independently
|
|
64
|
+
supervised invocation retains equivalent launch and cleanup proof, invoke
|
|
65
|
+
`node scripts/current-consumer.mjs /owned/original/contract.json
|
|
66
|
+
/owned/consumer-result.json --authorize-install` once, then join its retained
|
|
67
|
+
result with the same resume command plus `--consumer-result
|
|
68
|
+
/owned/consumer-result.json`. That join performs no install, build or pack.
|
|
69
|
+
Without `--authorize-install` the helper returns incomplete/exit 2; it cannot
|
|
70
|
+
complete overall checks. Immutable receipts are referenced by SHA256 in the
|
|
71
|
+
overall result, never inserted back into the producer hash. Do not rerun a
|
|
72
|
+
successful producer or pack merely to report or join evidence. Each invocation
|
|
73
|
+
needs fresh owned output storage; preserve uncertain/interrupted receipts.
|
|
74
|
+
|
|
75
|
+
`npm run checks:fast` runs only format/lint/types. It reports `partial-passed`,
|
|
76
|
+
`fullSuccess: false` and omitted build/tests/inventory. `npm test` is a separate
|
|
77
|
+
development command, not full-check proof. Every check run prints its results
|
|
78
|
+
directory and keeps `result.json`, `result.txt`, per-command logs, toolchain/tree,
|
|
79
|
+
selected file/test counts, skips, start/final exit, signals and partial state.
|
|
80
|
+
Raw test observations survive a failing command and remain distinct from the
|
|
81
|
+
validated proof required for full success.
|
|
82
|
+
Select owned storage outside the checkout with `npm run checks -- --results-dir
|
|
83
|
+
/an/owned/new/result-directory`. Existing results are never overwritten by a
|
|
84
|
+
retry. A lost response or missing CI artifact means completion is **unknown**:
|
|
85
|
+
inspect the original result and PID/birth records, prove owned quiescence, then
|
|
86
|
+
start a fresh attempt. Abrupt process/service loss can prevent final transport.
|
|
87
|
+
|
|
88
|
+
The reviewed `SKIP_ALLOWLIST` names only two top-level skips. The setup
|
|
89
|
+
interruption helper requires passing recovery parents and its receipt; their
|
|
90
|
+
launch is distinct from its top-level skip. Absent
|
|
91
|
+
`AI_DELIVERY_REAL_PACKAGE_ARCHIVE` (an explicitly supplied path is forwarded
|
|
92
|
+
and must not silently become an absent-input skip), the historical reviewed 0.3.4 archive
|
|
93
|
+
qualification remains **unexecuted**. That skip, checkout-sharing consumer tests
|
|
94
|
+
and dry inventory are not current production-only tarball or native adoption
|
|
95
|
+
proof. The reviewed current-tarball consumer is joined by the maintained full entry;
|
|
96
|
+
its installation proof remains distinct from the producer and historical archive. Unexpected skips,
|
|
97
|
+
exclusions, unknown statuses, missing proof and zero tests fail full checks.
|
|
98
|
+
|
|
99
|
+
Built-in Node/V8 coverage collects executed **observed V8 ranges** in compiled
|
|
100
|
+
library/contributor scripts without a new dependency; it is not TypeScript
|
|
101
|
+
source line/branch coverage. Startup collection measures compiled library files,
|
|
102
|
+
`scripts/build-plugin.mjs`, and native invocations of the two runners by synthetic
|
|
103
|
+
Git hooks. The runners' counters measure those native fixture paths; the main
|
|
104
|
+
canonical controller and Vitest-transformed imports are not instrumented. Each
|
|
105
|
+
result explicitly lists scripts without any raw measurement as unmeasured,
|
|
106
|
+
with no derived floors. For measured files, review staged floors five percentage
|
|
107
|
+
points below their first baseline using the same Node/V8 graph before
|
|
108
|
+
enforcement; retain these instrumentation limits when assessing those floors.
|
|
109
|
+
No arbitrary global 100% threshold or metric-only tests are required.
|
|
110
|
+
|
|
111
|
+
There is no local total wall-clock deadline. Set an explicit operator-requested
|
|
112
|
+
per-command budget with `--command-timeout-ms <milliseconds>` (default 0,
|
|
113
|
+
disabled). A timeout is separate from source assertion failure. Cancellation
|
|
114
|
+
stops identity-checked owned descendants (including observed separate sessions),
|
|
115
|
+
continues discovery from those descendants after the root exits, then uses a
|
|
116
|
+
three-second TERM grace before identity-checked KILL and up to one second to
|
|
117
|
+
confirm quiescence. Unconfirmed cleanup stays explicit.
|
|
118
|
+
Logs are limited to 32 MiB per command and process RSS is sampled against 3 GiB,
|
|
119
|
+
not a hard ceiling or model-service measurement. PID/birth observation must work
|
|
120
|
+
before launch. CI keeps its existing 15-minute service job limit; interruption
|
|
121
|
+
or failed artifact transport requires reconciliation, not a blind retry.
|
|
122
|
+
|
|
123
|
+
The optional tracked hook is `scripts/pre-commit.mjs`. It copies the index into
|
|
124
|
+
an owned temporary directory, honoring `GIT_INDEX_FILE` (including temporary
|
|
125
|
+
indexes supplied by `git commit -a` and path-limited commits), computes the exact staged tree with private
|
|
126
|
+
objects, materializes that tree, provisions from its staged lock and invokes
|
|
127
|
+
its **staged** six-gate canonical producer. The snapshot hook reports actual
|
|
128
|
+
archive/clean-HEAD consumer omissions and `artifactQualified: false`; it does not
|
|
129
|
+
install or force an uncommitted index through clean-source qualification. It does not stash, write the original index or
|
|
130
|
+
unstaged files, or borrow checkout node_modules. It checks the source index for
|
|
131
|
+
drift and removes only its owned snapshot after quiescence; results survive.
|
|
132
|
+
Unmerged/submodule/symlink index entries fail explicitly. Opt-in installation
|
|
133
|
+
in your own checkout only, after inspecting and preserving any existing hook:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
# Do not run on an operator host without explicit operator approval.
|
|
137
|
+
hook_path="$(git rev-parse --git-path hooks/pre-commit)"
|
|
138
|
+
test ! -e "$hook_path"
|
|
139
|
+
printf '%s\n' '#!/bin/sh' 'exec node scripts/pre-commit.mjs' > "$hook_path"
|
|
140
|
+
chmod +x "$hook_path"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The hook needs the pinned controller/npm PATH and exported actual Node26 path.
|
|
144
|
+
Synthetic fixtures prove partial staging, additions, deletions and lockfile
|
|
145
|
+
isolation without operator hook installation. Command environments are
|
|
146
|
+
allowlisted: credential references, NODE_PATH and ambient NODE_OPTIONS are not
|
|
147
|
+
forwarded. Synthetic tests do not mutate live issues. Review the complete
|
|
148
|
+
retained inventory; never commit credentials, host configuration, receipts,
|
|
149
|
+
logs or repository-specific policy. The separate TruffleHog job scans changed
|
|
150
|
+
Git history without release credentials.
|
|
20
151
|
|
|
21
152
|
The `Publish npm package` workflow is manual, runs only from `main`, and uses
|
|
22
153
|
the `npm-publish` environment. Before enabling it, the repository owner must:
|
|
@@ -45,11 +176,21 @@ the `npm-publish` environment. Before enabling it, the repository owner must:
|
|
|
45
176
|
version, actual built archive, complete inventory and confidentiality scan.
|
|
46
177
|
Dispatch the workflow on `main` with `reviewed_source_sha`, `package_version`
|
|
47
178
|
and `archive_sha256` from that accepted candidate. Missing or mismatched
|
|
48
|
-
inputs fail closed. The
|
|
49
|
-
permission; only the publish job receives `id-token: write`.
|
|
50
|
-
|
|
179
|
+
inputs fail closed. The package job checks, scans and retains its qualified archive without OIDC
|
|
180
|
+
permission; only the publish job receives `id-token: write`. The package job
|
|
181
|
+
runs full checks once with results outside the checkout, then
|
|
182
|
+
`scripts/release-artifact.mjs select` validates the successful source-bound
|
|
183
|
+
producer/pack/consumer joins and owned cleanup before copying that exact
|
|
184
|
+
archive and original receipt bytes into the uploaded artifact. It performs
|
|
185
|
+
no subsequent build or production pack. Missing, incomplete or mismatched
|
|
186
|
+
receipts fail before upload. The publish job checks the portable receipt and
|
|
187
|
+
downloaded archive against the accepted source/version/digest, compares an inert repack
|
|
51
188
|
byte for byte, and rejects observed protected-main or required-check drift
|
|
52
|
-
before
|
|
189
|
+
before passing the verified tarball path directly to `npm publish` through the
|
|
190
|
+
existing trusted publisher. The inert repack is a byte comparison only;
|
|
191
|
+
its output never becomes the upload or publication source. Receipt hashes
|
|
192
|
+
preserve evidence integrity; reviewed workflow source and its actual execution
|
|
193
|
+
remain necessary provenance. Inputs are passed
|
|
53
194
|
as environment values, never interpolated into shell commands.
|
|
54
195
|
|
|
55
196
|
Release dispatch remains an explicit action by the authorized delivery owner;
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Create `~/.config/aviaratech-ai/ai-delivery.json`, or set `AI_DELIVERY_CONFIG` t
|
|
|
22
22
|
"author": {
|
|
23
23
|
"identity": "host-author",
|
|
24
24
|
"authSource": "personal",
|
|
25
|
-
"credentialEnv": { "token": "
|
|
25
|
+
"credentialEnv": { "token": "GH_TOKEN" }
|
|
26
26
|
},
|
|
27
27
|
"reviewer": {
|
|
28
28
|
"identity": "delivery-reviewer",
|
|
@@ -38,7 +38,11 @@ Create `~/.config/aviaratech-ai/ai-delivery.json`, or set `AI_DELIVERY_CONFIG` t
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
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
|
|
41
|
+
An App author uses the same `credentialEnv` shape as the reviewer. Roles and credential environment names must be distinct. Credential values and private keys remain outside source control. A configured personal author uses its named token variable. With the conventional `GH_TOKEN` reference **absent**, it instead uses the existing active personal account from GitHub CLI `gh` for `github.com`. A present empty, malformed or expired token fails without switching accounts. A custom reference such as `DELIVERY_AUTHOR_TOKEN` always requires that exact value; its absence does not select a machine session. Unrelated `GITHUB_TOKEN` values do not satisfy either configured reference. The optional `--identity` or `AI_DELIVERY_IDENTITY` override must select the command's configured role; neither is needed for normal operation. The explicit legacy `--identity personal --personal-auth` override is limited to development access diagnosis under an App author configuration; it requires an explicit token and does not use a missing-token machine fallback. Publication requires the configured author.
|
|
42
|
+
|
|
43
|
+
The machine route uses `gh auth status --hostname github.com --active --json hosts`, validates the selected account's state, then privately obtains that exact user's credential through `gh auth token --hostname github.com --user <active-user>`. An actual authenticated user read must match the selection. Repository discovery and command execution retain that account; failed identity/access never selects another account. Inactive accounts with errors do not invalidate a healthy active user. Only required non-secret home/PATH/gh configuration selectors reach `gh`; token overrides, debug flags and unrelated credentials are excluded. No login, switch, refresh, credential-store scraping or persistent configuration change occurs. The reviewer still uses its distinct configured App, with no personal-session fallback.
|
|
44
|
+
|
|
45
|
+
`gh` must be executable on the running process's PATH and able to access its existing session. A terminal login does not prove that a Codex or Claude GUI process can find `gh` or use its keyring. `config:resolve` reports the selected route/executable and authenticated actor, or a safe actionable refusal. Default plugin doctor does not inspect or authenticate the session. This package currently supports `github.com` repositories; enterprise URLs or a conflicting `GH_HOST` refuse rather than silently using another host. No write probe or permission grant is performed, and a successful identity/repository read does not guarantee every later write or counted App approval.
|
|
42
46
|
|
|
43
47
|
The explicit organization Project number selects a compatible writable Project. Optional `pointsField`, `priorityField`, `statusField`, four `statuses` names (`todo`, `inProgress`, `blocked`, `done`), and `issueTypes` customize discovered metadata. Defaults are Points, Priority, Status and Todo/In Progress/Blocked/Done. IDs, option catalogs and issue types come from GitHub. This runtime supports github.com organization repositories and native organization single-select Points/Priority fields bound into the selected Project.
|
|
44
48
|
|
|
@@ -64,6 +68,51 @@ ai-delivery --repo example/widget finish --issue 17 --pr 23 --reviewed-head <rev
|
|
|
64
68
|
|
|
65
69
|
`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
70
|
|
|
71
|
+
For a new read-only investigation, the host first creates the linked `issue/N` worktree at the matching clone's exact `.worktrees/issue-N` path. Before investigating, explicitly register its unchanged current default commit:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
ai-delivery --repo example/widget --repo-root /clone start --issue 17 \
|
|
75
|
+
--investigation-worktree /clone/.worktrees/issue-17 --expected-head <initial-sha>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This author operation records prospective commit/tree, physical worktree identity, canonical registry custody and a native preparation acknowledgement. It creates no branch or worktree and refuses existing legacy custody. Historical investigations without this preparation cannot be adopted retrospectively.
|
|
79
|
+
|
|
80
|
+
After independently reviewing the complete result, preserve it in a private regular file outside the worktree. The issue must already be closed with reason `completed`, with no PR associated with its linked branch. Inspection prints the exact operator authority body and, when its comment ID is supplied, the configured-App acceptance body:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
|
|
84
|
+
--investigation --result /retained/result.txt --dry-run
|
|
85
|
+
ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
|
|
86
|
+
--investigation --result /retained/result.txt --authority-comment <operator-comment> --dry-run
|
|
87
|
+
ai-delivery --repo example/widget --repo-root /clone finish --issue 17 \
|
|
88
|
+
--investigation --result /retained/result.txt \
|
|
89
|
+
--authority-comment <operator-comment> --acceptance-comment <app-comment>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Completion consumes existing whole native comments from the configured personal operator and distinct configured reviewer App. These bind the preparation, exact result bytes, unchanged commit/tree and removal scope, including producer quiescence and continued exclusion of writers. This path supplies no non-PR App acceptance writer; unavailable authentic acceptance is a refusal, never a local approval substitute. Keep the result, native acceptance and producer exclusion available through interruption and resume.
|
|
93
|
+
|
|
94
|
+
Run completion from outside the investigation worktree. Dirty, untracked or ignored files, `assume-unchanged` or `skip-worktree` index entries, new commits (including same-tree commits), changed native refs, ambiguous or foreign custody and retained verification writers refuse removal. PR/merge options are incompatible with investigation mode. A durable intent preserves the result, native authority and exact registry beforeimage before non-force Git removal. Resume the same command and evidence after an interruption; unexplained absence or recreated worktrees refuse. Exact disk/Git/registry postconditions seal completion. The branch, private evidence and unrelated registry entries remain retained; ordinary source delivery still requires its full merged-PR proof.
|
|
95
|
+
|
|
96
|
+
Use explicit `--non-closing` on each PR command when delivering a partial fix while its issue remains OPEN. The default closing lifecycle above is unchanged. A non-closing body begins with exactly `References owner/repository#number` on its first line. Creation adds this line to the supplied body; inspection, review, promotion and merge require it to remain unchanged in meaning.
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
# An existing author-owned PR can transition its body only with an exact selector.
|
|
100
|
+
ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --body-file ./partial-body.md --dry-run
|
|
101
|
+
ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --body-file ./partial-body.md
|
|
102
|
+
ai-delivery --repo example/widget pr:info --issue 17 --pr 23 --non-closing
|
|
103
|
+
ai-delivery --repo example/widget pr:review --issue 17 --pr 23 --non-closing --artifact ./review-artifact.json
|
|
104
|
+
ai-delivery --repo example/widget pr:create --issue 17 --pr 23 --non-closing --ready
|
|
105
|
+
ai-delivery --repo example/widget pr:merge --issue 17 --pr 23 --non-closing --strategy squash --reviewed-head <reviewed-sha> --dry-run
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This mode requires complete native GitHub cross-reference evidence from the configured author, identifying the exact canonical issue and PR with `willCloseTarget: false`, plus complete empty native closing associations and the OPEN issue's unchanged title/body. The event establishes a server-recorded historical mention; it does not prove a current revocable Development link. Current body intent supplements that evidence and never replaces it. Missing, unauthorized, conflicting, truncated or moved evidence refuses delivery. Equivalent duplicate observations do not create additional ownership. New PRs still require native issue-branch linkage; `--pr` selects only an existing PR and never creates a replacement.
|
|
109
|
+
|
|
110
|
+
A closing-to-non-closing metadata transition is a narrow exception: with explicit issue/PR/body selection, the author may remove a fully proven intended-only native closing association by updating the body once. Exact PR identity, title, draft/open state, head/ref/base and OPEN issue criteria must remain unchanged; the post-readback must establish native non-closing reference proof and empty closing associations before any delivery action. Dry-run reports a pending transition, not verified non-closing state. Missing closing proof or an already-empty stale body cannot use this exception. An already valid non-closing PR is reused without another body update.
|
|
111
|
+
|
|
112
|
+
Non-closing delivery refuses closing directives in the current PR title/body and every introduced commit message, including other issues/repositories. Squash is required, with explicit safe title/message sent to GitHub. Counted independent exact-head App approval, required checks, blockers, current default base and CLEAN expected-head merge guards still apply. `finish --non-closing` refuses before any lifecycle call; this mode never closes the retained issue or changes its Project to Done. GitHub does not atomically lock issue intent or external edits with promotion/body/merge: failed acknowledgements or post-read drift require read-only reconciliation, never a blind mutation retry or reopening an issue.
|
|
113
|
+
|
|
114
|
+
If GitHub creates a draft but association verification fails, the diagnostic reports the created PR identity and the unresolved post-publication phase. Inspect that exact PR read-only before any further action; creation is not repeated to repair an association. A body containing closing words alone never proves the native association.
|
|
115
|
+
|
|
67
116
|
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.
|
|
68
117
|
|
|
69
118
|
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.
|
|
@@ -95,7 +144,30 @@ the managed version units for recovery and uses Claude Code's `--keep-data`.
|
|
|
95
144
|
Every command supports `--dry-run` and `--json`. Dry-run reports the target
|
|
96
145
|
without fetching an archive, running a native command, or writing configuration.
|
|
97
146
|
Doctor reports managed installation and source integrity, skills, and a direct
|
|
98
|
-
stdio startup check of the selected bundled MCP server.
|
|
147
|
+
credential-free stdio startup check of the selected bundled MCP server. Startup
|
|
148
|
+
means that the server initialized and listed its tools; it does not validate
|
|
149
|
+
user settings, receive GitHub credentials, or authenticate either delivery role.
|
|
150
|
+
For an opt-in authentication check, select a repository explicitly:
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
ai-delivery --repo example/widget plugin doctor --host codex --scope user --check-auth --json
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This checks settings and required process references before running the verified,
|
|
157
|
+
enabled plugin's selected CLI `config:resolve`. It reports authenticated actors,
|
|
158
|
+
repository access and visible review rules separately. Only configured credential
|
|
159
|
+
names and required runtime selectors reach that subprocess; an absent default
|
|
160
|
+
`GH_TOKEN` may use the selected machine session. Unrelated tokens and
|
|
161
|
+
legacy personal overrides do not. Missing or invalid inputs stop before key
|
|
162
|
+
access or network authentication. An eligible machine route is explicitly
|
|
163
|
+
authenticated through `gh` and the selected client after those gates. Dry-run
|
|
164
|
+
performs none of these checks.
|
|
165
|
+
The readback is labelled `selected_runtime_cli`; it does not prove GUI credential
|
|
166
|
+
propagation or counted exact-head approval. `config:resolve` remains available
|
|
167
|
+
for direct CLI readback; check an actual native tool call separately. The
|
|
168
|
+
[credential and readiness guide](plugins/ai-delivery/README.md#credentials-and-readiness)
|
|
169
|
+
explains the environment boundary and the evidence to retain without secrets.
|
|
170
|
+
Restart the native host
|
|
99
171
|
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.
|
|
100
172
|
|
|
101
173
|
First read `config:resolve` with the configured author, then stage a reviewed
|
|
@@ -174,6 +246,49 @@ Legacy transitions remain explicit preservation operations. Inspection returns e
|
|
|
174
246
|
|
|
175
247
|
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.
|
|
176
248
|
|
|
249
|
+
## Blocker overrides and delivery health
|
|
250
|
+
|
|
251
|
+
`create`, `start` and `update` accept `--blocks <issue-numbers>` to add the
|
|
252
|
+
selected issue as a native blocker of named dependents. This preserves those
|
|
253
|
+
dependents' other blockers. `--blocked-by` retains its exact-set replacement
|
|
254
|
+
semantics. The corresponding MCP inputs are `blocks` and `blockedBy`.
|
|
255
|
+
|
|
256
|
+
A genuinely new blocker on configured-Project **In Progress** work requires
|
|
257
|
+
`--override-reason <reason>` / `overrideReason` (1–2,000 trimmed characters).
|
|
258
|
+
The configured author must authenticate, and an author-verified comment must
|
|
259
|
+
precede the native edge. Existing edges and removals require no override.
|
|
260
|
+
Unresolved dependent status refuses additions. Creation preflights existing
|
|
261
|
+
dependents before creating the new issue. A retry reuses the same verified
|
|
262
|
+
comment for the same native removal episode; a later remove/re-add records a
|
|
263
|
+
new episode. Comments record intent, not successful dependency writes.
|
|
264
|
+
|
|
265
|
+
GitHub does not atomically lock status, comments and relationships. Every actual
|
|
266
|
+
addition is rechecked at its write boundary. A later failure can follow earlier
|
|
267
|
+
writes; inspect native state and resume the known issue rather than recreate it.
|
|
268
|
+
If creation partially succeeds, the existing known-created recovery identifies
|
|
269
|
+
that issue. Low-level exported relationship primitives remain available to
|
|
270
|
+
callers that own their own policy; the guard applies to canonical issue writes.
|
|
271
|
+
|
|
272
|
+
```sh
|
|
273
|
+
ai-delivery --repo example/widget update --issue 17 --blocked-by 18 --override-reason 'Await prerequisite validation'
|
|
274
|
+
ai-delivery --repo example/widget health --from 2026-10-01T00:00:00Z --to 2026-10-08T00:00:00Z
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
`delivery_health` / `health` requires an explicit repository and UTC `[from,to)`
|
|
278
|
+
window. It reports distinct issues opened and closed, current open In Progress
|
|
279
|
+
work in that repository lane of the configured Project, oldest active issues by
|
|
280
|
+
creation time, and distinct native blocker additions classified by proven
|
|
281
|
+
historical Project membership and status. Reopen/reclose counts one closed issue
|
|
282
|
+
per window. Unknown history is separate and never a violation verdict. Age is
|
|
283
|
+
since issue creation, not time spent in progress.
|
|
284
|
+
|
|
285
|
+
The window must end at or before collection time. The read-only snapshot is non-atomic and records collection timestamps. Defaults
|
|
286
|
+
are 200 issues, five timeline pages per issue, five Project item pages per
|
|
287
|
+
status read and ten oldest issues; bounds are 500 issues, 20 pages per read
|
|
288
|
+
and 20 oldest issues. `--max-project-pages` bounds Project status collection. Limits and read failures
|
|
289
|
+
produce explicit partial **observed** counts, not complete zeroes. Issues whose
|
|
290
|
+
current Project status cannot be resolved have a separate unknown count.
|
|
291
|
+
|
|
177
292
|
## Typed issue journals
|
|
178
293
|
|
|
179
294
|
`issue_comment` posts a typed journal through the configured author role. The public
|
|
@@ -202,12 +317,12 @@ operator's machine. Validation requires HTTPS with a DNS hostname; it rejects
|
|
|
202
317
|
file paths, credential-bearing URLs, IP literals, localhost and `.local` names.
|
|
203
318
|
It does not probe remote reachability. Each kind also requires these fields:
|
|
204
319
|
|
|
205
|
-
| Kind
|
|
206
|
-
|
|
|
207
|
-
| `start`
|
|
208
|
-
| `progress` | `done` (nonempty list), `decisionNeeded`; at least one evidence link
|
|
209
|
-
| `decision` | `decision`, `rationale`
|
|
210
|
-
| `blocker`
|
|
320
|
+
| Kind | Required fields |
|
|
321
|
+
| ---------- | ----------------------------------------------------------------------------------------- |
|
|
322
|
+
| `start` | `outcome` |
|
|
323
|
+
| `progress` | `done` (nonempty list), `decisionNeeded`; at least one evidence link |
|
|
324
|
+
| `decision` | `decision`, `rationale` |
|
|
325
|
+
| `blocker` | `blocker`, `resolution` |
|
|
211
326
|
| `closeout` | `acceptance` (nonempty `{criterion, evidence}` list), `followUps` (list; empty when none) |
|
|
212
327
|
|
|
213
328
|
Optional `details` adds supporting prose. `lengthCap` (600–10,000 characters,
|
package/dist/agent.d.ts
CHANGED
|
@@ -19,3 +19,5 @@ export type { DeliveryRouting, DiscoveryClients } from './github/discovery.js';
|
|
|
19
19
|
export type { DeliveryOverrides, DeliveryPolicySettings, LoadedDeliverySettings } from './config/deliveryConfig.js';
|
|
20
20
|
export { stageRuntime, admitRuntime, RuntimeAdmissionCommitUnknownError } from './setup.js';
|
|
21
21
|
export type { StageRuntimeInput, AdmitRuntimeInput, RuntimeStageResult } from './setup.js';
|
|
22
|
+
export { deliveryHealth } from './services/deliveryHealthService.js';
|
|
23
|
+
export type { DeliveryHealthRequest } from './services/deliveryHealthService.js';
|
package/dist/agent.js
CHANGED
|
@@ -12,4 +12,5 @@ export { normalizeLegacyIssue, planOfflineLegacyIssueMigration } from './service
|
|
|
12
12
|
export { withVerificationFilesystemFixture } from './verification.js';
|
|
13
13
|
export { discoverDeliveryRouting } from './github/discovery.js';
|
|
14
14
|
export { stageRuntime, admitRuntime, RuntimeAdmissionCommitUnknownError } from './setup.js';
|
|
15
|
+
export { deliveryHealth } from './services/deliveryHealthService.js';
|
|
15
16
|
//# sourceMappingURL=agent.js.map
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACpH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAItD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EA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,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAIhE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAG5F,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { test } from 'vitest';
|
|
6
|
+
import { evaluateAgentReadiness } from './agent.js';
|
|
7
|
+
import { IssueFields, renderIssueBody } from './issueContract.js';
|
|
8
|
+
function fixture() {
|
|
9
|
+
return IssueFields.parse({
|
|
10
|
+
title: 'Reject invalid widget identifiers before persistence',
|
|
11
|
+
points: 2,
|
|
12
|
+
problem: 'The Project Todo column tracks work; TODO/TBD are literal documentation.',
|
|
13
|
+
outcome: 'Reject malformed widget identifiers.',
|
|
14
|
+
acceptanceCriteria: [
|
|
15
|
+
{
|
|
16
|
+
behavior: 'An invalid widget identifier returns an error without a write.',
|
|
17
|
+
verifiedBy: 'A synthetic mock asserts no write.',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
outOfScope: ['Changing storage.'],
|
|
21
|
+
context: { files: ['src/absent.ts'], components: [], evidence: [] },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function evaluate(overrides = {}) {
|
|
25
|
+
const issue = fixture();
|
|
26
|
+
return evaluateAgentReadiness({
|
|
27
|
+
title: issue.title,
|
|
28
|
+
body: renderIssueBody(issue),
|
|
29
|
+
points: 2,
|
|
30
|
+
repoRoot: undefined,
|
|
31
|
+
...overrides,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
test('readiness from a non-git directory accepts Todo prose, absent paths and portable non-command verification', () => {
|
|
35
|
+
const prior = process.cwd();
|
|
36
|
+
const root = mkdtempSync(join(tmpdir(), 'typed-readiness-'));
|
|
37
|
+
try {
|
|
38
|
+
process.chdir(root);
|
|
39
|
+
const result = evaluate();
|
|
40
|
+
assert.equal(result.ready, true);
|
|
41
|
+
assert.deepEqual(result.failures, []);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
process.chdir(prior);
|
|
45
|
+
rmSync(root, { recursive: true, force: true });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
test('one or eight observable criteria are valid; count warns above seven', () => {
|
|
49
|
+
for (const count of [1, 8]) {
|
|
50
|
+
const issue = fixture();
|
|
51
|
+
issue.acceptanceCriteria = Array.from({ length: count }, () => ({ ...issue.acceptanceCriteria[0] }));
|
|
52
|
+
const result = evaluate({ body: renderIssueBody(issue) });
|
|
53
|
+
assert.equal(result.ready, true);
|
|
54
|
+
assert.equal(result.warnings.some((w) => w.code === 'many-criteria'), count === 8);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
for (const [name, override, code] of [
|
|
58
|
+
['missing live Points', { points: undefined }, 'points'],
|
|
59
|
+
['open native blocker', { blockedBy: [17] }, 'blocked'],
|
|
60
|
+
['tracking parent', { trackingParent: true }, 'tracking-parent'],
|
|
61
|
+
])
|
|
62
|
+
test(name + ' blocks independently of a valid body', () => {
|
|
63
|
+
const result = evaluate(override);
|
|
64
|
+
assert.equal(result.ready, false);
|
|
65
|
+
assert.ok(result.failures.some((f) => f.code === code));
|
|
66
|
+
});
|
|
67
|
+
test('draft and structured open questions block even without TODO markers', () => {
|
|
68
|
+
for (const changed of [{ draft: true }, { openQuestions: ['Select the persistence contract.'] }]) {
|
|
69
|
+
const issue = { ...fixture(), ...changed };
|
|
70
|
+
assert.equal(evaluate({ body: renderIssueBody(issue) }).ready, false);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
test('native Points drift and visible/payload divergence cannot pass canonical readiness', () => {
|
|
74
|
+
assert.ok(evaluate({ points: 3 }).failures.some((f) => f.code === 'points.sync'));
|
|
75
|
+
assert.ok(evaluate({ body: renderIssueBody(fixture()).replace('## Status', '## Changed status') }).failures.some((f) => f.code === 'body.canonical'));
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=agentReadiness.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentReadiness.test.js","sourceRoot":"","sources":["../src/agentReadiness.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElE,SAAS,OAAO;IACd,OAAO,WAAW,CAAC,KAAK,CAAC;QACvB,KAAK,EAAE,sDAAsD;QAC7D,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,0EAA0E;QACnF,OAAO,EAAE,sCAAsC;QAC/C,kBAAkB,EAAE;YAClB;gBACE,QAAQ,EAAE,gEAAgE;gBAC1E,UAAU,EAAE,oCAAoC;aACjD;SACF;QACD,UAAU,EAAE,CAAC,mBAAmB,CAAC;QACjC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,E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