@aviaratech/ai-delivery 0.3.41 → 0.3.43
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/README.md +7 -1
- package/dist/agentReadiness.test.js +15 -0
- package/dist/agentReadiness.test.js.map +2 -2
- package/dist/callerErrors.test.js +11 -1
- package/dist/callerErrors.test.js.map +2 -2
- package/dist/contributorChecks.test.js +4 -1
- package/dist/contributorChecks.test.js.map +2 -2
- package/dist/currentConsumer.test.js +3 -2
- package/dist/currentConsumer.test.js.map +2 -2
- package/dist/currentTrackingScenario.test.js +3 -2
- package/dist/currentTrackingScenario.test.js.map +2 -2
- package/dist/fixtures/builderReady.d.ts +82 -0
- package/dist/fixtures/builderReady.js +56 -0
- package/dist/fixtures/builderReady.js.map +7 -0
- package/dist/fixtures/inertTarget.d.ts +75 -0
- package/dist/fixtures/inertTarget.js +20 -15
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/fixtures/issue63.d.ts +96 -0
- package/dist/fixtures/issue63.js +21 -2
- package/dist/fixtures/issue63.js.map +2 -2
- package/dist/fixtures/readView.d.ts +9 -1
- package/dist/fixtures/readView.js +4 -0
- package/dist/fixtures/readView.js.map +2 -2
- package/dist/issue.d.ts +2 -2
- package/dist/issue.js +96 -27
- package/dist/issue.js.map +2 -2
- package/dist/issue63Routes.test.js +3 -3
- package/dist/issue63Routes.test.js.map +2 -2
- package/dist/issueBlockerGuard.test.js +5 -5
- package/dist/issueBlockerGuard.test.js.map +2 -2
- package/dist/issueContract.d.ts +242 -2
- package/dist/issueContract.js +147 -28
- package/dist/issueContract.js.map +2 -2
- package/dist/issueContract.test.d.ts +20 -0
- package/dist/issueContract.test.js +210 -13
- package/dist/issueContract.test.js.map +2 -2
- package/dist/issueDates.test.js +5 -6
- package/dist/issueDates.test.js.map +2 -2
- package/dist/issueInfoReadback.test.js +144 -7
- package/dist/issueInfoReadback.test.js.map +2 -2
- package/dist/issueIntake.test.js +201 -33
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueJournal.js +4 -2
- package/dist/issueJournal.js.map +2 -2
- package/dist/issueJournal.test.js +22 -0
- package/dist/issueJournal.test.js.map +2 -2
- package/dist/issueTracking.test.js +4 -1
- package/dist/issueTracking.test.js.map +2 -2
- package/dist/issueWriteRecovery.test.js +12 -12
- package/dist/issueWriteRecovery.test.js.map +2 -2
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/index.js.map +2 -2
- package/dist/mcp/tools.d.ts +155 -5
- package/dist/mcp/tools.js +136 -103
- package/dist/mcp/tools.js.map +2 -2
- package/dist/pluginPackaging.test.js +6 -3
- package/dist/pluginPackaging.test.js.map +2 -2
- package/dist/pr.d.ts +2 -0
- package/dist/pr.js +28 -3
- package/dist/pr.js.map +2 -2
- package/dist/pr.test.js +0 -7
- package/dist/pr.test.js.map +2 -2
- package/dist/prAssociation.test.js +82 -9
- package/dist/prAssociation.test.js.map +2 -2
- package/dist/projectNumbers.test.js +1 -1
- package/dist/projectNumbers.test.js.map +1 -1
- package/dist/readView.d.ts +32 -3
- package/dist/readView.js +29 -12
- package/dist/readView.js.map +2 -2
- package/dist/readView.test.js +63 -1
- package/dist/readView.test.js.map +2 -2
- package/dist/releaseWorkflow.test.js +2 -2
- package/dist/releaseWorkflow.test.js.map +2 -2
- package/dist/review.d.ts +8 -0
- package/dist/review.js +30 -2
- package/dist/review.js.map +2 -2
- package/dist/review.test.js +64 -1
- package/dist/review.test.js.map +2 -2
- package/dist/services/agentReadinessService.d.ts +2 -1
- package/dist/services/agentReadinessService.js +6 -0
- package/dist/services/agentReadinessService.js.map +2 -2
- package/dist/stdoutRegression.test.js +27 -15
- package/dist/stdoutRegression.test.js.map +2 -2
- package/dist/targetPolicyEntrypoints.test.js +1 -1
- package/dist/targetPolicyEntrypoints.test.js.map +2 -2
- package/dist/targetPolicyRoutes.test.js +1 -1
- package/dist/targetPolicyRoutes.test.js.map +2 -2
- package/dist/targetRepositoryExecution.test.js +11 -3
- package/dist/targetRepositoryExecution.test.js.map +2 -2
- package/dist/toolOutput.test.js +14 -0
- package/dist/toolOutput.test.js.map +2 -2
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +130 -124
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +1 -11
- package/plugins/ai-delivery/skills/ticket-design/SKILL.md +29 -0
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@ ai-delivery handles **GitHub issues, pull requests and independent reviews** thr
|
|
|
4
4
|
|
|
5
5
|
Explicit `--repo owner/name` or MCP `repo: "owner/name"` works outside Git. Without it, the checkout's `origin` selects the repository. Only `github.com` is supported. The runtime reads operator-owned JSON; it never executes a consuming repository's policy or checks.
|
|
6
6
|
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
In scope. ai-delivery is the only writer of the work-item standard: the issue contract (create, update, ready check, parents, sub-issues, blockers, milestones); work-item state (Project Status, Points, Priority, issue type, dates, `area:`/`risk:` labels); journals; linking an issue to its branch and PR; independent review under the reviewer App; one-call reads agents need to act; a ticket-design skill for builder-ready issues; drift detection and repair.
|
|
10
|
+
|
|
11
|
+
Out of scope. Checks and CI (repo-owned); worktrees and local git (host-owned); merge timing (the merge itself is `gh pr merge` at the reviewed head, with eligibility from GitHub rulesets); releases and deploys; generic GitHub reads (plain `gh`); agent orchestration. Install and doctor code stays but gains no features.
|
|
12
|
+
|
|
7
13
|
## Installation and runtime
|
|
8
14
|
|
|
9
15
|
Use Node **24.21.0** and npm **11.19.0** for CLI/MCP and contributor checks; public library consumers also support Node **26.2.0**. Install a qualified published version or reviewed archive. The [complete plugin](plugins/ai-delivery/README.md) is the canonical native installation; CLI/SDK/MCP entrypoints remain available.
|
|
@@ -111,4 +117,4 @@ Release still requires the exact mandatory archive inventory, complete release/c
|
|
|
111
117
|
|
|
112
118
|
Release is manual, main-only and uses npm trusted publishing. A packaged README edit changes the release candidate: retain accepted archives and independently qualify the new exact source/archive before dispatching.
|
|
113
119
|
|
|
114
|
-
Source version **0.3.
|
|
120
|
+
Source version **0.3.43** and green PR checks do not establish its qualification; see [#199](https://github.com/aviaratech/ai-delivery/issues/199). Wrappers and workflow definitions do not prove [#200](https://github.com/aviaratech/ai-delivery/issues/200)'s **under-60-second regular checks / under-five-minute qualification** targets. Functional removals and remaining documentation obligations stay with [#201](https://github.com/aviaratech/ai-delivery/issues/201).
|
|
@@ -5,9 +5,11 @@ import { join } from "node:path";
|
|
|
5
5
|
import { test } from "vitest";
|
|
6
6
|
import { evaluateAgentReadiness } from "./agent.js";
|
|
7
7
|
import { IssueFields, renderIssueBody } from "./issueContract.js";
|
|
8
|
+
import { builderReady } from "./fixtures/builderReady.js";
|
|
8
9
|
function fixture() {
|
|
9
10
|
return IssueFields.parse({
|
|
10
11
|
title: "Reject invalid widget identifiers before persistence",
|
|
12
|
+
issueType: "Task",
|
|
11
13
|
points: 2,
|
|
12
14
|
problem: "The Project Todo column tracks work; TODO/TBD are literal documentation.",
|
|
13
15
|
outcome: "Reject malformed widget identifiers.",
|
|
@@ -27,6 +29,8 @@ function evaluate(overrides = {}) {
|
|
|
27
29
|
title: issue.title,
|
|
28
30
|
body: renderIssueBody(issue),
|
|
29
31
|
points: 2,
|
|
32
|
+
priority: "High",
|
|
33
|
+
issueType: "Task",
|
|
30
34
|
repoRoot: void 0,
|
|
31
35
|
...overrides
|
|
32
36
|
});
|
|
@@ -58,6 +62,8 @@ test("one or eight observable criteria are valid; count warns above seven", () =
|
|
|
58
62
|
});
|
|
59
63
|
for (const [name, override, code] of [
|
|
60
64
|
["missing live Points", { points: void 0 }, "points"],
|
|
65
|
+
["missing live Priority", { priority: void 0 }, "priority"],
|
|
66
|
+
["missing live issue type", { issueType: void 0 }, "issue-type"],
|
|
61
67
|
["open native blocker", { blockedBy: [17] }, "blocked"],
|
|
62
68
|
["tracking parent", { trackingParent: true }, "tracking-parent"]
|
|
63
69
|
])
|
|
@@ -80,4 +86,13 @@ test("native Points drift and visible/payload divergence cannot pass canonical r
|
|
|
80
86
|
)
|
|
81
87
|
);
|
|
82
88
|
});
|
|
89
|
+
test("a legacy Ready issue without builder is ready and warns builder.unset; a builder-ready one does not", () => {
|
|
90
|
+
const legacy = evaluate();
|
|
91
|
+
assert.equal(legacy.ready, true);
|
|
92
|
+
assert.ok(legacy.warnings.some((w) => w.code === "builder.unset"));
|
|
93
|
+
const built = builderReady();
|
|
94
|
+
const result = evaluate({ title: built.title, body: renderIssueBody(built) });
|
|
95
|
+
assert.equal(result.ready, true);
|
|
96
|
+
assert.deepEqual(result.warnings, []);
|
|
97
|
+
});
|
|
83
98
|
//# sourceMappingURL=agentReadiness.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/agentReadiness.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { test } from 'vitest';\nimport { evaluateAgentReadiness } from './agent.js';\nimport { IssueFields, renderIssueBody } from './issueContract.js';\n\nfunction fixture() {\n return IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n points: 2,\n problem: 'The Project Todo column tracks work; TODO/TBD are literal documentation.',\n outcome: 'Reject malformed widget identifiers.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a write.',\n verifiedBy: 'A synthetic mock asserts no write.',\n },\n ],\n outOfScope: ['Changing storage.'],\n context: { files: ['src/absent.ts'], components: [], evidence: [] },\n });\n}\nfunction evaluate(overrides: Partial<Parameters<typeof evaluateAgentReadiness>[0]> = {}) {\n const issue = fixture();\n return evaluateAgentReadiness({\n title: issue.title,\n body: renderIssueBody(issue),\n points: 2,\n repoRoot: undefined,\n ...overrides,\n });\n}\n\ntest('readiness from a non-git directory accepts Todo prose, absent paths and portable non-command verification', () => {\n const prior = process.cwd();\n const root = mkdtempSync(join(tmpdir(), 'typed-readiness-'));\n try {\n process.chdir(root);\n const result = evaluate();\n assert.equal(result.ready, true);\n assert.deepEqual(result.failures, []);\n } finally {\n process.chdir(prior);\n rmSync(root, { recursive: true, force: true });\n }\n});\ntest('one or eight observable criteria are valid; count warns above seven', () => {\n for (const count of [1, 8]) {\n const issue = fixture();\n issue.acceptanceCriteria = Array.from({ length: count }, () => ({ ...issue.acceptanceCriteria[0]! }));\n const result = evaluate({ body: renderIssueBody(issue) });\n assert.equal(result.ready, true);\n assert.equal(\n result.warnings.some((w) => w.code === 'many-criteria'),\n count === 8,\n );\n }\n});\nfor (const [name, override, code] of [\n ['missing live Points', { points: undefined }, 'points'],\n ['open native blocker', { blockedBy: [17] }, 'blocked'],\n ['tracking parent', { trackingParent: true }, 'tracking-parent'],\n] as const)\n test(name + ' blocks independently of a valid body', () => {\n const result = evaluate(override);\n assert.equal(result.ready, false);\n assert.ok(result.failures.some((f) => f.code === code));\n });\ntest('draft and structured open questions block even without TODO markers', () => {\n for (const changed of [{ draft: true }, { openQuestions: ['Select the persistence contract.'] }]) {\n const issue = { ...fixture(), ...changed };\n assert.equal(evaluate({ body: renderIssueBody(issue) }).ready, false);\n }\n});\ntest('native Points drift and visible/payload divergence cannot pass canonical readiness', () => {\n assert.ok(evaluate({ points: 3 }).failures.some((f) => f.code === 'points.sync'));\n assert.ok(\n evaluate({ body: renderIssueBody(fixture()).replace('## Status', '## Changed status') }).failures.some(\n (f) => f.code === 'body.canonical',\n ),\n );\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,8BAA8B;AACvC,SAAS,aAAa,uBAAuB;
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { test } from 'vitest';\nimport { evaluateAgentReadiness } from './agent.js';\nimport { IssueFields, renderIssueBody } from './issueContract.js';\nimport { builderReady } from './fixtures/builderReady.js';\n\nfunction fixture() {\n return IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n issueType: 'Task',\n points: 2,\n problem: 'The Project Todo column tracks work; TODO/TBD are literal documentation.',\n outcome: 'Reject malformed widget identifiers.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a write.',\n verifiedBy: 'A synthetic mock asserts no write.',\n },\n ],\n outOfScope: ['Changing storage.'],\n context: { files: ['src/absent.ts'], components: [], evidence: [] },\n });\n}\nfunction evaluate(overrides: Partial<Parameters<typeof evaluateAgentReadiness>[0]> = {}) {\n const issue = fixture();\n return evaluateAgentReadiness({\n title: issue.title,\n body: renderIssueBody(issue),\n points: 2,\n priority: 'High',\n issueType: 'Task',\n repoRoot: undefined,\n ...overrides,\n });\n}\n\ntest('readiness from a non-git directory accepts Todo prose, absent paths and portable non-command verification', () => {\n const prior = process.cwd();\n const root = mkdtempSync(join(tmpdir(), 'typed-readiness-'));\n try {\n process.chdir(root);\n const result = evaluate();\n assert.equal(result.ready, true);\n assert.deepEqual(result.failures, []);\n } finally {\n process.chdir(prior);\n rmSync(root, { recursive: true, force: true });\n }\n});\ntest('one or eight observable criteria are valid; count warns above seven', () => {\n for (const count of [1, 8]) {\n const issue = fixture();\n issue.acceptanceCriteria = Array.from({ length: count }, () => ({ ...issue.acceptanceCriteria[0]! }));\n const result = evaluate({ body: renderIssueBody(issue) });\n assert.equal(result.ready, true);\n assert.equal(\n result.warnings.some((w) => w.code === 'many-criteria'),\n count === 8,\n );\n }\n});\nfor (const [name, override, code] of [\n ['missing live Points', { points: undefined }, 'points'],\n ['missing live Priority', { priority: undefined }, 'priority'],\n ['missing live issue type', { issueType: undefined }, 'issue-type'],\n ['open native blocker', { blockedBy: [17] }, 'blocked'],\n ['tracking parent', { trackingParent: true }, 'tracking-parent'],\n] as const)\n test(name + ' blocks independently of a valid body', () => {\n const result = evaluate(override);\n assert.equal(result.ready, false);\n assert.ok(result.failures.some((f) => f.code === code));\n });\ntest('draft and structured open questions block even without TODO markers', () => {\n for (const changed of [{ draft: true }, { openQuestions: ['Select the persistence contract.'] }]) {\n const issue = { ...fixture(), ...changed };\n assert.equal(evaluate({ body: renderIssueBody(issue) }).ready, false);\n }\n});\ntest('native Points drift and visible/payload divergence cannot pass canonical readiness', () => {\n assert.ok(evaluate({ points: 3 }).failures.some((f) => f.code === 'points.sync'));\n assert.ok(\n evaluate({ body: renderIssueBody(fixture()).replace('## Status', '## Changed status') }).failures.some(\n (f) => f.code === 'body.canonical',\n ),\n );\n});\n\ntest('a legacy Ready issue without builder is ready and warns builder.unset; a builder-ready one does not', () => {\n const legacy = evaluate();\n assert.equal(legacy.ready, true);\n assert.ok(legacy.warnings.some((w) => w.code === 'builder.unset'));\n const built = builderReady();\n const result = evaluate({ title: built.title, body: renderIssueBody(built) });\n assert.equal(result.ready, true);\n assert.deepEqual(result.warnings, []);\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,8BAA8B;AACvC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,oBAAoB;AAE7B,SAAS,UAAU;AACjB,SAAO,YAAY,MAAM;AAAA,IACvB,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,oBAAoB;AAAA,MAClB;AAAA,QACE,UAAU;AAAA,QACV,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IACA,YAAY,CAAC,mBAAmB;AAAA,IAChC,SAAS,EAAE,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EAC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;AAC5E,SAAO,MAAM,OAAO,OAAO,IAAI;AAC/B,SAAO,UAAU,OAAO,UAAU,CAAC,CAAC;AACtC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,6 +7,8 @@ import { IssueValidationError } from "./issueContract.js";
|
|
|
7
7
|
import { executeTool } from "./dispatch.js";
|
|
8
8
|
import * as issues from "./issue.js";
|
|
9
9
|
import { createAiDeliveryMcpServer } from "./mcp/index.js";
|
|
10
|
+
import { getAiDeliveryMcpTool } from "./mcp/tools.js";
|
|
11
|
+
const accepted = (tool) => `Unknown argument key. Accepted keys: ${Object.keys(getAiDeliveryMcpTool(tool).inputSchema.shape).join(", ")}.`;
|
|
10
12
|
const cases = [
|
|
11
13
|
["issue_start", { title: "" }, "Issue title is empty; enter a title.", "too_small", ["title"]],
|
|
12
14
|
[
|
|
@@ -50,7 +52,15 @@ const cases = [
|
|
|
50
52
|
"Review artifact is empty; provide the independent review artifact JSON.",
|
|
51
53
|
"too_small",
|
|
52
54
|
["artifact"]
|
|
53
|
-
]
|
|
55
|
+
],
|
|
56
|
+
...["branch", "bodyFile"].map((key) => [
|
|
57
|
+
"issue_pr_create",
|
|
58
|
+
{ issueNumber: 17, [key]: "x" },
|
|
59
|
+
accepted("issue_pr_create"),
|
|
60
|
+
"unrecognized_keys",
|
|
61
|
+
[]
|
|
62
|
+
]),
|
|
63
|
+
["issue_create", { title: "Valid title here", foo: 1 }, accepted("issue_create"), "field.unknown", ["issue"]]
|
|
54
64
|
];
|
|
55
65
|
afterEach(() => vi.restoreAllMocks());
|
|
56
66
|
for (const [tool, input, message, code, path] of cases) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/callerErrors.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { afterEach, test, vi } from 'vitest';\nimport { z } from 'zod';\nimport { IssueValidationError } from './issueContract.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport type
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,WAAW,MAAM,UAAU;AACpC,SAAS,SAAS;AAClB,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,YAAY,YAAY;AACxB,SAAS,iCAAiC;
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { afterEach, test, vi } from 'vitest';\nimport { z } from 'zod';\nimport { IssueValidationError } from './issueContract.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport { getAiDeliveryMcpTool, type AiDeliveryMcpToolName } from './mcp/tools.js';\n\nconst accepted = (tool: AiDeliveryMcpToolName) =>\n `Unknown argument key. Accepted keys: ${Object.keys(getAiDeliveryMcpTool(tool)!.inputSchema.shape).join(', ')}.`;\n\nconst cases: [AiDeliveryMcpToolName, Record<string, unknown>, string, string, string[]][] = [\n ['issue_start', { title: '' }, 'Issue title is empty; enter a title.', 'too_small', ['title']],\n [\n 'issue_start',\n { title: 'x'.repeat(257) },\n 'Issue title exceeds 256 characters; shorten the title.',\n 'too_big',\n ['title'],\n ],\n [\n 'issue_update',\n { issueNumber: 17, closeReason: 'completed' },\n 'Closure details require a closed issue; set state to closed.',\n 'closure.state',\n ['state'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, head: 'one', headBranch: 'two' },\n 'PR head selectors disagree; use the same branch for head and headBranch.',\n 'custom',\n [],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, title: '' },\n 'PR title is empty; enter a title or omit it to use the issue title.',\n 'too_small',\n ['title'],\n ],\n [\n 'issue_pr_create',\n { issueNumber: 17, body: '' },\n 'PR body is empty; enter a body or omit it to use the default body.',\n 'too_small',\n ['body'],\n ],\n [\n 'issue_pr_review',\n { issueNumber: 17, prNumber: 23, artifact: '' },\n 'Review artifact is empty; provide the independent review artifact JSON.',\n 'too_small',\n ['artifact'],\n ],\n ...(['branch', 'bodyFile'] as const).map((key): (typeof cases)[number] => [\n 'issue_pr_create',\n { issueNumber: 17, [key]: 'x' },\n accepted('issue_pr_create'),\n 'unrecognized_keys',\n [],\n ]),\n ['issue_create', { title: 'Valid title here', foo: 1 }, accepted('issue_create'), 'field.unknown', ['issue']],\n];\nafterEach(() => vi.restoreAllMocks());\n\nfor (const [tool, input, message, code, path] of cases) {\n test(`${tool}: ${message}`, async () => {\n const load = vi.spyOn(issues, 'loadDeliveryContext');\n await assert.rejects(executeTool(tool, input, { repoRoot: '/unrelated', repo: 'example/widget' }), (error) => {\n if (error instanceof IssueValidationError) {\n assert.deepEqual(\n error.failures.map(({ message, code, field }) => ({ message, code, path: [field] })),\n [{ message, code, path }],\n );\n return true;\n }\n assert.ok(error instanceof z.ZodError);\n assert.deepEqual(\n error.issues.slice(0, 1).map(({ message, code, path }) => ({ message, code, path })),\n [{ message, code, path }],\n );\n assert.deepEqual(error.issues.slice(1), []);\n return true;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: '/unrelated', repo: 'example/widget' });\n const client = new Client({ name: 'caller-errors', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const reply = await client.callTool({ name: tool, arguments: input });\n assert.equal(reply.isError, true);\n assert.ok(JSON.stringify(reply.content).includes(message));\n assert.equal(load.mock.calls.length, 0);\n } finally {\n await client.close();\n await server.close();\n }\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS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AAiB,SAAS,IAAI,CAAC;AACjE,UAAM,CAAC,iBAAiB,eAAe,IAAI,kBAAkB,iBAAiB;AAC9E,QAAI;AACF,YAAM,OAAO,QAAQ,eAAe;AACpC,YAAM,OAAO,QAAQ,eAAe;AACpC,YAAM,QAAQ,MAAM,OAAO,SAAS,EAAE,MAAM,MAAM,WAAW,MAAM,CAAC;AACpE,aAAO,MAAM,MAAM,SAAS,IAAI;AAChC,aAAO,GAAG,KAAK,UAAU,MAAM,OAAO,EAAE,SAAS,OAAO,CAAC;AACzD,aAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,CAAC;AAAA,IACxC,UAAE;AACA,YAAM,OAAO,MAAM;AACnB,YAAM,OAAO,MAAM;AAAA,IACrB;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": ["message", "code", "path"]
|
|
7
7
|
}
|
|
@@ -1049,7 +1049,10 @@ function qualificationFixture() {
|
|
|
1049
1049
|
packageVersion: contract.packageVersion,
|
|
1050
1050
|
inventorySha256: consumerProof.sha256(JSON.stringify(inventory)),
|
|
1051
1051
|
inventory,
|
|
1052
|
-
skills: ["intake-create", "worktree-lifecycle", "pr-handoff"].map((path) => ({
|
|
1052
|
+
skills: ["intake-create", "ticket-design", "worktree-lifecycle", "pr-handoff"].map((path) => ({
|
|
1053
|
+
path,
|
|
1054
|
+
sha256: "a".repeat(64)
|
|
1055
|
+
}))
|
|
1053
1056
|
};
|
|
1054
1057
|
};
|
|
1055
1058
|
const produce = async ({ resultsDir, release, signal }) => {
|