@aviaratech/ai-delivery 0.3.43 → 0.3.45
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 +1 -1
- package/dist/agentReadiness.test.js +12 -0
- package/dist/agentReadiness.test.js.map +2 -2
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +2 -2
- package/dist/directoryIndependent.test.js +22 -3
- package/dist/directoryIndependent.test.js.map +3 -3
- package/dist/dispatch.js.map +2 -2
- package/dist/fixtures/builderReady.d.ts +4 -0
- package/dist/fixtures/builderReady.js +2 -0
- package/dist/fixtures/builderReady.js.map +2 -2
- package/dist/fixtures/inertTarget.d.ts +11 -0
- package/dist/fixtures/inertTarget.js +5 -0
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/fixtures/issue63.d.ts +7 -0
- package/dist/issue.d.ts +21 -1
- package/dist/issue.js +103 -12
- package/dist/issue.js.map +2 -2
- package/dist/issueBlockerGuard.test.js +11 -0
- package/dist/issueBlockerGuard.test.js.map +2 -2
- package/dist/issueContract.d.ts +23 -0
- package/dist/issueContract.js +77 -9
- package/dist/issueContract.js.map +2 -2
- package/dist/issueContract.test.d.ts +3 -0
- package/dist/issueContract.test.js +92 -5
- package/dist/issueContract.test.js.map +2 -2
- package/dist/issueIntake.test.js +37 -0
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueJournal.d.ts +13 -9
- package/dist/issueJournal.js +14 -10
- package/dist/issueJournal.js.map +2 -2
- package/dist/issueJournal.test.js +11 -8
- package/dist/issueJournal.test.js.map +2 -2
- package/dist/issueTracking.test.js +135 -2
- package/dist/issueTracking.test.js.map +3 -3
- package/dist/mcp/index.js +10 -3
- package/dist/mcp/index.js.map +2 -2
- package/dist/mcp/tools.d.ts +49 -25
- package/dist/mcp/tools.js +23 -5
- package/dist/mcp/tools.js.map +2 -2
- package/dist/readView.d.ts +2 -0
- package/dist/readView.js +1 -1
- package/dist/readView.js.map +2 -2
- package/dist/releaseReconciliation.test.js +20 -6
- package/dist/releaseReconciliation.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 +139 -113
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/ticket-design/SKILL.md +11 -10
|
@@ -273,4 +273,15 @@ test("duplicate authority markers are refused before another content write", asy
|
|
|
273
273
|
);
|
|
274
274
|
assert.deepEqual(f.writes, before);
|
|
275
275
|
});
|
|
276
|
+
test("blockedBy with blockers naming each issue succeeds and shows that text", async () => {
|
|
277
|
+
const f = guardFixture();
|
|
278
|
+
const result = await updateIssue(f.context, {
|
|
279
|
+
issueNumber: 17,
|
|
280
|
+
blockedBy: [18, 19],
|
|
281
|
+
status: { blockers: "#19, #18" },
|
|
282
|
+
overrideReason: "Wait for the newly identified prerequisites."
|
|
283
|
+
});
|
|
284
|
+
assert.match(result.body ?? "", /\*\*Blockers:\*\* #19, #18/u);
|
|
285
|
+
assert.deepEqual([...f.edges.get(17)], [18, 19]);
|
|
286
|
+
});
|
|
276
287
|
//# sourceMappingURL=issueBlockerGuard.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/issueBlockerGuard.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport { updateIssue, createIssue, CreatedTrackingIssueError } from './issue.js';\nimport { issue63Fixture as guardFixture } from './fixtures/issue63.js';\n\ntest('forward creation reads a known Blocked item when its list status projection is empty', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 20;\n const result = await createIssue(f.context, { ...f.createInput, blockedBy: [18] });\n assert.equal(result.created.number, 20);\n assert.equal(result.created.url, 'https://github.com/example/widget/issues/20');\n assert.deepEqual([...f.edges.get(20)!], [18]);\n assert.equal(f.statuses.get(20), 'Waiting');\n assert.ok(f.writes.indexOf('status') < f.writes.indexOf('add'));\n assert.deepEqual(\n f.graphqlCalls.filter((call) => call.query.includes('addBlockedBy')).map((call) => call.variables),\n [{ blocking: 'ISSUE18', issue: 'ISSUE20' }],\n );\n const reads = f.graphqlCalls.filter((call) => call.query.includes('ProjectDeliveryItemReadback'));\n assert.ok(reads.length >= 2, 'Status synchronization and dependency guard must read the exact item.');\n assert.ok(reads.every((call) => call.variables.itemId === 'ITEM20' && call.variables.statusField === 'Flow'));\n assert.equal(f.comments.length, 0);\n});\n\ntest('a forward dependency failure preserves the created issue and update repairs its Blocked item', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 20;\n f.controls.failAdd = true;\n await assert.rejects(createIssue(f.context, { ...f.createInput, blockedBy: [18] }), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.deepEqual(error.created, {\n number: 20,\n title: f.ready.title,\n url: 'https://github.com/example/widget/issues/20',\n });\n assert.match(error.message, /Native add failed/u);\n assert.match(error.message, /Resume this known issue/u);\n return true;\n });\n assert.equal(f.statuses.get(20), 'Waiting');\n assert.deepEqual([...f.edges.get(20)!], []);\n f.controls.failAdd = false;\n const repaired = await updateIssue(f.context, { issueNumber: 20, blockedBy: [18] });\n assert.equal(repaired.issueNumber, 20);\n assert.equal(repaired.projectStatus, 'Blocked');\n assert.deepEqual(repaired.blockedBy, [18]);\n await updateIssue(f.context, { issueNumber: 20, blockedBy: [18] });\n assert.equal(f.writes.filter((write) => write === 'create').length, 1);\n assert.equal(f.writes.filter((write) => write === 'add').length, 1);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n});\n\ntest('an exact active item still requires an override when the list projection is empty', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 17;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.deepEqual(f.writes, []);\n await updateIssue(f.context, {\n issueNumber: 17,\n blockedBy: [18],\n overrideReason: 'Wait for the newly identified prerequisite.',\n });\n assert.deepEqual([...f.edges.get(17)!], [18]);\n assert.equal(f.comments.length, 1);\n});\n\ntest('missing or contradictory exact item evidence refuses a dependency without writes', async () => {\n for (const readback of [\n { fieldValueByName: null },\n { isArchived: true },\n { id: 'ITEM18' },\n { project: { id: 'OTHER', number: 1 } },\n { project: { id: 'PROJECT', number: 2 } },\n { content: { id: 'ISSUE18' } },\n { fieldValueByName: { name: 'Waiting', optionId: 'ACTIVE' } },\n ]) {\n const f = guardFixture();\n f.statuses.set(17, 'Waiting');\n f.controls.missingProjectStatus = 17;\n f.controls.projectItemReadback = readback;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /Project/u);\n assert.deepEqual(f.writes, []);\n assert.deepEqual([...f.edges.get(17)!], []);\n }\n const absent = guardFixture();\n absent.controls.missingProjectIssue = 17;\n await assert.rejects(updateIssue(absent.context, { issueNumber: 17, blockedBy: [18] }), /unresolved/u);\n assert.deepEqual(absent.writes, []);\n});\n\ntest('new blocker on active work refuses before every affected write without an override reason', async () => {\n const f = guardFixture();\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.deepEqual(f.writes, []);\n});\n\ntest('reciprocal creation preflights the active dependent before creating an issue', async () => {\n const f = guardFixture();\n await assert.rejects(\n createIssue(f.context, { ...f.createInput, blocks: [17] } as Parameters<typeof createIssue>[1]),\n /overrideReason/u,\n );\n assert.deepEqual(f.writes, []);\n});\n\ntest('an authorized active addition records verified evidence before the edge and retries once', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Await prerequisite validation.' }),\n /Native add failed/u,\n );\n assert.equal(f.comments.length, 1);\n assert.equal(f.edges.get(17)?.size, 0);\n const evidence = f.comments[0]!.body;\n f.controls.failAdd = false;\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Await prerequisite validation.' });\n assert.equal(f.comments.length, 1);\n assert.equal(f.comments[0]!.body, evidence);\n assert.deepEqual([...f.edges.get(17)!], [18]);\n assert.ok(f.writes.indexOf('comment') < f.writes.indexOf('add'));\n});\ntest('verified evidence conflicts and comment readback drift refuse the native edge', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Original reason' }));\n f.controls.failAdd = false;\n const priorWrites = [...f.writes];\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Changed reason' }),\n /conflicts/u,\n );\n assert.deepEqual(f.writes, priorWrites);\n assert.equal(f.comments.length, 1);\n assert.equal(f.edges.get(17)?.size, 0);\n const other = guardFixture();\n other.controls.corruptComment = true;\n await assert.rejects(\n updateIssue(other.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Documented prerequisite' }),\n /readback/u,\n );\n assert.equal(other.edges.get(17)?.size, 0);\n});\ntest('actual additions are guarded after an initially existing edge disappears', async () => {\n const f = guardFixture();\n f.edges.get(17)!.add(18);\n f.controls.race = () => f.edges.get(17)!.clear();\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.equal(f.edges.get(17)?.size, 0);\n assert.ok(!f.writes.includes('add'));\n});\ntest('preflight active observation remains sticky after a concurrent status change', async () => {\n const f = guardFixture();\n f.controls.race = () => f.statuses.set(17, 'Queued');\n await updateIssue(f.context, {\n issueNumber: 17,\n blockedBy: [18],\n overrideReason: 'Required despite concurrent parking',\n });\n assert.equal(f.comments.length, 1);\n assert.match(f.comments[0]!.body, /In Progress/u);\n});\ntest('inactive addition needs no override while a newly active dependent is guarded', async () => {\n const f = guardFixture();\n f.statuses.set(17, 'Queued');\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18] });\n assert.equal(f.comments.length, 0);\n const race = guardFixture();\n race.statuses.set(17, 'Queued');\n race.controls.race = () => race.statuses.set(17, 'Active');\n await assert.rejects(updateIssue(race.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.ok(!race.writes.includes('add'));\n});\ntest('remove and re-add uses a new native removal episode', async () => {\n const f = guardFixture();\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'First episode' });\n f.edges.get(17)!.clear();\n f.statuses.set(17, 'Active');\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'REMOVE1',\n createdAt: '2026-01-02T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Second episode' });\n assert.equal(f.comments.length, 2);\n assert.match(f.comments[1]!.body, /REMOVE1/u);\n});\ntest('incomplete active history and unavailable author refuse before writes', async () => {\n const f = guardFixture();\n f.controls.timelineIncomplete = true;\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Complete dependency history/u,\n );\n assert.deepEqual(f.writes, []);\n const noAuthor = guardFixture();\n noAuthor.controls.actor = '';\n await assert.rejects(\n updateIssue(noAuthor.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Author unavailable/u,\n );\n assert.deepEqual(noAuthor.writes, []);\n});\ntest('reciprocal create preserves unrelated edges and provides known-created recovery', async () => {\n const f = guardFixture();\n f.edges.get(17)!.add(19);\n f.controls.failAdd = true;\n await assert.rejects(\n createIssue(f.context, { ...f.createInput, blocks: [17], overrideReason: 'New prerequisite' }),\n (error) => error instanceof CreatedTrackingIssueError && error.created.number === 20,\n );\n assert.deepEqual([...f.edges.get(17)!], [19]);\n assert.equal(f.comments.length, 1);\n f.controls.failAdd = false;\n await updateIssue(f.context, { issueNumber: 20, blocks: [17], overrideReason: 'New prerequisite' });\n assert.deepEqual([...f.edges.get(17)!], [19, 20]);\n assert.equal(f.comments.length, 1);\n});\n\ntest('forward create refuses PR and foreign endpoint identities before creation', async () => {\n for (const bad of [{ pull_request: {} }, { html_url: 'https://github.com/foreign/repo/issues/18' }, { number: 19 }]) {\n const f = guardFixture();\n Object.assign(f.rows.get(18)!, bad);\n await assert.rejects(createIssue(f.context, { ...f.createInput, blockedBy: [18] }), /endpoint|repository issue/u);\n assert.deepEqual(f.writes, []);\n }\n});\ntest('missing blocker identity and ambiguous removal history refuse during preflight', async () => {\n const f = guardFixture();\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'R',\n createdAt: '2026-01-01T00:00:00Z',\n blockingIssue: null,\n });\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Complete dependency history/u,\n );\n assert.deepEqual(f.writes, []);\n const ambiguous = guardFixture();\n for (const id of ['R1', 'R2'])\n ambiguous.history.push({\n __typename: 'BlockedByRemovedEvent',\n id,\n createdAt: '2026-01-01T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await assert.rejects(\n updateIssue(ambiguous.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /ambiguous/u,\n );\n assert.deepEqual(ambiguous.writes, []);\n});\ntest('a removal during comment readback refuses authority from the earlier episode', async () => {\n const f = guardFixture();\n f.controls.commentRace = () =>\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'LATER',\n createdAt: '2026-01-03T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /episode changed/u,\n );\n assert.equal(f.edges.get(17)?.size, 0);\n assert.ok(!f.writes.includes('add'));\n});\n\ntest('duplicate authority markers are refused before another content write', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }));\n f.comments.push({ ...f.comments[0]!, id: 999 });\n f.controls.failAdd = false;\n const before = [...f.writes];\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /duplicate/u,\n );\n assert.deepEqual(f.writes, before);\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,aAAa,aAAa,iCAAiC;AACpE,SAAS,kBAAkB,oBAAoB;AAE/C,KAAK,wFAAwF,YAAY;AACvG,QAAM,IAAI,aAAa;AACvB,IAAE,SAAS,uBAAuB;AAClC,QAAM,SAAS,MAAM,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,WAAW,CAAC,EAAE,EAAE,CAAC;AACjF,SAAO,MAAM,OAAO,QAAQ,QAAQ,EAAE;AACtC,SAAO,MAAM,OAAO,QAAQ,KAAK,6CAA6C;AAC9E,SAAO,UAAU,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,CAAE,GAAG,CAAC,EAAE,CAAC;AAC5C,SAAO,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS;AAC1C,SAAO,GAAG,EAAE,OAAO,QAAQ,QAAQ,IAAI,EAAE,OAAO,QAAQ,KAAK,CAAC;AAC9D,SAAO;AAAA,IACL,EAAE,aAAa,OAAO,CAAC,SAAS,KAAK,MAAM,SAAS,cAAc,CAAC,EAAE,IAAI,CAAC,SAAS,KAAK,SAAS;AAAA,IACjG,CAAC,EAAE,UAAU,WAAW,OAAO,UAAU,CAAC;AAAA,EAC5C;AACA,QAAM,QAAQ,EAAE,aAAa,OAAO,CAAC,SAAS,KAAK,MAAM,SAAS,6BAA6B,CAAC;AAChG,SAAO,GAAG,MAAM,UAAU,GAAG,uEAAuE;AACpG,SAAO,GAAG,MAAM,MAAM,CAAC,SAAS,KAAK,UAAU,WAAW,YAAY,KAAK,UAAU,gBAAgB,MAAM,CAAC;AAC5G,SAAO,MAAM,EAAE,SAAS,QAAQ,CAAC;AACnC,CAAC;AAED,KA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\nimport { test } from 'vitest';\nimport { updateIssue, createIssue, CreatedTrackingIssueError } from './issue.js';\nimport { issue63Fixture as guardFixture } from './fixtures/issue63.js';\n\ntest('forward creation reads a known Blocked item when its list status projection is empty', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 20;\n const result = await createIssue(f.context, { ...f.createInput, blockedBy: [18] });\n assert.equal(result.created.number, 20);\n assert.equal(result.created.url, 'https://github.com/example/widget/issues/20');\n assert.deepEqual([...f.edges.get(20)!], [18]);\n assert.equal(f.statuses.get(20), 'Waiting');\n assert.ok(f.writes.indexOf('status') < f.writes.indexOf('add'));\n assert.deepEqual(\n f.graphqlCalls.filter((call) => call.query.includes('addBlockedBy')).map((call) => call.variables),\n [{ blocking: 'ISSUE18', issue: 'ISSUE20' }],\n );\n const reads = f.graphqlCalls.filter((call) => call.query.includes('ProjectDeliveryItemReadback'));\n assert.ok(reads.length >= 2, 'Status synchronization and dependency guard must read the exact item.');\n assert.ok(reads.every((call) => call.variables.itemId === 'ITEM20' && call.variables.statusField === 'Flow'));\n assert.equal(f.comments.length, 0);\n});\n\ntest('a forward dependency failure preserves the created issue and update repairs its Blocked item', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 20;\n f.controls.failAdd = true;\n await assert.rejects(createIssue(f.context, { ...f.createInput, blockedBy: [18] }), (error) => {\n assert.ok(error instanceof CreatedTrackingIssueError);\n assert.deepEqual(error.created, {\n number: 20,\n title: f.ready.title,\n url: 'https://github.com/example/widget/issues/20',\n });\n assert.match(error.message, /Native add failed/u);\n assert.match(error.message, /Resume this known issue/u);\n return true;\n });\n assert.equal(f.statuses.get(20), 'Waiting');\n assert.deepEqual([...f.edges.get(20)!], []);\n f.controls.failAdd = false;\n const repaired = await updateIssue(f.context, { issueNumber: 20, blockedBy: [18] });\n assert.equal(repaired.issueNumber, 20);\n assert.equal(repaired.projectStatus, 'Blocked');\n assert.deepEqual(repaired.blockedBy, [18]);\n await updateIssue(f.context, { issueNumber: 20, blockedBy: [18] });\n assert.equal(f.writes.filter((write) => write === 'create').length, 1);\n assert.equal(f.writes.filter((write) => write === 'add').length, 1);\n assert.deepEqual([...f.edges.get(20)!], [18]);\n});\n\ntest('an exact active item still requires an override when the list projection is empty', async () => {\n const f = guardFixture();\n f.controls.missingProjectStatus = 17;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.deepEqual(f.writes, []);\n await updateIssue(f.context, {\n issueNumber: 17,\n blockedBy: [18],\n overrideReason: 'Wait for the newly identified prerequisite.',\n });\n assert.deepEqual([...f.edges.get(17)!], [18]);\n assert.equal(f.comments.length, 1);\n});\n\ntest('missing or contradictory exact item evidence refuses a dependency without writes', async () => {\n for (const readback of [\n { fieldValueByName: null },\n { isArchived: true },\n { id: 'ITEM18' },\n { project: { id: 'OTHER', number: 1 } },\n { project: { id: 'PROJECT', number: 2 } },\n { content: { id: 'ISSUE18' } },\n { fieldValueByName: { name: 'Waiting', optionId: 'ACTIVE' } },\n ]) {\n const f = guardFixture();\n f.statuses.set(17, 'Waiting');\n f.controls.missingProjectStatus = 17;\n f.controls.projectItemReadback = readback;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /Project/u);\n assert.deepEqual(f.writes, []);\n assert.deepEqual([...f.edges.get(17)!], []);\n }\n const absent = guardFixture();\n absent.controls.missingProjectIssue = 17;\n await assert.rejects(updateIssue(absent.context, { issueNumber: 17, blockedBy: [18] }), /unresolved/u);\n assert.deepEqual(absent.writes, []);\n});\n\ntest('new blocker on active work refuses before every affected write without an override reason', async () => {\n const f = guardFixture();\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.deepEqual(f.writes, []);\n});\n\ntest('reciprocal creation preflights the active dependent before creating an issue', async () => {\n const f = guardFixture();\n await assert.rejects(\n createIssue(f.context, { ...f.createInput, blocks: [17] } as Parameters<typeof createIssue>[1]),\n /overrideReason/u,\n );\n assert.deepEqual(f.writes, []);\n});\n\ntest('an authorized active addition records verified evidence before the edge and retries once', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Await prerequisite validation.' }),\n /Native add failed/u,\n );\n assert.equal(f.comments.length, 1);\n assert.equal(f.edges.get(17)?.size, 0);\n const evidence = f.comments[0]!.body;\n f.controls.failAdd = false;\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Await prerequisite validation.' });\n assert.equal(f.comments.length, 1);\n assert.equal(f.comments[0]!.body, evidence);\n assert.deepEqual([...f.edges.get(17)!], [18]);\n assert.ok(f.writes.indexOf('comment') < f.writes.indexOf('add'));\n});\ntest('verified evidence conflicts and comment readback drift refuse the native edge', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Original reason' }));\n f.controls.failAdd = false;\n const priorWrites = [...f.writes];\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Changed reason' }),\n /conflicts/u,\n );\n assert.deepEqual(f.writes, priorWrites);\n assert.equal(f.comments.length, 1);\n assert.equal(f.edges.get(17)?.size, 0);\n const other = guardFixture();\n other.controls.corruptComment = true;\n await assert.rejects(\n updateIssue(other.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Documented prerequisite' }),\n /readback/u,\n );\n assert.equal(other.edges.get(17)?.size, 0);\n});\ntest('actual additions are guarded after an initially existing edge disappears', async () => {\n const f = guardFixture();\n f.edges.get(17)!.add(18);\n f.controls.race = () => f.edges.get(17)!.clear();\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.equal(f.edges.get(17)?.size, 0);\n assert.ok(!f.writes.includes('add'));\n});\ntest('preflight active observation remains sticky after a concurrent status change', async () => {\n const f = guardFixture();\n f.controls.race = () => f.statuses.set(17, 'Queued');\n await updateIssue(f.context, {\n issueNumber: 17,\n blockedBy: [18],\n overrideReason: 'Required despite concurrent parking',\n });\n assert.equal(f.comments.length, 1);\n assert.match(f.comments[0]!.body, /In Progress/u);\n});\ntest('inactive addition needs no override while a newly active dependent is guarded', async () => {\n const f = guardFixture();\n f.statuses.set(17, 'Queued');\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18] });\n assert.equal(f.comments.length, 0);\n const race = guardFixture();\n race.statuses.set(17, 'Queued');\n race.controls.race = () => race.statuses.set(17, 'Active');\n await assert.rejects(updateIssue(race.context, { issueNumber: 17, blockedBy: [18] }), /overrideReason/u);\n assert.ok(!race.writes.includes('add'));\n});\ntest('remove and re-add uses a new native removal episode', async () => {\n const f = guardFixture();\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'First episode' });\n f.edges.get(17)!.clear();\n f.statuses.set(17, 'Active');\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'REMOVE1',\n createdAt: '2026-01-02T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Second episode' });\n assert.equal(f.comments.length, 2);\n assert.match(f.comments[1]!.body, /REMOVE1/u);\n});\ntest('incomplete active history and unavailable author refuse before writes', async () => {\n const f = guardFixture();\n f.controls.timelineIncomplete = true;\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Complete dependency history/u,\n );\n assert.deepEqual(f.writes, []);\n const noAuthor = guardFixture();\n noAuthor.controls.actor = '';\n await assert.rejects(\n updateIssue(noAuthor.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Author unavailable/u,\n );\n assert.deepEqual(noAuthor.writes, []);\n});\ntest('reciprocal create preserves unrelated edges and provides known-created recovery', async () => {\n const f = guardFixture();\n f.edges.get(17)!.add(19);\n f.controls.failAdd = true;\n await assert.rejects(\n createIssue(f.context, { ...f.createInput, blocks: [17], overrideReason: 'New prerequisite' }),\n (error) => error instanceof CreatedTrackingIssueError && error.created.number === 20,\n );\n assert.deepEqual([...f.edges.get(17)!], [19]);\n assert.equal(f.comments.length, 1);\n f.controls.failAdd = false;\n await updateIssue(f.context, { issueNumber: 20, blocks: [17], overrideReason: 'New prerequisite' });\n assert.deepEqual([...f.edges.get(17)!], [19, 20]);\n assert.equal(f.comments.length, 1);\n});\n\ntest('forward create refuses PR and foreign endpoint identities before creation', async () => {\n for (const bad of [{ pull_request: {} }, { html_url: 'https://github.com/foreign/repo/issues/18' }, { number: 19 }]) {\n const f = guardFixture();\n Object.assign(f.rows.get(18)!, bad);\n await assert.rejects(createIssue(f.context, { ...f.createInput, blockedBy: [18] }), /endpoint|repository issue/u);\n assert.deepEqual(f.writes, []);\n }\n});\ntest('missing blocker identity and ambiguous removal history refuse during preflight', async () => {\n const f = guardFixture();\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'R',\n createdAt: '2026-01-01T00:00:00Z',\n blockingIssue: null,\n });\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /Complete dependency history/u,\n );\n assert.deepEqual(f.writes, []);\n const ambiguous = guardFixture();\n for (const id of ['R1', 'R2'])\n ambiguous.history.push({\n __typename: 'BlockedByRemovedEvent',\n id,\n createdAt: '2026-01-01T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await assert.rejects(\n updateIssue(ambiguous.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /ambiguous/u,\n );\n assert.deepEqual(ambiguous.writes, []);\n});\ntest('a removal during comment readback refuses authority from the earlier episode', async () => {\n const f = guardFixture();\n f.controls.commentRace = () =>\n f.history.push({\n __typename: 'BlockedByRemovedEvent',\n id: 'LATER',\n createdAt: '2026-01-03T00:00:00Z',\n blockingIssue: { id: 'ISSUE18', number: 18, repository: { nameWithOwner: 'example/widget' } },\n });\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /episode changed/u,\n );\n assert.equal(f.edges.get(17)?.size, 0);\n assert.ok(!f.writes.includes('add'));\n});\n\ntest('duplicate authority markers are refused before another content write', async () => {\n const f = guardFixture();\n f.controls.failAdd = true;\n await assert.rejects(updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }));\n f.comments.push({ ...f.comments[0]!, id: 999 });\n f.controls.failAdd = false;\n const before = [...f.writes];\n await assert.rejects(\n updateIssue(f.context, { issueNumber: 17, blockedBy: [18], overrideReason: 'Reason' }),\n /duplicate/u,\n );\n assert.deepEqual(f.writes, before);\n});\n\ntest('blockedBy with blockers naming each issue succeeds and shows that text', async () => {\n const f = guardFixture();\n const result = await updateIssue(f.context, {\n issueNumber: 17,\n blockedBy: [18, 19],\n status: { blockers: '#19, #18' },\n overrideReason: 'Wait for the newly identified prerequisites.',\n });\n assert.match(result.body ?? '', /\\*\\*Blockers:\\*\\* #19, #18/u);\n assert.deepEqual([...f.edges.get(17)!], [18, 19]);\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,aAAa,aAAa,iCAAiC;AACpE,SAAS,kBAAkB,oBAAoB;AAE/C,KAAK,wFAAwF,YAAY;AACvG,QAAM,IAAI,aAAa;AACvB,IAAE,SAAS,uBAAuB;AAClC,QAAM,SAAS,MAAM,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,WAAW,CAAC,EAAE,EAAE,CAAC;AACjF,SAAO,MAAM,OAAO,QAAQ,QAAQ,EAAE;AACtC,SAAO,MAAM,OAAO,QAAQ,KAAK,6CAA6C;AAC9E,SAAO,UAAU,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,CAAE,GAAG,CAAC,EAAE,CAAC;AAC5C,SAAO,MAAM,EAAE,SAAS,IA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AAK,CAAC;AACrC,CAAC;AAED,KAAK,wEAAwE,YAAY;AACvF,QAAM,IAAI,aAAa;AACvB,IAAE,SAAS,UAAU;AACrB,QAAM,OAAO,QAAQ,YAAY,EAAE,SAAS,EAAE,aAAa,IAAI,WAAW,CAAC,EAAE,GAAG,gBAAgB,SAAS,CAAC,CAAC;AAC3G,IAAE,SAAS,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,GAAI,IAAI,IAAI,CAAC;AAC9C,IAAE,SAAS,UAAU;AACrB,QAAM,SAAS,CAAC,GAAG,EAAE,MAAM;AAC3B,QAAM,OAAO;AAAA,IACX,YAAY,EAAE,SAAS,EAAE,aAAa,IAAI,WAAW,CAAC,EAAE,GAAG,gBAAgB,SAAS,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO,UAAU,EAAE,QAAQ,MAAM;AACnC,CAAC;AAED,KAAK,0EAA0E,YAAY;AACzF,QAAM,IAAI,aAAa;AACvB,QAAM,SAAS,MAAM,YAAY,EAAE,SAAS;AAAA,IAC1C,aAAa;AAAA,IACb,WAAW,CAAC,IAAI,EAAE;AAAA,IAClB,QAAQ,EAAE,UAAU,WAAW;AAAA,IAC/B,gBAAgB;AAAA,EAClB,CAAC;AACD,SAAO,MAAM,OAAO,QAAQ,IAAI,6BAA6B;AAC7D,SAAO,UAAU,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,CAAE,GAAG,CAAC,IAAI,EAAE,CAAC;AAClD,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/issueContract.d.ts
CHANGED
|
@@ -100,7 +100,10 @@ export declare const IssueFields: z.ZodObject<{
|
|
|
100
100
|
}>;
|
|
101
101
|
}, z.core.$strict>], "tier">>;
|
|
102
102
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
104
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
107
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
108
|
path: z.ZodString;
|
|
106
109
|
change: z.ZodEnum<{
|
|
@@ -199,7 +202,10 @@ export declare const DraftIssue: z.ZodObject<{
|
|
|
199
202
|
}>;
|
|
200
203
|
}, z.core.$strict>], "tier">>;
|
|
201
204
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
205
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
206
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
203
209
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
204
210
|
path: z.ZodString;
|
|
205
211
|
change: z.ZodEnum<{
|
|
@@ -216,6 +222,8 @@ export declare const DraftIssue: z.ZodObject<{
|
|
|
216
222
|
}, z.core.$strict>;
|
|
217
223
|
export type DraftIssueData = z.output<typeof DraftIssue>;
|
|
218
224
|
export type IssueFieldsInput = z.input<typeof IssueFields>;
|
|
225
|
+
/** Local paths an update adds to an already-Ready issue; paths it already cites only warn (#339). */
|
|
226
|
+
export declare function addedLocalPaths(before: DraftIssueData, after: DraftIssueData): IssueDiagnostic[];
|
|
219
227
|
export declare const ReadyIssue: z.ZodObject<{
|
|
220
228
|
issueType: z.ZodOptional<z.ZodString>;
|
|
221
229
|
epic: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -247,7 +255,10 @@ export declare const ReadyIssue: z.ZodObject<{
|
|
|
247
255
|
}>;
|
|
248
256
|
}, z.core.$strict>], "tier">>;
|
|
249
257
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
258
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
259
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
251
262
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
252
263
|
path: z.ZodString;
|
|
253
264
|
change: z.ZodEnum<{
|
|
@@ -329,7 +340,10 @@ export declare const ISSUE_JSON_SCHEMAS: {
|
|
|
329
340
|
}>;
|
|
330
341
|
}, z.core.$strict>], "tier">>;
|
|
331
342
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
343
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
332
344
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
345
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
333
347
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
334
348
|
path: z.ZodString;
|
|
335
349
|
change: z.ZodEnum<{
|
|
@@ -375,7 +389,10 @@ export declare const ISSUE_JSON_SCHEMAS: {
|
|
|
375
389
|
}>;
|
|
376
390
|
}, z.core.$strict>], "tier">>;
|
|
377
391
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
392
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
378
393
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
394
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
379
396
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
380
397
|
path: z.ZodString;
|
|
381
398
|
change: z.ZodEnum<{
|
|
@@ -450,7 +467,10 @@ export declare const IssueWriteFields: {
|
|
|
450
467
|
}>;
|
|
451
468
|
}, z.core.$strict>], "tier">>;
|
|
452
469
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
470
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
453
471
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
472
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
473
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
454
474
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
455
475
|
path: z.ZodString;
|
|
456
476
|
change: z.ZodEnum<{
|
|
@@ -507,7 +527,10 @@ export declare const IssueWriteSchema: z.ZodObject<{
|
|
|
507
527
|
}>;
|
|
508
528
|
}, z.core.$strict>], "tier">>;
|
|
509
529
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
530
|
+
priorWork: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
510
531
|
decisions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
532
|
+
moneyPath: z.ZodOptional<z.ZodBoolean>;
|
|
533
|
+
ownerOk: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
511
534
|
surface: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
512
535
|
path: z.ZodString;
|
|
513
536
|
change: z.ZodEnum<{
|
package/dist/issueContract.js
CHANGED
|
@@ -71,7 +71,12 @@ const IssueFields = z.strictObject({
|
|
|
71
71
|
"Builder capability: standard (any lighter builder can finish from the issue alone) or frontier with one reason."
|
|
72
72
|
),
|
|
73
73
|
extends: Strings.optional().describe("The design decision or existing owner this change uses or extends."),
|
|
74
|
+
priorWork: Strings.optional().describe(
|
|
75
|
+
"Searches run for earlier work on this question (closed issues, issue artifacts, decision logs) and what each found, or 'none found' with the searches."
|
|
76
|
+
),
|
|
74
77
|
decisions: Strings.optional().describe("Choices already made; the builder must not reopen them."),
|
|
78
|
+
moneyPath: z.boolean().optional().describe("True when the change touches a path the repository's review policy gates; ownerOk is then required."),
|
|
79
|
+
ownerOk: Strings.optional().describe("Link to the owner's comment approving this ticket's live-effect line."),
|
|
75
80
|
surface: z.array(SurfaceEntry).optional().describe(
|
|
76
81
|
"The complete change set: each path, its change, and exact signatures. Tests for these paths are implied."
|
|
77
82
|
),
|
|
@@ -128,9 +133,13 @@ const hint = (code, field, fixHint) => ({
|
|
|
128
133
|
fixHint,
|
|
129
134
|
message: fixHint
|
|
130
135
|
});
|
|
136
|
+
function stringEntries(value, path = "") {
|
|
137
|
+
if (typeof value === "string") return [[path, value]];
|
|
138
|
+
if (value === null || typeof value !== "object") return [];
|
|
139
|
+
return Object.entries(value).flatMap(([key, item]) => stringEntries(item, path ? `${path}.${key}` : key));
|
|
140
|
+
}
|
|
131
141
|
function secrets(value) {
|
|
132
|
-
const
|
|
133
|
-
const text = strings(value).join("\n");
|
|
142
|
+
const text = stringEntries(value).map(([, item]) => item).join("\n");
|
|
134
143
|
return /(?:-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|sk-(?:proj-)?[A-Za-z0-9_-]{20,}|AKIA[A-Z0-9]{16})\b|\b(?:password|secret|api[_-]?key|access[_-]?token)\s*[=:]\s*["']?(?!<|\$|redacted\b|placeholder\b)[A-Za-z0-9_+/-]{8,})/iu.test(
|
|
135
144
|
text
|
|
136
145
|
);
|
|
@@ -155,7 +164,8 @@ function readyRules(value, ctx) {
|
|
|
155
164
|
value.title.trim()
|
|
156
165
|
))
|
|
157
166
|
add("title.specific", ["title"], "Name the specific behavior or component that changes.");
|
|
158
|
-
if (value.title.length > 80)
|
|
167
|
+
if (value.title.length > 80)
|
|
168
|
+
add("title.length", ["title"], `The title is ${String(value.title.length)} characters; shorten it to at most 80.`);
|
|
159
169
|
if (/^\s*(?:\[\s*(?:bug|feature|task)\s*\]|(?:bug|feature|task)\s*:)/iu.test(value.title))
|
|
160
170
|
add("title.prefix", ["title"], "Remove the issue-type prefix; use the native Issue Type field.");
|
|
161
171
|
for (const field of ["problem", "outcome"])
|
|
@@ -192,6 +202,12 @@ function readyRules(value, ctx) {
|
|
|
192
202
|
if (!value.bug[field].trim()) add(`bug.${field}`, ["bug", field], `Describe the bug's ${field}.`);
|
|
193
203
|
}
|
|
194
204
|
}
|
|
205
|
+
if (value.moneyPath === true && !(value.ownerOk ?? []).some((item) => item.startsWith("https://")))
|
|
206
|
+
add(
|
|
207
|
+
"ownerOk",
|
|
208
|
+
["ownerOk"],
|
|
209
|
+
"Link the owner's comment that OKs this ticket's live-effect line, or set moneyPath to false."
|
|
210
|
+
);
|
|
195
211
|
if (value.epic || value.builder === void 0) return;
|
|
196
212
|
if (!(value.decisions ?? []).some((item) => item.trim()))
|
|
197
213
|
add("decisions", ["decisions"], `Record each choice the builder must not reopen. ${SKILL_HINT}`);
|
|
@@ -210,6 +226,50 @@ function readyRules(value, ctx) {
|
|
|
210
226
|
if (!(value.proof ?? []).some((item) => item.trim()))
|
|
211
227
|
add("proof", ["proof"], `List the commands to run in order, focused first. ${SKILL_HINT}`);
|
|
212
228
|
}
|
|
229
|
+
const LOCAL_PATH = /\.local\/|\/Users\/|~\//u;
|
|
230
|
+
const CONTRACT_WORD_LIMIT = 400;
|
|
231
|
+
function localPathHint(field, match) {
|
|
232
|
+
return hint(
|
|
233
|
+
"local-path",
|
|
234
|
+
field,
|
|
235
|
+
`${field} cites a local path (${match}); put that evidence on the issue as a comment or artifact and link it instead.`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function addedLocalPaths(before, after) {
|
|
239
|
+
const existing = stringEntries(before).map(([, text]) => text);
|
|
240
|
+
return stringEntries(after).flatMap(([field, text]) => {
|
|
241
|
+
const added = text.split(/\s+/u).find((word) => LOCAL_PATH.test(word) && !existing.some((item) => item.includes(word)));
|
|
242
|
+
const match = added === void 0 ? null : LOCAL_PATH.exec(added);
|
|
243
|
+
return match ? [localPathHint(field, match[0])] : [];
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function readyWriteRules(issue) {
|
|
247
|
+
if (issue.draft) return [];
|
|
248
|
+
const results = [];
|
|
249
|
+
if (!issue.epic && !(issue.priorWork ?? []).some((item) => item.trim()))
|
|
250
|
+
results.push(
|
|
251
|
+
hint(
|
|
252
|
+
"priorWork",
|
|
253
|
+
"priorWork",
|
|
254
|
+
"List each search you ran for earlier work on this question and what it found, or 'none found' with the searches."
|
|
255
|
+
)
|
|
256
|
+
);
|
|
257
|
+
for (const [field, text] of stringEntries(issue)) {
|
|
258
|
+
const match = LOCAL_PATH.exec(text);
|
|
259
|
+
if (match) results.push(localPathHint(field, match[0]));
|
|
260
|
+
}
|
|
261
|
+
const { outcome, surface, acceptanceCriteria, proof, priorWork } = issue;
|
|
262
|
+
const words = stringEntries({ outcome, surface, acceptanceCriteria, proof, priorWork }).flatMap(([, text]) => text.split(/\s+/u)).filter(Boolean).length;
|
|
263
|
+
if (words > CONTRACT_WORD_LIMIT)
|
|
264
|
+
results.push(
|
|
265
|
+
hint(
|
|
266
|
+
"contract-words",
|
|
267
|
+
"contract",
|
|
268
|
+
`The contract (outcome, files, acceptance, tests, prior work) is ${String(words)} words; keep it to 400 and move evidence to a comment or artifact.`
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
return results;
|
|
272
|
+
}
|
|
213
273
|
const ReadyIssue = IssueFields.extend({
|
|
214
274
|
title: Text.min(10).max(80),
|
|
215
275
|
points: z.number().int().min(1).max(8).optional(),
|
|
@@ -240,7 +300,10 @@ const IssueWriteFields = {
|
|
|
240
300
|
bug: IssueFields.shape.bug,
|
|
241
301
|
builder: IssueFields.shape.builder,
|
|
242
302
|
extends: IssueFields.shape.extends,
|
|
303
|
+
priorWork: IssueFields.shape.priorWork,
|
|
243
304
|
decisions: IssueFields.shape.decisions,
|
|
305
|
+
moneyPath: IssueFields.shape.moneyPath,
|
|
306
|
+
ownerOk: IssueFields.shape.ownerOk,
|
|
244
307
|
surface: IssueFields.shape.surface,
|
|
245
308
|
fences: IssueFields.shape.fences,
|
|
246
309
|
proof: IssueFields.shape.proof,
|
|
@@ -295,8 +358,10 @@ class IssueValidationError extends DeliveryError {
|
|
|
295
358
|
function requireIssue(value, options = {}) {
|
|
296
359
|
const structural = IssueFields.safeParse(value);
|
|
297
360
|
const result = validateIssue(value, !structural.success || !structural.data.draft);
|
|
298
|
-
const
|
|
299
|
-
|
|
361
|
+
const gated = options.requireBuilder === true && structural.success && !structural.data.draft;
|
|
362
|
+
const unbuilt = gated && !structural.data.epic && structural.data.builder === void 0;
|
|
363
|
+
const writeFailures = gated ? readyWriteRules(structural.data) : [];
|
|
364
|
+
if (!result.issue || unbuilt || writeFailures.length)
|
|
300
365
|
throw new IssueValidationError([
|
|
301
366
|
...unbuilt ? [
|
|
302
367
|
hint(
|
|
@@ -305,7 +370,8 @@ function requireIssue(value, options = {}) {
|
|
|
305
370
|
`Add builder, decisions, surface, proof and examples, or pass draft: true to capture it now. ${SKILL_HINT}`
|
|
306
371
|
)
|
|
307
372
|
] : [],
|
|
308
|
-
...result.failures
|
|
373
|
+
...result.failures,
|
|
374
|
+
...writeFailures
|
|
309
375
|
]);
|
|
310
376
|
return result.issue;
|
|
311
377
|
}
|
|
@@ -331,7 +397,10 @@ function renderIssueBody(value, status, legacyFormatting = false) {
|
|
|
331
397
|
...item.deferral === void 0 ? [] : ["## Deferral", `Deferred: ${JSON.stringify(item.deferral)}`],
|
|
332
398
|
...item.builder === void 0 ? [] : ["## Builder", item.builder.tier === "standard" ? "standard" : `frontier: ${item.builder.reason}`],
|
|
333
399
|
...bulletSection("Extends", item.extends),
|
|
400
|
+
...bulletSection("Prior work", item.priorWork),
|
|
334
401
|
...bulletSection("Decisions", item.decisions),
|
|
402
|
+
...item.moneyPath === true ? ["## Money path", "yes"] : [],
|
|
403
|
+
...bulletSection("Owner OK", item.ownerOk),
|
|
335
404
|
"## Acceptance criteria",
|
|
336
405
|
item.acceptanceCriteria.map(
|
|
337
406
|
(ac) => (legacyFormatting ? `- [ ] ${ac.behavior}
|
|
@@ -493,9 +562,7 @@ function issueWarnings(issue) {
|
|
|
493
562
|
warn("bug.regression", "acceptanceCriteria", "Add a regression test criterion for the bug.");
|
|
494
563
|
if (issue.builder === void 0 && ![...issue.context.files, ...issue.context.components].some((item) => item.trim()))
|
|
495
564
|
warn("context", "context", "Name relevant components or files.");
|
|
496
|
-
|
|
497
|
-
if (proofs.length && proofs.every((proof) => /^(?:\/|[A-Za-z]:\\|~\/)/u.test(proof.trim())))
|
|
498
|
-
warn("local-evidence", "context.evidence", "Use portable evidence in addition to machine-local paths.");
|
|
565
|
+
warnings.push(...readyWriteRules(issue));
|
|
499
566
|
if (proseWords(issue) > 300)
|
|
500
567
|
warn("body.length", "body", `Consider cutting the problem, outcome and criteria to 300 words. ${SKILL_HINT}`);
|
|
501
568
|
if (issue.draft || issue.epic) return warnings;
|
|
@@ -558,6 +625,7 @@ export {
|
|
|
558
625
|
ReadyIssue,
|
|
559
626
|
SurfaceEntry,
|
|
560
627
|
acceptedKeysError,
|
|
628
|
+
addedLocalPaths,
|
|
561
629
|
issueBodyDiff,
|
|
562
630
|
issueInputSchema,
|
|
563
631
|
issueStartFooter,
|