@aviaratech/ai-delivery 0.3.39 → 0.3.41
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 +2 -0
- package/README.md +1 -1
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +2 -2
- package/dist/dispatch.js +7 -0
- package/dist/dispatch.js.map +2 -2
- package/dist/fixtures/inertTarget.d.ts +33 -0
- package/dist/fixtures/inertTarget.js +42 -0
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/github/commandIdentityPolicy.js +1 -0
- package/dist/github/commandIdentityPolicy.js.map +2 -2
- package/dist/github/projectNumbers.d.ts +30 -0
- package/dist/github/projectNumbers.js +87 -0
- package/dist/github/projectNumbers.js.map +7 -0
- package/dist/issue.d.ts +4 -1
- package/dist/issue.js +50 -4
- package/dist/issue.js.map +2 -2
- package/dist/issueWriteRecovery.test.js +35 -0
- package/dist/issueWriteRecovery.test.js.map +2 -2
- package/dist/mcp/tools.d.ts +13 -0
- package/dist/mcp/tools.js +14 -1
- package/dist/mcp/tools.js.map +2 -2
- package/dist/milestone.d.ts +20 -0
- package/dist/milestone.js +41 -0
- package/dist/milestone.js.map +7 -0
- package/dist/milestone.test.d.ts +1 -0
- package/dist/milestone.test.js +101 -0
- package/dist/milestone.test.js.map +7 -0
- package/dist/projectNumbers.test.d.ts +1 -0
- package/dist/projectNumbers.test.js +114 -0
- package/dist/projectNumbers.test.js.map +7 -0
- package/dist/releaseSmoke.test.d.ts +1 -0
- package/dist/releaseSmoke.test.js +73 -0
- package/dist/releaseSmoke.test.js.map +7 -0
- package/dist/targetRepositoryExecution.test.js +6 -0
- package/dist/targetRepositoryExecution.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 +106 -93
- package/plugins/ai-delivery/runtime/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "vitest";
|
|
3
|
+
import { getAiDeliveryMcpTool } from "./mcp/tools.js";
|
|
4
|
+
import { projectTradePatch, readProjectTradeFieldIds, setProjectTradeNumbers } from "./github/projectNumbers.js";
|
|
5
|
+
import { inertTarget } from "./fixtures/inertTarget.js";
|
|
6
|
+
const EXPECTED = { id: "F_EXPECTED", name: "Expected trades/day", dataType: "NUMBER" };
|
|
7
|
+
const MEASURED = { id: "F_MEASURED", name: "Measured trades/day", dataType: "NUMBER" };
|
|
8
|
+
function fakeProject(options = {}) {
|
|
9
|
+
const values = /* @__PURE__ */ new Map([["F_MEASURED", 7]]);
|
|
10
|
+
const mutations = [];
|
|
11
|
+
const graphql = (async (query, variables) => {
|
|
12
|
+
if (query.includes("ProjectNumberFields"))
|
|
13
|
+
return { node: { fields: { nodes: options.fields ?? [EXPECTED, MEASURED] } } };
|
|
14
|
+
if (query.includes("SetProjectNumber") || query.includes("ClearProjectNumber")) {
|
|
15
|
+
const set = query.includes("SetProjectNumber");
|
|
16
|
+
mutations.push({ name: set ? "set" : "clear", variables });
|
|
17
|
+
if (options.stuck !== true) {
|
|
18
|
+
if (set) values.set(variables.fieldId, variables.value);
|
|
19
|
+
else values.delete(variables.fieldId);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const number = (id) => values.has(id) ? { number: values.get(id) } : null;
|
|
24
|
+
return { node: { expectedTradesPerDay: number("F_EXPECTED"), measuredTradesPerDay: number("F_MEASURED") } };
|
|
25
|
+
});
|
|
26
|
+
return { graphql, mutations };
|
|
27
|
+
}
|
|
28
|
+
async function write(project, patch) {
|
|
29
|
+
const fieldIds = await readProjectTradeFieldIds({
|
|
30
|
+
graphql: project.graphql,
|
|
31
|
+
keys: Object.keys(patch),
|
|
32
|
+
projectId: "PROJECT"
|
|
33
|
+
});
|
|
34
|
+
return setProjectTradeNumbers({ fieldIds, graphql: project.graphql, itemId: "ITEM", patch, projectId: "PROJECT" });
|
|
35
|
+
}
|
|
36
|
+
test("the helper writes and reads back the Project trades/day numbers", async () => {
|
|
37
|
+
const project = fakeProject();
|
|
38
|
+
const result = await write(project, projectTradePatch({ expectedTradesPerDay: 12.5 }));
|
|
39
|
+
assert.deepEqual(result, { expectedTradesPerDay: 12.5, measuredTradesPerDay: 7 });
|
|
40
|
+
assert.deepEqual(
|
|
41
|
+
project.mutations.map(({ name, variables }) => [name, variables.fieldId, variables.value]),
|
|
42
|
+
[["set", "F_EXPECTED", 12.5]],
|
|
43
|
+
"only the requested field is written; the other number is preserved"
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
test("a null trades/day number clears only that field", async () => {
|
|
47
|
+
const project = fakeProject();
|
|
48
|
+
const result = await write(project, projectTradePatch({ measuredTradesPerDay: null }));
|
|
49
|
+
assert.deepEqual(result, { expectedTradesPerDay: null, measuredTradesPerDay: null });
|
|
50
|
+
assert.deepEqual(
|
|
51
|
+
project.mutations.map(({ name }) => name),
|
|
52
|
+
["clear"]
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
test("the helper refuses a missing, duplicated or non-number Project field and a readback that differs", async () => {
|
|
56
|
+
const patch = { expectedTradesPerDay: 3 };
|
|
57
|
+
for (const fields of [[MEASURED], [EXPECTED, EXPECTED, MEASURED], [{ ...EXPECTED, dataType: "TEXT" }, MEASURED]])
|
|
58
|
+
await assert.rejects(
|
|
59
|
+
write(fakeProject({ fields }), patch),
|
|
60
|
+
/one Project number field named Expected trades\/day\. Add it to the Project as a Number field/u
|
|
61
|
+
);
|
|
62
|
+
await assert.rejects(write(fakeProject({ stuck: true }), patch), /Expected trades\/day readback differs/u);
|
|
63
|
+
});
|
|
64
|
+
test("the issue_update schema takes finite non-negative trades/day numbers and null; issue_batch_update refuses them", () => {
|
|
65
|
+
const schema = getAiDeliveryMcpTool("issue_update").inputSchema;
|
|
66
|
+
assert.ok(schema.safeParse({ issueNumber: 1, expectedTradesPerDay: 0, measuredTradesPerDay: null }).success);
|
|
67
|
+
for (const [key, value] of [
|
|
68
|
+
["expectedTradesPerDay", -1],
|
|
69
|
+
["measuredTradesPerDay", Number.NaN],
|
|
70
|
+
["expectedTradesPerDay", "3"]
|
|
71
|
+
])
|
|
72
|
+
assert.throws(() => schema.safeParse({ issueNumber: 1, [key]: value }), new RegExp(key, "u"));
|
|
73
|
+
const batch = getAiDeliveryMcpTool("issue_batch_update").inputSchema;
|
|
74
|
+
assert.throws(
|
|
75
|
+
() => batch.safeParse({ items: [{ issueNumber: 1, expectedTradesPerDay: 2 }] }),
|
|
76
|
+
/unrecognized fields/u
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
test("MCP issue_update sets the numbers alone without touching the issue, and after the fields in a mixed call", async () => {
|
|
80
|
+
const f = inertTarget();
|
|
81
|
+
const c = await f.connect();
|
|
82
|
+
try {
|
|
83
|
+
const only = await c.call("issue_update", { issueNumber: 17, expectedTradesPerDay: 4 });
|
|
84
|
+
assert.equal(only.response.isError, void 0, only.text);
|
|
85
|
+
assert.deepEqual(only.value.projectNumbers, { expectedTradesPerDay: 4, measuredTradesPerDay: null });
|
|
86
|
+
assert.equal(
|
|
87
|
+
f.calls.some((call) => call.name === "issues.update"),
|
|
88
|
+
false,
|
|
89
|
+
"a numbers-only call writes no issue field"
|
|
90
|
+
);
|
|
91
|
+
f.calls.length = 0;
|
|
92
|
+
const mixed = await c.call("issue_update", {
|
|
93
|
+
issueNumber: 17,
|
|
94
|
+
title: "Retitled for trades",
|
|
95
|
+
measuredTradesPerDay: 5
|
|
96
|
+
});
|
|
97
|
+
assert.equal(mixed.response.isError, void 0, mixed.text);
|
|
98
|
+
assert.deepEqual(mixed.value.projectNumbers, { expectedTradesPerDay: 4, measuredTradesPerDay: 5 });
|
|
99
|
+
const order = f.calls.map((call) => call.name);
|
|
100
|
+
assert.ok(order.indexOf("issues.update") < order.indexOf("SetProjectNumber"), order.join(", "));
|
|
101
|
+
f.calls.length = 0;
|
|
102
|
+
const plain = await c.call("issue_update", { issueNumber: 17, title: "Retitled again" });
|
|
103
|
+
assert.equal(plain.response.isError, void 0, plain.text);
|
|
104
|
+
assert.equal(plain.value.projectNumbers, void 0);
|
|
105
|
+
assert.equal(
|
|
106
|
+
f.calls.some((call) => call.name.includes("ProjectNumber")),
|
|
107
|
+
false,
|
|
108
|
+
"with no number given, the Project number fields are never read or written"
|
|
109
|
+
);
|
|
110
|
+
} finally {
|
|
111
|
+
await f.dispose(c);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=projectNumbers.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/projectNumbers.test.ts"],
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport type { graphql as GraphQLType } from '@octokit/graphql';\nimport { getAiDeliveryMcpTool } from './mcp/tools.js';\nimport { projectTradePatch, readProjectTradeFieldIds, setProjectTradeNumbers } from './github/projectNumbers.js';\nimport { inertTarget } from './fixtures/inertTarget.js';\n\nconst EXPECTED = { id: 'F_EXPECTED', name: 'Expected trades/day', dataType: 'NUMBER' };\nconst MEASURED = { id: 'F_MEASURED', name: 'Measured trades/day', dataType: 'NUMBER' };\n\n/** A Project item holding one number per field name; records every mutation it receives. */\nfunction fakeProject(options: { fields?: object[]; stuck?: boolean } = {}) {\n const values = new Map<string, number>([['F_MEASURED', 7]]);\n const mutations: { name: string; variables: Record<string, unknown> }[] = [];\n const graphql = (async (query: string, variables: Record<string, unknown>) => {\n if (query.includes('ProjectNumberFields'))\n return { node: { fields: { nodes: options.fields ?? [EXPECTED, MEASURED] } } };\n if (query.includes('SetProjectNumber') || query.includes('ClearProjectNumber')) {\n const set = query.includes('SetProjectNumber');\n mutations.push({ name: set ? 'set' : 'clear', variables });\n if (options.stuck !== true) {\n if (set) values.set(variables.fieldId as string, variables.value as number);\n else values.delete(variables.fieldId as string);\n }\n return {};\n }\n const number = (id: string) => (values.has(id) ? { number: values.get(id) } : null);\n return { node: { expectedTradesPerDay: number('F_EXPECTED'), measuredTradesPerDay: number('F_MEASURED') } };\n }) as unknown as typeof GraphQLType;\n return { graphql, mutations };\n}\n\nasync function write(project: ReturnType<typeof fakeProject>, patch: ReturnType<typeof projectTradePatch>) {\n const fieldIds = await readProjectTradeFieldIds({\n graphql: project.graphql,\n keys: Object.keys(patch) as ('expectedTradesPerDay' | 'measuredTradesPerDay')[],\n projectId: 'PROJECT',\n });\n return setProjectTradeNumbers({ fieldIds, graphql: project.graphql, itemId: 'ITEM', patch, projectId: 'PROJECT' });\n}\n\ntest('the helper writes and reads back the Project trades/day numbers', async () => {\n const project = fakeProject();\n const result = await write(project, projectTradePatch({ expectedTradesPerDay: 12.5 }));\n assert.deepEqual(result, { expectedTradesPerDay: 12.5, measuredTradesPerDay: 7 });\n assert.deepEqual(\n project.mutations.map(({ name, variables }) => [name, variables.fieldId, variables.value]),\n [['set', 'F_EXPECTED', 12.5]],\n 'only the requested field is written; the other number is preserved',\n );\n});\n\ntest('a null trades/day number clears only that field', async () => {\n const project = fakeProject();\n const result = await write(project, projectTradePatch({ measuredTradesPerDay: null }));\n assert.deepEqual(result, { expectedTradesPerDay: null, measuredTradesPerDay: null });\n assert.deepEqual(\n project.mutations.map(({ name }) => name),\n ['clear'],\n );\n});\n\ntest('the helper refuses a missing, duplicated or non-number Project field and a readback that differs', async () => {\n const patch = { expectedTradesPerDay: 3 };\n for (const fields of [[MEASURED], [EXPECTED, EXPECTED, MEASURED], [{ ...EXPECTED, dataType: 'TEXT' }, MEASURED]])\n await assert.rejects(\n write(fakeProject({ fields }), patch),\n /one Project number field named Expected trades\\/day\\. Add it to the Project as a Number field/u,\n );\n await assert.rejects(write(fakeProject({ stuck: true }), patch), /Expected trades\\/day readback differs/u);\n});\n\ntest('the issue_update schema takes finite non-negative trades/day numbers and null; issue_batch_update refuses them', () => {\n const schema = getAiDeliveryMcpTool('issue_update')!.inputSchema;\n assert.ok(schema.safeParse({ issueNumber: 1, expectedTradesPerDay: 0, measuredTradesPerDay: null }).success);\n for (const [key, value] of [\n ['expectedTradesPerDay', -1],\n ['measuredTradesPerDay', Number.NaN],\n ['expectedTradesPerDay', '3'],\n ] as const)\n assert.throws(() => schema.safeParse({ issueNumber: 1, [key]: value }), new RegExp(key, 'u'));\n // A batch item never writes the numbers, so it must not accept them and report success.\n const batch = getAiDeliveryMcpTool('issue_batch_update')!.inputSchema;\n assert.throws(\n () => batch.safeParse({ items: [{ issueNumber: 1, expectedTradesPerDay: 2 }] }),\n /unrecognized fields/u,\n );\n});\n\ntest('MCP issue_update sets the numbers alone without touching the issue, and after the fields in a mixed call', async () => {\n const f = inertTarget();\n const c = await f.connect();\n try {\n const only = await c.call('issue_update', { issueNumber: 17, expectedTradesPerDay: 4 });\n assert.equal(only.response.isError, undefined, only.text);\n assert.deepEqual(only.value!.projectNumbers, { expectedTradesPerDay: 4, measuredTradesPerDay: null });\n assert.equal(\n f.calls.some((call) => call.name === 'issues.update'),\n false,\n 'a numbers-only call writes no issue field',\n );\n\n f.calls.length = 0;\n const mixed = await c.call('issue_update', {\n issueNumber: 17,\n title: 'Retitled for trades',\n measuredTradesPerDay: 5,\n });\n assert.equal(mixed.response.isError, undefined, mixed.text);\n assert.deepEqual(mixed.value!.projectNumbers, { expectedTradesPerDay: 4, measuredTradesPerDay: 5 });\n const order = f.calls.map((call) => call.name);\n assert.ok(order.indexOf('issues.update') < order.indexOf('SetProjectNumber'), order.join(', '));\n\n f.calls.length = 0;\n const plain = await c.call('issue_update', { issueNumber: 17, title: 'Retitled again' });\n assert.equal(plain.response.isError, undefined, plain.text);\n assert.equal(plain.value!.projectNumbers, undefined);\n assert.equal(\n f.calls.some((call) => call.name.includes('ProjectNumber')),\n false,\n 'with no number given, the Project number fields are never read or written',\n );\n } finally {\n await f.dispose(c);\n }\n});\n"],
|
|
5
|
+
"mappings": "AAAA,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IAAI;AAC1D,WAAO,UAAU,MAAM,MAAO,gBAAgB,EAAE,sBAAsB,GAAG,sBAAsB,EAAE,CAAC;AAClG,UAAM,QAAQ,EAAE,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI;AAC7C,WAAO,GAAG,MAAM,QAAQ,eAAe,IAAI,MAAM,QAAQ,kBAAkB,GAAG,MAAM,KAAK,IAAI,CAAC;AAE9F,MAAE,MAAM,SAAS;AACjB,UAAM,QAAQ,MAAM,EAAE,KAAK,gBAAgB,EAAE,aAAa,IAAI,OAAO,iBAAiB,CAAC;AACvF,WAAO,MAAM,MAAM,SAAS,SAAS,QAAW,MAAM,IAAI;AAC1D,WAAO,MAAM,MAAM,MAAO,gBAAgB,MAAS;AACnD,WAAO;AAAA,MACL,EAAE,MAAM,KAAK,CAAC,SAAS,KAAK,KAAK,SAAS,eAAe,CAAC;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,EACF,UAAE;AACA,UAAM,EAAE,QAAQ,CAAC;AAAA,EACnB;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "vitest";
|
|
3
|
+
const { releaseSmoke } = await import(new URL("../scripts/release-smoke.mjs", import.meta.url).href);
|
|
4
|
+
function fakeCli(fail, readTitle) {
|
|
5
|
+
const calls = [];
|
|
6
|
+
let title = "";
|
|
7
|
+
let state = "open";
|
|
8
|
+
const cli = (args) => {
|
|
9
|
+
calls.push(args);
|
|
10
|
+
const command = args[0];
|
|
11
|
+
if (command === fail) throw new Error(`${command} unavailable`);
|
|
12
|
+
if (command === "create") {
|
|
13
|
+
title = args[args.indexOf("--title") + 1];
|
|
14
|
+
return { created: { number: 42 } };
|
|
15
|
+
}
|
|
16
|
+
if (command === "info") return { title: readTitle ?? title, state };
|
|
17
|
+
state = "closed";
|
|
18
|
+
return { state };
|
|
19
|
+
};
|
|
20
|
+
return { calls, cli };
|
|
21
|
+
}
|
|
22
|
+
const now = () => /* @__PURE__ */ new Date("2026-11-02T18:00:00.000Z");
|
|
23
|
+
test("release smoke creates a draft issue, reads it back and closes it", () => {
|
|
24
|
+
const repository = fakeCli();
|
|
25
|
+
const result = releaseSmoke({ cli: repository.cli, now, version: "0.3.41" });
|
|
26
|
+
assert.equal(result.ok, true);
|
|
27
|
+
assert.equal(result.line, "PASS release smoke 0.3.41: created, read back and closed #42");
|
|
28
|
+
assert.deepEqual(
|
|
29
|
+
repository.calls.map((call) => call[0]),
|
|
30
|
+
["create", "info", "update"]
|
|
31
|
+
);
|
|
32
|
+
assert.ok(repository.calls[0].includes("--draft"));
|
|
33
|
+
assert.equal(
|
|
34
|
+
repository.calls[0][repository.calls[0].indexOf("--title") + 1],
|
|
35
|
+
"release smoke 0.3.41 2026-11-02T18:00:00.000Z"
|
|
36
|
+
);
|
|
37
|
+
assert.deepEqual(repository.calls[2], [
|
|
38
|
+
"update",
|
|
39
|
+
"--issue",
|
|
40
|
+
"42",
|
|
41
|
+
"--state",
|
|
42
|
+
"closed",
|
|
43
|
+
"--close-reason",
|
|
44
|
+
"not_planned"
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
test("a failed or wrong read-back still closes the issue and fails the check", () => {
|
|
48
|
+
for (const repository of [fakeCli("info"), fakeCli(void 0, "some other issue")]) {
|
|
49
|
+
const result = releaseSmoke({ cli: repository.cli, now, version: "0.3.41" });
|
|
50
|
+
assert.equal(result.ok, false);
|
|
51
|
+
assert.match(result.line, /^FAIL release smoke 0\.3\.41: read back #42: /u);
|
|
52
|
+
assert.deepEqual(
|
|
53
|
+
repository.calls.map((call) => call[0]),
|
|
54
|
+
["create", "info", "update"],
|
|
55
|
+
"the close is attempted after the failed read"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
test("a failed create attempts no close, and a failed close tells the caller to close by hand", () => {
|
|
60
|
+
const created = fakeCli("create");
|
|
61
|
+
const failedCreate = releaseSmoke({ cli: created.cli, now, version: "0.3.41" });
|
|
62
|
+
assert.equal(failedCreate.ok, false);
|
|
63
|
+
assert.match(failedCreate.line, /^FAIL release smoke 0\.3\.41: create: create unavailable$/u);
|
|
64
|
+
assert.deepEqual(
|
|
65
|
+
created.calls.map((call) => call[0]),
|
|
66
|
+
["create"]
|
|
67
|
+
);
|
|
68
|
+
const closing = fakeCli("update");
|
|
69
|
+
const failedClose = releaseSmoke({ cli: closing.cli, now, version: "0.3.41" });
|
|
70
|
+
assert.equal(failedClose.ok, false);
|
|
71
|
+
assert.match(failedClose.line, /close #42: update unavailable\. Close it by hand\.$/u);
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=releaseSmoke.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/releaseSmoke.test.ts"],
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\n\ninterface Smoke {\n releaseSmoke: (input: { cli: (args: string[]) => unknown; version: string; now?: () => Date }) => {\n line: string;\n ok: boolean;\n };\n}\nconst { releaseSmoke } = (await import(new URL('../scripts/release-smoke.mjs', import.meta.url).href)) as Smoke;\n\n/** A repository with one issue state; `fail` makes the named command throw. */\nfunction fakeCli(fail?: string, readTitle?: string) {\n const calls: string[][] = [];\n let title = '';\n let state = 'open';\n const cli = (args: string[]) => {\n calls.push(args);\n const command = args[0]!;\n if (command === fail) throw new Error(`${command} unavailable`);\n if (command === 'create') {\n title = args[args.indexOf('--title') + 1]!;\n return { created: { number: 42 } };\n }\n if (command === 'info') return { title: readTitle ?? title, state };\n state = 'closed';\n return { state };\n };\n return { calls, cli };\n}\nconst now = () => new Date('2026-11-02T18:00:00.000Z');\n\ntest('release smoke creates a draft issue, reads it back and closes it', () => {\n const repository = fakeCli();\n const result = releaseSmoke({ cli: repository.cli, now, version: '0.3.41' });\n assert.equal(result.ok, true);\n assert.equal(result.line, 'PASS release smoke 0.3.41: created, read back and closed #42');\n assert.deepEqual(\n repository.calls.map((call) => call[0]),\n ['create', 'info', 'update'],\n );\n assert.ok(repository.calls[0]!.includes('--draft'));\n assert.equal(\n repository.calls[0]![repository.calls[0]!.indexOf('--title') + 1],\n 'release smoke 0.3.41 2026-11-02T18:00:00.000Z',\n );\n assert.deepEqual(repository.calls[2], [\n 'update',\n '--issue',\n '42',\n '--state',\n 'closed',\n '--close-reason',\n 'not_planned',\n ]);\n});\n\ntest('a failed or wrong read-back still closes the issue and fails the check', () => {\n for (const repository of [fakeCli('info'), fakeCli(undefined, 'some other issue')]) {\n const result = releaseSmoke({ cli: repository.cli, now, version: '0.3.41' });\n assert.equal(result.ok, false);\n assert.match(result.line, /^FAIL release smoke 0\\.3\\.41: read back #42: /u);\n assert.deepEqual(\n repository.calls.map((call) => call[0]),\n ['create', 'info', 'update'],\n 'the close is attempted after the failed read',\n );\n }\n});\n\ntest('a failed create attempts no close, and a failed close tells the caller to close by hand', () => {\n const created = fakeCli('create');\n const failedCreate = releaseSmoke({ cli: created.cli, now, version: '0.3.41' });\n assert.equal(failedCreate.ok, false);\n assert.match(failedCreate.line, /^FAIL release smoke 0\\.3\\.41: create: create unavailable$/u);\n assert.deepEqual(\n created.calls.map((call) => call[0]),\n ['create'],\n );\n const closing = fakeCli('update');\n const failedClose = releaseSmoke({ cli: closing.cli, now, version: '0.3.41' });\n assert.equal(failedClose.ok, false);\n assert.match(failedClose.line, /close #42: update unavailable\\. Close it by hand\\.$/u);\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AAQrB,MAAM,EAAE,aAAa,IAAK,MAAM,OAAO,IAAI,IAAI,gCAAgC,YAAY,GAAG,EAAE;AAGhG,SAAS,QAAQ,MAAe,WAAoB;AAClD,QAAM,QAAoB,CAAC;AAC3B,MAAI,QAAQ;AACZ,MAAI,QAAQ;AAC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SAAS,aAAa,EAAE,KAAK,WAAW,KAAK,KAAK,SAAS,SAAS,CAAC;AAC3E,WAAO,MAAM,OAAO,IAAI,KAAK;AAC7B,WAAO,MAAM,OAAO,MAAM,gDAAgD;AAC1E,WAAO;AAAA,MACL,WAAW,MAAM,IAAI,CAAC,SAAS,KAAK,CAAC,CAAC;AAAA,MACtC,CAAC,UAAU,QAAQ,QAAQ;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAED,KAAK,2FAA2F,MAAM;AACpG,QAAM,UAAU,QAAQ,QAAQ;AAChC,QAAM,eAAe,aAAa,EAAE,KAAK,QAAQ,KAAK,KAAK,SAAS,SAAS,CAAC;AAC9E,SAAO,MAAM,aAAa,IAAI,KAAK;AACnC,SAAO,MAAM,aAAa,MAAM,4DAA4D;AAC5F,SAAO;AAAA,IACL,QAAQ,MAAM,IAAI,CAAC,SAAS,KAAK,CAAC,CAAC;AAAA,IACnC,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,UAAU,QAAQ,QAAQ;AAChC,QAAM,cAAc,aAAa,EAAE,KAAK,QAAQ,KAAK,KAAK,SAAS,SAAS,CAAC;AAC7E,SAAO,MAAM,YAAY,IAAI,KAAK;AAClC,SAAO,MAAM,YAAY,MAAM,sDAAsD;AACvF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -112,6 +112,12 @@ const routes = [
|
|
|
112
112
|
cli: () => ["pr:info", "--pr", "23"],
|
|
113
113
|
witness: "pulls.get"
|
|
114
114
|
},
|
|
115
|
+
{
|
|
116
|
+
name: "milestone_create",
|
|
117
|
+
input: () => ({ title: "R12", dueOn: "2026-11-27", description: "Speed lane" }),
|
|
118
|
+
cli: () => ["milestone:create", "--title", "R12", "--due-on", "2026-11-27", "--description", "Speed lane"],
|
|
119
|
+
witness: "issues.createMilestone"
|
|
120
|
+
},
|
|
115
121
|
{
|
|
116
122
|
name: "issue_pr_review",
|
|
117
123
|
input: (f) => ({ issueNumber: 17, prNumber: 23, artifact: JSON.stringify(f.artifact) }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/targetRepositoryExecution.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { Command } from 'commander';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';\nimport { beforeAll, test, vi } from 'vitest';\nimport { fixtureFields, inertTarget } from './fixtures/inertTarget.js';\nimport { AI_DELIVERY_MCP_TOOLS, type AiDeliveryMcpToolName } from './mcp/tools.js';\n\ntype Fixture = ReturnType<typeof inertTarget>;\ntype Route = {\n name: AiDeliveryMcpToolName;\n input: (f: Fixture) => Record<string, unknown>;\n cli?: (f: Fixture) => string[];\n witness?: string;\n refusal?: RegExp;\n verify?: (value: Record<string, unknown>) => void;\n before?: (f: Fixture) => void | Promise<void>;\n};\nfunction inputFile(f: Fixture, name: string, value: unknown): string {\n const path = join(f.base, name);\n writeFileSync(path, JSON.stringify(value));\n return path;\n}\nconst journal = {\n issueNumber: 17,\n kind: 'decision',\n summary: 'Retain the target code boundary.',\n status: 'In progress',\n decision: 'Only operator settings are executable.',\n rationale: 'Repository content is untrusted.',\n nextStep: 'Review synthetic evidence',\n nextDate: null,\n keyNumbers: [],\n evidence: [],\n};\nconst routes: Route[] = [\n {\n name: 'issue_comment',\n input: () => journal,\n witness: 'issues.getComment',\n },\n {\n name: 'issue_create',\n input: () => fixtureFields,\n cli: (f) => ['create', '--title', fixtureFields.title, '--fields-file', inputFile(f, 'fields.json', fixtureFields)],\n witness: 'issues.create',\n },\n {\n name: 'issue_start',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['start', '--issue', '17'],\n witness: 'DeliveryStartBranch',\n before: (f) => {\n f.state.linked = false;\n },\n },\n {\n name: 'issue_list',\n input: () => ({ perPage: 1 }),\n cli: () => ['list', '--per-page', '1'],\n witness: 'issues.listForRepo',\n },\n {\n name: 'issue_search',\n input: () => ({ query: 'widget', perPage: 1 }),\n cli: () => ['search', '--query', 'widget', '--per-page', '1'],\n witness: 'search.issuesAndPullRequests',\n },\n {\n name: 'issue_update',\n input: () => ({ issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' }),\n cli: () => ['update', '--issue', '17', '--title', 'Reject invalid widget identifiers before any persistence call'],\n witness: 'issues.update',\n },\n {\n name: 'issue_batch_update',\n input: () => ({\n items: [{ issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' }],\n dryRun: true,\n }),\n cli: (f) => [\n 'batch:update',\n '--items-file',\n inputFile(f, 'items.json', [\n { issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' },\n ]),\n '--dry-run',\n ],\n witness: 'issues.get',\n },\n {\n name: 'issue_info',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['info', '--issue', '17'],\n witness: 'issues.get',\n },\n {\n name: 'issue_ready_check',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['ready:check', '--issue', '17'],\n witness: 'issues.get',\n },\n {\n name: 'issue_pr_create',\n input: () => ({ issueNumber: 17, body: 'Closes #17\\n\\nReject invalid identifiers.', draft: true }),\n cli: (f) => {\n const path = join(f.base, 'body.md');\n writeFileSync(path, 'Closes #17\\n\\nReject invalid identifiers.');\n return ['pr:create', '--issue', '17', '--body-file', path];\n },\n witness: 'pulls.create',\n before: (f) => {\n f.state.published = false;\n },\n },\n {\n name: 'issue_pr_info',\n input: () => ({ prNumber: 23 }),\n cli: () => ['pr:info', '--pr', '23'],\n witness: 'pulls.get',\n },\n {\n name: 'issue_pr_review',\n input: (f) => ({ issueNumber: 17, prNumber: 23, artifact: JSON.stringify(f.artifact) }),\n cli: (f) => ['pr:review', '--issue', '17', '--pr', '23', '--artifact', f.artifactPath],\n witness: 'pulls.createReview',\n before: (f) => {\n f.reviews.length = 0;\n },\n },\n];\n\n// Capture the real registered Commander tree without running process.argv. Each\n// case then uses Commander's real parser and actual action/dispatch/owner code.\nlet cli: Command;\nbeforeAll(async () => {\n const captured: Command[] = [];\n const argv = process.argv;\n process.argv = ['node', 'ai-delivery', 'plugin'];\n const parse = vi.spyOn(Command.prototype, 'parseAsync').mockImplementationOnce(async function (this: Command) {\n captured.push(this);\n return this;\n });\n try {\n await import('./cli.js');\n } finally {\n process.argv = argv;\n parse.mockRestore();\n }\n cli = captured[0]!;\n cli.exitOverride();\n});\n\nfunction cliLeaves(command: Command, prefix = ''): string[] {\n return command.commands.flatMap((child) => {\n const name = `${prefix}${child.name()}`;\n return child.commands.length ? cliLeaves(child, `${name} `) : [name];\n });\n}\n\nasync function runCli(f: Fixture, args: string[]) {\n const exitCode = process.exitCode;\n let output = '';\n const stdout = vi.spyOn(process.stdout, 'write').mockImplementation((chunk) => {\n output += String(chunk);\n return true;\n });\n try {\n await cli.parseAsync(['--repo', 'example/widget', '--repo-root', f.root, ...args], { from: 'user' });\n return JSON.parse(output) as Record<string, unknown>;\n } finally {\n stdout.mockRestore();\n process.exitCode = exitCode;\n f.assertInert();\n }\n}\n\ntest('every public MCP and CLI route has an execution-boundary case', () => {\n assert.deepEqual(routes.map((r) => r.name).sort(), AI_DELIVERY_MCP_TOOLS.map((r) => r.name).sort());\n assert.deepEqual(\n cliLeaves(cli).sort(),\n [\n ...routes\n .filter((r) => r.cli)\n .map((r) => AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === r.name)!.commandName),\n ...new Set(cliOnly.map((r) => r.command)),\n 'mcp:serve',\n ].sort(),\n );\n});\n\nfor (const route of routes) {\n for (const surface of ['MCP', 'CLI'] as const) {\n if (surface === 'CLI' && route.cli === undefined) continue;\n test(`${surface} ${route.name} never executes target repository files`, async ({ signal }) => {\n const f = inertTarget(signal);\n let connection: Awaited<ReturnType<Fixture['connect']>> | undefined;\n try {\n f.policy('tracked');\n await route.before?.(f);\n // A schema/authentication failure must never masquerade as owner coverage.\n AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === route.name)!.inputSchema.parse({\n repo: 'example/widget',\n ...route.input(f),\n });\n if (surface === 'MCP') {\n connection = await f.connect();\n const result = await connection.call(route.name, route.input(f));\n if (route.refusal) {\n assert.equal(result.response.isError, true);\n assert.match(result.text, route.refusal);\n } else {\n assert.notEqual(result.response.isError, true, result.text);\n route.verify?.(result.value!);\n }\n } else if (route.refusal) {\n await assert.rejects(runCli(f, route.cli!(f)), route.refusal);\n } else {\n const value = await runCli(f, route.cli!(f));\n assert.ok(value);\n route.verify?.(value);\n }\n if (route.witness)\n assert.ok(\n f.calls.some((call) => call.name === route.witness),\n `Missing owner witness: ${route.witness}`,\n );\n } finally {\n await f.dispose(connection);\n }\n });\n }\n}\n\nfunction configureReviewer(f: Fixture) {\n const path = process.env.AI_DELIVERY_CONFIG!;\n const settings = JSON.parse(readFileSync(path, 'utf8')) as { roles: { reviewer: unknown } };\n settings.roles.reviewer = {\n identity: 'reviewer',\n authSource: 'app',\n appId: 1,\n installationId: 2,\n actorLogin: 'reviewer[bot]',\n provider: 'openai',\n };\n writeFileSync(path, JSON.stringify(settings));\n f.reviews.length = 0;\n}\n\nconst cliOnly: {\n command: string;\n variant?: string;\n args: (f: Fixture) => string[];\n witness?: string;\n before?: (f: Fixture) => void;\n}[] = [\n { command: 'pr:list', args: () => ['pr:list'], witness: 'pulls.list' },\n { command: 'pr:checks', args: () => ['pr:checks', '--pr', '23'], witness: 'checks.listForRef' },\n { command: 'config:resolve', args: () => ['config:resolve'], witness: 'appActorLogin' },\n {\n command: 'review',\n variant: 'doctor',\n args: () => ['review', 'doctor', '--identity', 'reviewer'],\n before: configureReviewer,\n witness: 'appActorLogin',\n },\n {\n command: 'review',\n variant: 'submit',\n before: configureReviewer,\n witness: 'pulls.createReview',\n args: (f) => [\n 'review',\n 'submit',\n '--identity',\n 'reviewer',\n '--pr',\n '23',\n '--head',\n f.head,\n '--verdict',\n inputFile(f, 'verdict.json', {\n schemaVersion: 'ai-delivery.review-verdict@1',\n verdict: 'approve',\n summary: 'Synthetic independent review.',\n issueNumber: 17,\n scope: { headSha: f.head, headTree: f.tree, changedPaths: ['change.ts'] },\n verificationReproduced: ['Synthetic route boundary'],\n requestedModel: 'gpt-6-astra',\n requestedEffort: 'xhigh',\n effectiveModel: 'gpt-6-astra',\n effectiveEffort: 'xhigh',\n elapsedMs: 1,\n findings: [],\n readOnly: true,\n }),\n ],\n },\n ...(['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const).map((action) => ({\n command: `plugin ${action}`,\n args: () => [\n 'plugin',\n action,\n '--host',\n 'codex',\n '--dry-run',\n '--json',\n ...(['install', 'update'].includes(action) ? ['--version', '0.3.35'] : []),\n ],\n })),\n];\nfor (const route of cliOnly) {\n test(`CLI ${route.command}${route.variant ? ` ${route.variant}` : ''} never executes target repository files`, async () => {\n const f = inertTarget();\n const home = process.env.HOME;\n process.env.HOME = f.base;\n try {\n f.policy('tracked');\n route.before?.(f);\n assert.ok(await runCli(f, route.args(f)));\n if (route.witness)\n assert.ok(\n f.calls.some((call) => call.name === route.witness),\n `Missing owner witness: ${route.witness}`,\n );\n } finally {\n if (home === undefined) delete process.env.HOME;\n else process.env.HOME = home;\n await f.dispose(undefined);\n }\n });\n}\n\ntest(\n 'CLI mcp:serve initializes and serves a real stdio request without target code execution',\n { tags: ['release'] },\n async () => {\n const f = inertTarget();\n const request = inputFile(f, 'stdio-request.json', {\n mode: 'cli',\n root: f.root,\n head: f.head,\n report: join(f.base, 'stdio-report.json'),\n args: [],\n });\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [\n '--max-old-space-size=96',\n '--experimental-test-module-mocks',\n '--import',\n fileURLToPath(new URL('./fixtures/inertEntrypointChild.js', import.meta.url)),\n fileURLToPath(new URL('./cli.js', import.meta.url)),\n '--repo-root',\n f.root,\n 'mcp:serve',\n ],\n env: {\n PATH: process.env.PATH!,\n HOME: f.base,\n AI_DELIVERY_CONFIG: process.env.AI_DELIVERY_CONFIG!,\n AI_DELIVERY_ENTRYPOINT_REQUEST: request,\n },\n stderr: 'pipe',\n });\n let childClosed = false;\n let childStderr = '';\n transport.stderr?.on('data', (bytes: Buffer) => {\n childStderr = (childStderr + bytes.toString('utf8')).slice(-64 * 1024);\n });\n transport.onclose = () => {\n childClosed = true;\n };\n const client = new Client({ name: 'hostile-stdio-fixture', version: '1' });\n try {\n f.policy('tracked');\n await client.connect(transport);\n const result = await client.callTool({\n name: 'issue_info',\n arguments: { repo: 'example/widget', issueNumber: 17 },\n });\n assert.notEqual(result.isError, true, JSON.stringify(result));\n const value = JSON.parse((result.content as { text: string }[])[0]!.text) as { issueNumber: number };\n assert.equal(value.issueNumber, 17);\n f.assertInert();\n } catch (cause) {\n throw new Error(`Real stdio MCP failed. Child stderr: ${childStderr}`, { cause });\n } finally {\n await client.close();\n await transport.close();\n assert.equal(childClosed, true, 'The stdio child must exit before removing its fixture');\n await f.dispose(undefined);\n }\n },\n);\n\ntest('hostile repository arms policy, executable configs, package scripts and Git hooks', async () => {\n const f = inertTarget();\n try {\n for (const file of ['ai-delivery.policy.mjs', 'ai-delivery.config.mjs', 'ai-delivery.config.js', 'package.json'])\n assert.equal(existsSync(join(f.root, file)), true, `Missing target execution trap: ${file}`);\n const manifest = JSON.parse(readFileSync(join(f.root, 'package.json'), 'utf8')) as {\n scripts: Record<string, string>;\n };\n for (const script of ['prepare', 'postinstall', 'test'])\n assert.equal(manifest.scripts[script], 'node consumer-trap.cjs');\n for (const hook of ['pre-commit', 'post-commit', 'post-checkout', 'pre-push'])\n assert.equal(existsSync(join(f.root, '.git', 'hooks', hook)), true, `Missing Git hook: ${hook}`);\n for (const file of [\n 'ai-delivery.policy.mjs',\n 'ai-delivery.config.mjs',\n 'ai-delivery.config.js',\n 'consumer-trap.cjs',\n ]) {\n execFileSync(process.execPath, [\n '--input-type=module',\n '-e',\n `await import(${JSON.stringify(pathToFileURL(join(f.root, file)).href)})`,\n ]);\n assert.equal(existsSync(f.sentinel), true, `Importing the actual fixture ${file} must execute the sentinel`);\n unlinkSync(f.sentinel);\n }\n for (const hook of ['pre-commit', 'post-commit', 'post-checkout', 'pre-push']) {\n execFileSync('/bin/sh', [join(f.root, '.git', 'hooks', hook)]);\n assert.equal(existsSync(f.sentinel), true, `Executing the actual fixture ${hook} must execute the sentinel`);\n unlinkSync(f.sentinel);\n }\n } finally {\n await f.dispose(undefined);\n }\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc,YAAY,qBAAqB;AACpE,SAAS,YAAY;AACrB,SAAS,eAAe,qBAAqB;AAC7C,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,WAAW,MAAM,UAAU;AACpC,SAAS,eAAe,mBAAmB;AAC3C,SAAS,6BAAyD;AAYlE,SAAS,UAAU,GAAY,MAAc,OAAwB;AACnE,QAAM,OAAO,KAAK,EAAE,MAAM,IAAI;AAC9B,gBAAc,MAAM,KAAK,UAAU,KAAK,CAAC;AACzC,SAAO;AACT;AACA,MAAM,UAAU;AAAA,EACd,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY,CAAC;AAAA,EACb,UAAU,CAAC;AACb;AACA,MAAM,SAAkB;AAAA,EACtB;AAAA,IACE,MAAM;AAAA,IACN,OAAO,MAAM;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,MAAM;AAAA,IACb,KAAK,CAAC,MAAM,CAAC,UAAU,WAAW,cAAc,OAAO,iBAAiB,UAAU,GAAG,eAAe,aAAa,CAAC;AAAA,IAClH,SAAS;AA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AG;AAC7E,mBAAa,WAAW,CAAC,KAAK,EAAE,MAAM,QAAQ,SAAS,IAAI,CAAC,CAAC;AAC7D,aAAO,MAAM,WAAW,EAAE,QAAQ,GAAG,MAAM,gCAAgC,IAAI,4BAA4B;AAC3G,iBAAW,EAAE,QAAQ;AAAA,IACvB;AAAA,EACF,UAAE;AACA,UAAM,EAAE,QAAQ,MAAS;AAAA,EAC3B;AACF,CAAC;",
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { Command } from 'commander';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';\nimport { beforeAll, test, vi } from 'vitest';\nimport { fixtureFields, inertTarget } from './fixtures/inertTarget.js';\nimport { AI_DELIVERY_MCP_TOOLS, type AiDeliveryMcpToolName } from './mcp/tools.js';\n\ntype Fixture = ReturnType<typeof inertTarget>;\ntype Route = {\n name: AiDeliveryMcpToolName;\n input: (f: Fixture) => Record<string, unknown>;\n cli?: (f: Fixture) => string[];\n witness?: string;\n refusal?: RegExp;\n verify?: (value: Record<string, unknown>) => void;\n before?: (f: Fixture) => void | Promise<void>;\n};\nfunction inputFile(f: Fixture, name: string, value: unknown): string {\n const path = join(f.base, name);\n writeFileSync(path, JSON.stringify(value));\n return path;\n}\nconst journal = {\n issueNumber: 17,\n kind: 'decision',\n summary: 'Retain the target code boundary.',\n status: 'In progress',\n decision: 'Only operator settings are executable.',\n rationale: 'Repository content is untrusted.',\n nextStep: 'Review synthetic evidence',\n nextDate: null,\n keyNumbers: [],\n evidence: [],\n};\nconst routes: Route[] = [\n {\n name: 'issue_comment',\n input: () => journal,\n witness: 'issues.getComment',\n },\n {\n name: 'issue_create',\n input: () => fixtureFields,\n cli: (f) => ['create', '--title', fixtureFields.title, '--fields-file', inputFile(f, 'fields.json', fixtureFields)],\n witness: 'issues.create',\n },\n {\n name: 'issue_start',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['start', '--issue', '17'],\n witness: 'DeliveryStartBranch',\n before: (f) => {\n f.state.linked = false;\n },\n },\n {\n name: 'issue_list',\n input: () => ({ perPage: 1 }),\n cli: () => ['list', '--per-page', '1'],\n witness: 'issues.listForRepo',\n },\n {\n name: 'issue_search',\n input: () => ({ query: 'widget', perPage: 1 }),\n cli: () => ['search', '--query', 'widget', '--per-page', '1'],\n witness: 'search.issuesAndPullRequests',\n },\n {\n name: 'issue_update',\n input: () => ({ issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' }),\n cli: () => ['update', '--issue', '17', '--title', 'Reject invalid widget identifiers before any persistence call'],\n witness: 'issues.update',\n },\n {\n name: 'issue_batch_update',\n input: () => ({\n items: [{ issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' }],\n dryRun: true,\n }),\n cli: (f) => [\n 'batch:update',\n '--items-file',\n inputFile(f, 'items.json', [\n { issueNumber: 17, title: 'Reject invalid widget identifiers before any persistence call' },\n ]),\n '--dry-run',\n ],\n witness: 'issues.get',\n },\n {\n name: 'issue_info',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['info', '--issue', '17'],\n witness: 'issues.get',\n },\n {\n name: 'issue_ready_check',\n input: () => ({ issueNumber: 17 }),\n cli: () => ['ready:check', '--issue', '17'],\n witness: 'issues.get',\n },\n {\n name: 'issue_pr_create',\n input: () => ({ issueNumber: 17, body: 'Closes #17\\n\\nReject invalid identifiers.', draft: true }),\n cli: (f) => {\n const path = join(f.base, 'body.md');\n writeFileSync(path, 'Closes #17\\n\\nReject invalid identifiers.');\n return ['pr:create', '--issue', '17', '--body-file', path];\n },\n witness: 'pulls.create',\n before: (f) => {\n f.state.published = false;\n },\n },\n {\n name: 'issue_pr_info',\n input: () => ({ prNumber: 23 }),\n cli: () => ['pr:info', '--pr', '23'],\n witness: 'pulls.get',\n },\n {\n name: 'milestone_create',\n input: () => ({ title: 'R12', dueOn: '2026-11-27', description: 'Speed lane' }),\n cli: () => ['milestone:create', '--title', 'R12', '--due-on', '2026-11-27', '--description', 'Speed lane'],\n witness: 'issues.createMilestone',\n },\n {\n name: 'issue_pr_review',\n input: (f) => ({ issueNumber: 17, prNumber: 23, artifact: JSON.stringify(f.artifact) }),\n cli: (f) => ['pr:review', '--issue', '17', '--pr', '23', '--artifact', f.artifactPath],\n witness: 'pulls.createReview',\n before: (f) => {\n f.reviews.length = 0;\n },\n },\n];\n\n// Capture the real registered Commander tree without running process.argv. Each\n// case then uses Commander's real parser and actual action/dispatch/owner code.\nlet cli: Command;\nbeforeAll(async () => {\n const captured: Command[] = [];\n const argv = process.argv;\n process.argv = ['node', 'ai-delivery', 'plugin'];\n const parse = vi.spyOn(Command.prototype, 'parseAsync').mockImplementationOnce(async function (this: Command) {\n captured.push(this);\n return this;\n });\n try {\n await import('./cli.js');\n } finally {\n process.argv = argv;\n parse.mockRestore();\n }\n cli = captured[0]!;\n cli.exitOverride();\n});\n\nfunction cliLeaves(command: Command, prefix = ''): string[] {\n return command.commands.flatMap((child) => {\n const name = `${prefix}${child.name()}`;\n return child.commands.length ? cliLeaves(child, `${name} `) : [name];\n });\n}\n\nasync function runCli(f: Fixture, args: string[]) {\n const exitCode = process.exitCode;\n let output = '';\n const stdout = vi.spyOn(process.stdout, 'write').mockImplementation((chunk) => {\n output += String(chunk);\n return true;\n });\n try {\n await cli.parseAsync(['--repo', 'example/widget', '--repo-root', f.root, ...args], { from: 'user' });\n return JSON.parse(output) as Record<string, unknown>;\n } finally {\n stdout.mockRestore();\n process.exitCode = exitCode;\n f.assertInert();\n }\n}\n\ntest('every public MCP and CLI route has an execution-boundary case', () => {\n assert.deepEqual(routes.map((r) => r.name).sort(), AI_DELIVERY_MCP_TOOLS.map((r) => r.name).sort());\n assert.deepEqual(\n cliLeaves(cli).sort(),\n [\n ...routes\n .filter((r) => r.cli)\n .map((r) => AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === r.name)!.commandName),\n ...new Set(cliOnly.map((r) => r.command)),\n 'mcp:serve',\n ].sort(),\n );\n});\n\nfor (const route of routes) {\n for (const surface of ['MCP', 'CLI'] as const) {\n if (surface === 'CLI' && route.cli === undefined) continue;\n test(`${surface} ${route.name} never executes target repository files`, async ({ signal }) => {\n const f = inertTarget(signal);\n let connection: Awaited<ReturnType<Fixture['connect']>> | undefined;\n try {\n f.policy('tracked');\n await route.before?.(f);\n // A schema/authentication failure must never masquerade as owner coverage.\n AI_DELIVERY_MCP_TOOLS.find((tool) => tool.name === route.name)!.inputSchema.parse({\n repo: 'example/widget',\n ...route.input(f),\n });\n if (surface === 'MCP') {\n connection = await f.connect();\n const result = await connection.call(route.name, route.input(f));\n if (route.refusal) {\n assert.equal(result.response.isError, true);\n assert.match(result.text, route.refusal);\n } else {\n assert.notEqual(result.response.isError, true, result.text);\n route.verify?.(result.value!);\n }\n } else if (route.refusal) {\n await assert.rejects(runCli(f, route.cli!(f)), route.refusal);\n } else {\n const value = await runCli(f, route.cli!(f));\n assert.ok(value);\n route.verify?.(value);\n }\n if (route.witness)\n assert.ok(\n f.calls.some((call) => call.name === route.witness),\n `Missing owner witness: ${route.witness}`,\n );\n } finally {\n await f.dispose(connection);\n }\n });\n }\n}\n\nfunction configureReviewer(f: Fixture) {\n const path = process.env.AI_DELIVERY_CONFIG!;\n const settings = JSON.parse(readFileSync(path, 'utf8')) as { roles: { reviewer: unknown } };\n settings.roles.reviewer = {\n identity: 'reviewer',\n authSource: 'app',\n appId: 1,\n installationId: 2,\n actorLogin: 'reviewer[bot]',\n provider: 'openai',\n };\n writeFileSync(path, JSON.stringify(settings));\n f.reviews.length = 0;\n}\n\nconst cliOnly: {\n command: string;\n variant?: string;\n args: (f: Fixture) => string[];\n witness?: string;\n before?: (f: Fixture) => void;\n}[] = [\n { command: 'pr:list', args: () => ['pr:list'], witness: 'pulls.list' },\n { command: 'pr:checks', args: () => ['pr:checks', '--pr', '23'], witness: 'checks.listForRef' },\n { command: 'config:resolve', args: () => ['config:resolve'], witness: 'appActorLogin' },\n {\n command: 'review',\n variant: 'doctor',\n args: () => ['review', 'doctor', '--identity', 'reviewer'],\n before: configureReviewer,\n witness: 'appActorLogin',\n },\n {\n command: 'review',\n variant: 'submit',\n before: configureReviewer,\n witness: 'pulls.createReview',\n args: (f) => [\n 'review',\n 'submit',\n '--identity',\n 'reviewer',\n '--pr',\n '23',\n '--head',\n f.head,\n '--verdict',\n inputFile(f, 'verdict.json', {\n schemaVersion: 'ai-delivery.review-verdict@1',\n verdict: 'approve',\n summary: 'Synthetic independent review.',\n issueNumber: 17,\n scope: { headSha: f.head, headTree: f.tree, changedPaths: ['change.ts'] },\n verificationReproduced: ['Synthetic route boundary'],\n requestedModel: 'gpt-6-astra',\n requestedEffort: 'xhigh',\n effectiveModel: 'gpt-6-astra',\n effectiveEffort: 'xhigh',\n elapsedMs: 1,\n findings: [],\n readOnly: true,\n }),\n ],\n },\n ...(['install', 'doctor', 'preview', 'update', 'rollback', 'remove'] as const).map((action) => ({\n command: `plugin ${action}`,\n args: () => [\n 'plugin',\n action,\n '--host',\n 'codex',\n '--dry-run',\n '--json',\n ...(['install', 'update'].includes(action) ? ['--version', '0.3.35'] : []),\n ],\n })),\n];\nfor (const route of cliOnly) {\n test(`CLI ${route.command}${route.variant ? ` ${route.variant}` : ''} never executes target repository files`, async () => {\n const f = inertTarget();\n const home = process.env.HOME;\n process.env.HOME = f.base;\n try {\n f.policy('tracked');\n route.before?.(f);\n assert.ok(await runCli(f, route.args(f)));\n if (route.witness)\n assert.ok(\n f.calls.some((call) => call.name === route.witness),\n `Missing owner witness: ${route.witness}`,\n );\n } finally {\n if (home === undefined) delete process.env.HOME;\n else process.env.HOME = home;\n await f.dispose(undefined);\n }\n });\n}\n\ntest(\n 'CLI mcp:serve initializes and serves a real stdio request without target code execution',\n { tags: ['release'] },\n async () => {\n const f = inertTarget();\n const request = inputFile(f, 'stdio-request.json', {\n mode: 'cli',\n root: f.root,\n head: f.head,\n report: join(f.base, 'stdio-report.json'),\n args: [],\n });\n const transport = new StdioClientTransport({\n command: process.execPath,\n args: [\n '--max-old-space-size=96',\n '--experimental-test-module-mocks',\n '--import',\n fileURLToPath(new URL('./fixtures/inertEntrypointChild.js', import.meta.url)),\n fileURLToPath(new URL('./cli.js', import.meta.url)),\n '--repo-root',\n f.root,\n 'mcp:serve',\n ],\n env: {\n PATH: process.env.PATH!,\n HOME: f.base,\n AI_DELIVERY_CONFIG: process.env.AI_DELIVERY_CONFIG!,\n AI_DELIVERY_ENTRYPOINT_REQUEST: request,\n },\n stderr: 'pipe',\n });\n let childClosed = false;\n let childStderr = '';\n transport.stderr?.on('data', (bytes: Buffer) => {\n childStderr = (childStderr + bytes.toString('utf8')).slice(-64 * 1024);\n });\n transport.onclose = () => {\n childClosed = true;\n };\n const client = new Client({ name: 'hostile-stdio-fixture', version: '1' });\n try {\n f.policy('tracked');\n await client.connect(transport);\n const result = await client.callTool({\n name: 'issue_info',\n arguments: { repo: 'example/widget', issueNumber: 17 },\n });\n assert.notEqual(result.isError, true, JSON.stringify(result));\n const value = JSON.parse((result.content as { text: string }[])[0]!.text) as { issueNumber: number };\n assert.equal(value.issueNumber, 17);\n f.assertInert();\n } catch (cause) {\n throw new Error(`Real stdio MCP failed. Child stderr: ${childStderr}`, { cause });\n } finally {\n await client.close();\n await transport.close();\n assert.equal(childClosed, true, 'The stdio child must exit before removing its fixture');\n await f.dispose(undefined);\n }\n },\n);\n\ntest('hostile repository arms policy, executable configs, package scripts and Git hooks', async () => {\n const f = inertTarget();\n try {\n for (const file of ['ai-delivery.policy.mjs', 'ai-delivery.config.mjs', 'ai-delivery.config.js', 'package.json'])\n assert.equal(existsSync(join(f.root, file)), true, `Missing target execution trap: ${file}`);\n const manifest = JSON.parse(readFileSync(join(f.root, 'package.json'), 'utf8')) as {\n scripts: Record<string, string>;\n };\n for (const script of ['prepare', 'postinstall', 'test'])\n assert.equal(manifest.scripts[script], 'node consumer-trap.cjs');\n for (const hook of ['pre-commit', 'post-commit', 'post-checkout', 'pre-push'])\n assert.equal(existsSync(join(f.root, '.git', 'hooks', hook)), true, `Missing Git hook: ${hook}`);\n for (const file of [\n 'ai-delivery.policy.mjs',\n 'ai-delivery.config.mjs',\n 'ai-delivery.config.js',\n 'consumer-trap.cjs',\n ]) {\n execFileSync(process.execPath, [\n '--input-type=module',\n '-e',\n `await import(${JSON.stringify(pathToFileURL(join(f.root, file)).href)})`,\n ]);\n assert.equal(existsSync(f.sentinel), true, `Importing the actual fixture ${file} must execute the sentinel`);\n unlinkSync(f.sentinel);\n }\n for (const hook of ['pre-commit', 'post-commit', 'post-checkout', 'pre-push']) {\n execFileSync('/bin/sh', [join(f.root, '.git', 'hooks', hook)]);\n assert.equal(existsSync(f.sentinel), true, `Executing the actual fixture ${hook} must execute the sentinel`);\n unlinkSync(f.sentinel);\n }\n } finally {\n await f.dispose(undefined);\n }\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc,YAAY,qBAAqB;AACpE,SAAS,YAAY;AACrB,SAAS,eAAe,qBAAqB;AAC7C,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,WAAW,MAAM,UAAU;AACpC,SAAS,eAAe,mBAAmB;AAC3C,SAAS,6BAAyD;AAYlE,SAAS,UAAU,GAAY,MAAc,OAAwB;AACnE,QAAM,OAAO,KAAK,EAAE,MAAM,IAAI;AAC9B,gBAAc,MAAM,KAAK,UAAU,KAAK,CAAC;AACzC,SAAO;AACT;AACA,MAAM,UAAU;AAAA,EACd,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY,CAAC;AAAA,EACb,UAAU,C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W,KAAK,EAAE,MAAM,QAAQ,SAAS,IAAI,CAAC,GAAG,MAAM,qBAAqB,IAAI,EAAE;AACjG,eAAW,QAAQ;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,GAAG;AACD,mBAAa,QAAQ,UAAU;AAAA,QAC7B;AAAA,QACA;AAAA,QACA,gBAAgB,KAAK,UAAU,cAAc,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,MACxE,CAAC;AACD,aAAO,MAAM,WAAW,EAAE,QAAQ,GAAG,MAAM,gCAAgC,IAAI,4BAA4B;AAC3G,iBAAW,EAAE,QAAQ;AAAA,IACvB;AACA,eAAW,QAAQ,CAAC,cAAc,eAAe,iBAAiB,UAAU,GAAG;AAC7E,mBAAa,WAAW,CAAC,KAAK,EAAE,MAAM,QAAQ,SAAS,IAAI,CAAC,CAAC;AAC7D,aAAO,MAAM,WAAW,EAAE,QAAQ,GAAG,MAAM,gCAAgC,IAAI,4BAA4B;AAC3G,iBAAW,EAAE,QAAQ;AAAA,IACvB;AAAA,EACF,UAAE;AACA,UAAM,EAAE,QAAQ,MAAS;AAAA,EAC3B;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-delivery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.41",
|
|
4
4
|
"description": "GitHub issue and pull request delivery tools for prepared worktrees and evidence-based handoff.",
|
|
5
5
|
"author": { "name": "AviaraTech", "url": "https://github.com/aviaratech" },
|
|
6
6
|
"homepage": "https://github.com/aviaratech/ai-delivery#readme",
|
|
7
7
|
"repository": "https://github.com/aviaratech/ai-delivery",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"deliveryCapabilityVersion": 2,
|
|
10
|
-
"packageVersion": "0.3.
|
|
10
|
+
"packageVersion": "0.3.41"
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "ai-delivery",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.41",
|
|
5
5
|
"description": "GitHub issue and pull request delivery tools for prepared worktrees and evidence-based handoff.",
|
|
6
6
|
"author": { "name": "AviaraTech", "url": "https://github.com/aviaratech" },
|
|
7
7
|
"homepage": "https://github.com/aviaratech/ai-delivery#readme",
|