@aviaratech/ai-delivery 0.3.42 → 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 +2 -2
- package/dist/agentReadiness.test.js +15 -0
- package/dist/agentReadiness.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/issue.d.ts +2 -1
- package/dist/issue.js +55 -17
- 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 +240 -2
- package/dist/issueContract.js +136 -19
- 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 +64 -0
- package/dist/issueInfoReadback.test.js.map +2 -2
- package/dist/issueIntake.test.js +173 -35
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueWriteRecovery.test.js +12 -12
- package/dist/issueWriteRecovery.test.js.map +2 -2
- package/dist/mcp/tools.d.ts +147 -2
- package/dist/mcp/tools.js +2 -2
- 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/readView.d.ts +1 -0
- 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/targetRepositoryExecution.test.js +11 -3
- 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 +117 -111
- 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
|
@@ -11,6 +11,11 @@ export declare function issue63Fixture(): {
|
|
|
11
11
|
acceptanceCriteria: {
|
|
12
12
|
behavior: string;
|
|
13
13
|
verifiedBy: string;
|
|
14
|
+
examples?: {
|
|
15
|
+
input: string;
|
|
16
|
+
expected: string;
|
|
17
|
+
failure?: true | undefined;
|
|
18
|
+
}[] | undefined;
|
|
14
19
|
}[];
|
|
15
20
|
outOfScope: string[];
|
|
16
21
|
openQuestions: string[];
|
|
@@ -31,9 +36,100 @@ export declare function issue63Fixture(): {
|
|
|
31
36
|
until?: string | undefined;
|
|
32
37
|
trigger?: string | undefined;
|
|
33
38
|
} | undefined;
|
|
39
|
+
builder?: {
|
|
40
|
+
tier: "standard";
|
|
41
|
+
} | {
|
|
42
|
+
tier: "frontier";
|
|
43
|
+
reason: "concurrency-recovery" | "risk-semantics" | "state-machine" | "unprovable-refactor";
|
|
44
|
+
} | undefined;
|
|
45
|
+
extends?: string[] | undefined;
|
|
46
|
+
decisions?: string[] | undefined;
|
|
47
|
+
surface?: {
|
|
48
|
+
path: string;
|
|
49
|
+
change: "add" | "delete" | "edit";
|
|
50
|
+
signatures?: string[] | undefined;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
fences?: string[] | undefined;
|
|
53
|
+
proof?: string[] | undefined;
|
|
34
54
|
legacyBody?: string | undefined;
|
|
35
55
|
retainLegacyBody?: boolean | undefined;
|
|
36
56
|
};
|
|
57
|
+
createInput: {
|
|
58
|
+
title: string;
|
|
59
|
+
points?: number | undefined;
|
|
60
|
+
epic?: true | undefined;
|
|
61
|
+
problem: string;
|
|
62
|
+
outcome: string;
|
|
63
|
+
acceptanceCriteria: {
|
|
64
|
+
behavior: string;
|
|
65
|
+
verifiedBy: string;
|
|
66
|
+
examples?: {
|
|
67
|
+
input: string;
|
|
68
|
+
expected: string;
|
|
69
|
+
failure?: true | undefined;
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
}[];
|
|
72
|
+
outOfScope: string[];
|
|
73
|
+
openQuestions: string[];
|
|
74
|
+
context: {
|
|
75
|
+
components: string[];
|
|
76
|
+
files: string[];
|
|
77
|
+
evidence: string[];
|
|
78
|
+
};
|
|
79
|
+
bug?: {
|
|
80
|
+
steps: string[];
|
|
81
|
+
expected: string;
|
|
82
|
+
actual: string;
|
|
83
|
+
reproducibility: string;
|
|
84
|
+
environment: string;
|
|
85
|
+
} | undefined;
|
|
86
|
+
draft: boolean;
|
|
87
|
+
deferral?: {
|
|
88
|
+
until?: string | undefined;
|
|
89
|
+
trigger?: string | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
builder?: {
|
|
92
|
+
tier: "standard";
|
|
93
|
+
} | {
|
|
94
|
+
tier: "frontier";
|
|
95
|
+
reason: "concurrency-recovery" | "risk-semantics" | "state-machine" | "unprovable-refactor";
|
|
96
|
+
} | undefined;
|
|
97
|
+
extends?: string[] | undefined;
|
|
98
|
+
decisions?: string[] | undefined;
|
|
99
|
+
surface?: {
|
|
100
|
+
path: string;
|
|
101
|
+
change: "add" | "delete" | "edit";
|
|
102
|
+
signatures?: string[] | undefined;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
fences?: string[] | undefined;
|
|
105
|
+
proof?: string[] | undefined;
|
|
106
|
+
legacyBody?: string | undefined;
|
|
107
|
+
retainLegacyBody?: boolean | undefined;
|
|
108
|
+
issueType: string;
|
|
109
|
+
priority: string;
|
|
110
|
+
} & {
|
|
111
|
+
builder: {
|
|
112
|
+
tier: 'standard';
|
|
113
|
+
};
|
|
114
|
+
extends: string[];
|
|
115
|
+
decisions: string[];
|
|
116
|
+
surface: {
|
|
117
|
+
path: string;
|
|
118
|
+
change: 'edit';
|
|
119
|
+
signatures: string[];
|
|
120
|
+
}[];
|
|
121
|
+
fences: string[];
|
|
122
|
+
proof: string[];
|
|
123
|
+
acceptanceCriteria: {
|
|
124
|
+
behavior: string;
|
|
125
|
+
verifiedBy: string;
|
|
126
|
+
examples?: {
|
|
127
|
+
input: string;
|
|
128
|
+
expected: string;
|
|
129
|
+
failure?: true | undefined;
|
|
130
|
+
}[] | undefined;
|
|
131
|
+
}[];
|
|
132
|
+
};
|
|
37
133
|
rows: Map<number, {
|
|
38
134
|
number: number;
|
|
39
135
|
id: number;
|
package/dist/fixtures/issue63.js
CHANGED
|
@@ -2,6 +2,7 @@ import { quietReadViewResponse } from "./readView.js";
|
|
|
2
2
|
import { issueProjectItemsResponse } from "./issueProjectItems.js";
|
|
3
3
|
import { IssueFields, renderIssueBody } from "../issueContract.js";
|
|
4
4
|
import { syntheticDiscoveryConfig } from "./discovery.js";
|
|
5
|
+
import { withBuilder } from "./builderReady.js";
|
|
5
6
|
function issue63Fixture() {
|
|
6
7
|
const ready = IssueFields.parse({
|
|
7
8
|
title: "Guard active widget dependency additions",
|
|
@@ -107,6 +108,7 @@ function issue63Fixture() {
|
|
|
107
108
|
rows.set(n, {
|
|
108
109
|
...get(18),
|
|
109
110
|
...input,
|
|
111
|
+
...typeof input.type === "string" ? { type: { name: input.type } } : {},
|
|
110
112
|
number: n,
|
|
111
113
|
id: 120,
|
|
112
114
|
node_id: "ISSUE20",
|
|
@@ -160,7 +162,10 @@ function issue63Fixture() {
|
|
|
160
162
|
data_type: "single_select",
|
|
161
163
|
options: ["High", "Low"].map((name) => ({ name }))
|
|
162
164
|
}
|
|
163
|
-
] : [
|
|
165
|
+
] : [
|
|
166
|
+
{ issue_field_id: 101, issue_field_name: "Estimate", data_type: "single_select", value: "2" },
|
|
167
|
+
{ issue_field_id: 102, issue_field_name: "Urgency", data_type: "single_select", value: "High" }
|
|
168
|
+
]
|
|
164
169
|
};
|
|
165
170
|
}
|
|
166
171
|
},
|
|
@@ -257,7 +262,21 @@ function issue63Fixture() {
|
|
|
257
262
|
}
|
|
258
263
|
}
|
|
259
264
|
};
|
|
260
|
-
|
|
265
|
+
const createInput = withBuilder({ ...ready, issueType: "Task", priority: "High" });
|
|
266
|
+
return {
|
|
267
|
+
context,
|
|
268
|
+
ready,
|
|
269
|
+
createInput,
|
|
270
|
+
rows,
|
|
271
|
+
edges,
|
|
272
|
+
statuses,
|
|
273
|
+
writes,
|
|
274
|
+
graphqlCalls,
|
|
275
|
+
comments,
|
|
276
|
+
history,
|
|
277
|
+
histories,
|
|
278
|
+
controls
|
|
279
|
+
};
|
|
261
280
|
}
|
|
262
281
|
export {
|
|
263
282
|
issue63Fixture
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/fixtures/issue63.ts"],
|
|
4
|
-
"sourcesContent": ["import { quietReadViewResponse } from './readView.js';\nimport { issueProjectItemsResponse } from './issueProjectItems.js';\nimport type { DeliveryContext } from '../issue.js';\nimport { IssueFields, renderIssueBody } from '../issueContract.js';\nimport { syntheticDiscoveryConfig } from './discovery.js';\nexport function issue63Fixture() {\n const ready = IssueFields.parse({\n title: 'Guard active widget dependency additions',\n points: 2,\n problem: 'Unexplained blockers interrupt active work.',\n outcome: 'Require deliberate blocker additions.',\n acceptanceCriteria: [\n { behavior: 'Missing reasons refuse dependency writes.', verifiedBy: 'Native dependency regression fixture.' },\n ],\n outOfScope: ['Readiness changes.'],\n });\n const rows = new Map(\n [17, 18, 19].map((number) => [\n number,\n {\n number,\n id: 100 + number,\n node_id: `ISSUE${number}`,\n title: ready.title,\n body: renderIssueBody(ready),\n state: 'open',\n created_at: '2026-01-01T00:00:00Z',\n html_url: `https://github.com/example/widget/issues/${number}`,\n type: { name: 'Task' },\n },\n ]),\n );\n const edges = new Map<number, Set<number>>([\n [17, new Set()],\n [18, new Set()],\n [19, new Set()],\n ]);\n const statuses = new Map([\n [17, 'Active'],\n [18, 'Queued'],\n [19, 'Queued'],\n ]);\n const writes: string[] = [];\n const graphqlCalls: { query: string; variables: Record<string, unknown> }[] = [];\n const comments: { id: number; body: string; html_url: string; issue_url: string; user: { login: string } }[] = [];\n const history: Record<string, unknown>[] = [];\n const histories = new Map<number, Record<string, unknown>[]>();\n const controls = {\n timelineIncomplete: false,\n missingProjectIssue: undefined as number | undefined,\n missingProjectStatus: undefined as number | undefined,\n projectItemReadback: undefined as Record<string, unknown> | undefined,\n commentRace: undefined as (() => void) | undefined,\n actor: 'operator',\n corruptComment: false,\n failAdd: false,\n reads: 0,\n race: undefined as (() => void) | undefined,\n };\n const get = (n: number) => {\n const row = rows.get(n);\n if (!row) throw new Error('Unknown fixture issue');\n return row;\n };\n const configuration = {\n projectId: 'PROJECT',\n projectNumber: 1,\n title: 'Delivery',\n writable: true,\n pointsFieldId: 'POINTS',\n priorityFieldId: 'PRIORITY',\n statusFieldId: 'STATUS',\n statusOptionIds: { Todo: 'TODO', 'In Progress': 'ACTIVE', Blocked: 'BLOCKED', Done: 'DONE' },\n settings: {\n number: 1,\n title: 'Delivery',\n statusField: 'Flow',\n statuses: { Todo: 'Queued', 'In Progress': 'Active', Blocked: 'Waiting', Done: 'Shipped' },\n points: syntheticDiscoveryConfig.native.points,\n priority: syntheticDiscoveryConfig.native.priority,\n },\n };\n const context = {\n root: '/synthetic',\n repo: { owner: 'example', repo: 'widget' },\n config: syntheticDiscoveryConfig,\n projectConfiguration: configuration,\n clients: {\n role: 'author',\n authenticatedAuthor: async () => {\n if (!controls.actor) throw new Error('Author unavailable');\n return { actorLogin: controls.actor, credentialIdentity: 'user:1' };\n },\n rest: {\n issues: {\n get: async ({ issue_number }: { issue_number: number }) => ({ data: { ...get(issue_number) } }),\n update: async (input: { issue_number: number; body?: string; title?: string; type?: string }) => {\n writes.push('content');\n controls.race?.();\n controls.race = undefined;\n Object.assign(get(input.issue_number), input);\n if (input.type) get(input.issue_number).type = { name: input.type };\n return { data: get(input.issue_number) };\n },\n create: async (input: Record<string, unknown>) => {\n writes.push('create');\n const n = 20;\n rows.set(n, {\n ...get(18),\n ...input,\n number: n,\n id: 120,\n node_id: 'ISSUE20',\n html_url: 'https://github.com/example/widget/issues/20',\n } as ReturnType<typeof get>);\n edges.set(n, new Set());\n statuses.set(n, 'Queued');\n return { data: get(n) };\n },\n listForRepo: async () => ({ data: [...rows.values()] }),\n listComments: async ({ issue_number }: { issue_number: number }) => ({\n data: comments.filter((c) => c.issue_url.endsWith(`/issues/${issue_number}`)),\n }),\n createComment: async ({ body, issue_number }: { body: string; issue_number: number }) => {\n writes.push('comment');\n const c = {\n id: 91 + comments.length,\n body,\n html_url: `https://github.com/example/widget/issues/${issue_number}#issuecomment-${91 + comments.length}`,\n issue_url: `https://api.github.com/repos/example/widget/issues/${issue_number}`,\n user: { login: 'operator' },\n };\n comments.push(c);\n return { data: c };\n },\n getComment: async ({ comment_id }: { comment_id: number }) => {\n controls.commentRace?.();\n controls.commentRace = undefined;\n return {\n data: {\n ...comments.find((c) => c.id === comment_id),\n ...(controls.corruptComment ? { body: 'Wrong authority' } : {}),\n },\n };\n },\n listSubIssues: async () => ({ data: [] }),\n },\n request: async (route: string) => {\n if (!route.startsWith('GET')) writes.push('metadata');\n return {\n data: route.includes('/orgs/')\n ? [\n {\n id: 101,\n name: 'Estimate',\n data_type: 'single_select',\n options: ['1', '2', '4'].map((name) => ({ name })),\n },\n {\n id: 102,\n name: 'Urgency',\n data_type: 'single_select',\n options: ['High', 'Low'].map((name) => ({ name })),\n },\n ]\n : [{ issue_field_id: 101, issue_field_name: 'Estimate', data_type: 'single_select', value: '2' }],\n };\n },\n },\n graphql: async (query: string, v: Record<string, unknown>) => {\n graphqlCalls.push({ query, variables: structuredClone(v) });\n if (query.includes('NativeIssueHistory'))\n return {\n repository: {\n nameWithOwner: 'example/widget',\n issue: {\n id: `ISSUE${String(v.number)}`,\n number: v.number,\n repository: { nameWithOwner: 'example/widget' },\n timelineItems: {\n nodes: histories.get(Number(v.number)) ?? history,\n pageInfo: {\n hasNextPage: controls.timelineIncomplete,\n endCursor: controls.timelineIncomplete ? 'repeat' : null,\n },\n },\n },\n },\n };\n if (query.includes('blockedBy(first:')) {\n controls.reads++;\n return {\n repository: {\n issue: {\n parent: null,\n blockedBy: {\n nodes: [...(edges.get(Number(v.number)) ?? [])].map((n) => ({\n id: `ISSUE${n}`,\n number: n,\n title: 'Blocker',\n state: 'OPEN',\n repository: { nameWithOwner: 'example/widget' },\n })),\n pageInfo: { hasNextPage: false, endCursor: null },\n },\n },\n },\n };\n }\n if (query.includes('ProjectDeliveryIssueItems'))\n return issueProjectItemsResponse(\n v,\n [...rows.values()]\n .filter((row) => row.node_id === v.issueNodeId && row.number !== controls.missingProjectIssue)\n .map((r) => ({\n id: `ITEM${r.number}`,\n isArchived: false,\n content: { id: r.node_id },\n fieldValueByName:\n controls.missingProjectStatus === r.number\n ? null\n : {\n name: statuses.get(r.number),\n optionId:\n statuses.get(r.number) === 'Active'\n ? 'ACTIVE'\n : statuses.get(r.number) === 'Waiting'\n ? 'BLOCKED'\n : 'TODO',\n },\n })),\n );\n if (query.includes('UpdateProjectDeliveryStatus')) {\n const n = Number(String(v.itemId).replace('ITEM', ''));\n statuses.set(n, v.optionId === 'ACTIVE' ? 'Active' : v.optionId === 'BLOCKED' ? 'Waiting' : 'Queued');\n writes.push('status');\n return { updateProjectV2ItemFieldValue: { projectV2Item: { id: v.itemId } } };\n }\n if (query.includes('ProjectDeliveryItemReadback')) {\n const n = Number(String(v.itemId).replace('ITEM', ''));\n return {\n node: {\n id: v.itemId,\n isArchived: false,\n project: { id: 'PROJECT', number: 1 },\n content: { id: `ISSUE${n}` },\n fieldValueByName: {\n name: statuses.get(n),\n optionId: statuses.get(n) === 'Active' ? 'ACTIVE' : statuses.get(n) === 'Waiting' ? 'BLOCKED' : 'TODO',\n },\n ...controls.projectItemReadback,\n },\n };\n }\n if (query.includes('addBlockedBy')) {\n if (controls.failAdd) throw new Error('Native add failed');\n const n = Number(String(v.issue).replace('ISSUE', '')),\n b = Number(String(v.blocking).replace('ISSUE', ''));\n edges.get(n)!.add(b);\n writes.push('add');\n return { addBlockedBy: { issue: { number: n } } };\n }\n if (query.includes('removeBlockedBy')) {\n edges\n .get(Number(String(v.issue).replace('ISSUE', '')))!\n .delete(Number(String(v.blocking).replace('ISSUE', '')));\n writes.push('remove');\n return {};\n }\n const quiet = quietReadViewResponse(query, v);\n if (quiet !== undefined) return quiet;\n throw new Error('Unexpected fixture query ' + query);\n },\n },\n } as unknown as DeliveryContext;\n return { context, ready, rows, edges, statuses, writes, graphqlCalls, comments, history, histories, controls };\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,6BAA6B;AACtC,SAAS,iCAAiC;AAE1C,SAAS,aAAa,uBAAuB;AAC7C,SAAS,gCAAgC;
|
|
4
|
+
"sourcesContent": ["import { quietReadViewResponse } from './readView.js';\nimport { issueProjectItemsResponse } from './issueProjectItems.js';\nimport type { DeliveryContext } from '../issue.js';\nimport { IssueFields, renderIssueBody } from '../issueContract.js';\nimport { syntheticDiscoveryConfig } from './discovery.js';\nimport { withBuilder } from './builderReady.js';\nexport function issue63Fixture() {\n const ready = IssueFields.parse({\n title: 'Guard active widget dependency additions',\n points: 2,\n problem: 'Unexplained blockers interrupt active work.',\n outcome: 'Require deliberate blocker additions.',\n acceptanceCriteria: [\n { behavior: 'Missing reasons refuse dependency writes.', verifiedBy: 'Native dependency regression fixture.' },\n ],\n outOfScope: ['Readiness changes.'],\n });\n const rows = new Map(\n [17, 18, 19].map((number) => [\n number,\n {\n number,\n id: 100 + number,\n node_id: `ISSUE${number}`,\n title: ready.title,\n body: renderIssueBody(ready),\n state: 'open',\n created_at: '2026-01-01T00:00:00Z',\n html_url: `https://github.com/example/widget/issues/${number}`,\n type: { name: 'Task' },\n },\n ]),\n );\n const edges = new Map<number, Set<number>>([\n [17, new Set()],\n [18, new Set()],\n [19, new Set()],\n ]);\n const statuses = new Map([\n [17, 'Active'],\n [18, 'Queued'],\n [19, 'Queued'],\n ]);\n const writes: string[] = [];\n const graphqlCalls: { query: string; variables: Record<string, unknown> }[] = [];\n const comments: { id: number; body: string; html_url: string; issue_url: string; user: { login: string } }[] = [];\n const history: Record<string, unknown>[] = [];\n const histories = new Map<number, Record<string, unknown>[]>();\n const controls = {\n timelineIncomplete: false,\n missingProjectIssue: undefined as number | undefined,\n missingProjectStatus: undefined as number | undefined,\n projectItemReadback: undefined as Record<string, unknown> | undefined,\n commentRace: undefined as (() => void) | undefined,\n actor: 'operator',\n corruptComment: false,\n failAdd: false,\n reads: 0,\n race: undefined as (() => void) | undefined,\n };\n const get = (n: number) => {\n const row = rows.get(n);\n if (!row) throw new Error('Unknown fixture issue');\n return row;\n };\n const configuration = {\n projectId: 'PROJECT',\n projectNumber: 1,\n title: 'Delivery',\n writable: true,\n pointsFieldId: 'POINTS',\n priorityFieldId: 'PRIORITY',\n statusFieldId: 'STATUS',\n statusOptionIds: { Todo: 'TODO', 'In Progress': 'ACTIVE', Blocked: 'BLOCKED', Done: 'DONE' },\n settings: {\n number: 1,\n title: 'Delivery',\n statusField: 'Flow',\n statuses: { Todo: 'Queued', 'In Progress': 'Active', Blocked: 'Waiting', Done: 'Shipped' },\n points: syntheticDiscoveryConfig.native.points,\n priority: syntheticDiscoveryConfig.native.priority,\n },\n };\n const context = {\n root: '/synthetic',\n repo: { owner: 'example', repo: 'widget' },\n config: syntheticDiscoveryConfig,\n projectConfiguration: configuration,\n clients: {\n role: 'author',\n authenticatedAuthor: async () => {\n if (!controls.actor) throw new Error('Author unavailable');\n return { actorLogin: controls.actor, credentialIdentity: 'user:1' };\n },\n rest: {\n issues: {\n get: async ({ issue_number }: { issue_number: number }) => ({ data: { ...get(issue_number) } }),\n update: async (input: { issue_number: number; body?: string; title?: string; type?: string }) => {\n writes.push('content');\n controls.race?.();\n controls.race = undefined;\n Object.assign(get(input.issue_number), input);\n if (input.type) get(input.issue_number).type = { name: input.type };\n return { data: get(input.issue_number) };\n },\n create: async (input: Record<string, unknown>) => {\n writes.push('create');\n const n = 20;\n rows.set(n, {\n ...get(18),\n ...input,\n ...(typeof input.type === 'string' ? { type: { name: input.type } } : {}),\n number: n,\n id: 120,\n node_id: 'ISSUE20',\n html_url: 'https://github.com/example/widget/issues/20',\n } as ReturnType<typeof get>);\n edges.set(n, new Set());\n statuses.set(n, 'Queued');\n return { data: get(n) };\n },\n listForRepo: async () => ({ data: [...rows.values()] }),\n listComments: async ({ issue_number }: { issue_number: number }) => ({\n data: comments.filter((c) => c.issue_url.endsWith(`/issues/${issue_number}`)),\n }),\n createComment: async ({ body, issue_number }: { body: string; issue_number: number }) => {\n writes.push('comment');\n const c = {\n id: 91 + comments.length,\n body,\n html_url: `https://github.com/example/widget/issues/${issue_number}#issuecomment-${91 + comments.length}`,\n issue_url: `https://api.github.com/repos/example/widget/issues/${issue_number}`,\n user: { login: 'operator' },\n };\n comments.push(c);\n return { data: c };\n },\n getComment: async ({ comment_id }: { comment_id: number }) => {\n controls.commentRace?.();\n controls.commentRace = undefined;\n return {\n data: {\n ...comments.find((c) => c.id === comment_id),\n ...(controls.corruptComment ? { body: 'Wrong authority' } : {}),\n },\n };\n },\n listSubIssues: async () => ({ data: [] }),\n },\n request: async (route: string) => {\n if (!route.startsWith('GET')) writes.push('metadata');\n return {\n data: route.includes('/orgs/')\n ? [\n {\n id: 101,\n name: 'Estimate',\n data_type: 'single_select',\n options: ['1', '2', '4'].map((name) => ({ name })),\n },\n {\n id: 102,\n name: 'Urgency',\n data_type: 'single_select',\n options: ['High', 'Low'].map((name) => ({ name })),\n },\n ]\n : [\n { issue_field_id: 101, issue_field_name: 'Estimate', data_type: 'single_select', value: '2' },\n { issue_field_id: 102, issue_field_name: 'Urgency', data_type: 'single_select', value: 'High' },\n ],\n };\n },\n },\n graphql: async (query: string, v: Record<string, unknown>) => {\n graphqlCalls.push({ query, variables: structuredClone(v) });\n if (query.includes('NativeIssueHistory'))\n return {\n repository: {\n nameWithOwner: 'example/widget',\n issue: {\n id: `ISSUE${String(v.number)}`,\n number: v.number,\n repository: { nameWithOwner: 'example/widget' },\n timelineItems: {\n nodes: histories.get(Number(v.number)) ?? history,\n pageInfo: {\n hasNextPage: controls.timelineIncomplete,\n endCursor: controls.timelineIncomplete ? 'repeat' : null,\n },\n },\n },\n },\n };\n if (query.includes('blockedBy(first:')) {\n controls.reads++;\n return {\n repository: {\n issue: {\n parent: null,\n blockedBy: {\n nodes: [...(edges.get(Number(v.number)) ?? [])].map((n) => ({\n id: `ISSUE${n}`,\n number: n,\n title: 'Blocker',\n state: 'OPEN',\n repository: { nameWithOwner: 'example/widget' },\n })),\n pageInfo: { hasNextPage: false, endCursor: null },\n },\n },\n },\n };\n }\n if (query.includes('ProjectDeliveryIssueItems'))\n return issueProjectItemsResponse(\n v,\n [...rows.values()]\n .filter((row) => row.node_id === v.issueNodeId && row.number !== controls.missingProjectIssue)\n .map((r) => ({\n id: `ITEM${r.number}`,\n isArchived: false,\n content: { id: r.node_id },\n fieldValueByName:\n controls.missingProjectStatus === r.number\n ? null\n : {\n name: statuses.get(r.number),\n optionId:\n statuses.get(r.number) === 'Active'\n ? 'ACTIVE'\n : statuses.get(r.number) === 'Waiting'\n ? 'BLOCKED'\n : 'TODO',\n },\n })),\n );\n if (query.includes('UpdateProjectDeliveryStatus')) {\n const n = Number(String(v.itemId).replace('ITEM', ''));\n statuses.set(n, v.optionId === 'ACTIVE' ? 'Active' : v.optionId === 'BLOCKED' ? 'Waiting' : 'Queued');\n writes.push('status');\n return { updateProjectV2ItemFieldValue: { projectV2Item: { id: v.itemId } } };\n }\n if (query.includes('ProjectDeliveryItemReadback')) {\n const n = Number(String(v.itemId).replace('ITEM', ''));\n return {\n node: {\n id: v.itemId,\n isArchived: false,\n project: { id: 'PROJECT', number: 1 },\n content: { id: `ISSUE${n}` },\n fieldValueByName: {\n name: statuses.get(n),\n optionId: statuses.get(n) === 'Active' ? 'ACTIVE' : statuses.get(n) === 'Waiting' ? 'BLOCKED' : 'TODO',\n },\n ...controls.projectItemReadback,\n },\n };\n }\n if (query.includes('addBlockedBy')) {\n if (controls.failAdd) throw new Error('Native add failed');\n const n = Number(String(v.issue).replace('ISSUE', '')),\n b = Number(String(v.blocking).replace('ISSUE', ''));\n edges.get(n)!.add(b);\n writes.push('add');\n return { addBlockedBy: { issue: { number: n } } };\n }\n if (query.includes('removeBlockedBy')) {\n edges\n .get(Number(String(v.issue).replace('ISSUE', '')))!\n .delete(Number(String(v.blocking).replace('ISSUE', '')));\n writes.push('remove');\n return {};\n }\n const quiet = quietReadViewResponse(query, v);\n if (quiet !== undefined) return quiet;\n throw new Error('Unexpected fixture query ' + query);\n },\n },\n } as unknown as DeliveryContext;\n const createInput = withBuilder({ ...ready, issueType: 'Task', priority: 'High' });\n return {\n context,\n ready,\n createInput,\n rows,\n edges,\n statuses,\n writes,\n graphqlCalls,\n comments,\n history,\n histories,\n controls,\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,6BAA6B;AACtC,SAAS,iCAAiC;AAE1C,SAAS,aAAa,uBAAuB;AAC7C,SAAS,gCAAgC;AACzC,SAAS,mBAAmB;AACrB,SAAS,iBAAiB;AAC/B,QA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,OAAO,EAAE,KAAK,EAAE,QAAQ,SAAS,EAAE,CAAC,CAAC,EAChD,OAAO,OAAO,OAAO,EAAE,QAAQ,EAAE,QAAQ,SAAS,EAAE,CAAC,CAAC;AACzD,iBAAO,KAAK,QAAQ;AACpB,iBAAO,CAAC;AAAA,QACV;AACA,cAAM,QAAQ,sBAAsB,OAAO,CAAC;AAC5C,YAAI,UAAU,OAAW,QAAO;AAChC,cAAM,IAAI,MAAM,8BAA8B,KAAK;AAAA,MACrD;AAAA,IACF;AAAA,EACF;AACA,QAAM,cAAc,YAAY,EAAE,GAAG,OAAO,WAAW,QAAQ,UAAU,OAAO,CAAC;AACjF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/issue.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type ProjectTradeKey, type ProjectTradePatch } from './github/projectNu
|
|
|
7
7
|
import { type RepoCoordinates } from './github/repo.js';
|
|
8
8
|
import { type AgentReadinessResult } from './services/agentReadinessService.js';
|
|
9
9
|
import { type JournalInput } from './issueJournal.js';
|
|
10
|
-
import { type ProjectStatusPatchData, type IssueFieldsInput, type IssueDiagnostic, type IssueDeferralData } from './issueContract.js';
|
|
10
|
+
import { type ProjectStatusPatchData, type IssueFieldsInput, type IssueDiagnostic, type IssueDeferralData, type BuilderTierData } from './issueContract.js';
|
|
11
11
|
export interface IssueCommentReadback {
|
|
12
12
|
commentId: number;
|
|
13
13
|
url: string;
|
|
@@ -301,6 +301,7 @@ export type IssueChildCounts = Pick<IssueChildProgress, 'childCount' | 'closedCh
|
|
|
301
301
|
export interface IssueInfo {
|
|
302
302
|
childProgress?: IssueChildProgress | IssueChildCounts;
|
|
303
303
|
deferred?: IssueDeferralData | null;
|
|
304
|
+
builder?: BuilderTierData | null;
|
|
304
305
|
routing?: LoadedDeliveryConfig['routing'];
|
|
305
306
|
blockedBy: number[];
|
|
306
307
|
body: string;
|
package/dist/issue.js
CHANGED
|
@@ -251,17 +251,21 @@ function prepareIssueWrite(input, current, forIntent = false) {
|
|
|
251
251
|
return value === void 0 ? [] : [[key, value]];
|
|
252
252
|
})
|
|
253
253
|
);
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
254
|
+
const requireBuilder = input.requireBuilder === true || currentParsed?.issue.draft === true && input.park !== true && (input.draft ?? parsed.issue.draft) === false;
|
|
255
|
+
const issue = requireIssue(
|
|
256
|
+
{
|
|
257
|
+
...parsed.issue,
|
|
258
|
+
// Body replacements and unrelated typed patches cannot implicitly resume deferred work.
|
|
259
|
+
deferral: input.undefer === true ? void 0 : input.defer ?? (current === void 0 ? parsed.issue.deferral : currentParsed?.issue.deferral),
|
|
260
|
+
...metadata,
|
|
261
|
+
...fields,
|
|
262
|
+
title,
|
|
263
|
+
...legacyBody === void 0 ? {} : { legacyBody },
|
|
264
|
+
...input.retainLegacyBody !== void 0 ? { retainLegacyBody: input.retainLegacyBody } : incomingLegacy ? { retainLegacyBody: true } : current !== void 0 && legacyBody !== void 0 && input.preserveHistory !== false && !statusOnly ? { retainLegacyBody: false } : {},
|
|
265
|
+
...input.park ? { draft: true } : {}
|
|
266
|
+
},
|
|
267
|
+
requireBuilder ? { requireBuilder: true } : {}
|
|
268
|
+
);
|
|
265
269
|
const unchangedContract = currentParsed !== void 0 && JSON.stringify(issue) === JSON.stringify(currentParsed.issue);
|
|
266
270
|
const legacyFormatting = unchangedContract && parsed.legacyFormatting === true;
|
|
267
271
|
const base = parsed.status ?? currentParsed?.status;
|
|
@@ -295,7 +299,7 @@ function prepareIssueWrite(input, current, forIntent = false) {
|
|
|
295
299
|
body,
|
|
296
300
|
statusOnly,
|
|
297
301
|
preserveHistory: input.preserveHistory ?? ((currentLegacy || parsed.legacy || legacyBody !== void 0 && issue.retainLegacyBody === false && currentParsed?.issue.retainLegacyBody !== false) && !statusOnly),
|
|
298
|
-
warnings: issueWarnings(issue
|
|
302
|
+
warnings: issueWarnings(issue),
|
|
299
303
|
...(currentLegacy || parsed.legacy) && prior !== void 0 ? { conversion: { priorBody: prior, canonicalBody: body, diff: issueBodyDiff(prior, body) } } : {}
|
|
300
304
|
};
|
|
301
305
|
}
|
|
@@ -320,7 +324,7 @@ class CreatedTrackingIssueError extends DeliveryError {
|
|
|
320
324
|
async function createIssue(context, input) {
|
|
321
325
|
if (context.clients.role !== "author") throw new DeliveryError("Issue writes require the configured author role.");
|
|
322
326
|
const canonicalBody = canonicalIssueBody(input);
|
|
323
|
-
const prepared = prepareIssueWrite(input);
|
|
327
|
+
const prepared = prepareIssueWrite({ ...input, requireBuilder: true });
|
|
324
328
|
const originalIntent = digestValue(
|
|
325
329
|
Object.fromEntries(
|
|
326
330
|
Object.entries({ ...input, opId: void 0, body: canonicalBody }).filter(([, value]) => value !== void 0)
|
|
@@ -344,6 +348,14 @@ async function createIssue(context, input) {
|
|
|
344
348
|
if (input.priority !== void 0 && !context.config.native.priority.values.includes(input.priority)) {
|
|
345
349
|
throw new DeliveryError("Unsupported configured Priority value.");
|
|
346
350
|
}
|
|
351
|
+
if (!prepared.issue.draft) {
|
|
352
|
+
const missing = [];
|
|
353
|
+
if (input.issueType === void 0)
|
|
354
|
+
missing.push(missingNativeField("issue-type", "issueType", context.config.native.issueTypes));
|
|
355
|
+
if (input.priority === void 0 && !prepared.issue.epic)
|
|
356
|
+
missing.push(missingNativeField("priority", "priority", context.config.native.priority.values));
|
|
357
|
+
if (missing.length > 0) throw new IssueValidationError(missing);
|
|
358
|
+
}
|
|
347
359
|
const { clients, config, repo } = context;
|
|
348
360
|
const targets = await resolveNativeRelationshipTargets({
|
|
349
361
|
blockers: input.blockedBy ?? [],
|
|
@@ -792,9 +804,11 @@ async function listIssues(context, input, options = {}) {
|
|
|
792
804
|
if (input.parentIssueNumber !== void 0 && (input.parentIssueNumber === null ? relationships.parentNumber !== null : localParent !== input.parentIssueNumber))
|
|
793
805
|
return null;
|
|
794
806
|
if (input.projectStatus !== void 0 && (project?.status ?? null) !== input.projectStatus) return null;
|
|
807
|
+
const readback = deferralReadback(current.body, current.title);
|
|
808
|
+
delete readback.builder;
|
|
795
809
|
const listed = {
|
|
796
810
|
...options.capacityRead ? { nodeId: current.node_id, fieldIds: Object.fromEntries(catalog.map((field) => [field.name, field.id])) } : {},
|
|
797
|
-
...
|
|
811
|
+
...readback,
|
|
798
812
|
number: current.number,
|
|
799
813
|
title: current.title,
|
|
800
814
|
state: current.state,
|
|
@@ -932,6 +946,18 @@ const BODY_FREE_KEYS = /* @__PURE__ */ new Set([
|
|
|
932
946
|
..."projectStatus milestone labels priority startDate targetDate".split(" "),
|
|
933
947
|
..."expectedTradesPerDay measuredTradesPerDay".split(" ")
|
|
934
948
|
]);
|
|
949
|
+
function oldDataKeys(body) {
|
|
950
|
+
const prefix = "<!-- ai-delivery:issue-data@1 ";
|
|
951
|
+
const start = body.lastIndexOf(prefix);
|
|
952
|
+
const end = body.indexOf(" -->", start);
|
|
953
|
+
try {
|
|
954
|
+
return new Set(
|
|
955
|
+
start < 0 || end < 0 ? [] : Object.keys(JSON.parse(body.slice(start + prefix.length, end)))
|
|
956
|
+
);
|
|
957
|
+
} catch {
|
|
958
|
+
return /* @__PURE__ */ new Set();
|
|
959
|
+
}
|
|
960
|
+
}
|
|
935
961
|
function rebuildableWrite(input, current) {
|
|
936
962
|
try {
|
|
937
963
|
return prepareIssueWrite(input, current);
|
|
@@ -952,7 +978,13 @@ function rebuildableWrite(input, current) {
|
|
|
952
978
|
);
|
|
953
979
|
if (validateIssue(fields, true).failures.length) throw error;
|
|
954
980
|
const prepared = prepareIssueWrite(full, void 0);
|
|
955
|
-
const
|
|
981
|
+
const carried = oldDataKeys(current.body);
|
|
982
|
+
const reset = [
|
|
983
|
+
"draft",
|
|
984
|
+
"openQuestions",
|
|
985
|
+
"context",
|
|
986
|
+
...["builder", "extends", "decisions", "surface", "fences", "proof"].filter((key) => carried.has(key))
|
|
987
|
+
].filter((key) => input[key] === void 0);
|
|
956
988
|
if (reset.length) {
|
|
957
989
|
const message = `Rebuilt the hand-edited body (old one in the history comment); reset because not sent: ${reset.join(", ")}.`;
|
|
958
990
|
prepared.warnings.push({ code: "body.rebuilt", field: "body", message, fixHint: message });
|
|
@@ -1859,10 +1891,11 @@ function childCounts(children) {
|
|
|
1859
1891
|
function deferralReadback(body, title) {
|
|
1860
1892
|
if (body === void 0) return {};
|
|
1861
1893
|
try {
|
|
1862
|
-
|
|
1894
|
+
const { issue } = parseIssueBody(body ?? "", { title });
|
|
1895
|
+
return { deferred: issue.deferral ?? null, builder: issue.builder ?? null };
|
|
1863
1896
|
} catch (error) {
|
|
1864
1897
|
if (!(error instanceof IssueValidationError)) throw error;
|
|
1865
|
-
return {};
|
|
1898
|
+
return { builder: null };
|
|
1866
1899
|
}
|
|
1867
1900
|
}
|
|
1868
1901
|
const DirectIssueChild = z.object({
|
|
@@ -2007,6 +2040,10 @@ async function listIssueSubissues(context, issueNumber) {
|
|
|
2007
2040
|
if ("pull_request" in issue) throw new DeliveryError("Requested issue number is a pull request.");
|
|
2008
2041
|
return (await readDirectIssueChildren(context, issueNumber, issue)).map((child) => child.number);
|
|
2009
2042
|
}
|
|
2043
|
+
function missingNativeField(code, field, values) {
|
|
2044
|
+
const fixHint = `Choose ${code}: ${values.join(", ")}.`;
|
|
2045
|
+
return { code, field, fixHint, message: fixHint };
|
|
2046
|
+
}
|
|
2010
2047
|
async function readyCheck(context, issueNumber, onReadback) {
|
|
2011
2048
|
const observation = await readIssueInfo(context, issueNumber);
|
|
2012
2049
|
const { info } = observation;
|
|
@@ -2021,6 +2058,7 @@ async function readyCheck(context, issueNumber, onReadback) {
|
|
|
2021
2058
|
blockedBy: info.blockedBy,
|
|
2022
2059
|
body: info.body,
|
|
2023
2060
|
...info.points === void 0 ? {} : { points: info.points },
|
|
2061
|
+
...info.priority === void 0 ? {} : { priority: info.priority },
|
|
2024
2062
|
repoRoot: void 0,
|
|
2025
2063
|
title: info.title,
|
|
2026
2064
|
...info.issueType === null ? {} : { issueType: info.issueType },
|