@aviaratech/ai-delivery 0.3.37 → 0.3.39
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 +14 -18
- package/dist/agent.d.ts +0 -4
- package/dist/agent.js +1 -8
- package/dist/agent.js.map +2 -2
- package/dist/cli.js +2 -72
- package/dist/cli.js.map +2 -2
- package/dist/cliResult.js +2 -14
- package/dist/cliResult.js.map +2 -2
- package/dist/cliResult.test.js +0 -74
- package/dist/cliResult.test.js.map +2 -2
- package/dist/config/deliveryConfig.d.ts +0 -6
- package/dist/config/deliveryConfig.js +2 -35
- package/dist/config/deliveryConfig.js.map +2 -2
- package/dist/config/deliveryConfig.test.js +1 -25
- package/dist/config/deliveryConfig.test.js.map +2 -2
- package/dist/contributorChecks.test.js +5 -3
- package/dist/contributorChecks.test.js.map +2 -2
- package/dist/delivery/common.d.ts +0 -14
- package/dist/delivery/common.js +1 -44
- package/dist/delivery/common.js.map +2 -2
- package/dist/directoryIndependent.test.js +2 -24
- package/dist/directoryIndependent.test.js.map +2 -2
- package/dist/dispatch.js +0 -46
- package/dist/dispatch.js.map +3 -3
- package/dist/fixtures/inertTarget.js +3 -5
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/fixtures/recordedGitHubFlows.d.ts +0 -72
- package/dist/fixtures/recordedGitHubFlows.js +1 -57
- package/dist/fixtures/recordedGitHubFlows.js.map +2 -2
- package/dist/git.d.ts +0 -6
- package/dist/git.js +0 -15
- package/dist/git.js.map +2 -2
- package/dist/github/client.js +0 -3
- package/dist/github/client.js.map +2 -2
- package/dist/github/commandIdentityPolicy.js +0 -1
- package/dist/github/commandIdentityPolicy.js.map +2 -2
- package/dist/github/issueHistory.d.ts +0 -6
- package/dist/github/issueHistory.js +0 -39
- package/dist/github/issueHistory.js.map +2 -2
- package/dist/github/nativeIssueMetadata.d.ts +0 -10
- package/dist/github/nativeIssueMetadata.js +1 -33
- package/dist/github/nativeIssueMetadata.js.map +3 -3
- package/dist/github/projectDelivery.d.ts +0 -34
- package/dist/github/projectDelivery.js +0 -211
- package/dist/github/projectDelivery.js.map +2 -2
- package/dist/github/repo.d.ts +0 -8
- package/dist/github/repo.js +0 -72
- package/dist/github/repo.js.map +2 -2
- package/dist/issue.js +22 -17
- package/dist/issue.js.map +2 -2
- package/dist/issue63Routes.test.js +1 -72
- package/dist/issue63Routes.test.js.map +2 -2
- package/dist/issueInfoReadback.test.js +59 -1
- package/dist/issueInfoReadback.test.js.map +2 -2
- package/dist/issueIntake.test.js +12 -0
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueJournal.d.ts +0 -9
- package/dist/issueJournal.js +10 -76
- package/dist/issueJournal.js.map +2 -2
- package/dist/issueJournal.test.js +1 -108
- package/dist/issueJournal.test.js.map +2 -2
- package/dist/issueTracking.test.js +0 -48
- package/dist/issueTracking.test.js.map +2 -2
- package/dist/lifecycle.test.js +12 -48
- package/dist/lifecycle.test.js.map +2 -2
- package/dist/logger.d.ts +0 -4
- package/dist/logger.js +0 -31
- package/dist/logger.js.map +2 -2
- package/dist/mcp/tools.d.ts +2 -618
- package/dist/mcp/tools.js +8 -34
- package/dist/mcp/tools.js.map +2 -2
- package/dist/pluginAuthProbe.js +0 -3
- package/dist/pluginAuthProbe.js.map +2 -2
- package/dist/pluginDoctor.test.js +1 -1
- package/dist/pluginDoctor.test.js.map +2 -2
- package/dist/pluginInstaller.js +0 -3
- package/dist/pluginInstaller.js.map +2 -2
- package/dist/pluginInstaller.test.js +3 -19
- package/dist/pluginInstaller.test.js.map +2 -2
- package/dist/pluginPackaging.test.js +1 -118
- package/dist/pluginPackaging.test.js.map +2 -2
- package/dist/pr.d.ts +2 -73
- package/dist/pr.js +27 -220
- package/dist/pr.js.map +3 -3
- package/dist/pr.test.js +11 -304
- package/dist/pr.test.js.map +2 -2
- package/dist/prAssociation.test.js +112 -22
- package/dist/prAssociation.test.js.map +2 -2
- package/dist/prDispatch.test.js +4 -11
- package/dist/prDispatch.test.js.map +2 -2
- package/dist/releaseWorkflow.test.js +0 -1
- package/dist/releaseWorkflow.test.js.map +2 -2
- package/dist/review.d.ts +0 -82
- package/dist/review.js +3 -94
- package/dist/review.js.map +2 -2
- package/dist/review.test.js +2 -4
- package/dist/review.test.js.map +2 -2
- package/dist/services/agentReadinessService.d.ts +0 -1
- package/dist/services/agentReadinessService.js.map +2 -2
- package/dist/stdoutRegression.test.js +3 -22
- package/dist/stdoutRegression.test.js.map +2 -2
- package/dist/targetPolicyDiscovery.test.js +0 -86
- package/dist/targetPolicyDiscovery.test.js.map +2 -2
- package/dist/targetPolicyEntrypoints.test.js +1 -54
- package/dist/targetPolicyEntrypoints.test.js.map +2 -2
- package/dist/targetRepositoryExecution.test.js +1 -49
- package/dist/targetRepositoryExecution.test.js.map +2 -2
- package/dist/terminalMessages.d.ts +0 -10
- package/dist/terminalMessages.js +1 -31
- package/dist/terminalMessages.js.map +2 -2
- package/dist/toolOutput.js +0 -2
- package/dist/toolOutput.js.map +2 -2
- package/dist/toolOutput.test.js +15 -1
- package/dist/toolOutput.test.js.map +2 -2
- package/dist/verification.d.ts +1 -186
- package/dist/verification.js +29 -587
- package/dist/verification.js.map +3 -3
- package/dist/verificationGate.test.js +4 -90
- package/dist/verificationGate.test.js.map +2 -2
- package/dist/version.d.ts +0 -6
- package/dist/version.js +2 -39
- package/dist/version.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 +118 -162
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/dist/boardReconcile.test.d.ts +0 -1
- package/dist/boardReconcile.test.js +0 -1746
- package/dist/boardReconcile.test.js.map +0 -7
- package/dist/delivery/delivery.test.d.ts +0 -1
- package/dist/delivery/delivery.test.js +0 -560
- package/dist/delivery/delivery.test.js.map +0 -7
- package/dist/delivery/evidence.d.ts +0 -92
- package/dist/delivery/evidence.js +0 -139
- package/dist/delivery/evidence.js.map +0 -7
- package/dist/delivery/legacy.d.ts +0 -8
- package/dist/delivery/legacy.js +0 -65
- package/dist/delivery/legacy.js.map +0 -7
- package/dist/delivery/policy.d.ts +0 -252
- package/dist/delivery/policy.js +0 -221
- package/dist/delivery/policy.js.map +0 -7
- package/dist/delivery/stage.d.ts +0 -179
- package/dist/delivery/stage.js +0 -242
- package/dist/delivery/stage.js.map +0 -7
- package/dist/deliveryBoard.d.ts +0 -74
- package/dist/deliveryBoard.js +0 -644
- package/dist/deliveryBoard.js.map +0 -7
- package/dist/deliveryBoard.test.d.ts +0 -1
- package/dist/deliveryBoard.test.js +0 -649
- package/dist/deliveryBoard.test.js.map +0 -7
- package/dist/deliveryHealth.test.d.ts +0 -1
- package/dist/deliveryHealth.test.js +0 -191
- package/dist/deliveryHealth.test.js.map +0 -7
- package/dist/fixtures/deliveryBoardReplay.d.ts +0 -56
- package/dist/fixtures/deliveryBoardReplay.js +0 -617
- package/dist/fixtures/deliveryBoardReplay.js.map +0 -7
- package/dist/genericCompatibility.test.d.ts +0 -1
- package/dist/genericCompatibility.test.js +0 -66
- package/dist/genericCompatibility.test.js.map +0 -7
- package/dist/services/boardReconcileService.d.ts +0 -1204
- package/dist/services/boardReconcileService.js +0 -1445
- package/dist/services/boardReconcileService.js.map +0 -7
- package/dist/services/deliveryHealthService.d.ts +0 -84
- package/dist/services/deliveryHealthService.js +0 -204
- package/dist/services/deliveryHealthService.js.map +0 -7
- package/dist/services/legacyIssueMigration.d.ts +0 -46
- package/dist/services/legacyIssueMigration.js +0 -299
- package/dist/services/legacyIssueMigration.js.map +0 -7
- package/dist/utils/filesystem.d.ts +0 -1
- package/dist/utils/filesystem.js +0 -5
- package/dist/utils/filesystem.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/prAssociation.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { syntheticDiscoveryClients, syntheticDiscoveryConfig } from './fixtures/discovery.js';\nimport { issueProjectItemsResponse } from './fixtures/issueProjectItems.js';\nimport { quietReadViewResponse } from './fixtures/readView.js';\nimport assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join, resolve } from 'node:path';\nimport { afterEach, describe, expect, it, vi } from 'vitest';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport * as settings from './config/deliveryConfig.js';\nimport * as github from './github/client.js';\nimport { digestValue } from './delivery/common.js';\nimport { DeliveryError, setMachineRequestDiagnostics } from './errors.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport type { DeliveryContext } from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport { preflightReviewRoute, prInfo, publishPr, startIssueBranch, submitFormalReview } from './pr.js';\n\nconst repo = 'example/widget';\nconst head = 'a'.repeat(40);\nconst base = 'b'.repeat(40);\nconst tree = 'c'.repeat(40);\nconst pageInfo = { hasNextPage: false, endCursor: null };\nconst nonClosingCreation = {\n issueNumber: 17,\n nonClosing: true,\n reconcileNonClosingReference: true,\n expectedHeadSha: head,\n expectedBaseSha: base,\n body: `References ${repo}#17\\n\\nImprove widget.`,\n};\n\nfunction fixture(published = true, nonClosing = false) {\n const state = {\n published,\n nonClosing,\n body: nonClosing ? `References ${repo}#17\\n\\nImprove widget.` : 'Closes #17',\n title: 'Improve widget',\n issueBody: 'Four retained criteria',\n issueState: 'open',\n referenceReadback: undefined as unknown,\n referencePages: [] as unknown[],\n referencePageIndex: 0,\n commitReadback: undefined as unknown,\n comparisonReadback: undefined as unknown,\n commitMessage: 'Improve widget',\n referenceActor: 'author',\n referenceCloses: false as unknown,\n updates: 0,\n failCreateAck: false,\n failUpdateAck: false,\n linked: false,\n remoteHead: published ? head : base,\n headSha: head,\n headRef: 'issue/17',\n headRepo: repo,\n baseRepo: repo,\n baseSha: base,\n baseRef: 'main',\n remoteBase: { ref: 'refs/heads/main', object: { type: 'commit', sha: base } },\n nodeId: 'PR23',\n prAuthor: 'author',\n prState: 'open',\n merged: false as unknown,\n draft: true as unknown,\n remoteRef: 'refs/heads/issue/17',\n remoteType: 'commit',\n issueNumber: 17,\n associationRepo: repo,\n associationPr: 23,\n closingReadback: undefined as unknown,\n closingPages: [] as unknown[],\n closingPageIndex: 0,\n closingOnCreate: false,\n manualClosing: false,\n manualReadback: undefined as unknown,\n manualPages: [] as unknown[],\n manualPageIndex: 0,\n removals: 0,\n failRemovalAck: false,\n removalReadback: undefined as unknown,\n keepClosingOnRemoval: false,\n removalHook: undefined as (() => void) | undefined,\n branchReadback: undefined as unknown,\n reviewerActor: 'reviewer[bot]',\n movedOnRead: 0,\n reads: 0,\n readHook: undefined as ((reads: number) => void) | undefined,\n matchReadback: undefined as unknown,\n promotionReadback: undefined as unknown,\n keepDraftOnPromotion: false,\n promotions: 0,\n creations: 0,\n expectedCreationDraft: true,\n events: [] as string[],\n reviews: [] as Array<{\n id: number;\n body: string;\n user: { login: string };\n state: string;\n commit_id: string;\n html_url: string;\n }>,\n submissions: 0,\n };\n const pr = () => ({\n number: 23,\n node_id: state.nodeId,\n changed_files: 1,\n title: state.title,\n body: state.body,\n html_url: `https://github.com/${repo}/pull/23`,\n state: state.prState,\n draft: state.draft,\n merged: state.merged,\n head: { sha: state.headSha, ref: state.headRef, repo: { full_name: state.headRepo } },\n base: { sha: state.baseSha, ref: state.baseRef, repo: { full_name: state.baseRepo } },\n user: { login: state.prAuthor },\n });\n const rest = {\n request: async () => ({ data: [] }),\n repos: {\n get: async () => ({ data: { node_id: 'REPO', full_name: repo, default_branch: 'main' } }),\n compareCommitsWithBasehead: async () => ({\n data: state.comparisonReadback ?? {\n base_commit: { sha: base },\n merge_base_commit: { sha: base },\n status: 'ahead',\n total_commits: 1,\n commits: [{ sha: head, commit: { message: state.commitMessage }, parents: [{ sha: base }] }],\n },\n }),\n },\n issues: {\n get: async () => ({\n data: {\n node_id: 'ISSUE17',\n number: 17,\n state: state.issueState,\n title: 'Improve widget',\n body: state.issueBody,\n html_url: `https://github.com/${repo}/issues/17`,\n },\n }),\n },\n git: {\n getRef: async (input: { owner: string; repo: string; ref: string }) => {\n assert.equal(`${input.owner}/${input.repo}`, repo);\n return {\n data:\n input.ref === 'heads/main'\n ? state.remoteBase\n : { ref: state.remoteRef, object: { type: state.remoteType, sha: state.remoteHead } },\n };\n },\n getCommit: async () => ({ data: { sha: head, tree: { sha: tree } } }),\n },\n pulls: {\n get: async () => {\n state.reads++;\n state.readHook?.(state.reads);\n if (state.movedOnRead && state.reads >= state.movedOnRead) state.headSha = 'd'.repeat(40);\n return { data: pr() };\n },\n list: async () => ({ data: state.matchReadback ?? (state.published ? [{ number: 23 }] : []) }),\n create: async (input: { draft: boolean; head: string; body: string }) => {\n assert.equal(input.draft, state.expectedCreationDraft);\n assert.equal(input.head, 'issue/17');\n state.creations++;\n state.body = input.body;\n if (state.closingOnCreate) {\n state.manualClosing = true;\n state.referenceCloses = true;\n }\n if (state.failCreateAck) {\n state.published = true;\n throw new Error('Transport lost after creation');\n }\n state.draft = input.draft;\n state.published = true;\n state.linked = false;\n state.events.push('draft-publication-replaces-branch-link');\n return { data: pr() };\n },\n update: async (input: { body: string }) => {\n state.updates++;\n state.body = input.body;\n state.nonClosing = input.body.startsWith('References ');\n if (state.failUpdateAck) throw new Error('Transport lost after body update');\n return { data: pr() };\n },\n listFiles: async () => ({ data: [{ filename: 'change.ts' }] }),\n listReviews: async () => ({ data: state.reviews }),\n getReview: async (input: { review_id: number }) => ({\n data: state.reviews.find((review) => review.id === input.review_id),\n }),\n createReview: async (input: { commit_id: string; body: string; event: string }) => {\n assert.equal(input.commit_id, head);\n assert.equal(input.event, 'APPROVE');\n state.submissions++;\n const review = {\n id: 98 + state.submissions,\n body: input.body,\n user: { login: state.reviewerActor },\n state: 'APPROVED',\n commit_id: head,\n html_url: `https://github.com/${repo}/pull/23#pullrequestreview-${98 + state.submissions}`,\n };\n state.reviews.push(review);\n return { data: review };\n },\n },\n };\n const graphql = async (query: string, variables: Record<string, unknown> = {}) => {\n if (query.includes('DeliveryRemoveClosingReference')) {\n assert.deepEqual(variables.issueId, 'ISSUE17');\n assert.deepEqual(variables.pullRequestIds, ['PR23']);\n assert.equal(typeof variables.clientMutationId, 'string');\n state.removals++;\n state.events.push('remove-exact-closing-pair');\n if (!state.keepClosingOnRemoval) {\n state.manualClosing = false;\n state.referenceCloses = false;\n }\n state.removalHook?.();\n if (state.failRemovalAck) throw new Error('Lost reference-removal acknowledgement');\n return state.removalReadback ?? { removeCloseIssueReferences: { issue: { id: 'ISSUE17' } } };\n }\n if (query.includes('DeliveryNonClosingReferences')) {\n if (state.referencePages.length) return state.referencePages[state.referencePageIndex++];\n return (\n state.referenceReadback ?? {\n repository: {\n id: 'REPO',\n nameWithOwner: repo,\n issue: {\n id: 'ISSUE17',\n number: 17,\n state: 'OPEN',\n timelineItems: {\n nodes: [\n {\n id: 'REFERENCE',\n actor: { login: state.referenceActor },\n isCrossRepository: false,\n willCloseTarget: state.referenceCloses,\n source: {\n __typename: 'PullRequest',\n id: 'PR23',\n number: 23,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n target: {\n __typename: 'Issue',\n id: 'ISSUE17',\n number: 17,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n }\n if (query.includes('DeliveryNonClosingCommits'))\n return (\n state.commitReadback ?? {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n headRefOid: head,\n baseRefOid: base,\n baseRefName: 'main',\n commits: {\n totalCount: 1,\n nodes: [\n {\n commit: {\n oid: head,\n message: state.commitMessage,\n parents: { totalCount: 1, nodes: [{ oid: base }], pageInfo },\n },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n if (query.includes('DeliveryStartBranch')) {\n state.linked = true;\n state.events.push('native-start');\n return { createLinkedBranch: { linkedBranch: { ref: { name: 'issue/17', target: { oid: base } } } } };\n }\n if (query.includes('DeliveryIssueBranches'))\n return (\n state.branchReadback ?? {\n repository: {\n issue: {\n linkedBranches: {\n nodes: state.linked\n ? [\n {\n ref: {\n name: 'issue/17',\n target: { oid: state.remoteHead },\n repository: { nameWithOwner: repo },\n },\n },\n ]\n : [],\n pageInfo,\n },\n },\n },\n }\n );\n const manual = query.includes('userLinkedOnly');\n if (query.includes('DeliveryClosingIssues') && manual && state.manualPages.length > 0)\n return state.manualPages[state.manualPageIndex++ % state.manualPages.length];\n if (query.includes('DeliveryClosingIssues') && manual && state.manualReadback !== undefined)\n return state.manualReadback;\n if (query.includes('DeliveryClosingIssues') && !manual && state.closingPages.length > 0)\n return state.closingPages[state.closingPageIndex++];\n if (query.includes('DeliveryClosingIssues'))\n return (\n (manual ? undefined : state.closingReadback) ?? {\n repository: {\n nameWithOwner: state.associationRepo,\n pullRequest: {\n id: state.nodeId,\n number: state.associationPr,\n closingIssuesReferences: {\n nodes: (manual ? !state.manualClosing : state.nonClosing && !state.manualClosing)\n ? []\n : [\n {\n __typename: 'Issue',\n id: 'ISSUE17',\n number: state.issueNumber,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n if (query.includes('DeliveryReadyPr')) {\n state.promotions++;\n if (!state.keepDraftOnPromotion) state.draft = false;\n return (\n state.promotionReadback ?? { markPullRequestReadyForReview: { pullRequest: { id: 'PR23', isDraft: false } } }\n );\n }\n if (query.includes('ProjectDeliveryIssueItems')) return issueProjectItemsResponse(variables, []);\n if (query.includes('ProjectDeliveryConfiguration')) return syntheticDiscoveryClients().graphql(query, variables);\n const quiet = quietReadViewResponse(query, variables);\n if (quiet !== undefined) return quiet;\n throw new Error(`Unexpected synthetic query: ${query}`);\n };\n const reviewer = {\n role: 'reviewer',\n authSource: 'app',\n effectiveContentsPermission: 'write',\n appActorLogin: async () => state.reviewerActor,\n rest,\n graphql,\n };\n const context = {\n root: '/nonexistent-launch-directory',\n repo: { owner: 'example', repo: 'widget' },\n config: {\n schemaVersion: 'ai-delivery.github@1',\n repository: repo,\n roles: { author: { authSource: 'personal', identity: 'author' }, reviewer: { identity: 'reviewer' } },\n native: syntheticDiscoveryConfig.native,\n },\n clients: {\n role: 'author',\n authSource: 'personal',\n authenticatedAuthor: async () => ({ actorLogin: 'author', credentialIdentity: 'synthetic-author' }),\n rest,\n graphql,\n },\n reviewerClients: reviewer,\n } as unknown as DeliveryContext;\n const content = {\n schemaVersion: 'ai-delivery.review-artifact@1',\n authorIdentity: 'author',\n reviewerIdentity: 'reviewer',\n checks: ['Synthetic exact-head checks'],\n diffScopeHash: digestValue(['change.ts']),\n elapsedMs: 1,\n findings: [],\n head: { sha: head, tree },\n issueNumber: 17,\n prNumber: 23,\n readOnly: true,\n requestedEffort: 'xhigh',\n requestedModel: 'gpt-6-astra',\n effectiveEffort: 'unknown',\n effectiveModel: 'unknown',\n summary: 'Synthetic independent review.',\n verdict: 'approve',\n };\n const artifact = JSON.stringify({ ...content, artifactId: digestValue(content) });\n return { state, context, reviewerContext: { ...context, clients: reviewer } as unknown as DeliveryContext, artifact };\n}\n\nafterEach(() => vi.restoreAllMocks());\n\nit('publishes a pushed canonical branch without native creation and preserves the open issue', async () => {\n const { context, state } = fixture(false, true);\n state.remoteHead = head;\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.issueState, 'open');\n state.issueState = 'closed';\n await assert.rejects(issues.issueBranch(context, 17), /open|OPEN/u);\n await assert.rejects(issues.issueBranch(context, 17, 'issue/18'), /Branch issue\\/18 is not linked/u);\n});\n\nit('accepts a hyphenated close mention while refusing an actual closing directive', async () => {\n const { context, state } = fixture(true, true);\n state.title = 'absent-close (#3777)';\n await publishPr(context, { issueNumber: 17, nonClosing: true, prNumber: 23, draft: false });\n state.title = 'closes #3777';\n await assert.rejects(\n publishPr(context, { issueNumber: 17, nonClosing: true, prNumber: 23, draft: false }),\n /closing directives/u,\n );\n});\n\ndescribe('remote closing PR creation', () => {\n it('replays a plain-git head from a temporary non-git directory through the public tool', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.issueBody =\n '## Outcome\\n\\nWidgets improve.\\n\\n## Acceptance criteria\\n\\n- [ ] Reject invalid widgets.\\n Verified by: A synthetic widget test.';\n const root = realpathSync(mkdtempSync(join(tmpdir(), 'delivery-pr-open-')));\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n return { ...context, root };\n });\n const branchLinks = vi\n .spyOn(issues, 'linkedIssueBranches')\n .mockRejectedValue(new Error('No ai-delivery branch lifecycle'));\n try {\n const result = await executeTool(\n 'issue_pr_create',\n { repo, issueNumber: 17, head: 'issue/17', base: 'main' },\n { repoRoot: root },\n );\n assert.equal(state.creations, 1);\n assert.equal(branchLinks.mock.calls.length, 0);\n assert.equal(\n state.body,\n 'Closes #17\\n\\n## Outcome\\n\\nWidgets improve.\\n\\n## Acceptance criteria\\n\\n- [ ] Reject invalid widgets.\\n Verified by: A synthetic widget test.\\n\\n<!-- ai-delivery:pr@1 -->',\n );\n assert.deepEqual(result, {\n prNumber: 23,\n url: 'https://github.com/example/widget/pull/23',\n headSha: head,\n state: 'draft',\n });\n expect(JSON.stringify(result)).toMatchInlineSnapshot(\n '\"{\"prNumber\":23,\"url\":\"https://github.com/example/widget/pull/23\",\"headSha\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"state\":\"draft\"}\"',\n );\n assert.ok(JSON.stringify(result).length < 1000);\n } finally {\n rmSync(root, { recursive: true });\n }\n });\n\n it('reuses an open PR for an unlinked remote head without changing its body', async () => {\n const { context, state } = fixture();\n state.body = 'Closes #17\\n\\nRetain the author explanation.';\n const result = await publishPr(context, { issueNumber: 17, headBranch: 'issue/17' });\n assert.equal(result.prNumber, 23);\n assert.equal(state.creations + state.updates, 0);\n assert.equal(state.body, 'Closes #17\\n\\nRetain the author explanation.');\n });\n\n it('restores a lost closing link once and reports the repair without replacing user content', async () => {\n const { context, state } = fixture();\n state.body = 'Retain the author explanation.';\n state.nonClosing = true;\n const input = { issueNumber: 17, headBranch: 'issue/17' };\n assert.deepEqual(await publishPr(context, input), {\n prNumber: 23,\n url: 'https://github.com/example/widget/pull/23',\n headSha: head,\n state: 'draft',\n closingLinkAdded: true,\n });\n assert.equal(state.body, 'Closes #17\\n\\nRetain the author explanation.');\n await publishPr(context, input);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 1);\n });\n\n it('previews a closing-link repair without a mutation', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n await publishPr(context, { issueNumber: 17, headBranch: 'issue/17', dryRun: true });\n assert.equal(state.updates + state.creations, 0);\n });\n\n it('refuses a conflicting association without rewriting the existing body', async () => {\n const { context, state } = fixture();\n state.body = 'Closes #18';\n state.issueNumber = 18;\n await assert.rejects(publishPr(context, { issueNumber: 17, headBranch: 'issue/17' }), /conflicting/u);\n assert.equal(state.updates + state.creations, 0);\n });\n\n it('refuses body drift during the final association read before repair', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n const graphql = context.clients.graphql;\n let associationReads = 0;\n vi.spyOn(context.clients, 'graphql').mockImplementation(async (query, variables) => {\n const result = await graphql(query, variables);\n if (String(query).includes('DeliveryClosingIssues') && ++associationReads === 2)\n state.body = 'Concurrent author edit';\n return result;\n });\n await assert.rejects(publishPr(context, { issueNumber: 17, headBranch: 'issue/17' }), /drifted/u);\n assert.equal(state.updates, 0);\n assert.equal(state.body, 'Concurrent author edit');\n });\n\n it('reconciles a lost repair acknowledgement without repeating the applied update', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n state.failUpdateAck = true;\n const input = { issueNumber: 17, headBranch: 'issue/17' };\n await assert.rejects(publishPr(context, input), /repair acknowledgement is uncertain/u);\n state.failUpdateAck = false;\n await publishPr(context, input);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 1);\n });\n\n it('names the missing closing line and exact repair call before independent review', async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.body = 'Lost closing link';\n state.nonClosing = true;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n (error: unknown) => {\n assert.ok(error instanceof Error);\n assert.match(error.message, /Missing `Closes #17`/u);\n assert.ok(\n error.message.includes('issue_pr_create({\"repo\":\"example/widget\",\"issueNumber\":17,\"head\":\"issue/17\"})'),\n );\n assert.doesNotMatch(error.message, /association does not identify/u);\n return true;\n },\n );\n assert.equal(state.submissions + state.updates, 0);\n });\n});\n\nfunction rulesetOnlyFixture(published = true) {\n const current = fixture(published, true);\n const evidence = {\n deniedRoute: '',\n protectionError: { status: 404, response: { status: 404, data: { message: 'Branch not protected' } } } as unknown,\n protection: undefined as unknown,\n rules: {\n status: 200,\n headers: {},\n data: [\n {\n type: 'required_status_checks',\n ruleset_id: 41,\n ruleset_source_type: 'Repository',\n ruleset_source: repo,\n parameters: {\n strict_required_status_checks_policy: true,\n required_status_checks: [{ context: 'local-verify' }],\n },\n },\n {\n type: 'pull_request',\n ruleset_id: 42,\n ruleset_source_type: 'Organization',\n ruleset_source: 'example',\n parameters: { required_approving_review_count: 1, dismiss_stale_reviews_on_push: true },\n },\n ],\n } as unknown,\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: repo, enforcement: 'active' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n } as unknown,\n branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: true } } } as unknown,\n repository: { status: 200, data: { full_name: repo, permissions: { push: true } } } as unknown,\n };\n current.context.clients.rest.request = (async (route: string, input: Record<string, unknown>) => {\n assert.equal(input.owner, 'example');\n assert.equal(input.repo, 'widget');\n if (route === evidence.deniedRoute) throw { status: 403 };\n if (route.endsWith('/protection')) {\n if (evidence.protection !== undefined) return evidence.protection;\n throw evidence.protectionError;\n }\n if (route.endsWith('/rules/branches/{branch}')) return evidence.rules;\n if (route.endsWith('/rulesets')) {\n assert.equal(input.includes_parents, true);\n assert.equal(input.page, 1);\n assert.equal(input.per_page, 100);\n return evidence.rulesets;\n }\n if (route.endsWith('/branches/{branch}')) {\n assert.equal(input.branch, 'main');\n return evidence.branch;\n }\n if (route === 'GET /repos/{owner}/{repo}') return evidence.repository;\n throw new Error(`Unexpected fictional route ${route}`);\n }) as typeof current.context.clients.rest.request;\n return { ...current, evidence };\n}\n\nasync function machineRulesetOnlyFixture(published = true) {\n const current = rulesetOnlyFixture(published);\n const { context, evidence } = current;\n const rest = context.clients.rest;\n const graphql = context.clients.graphql;\n const home = realpathSync(mkdtempSync(join(tmpdir(), 'ai-delivery-machine-protection-')));\n const bin = join(home, 'bin');\n mkdirSync(bin);\n const token = 'fictional_machine_protection_token';\n writeFileSync(\n join(bin, 'gh'),\n `#!${process.execPath}\nconst args=process.argv.slice(2);\nif(JSON.stringify(args)===JSON.stringify(['auth','status','--hostname','github.com','--active','--json','hosts']))\n process.stdout.write(JSON.stringify({hosts:{'github.com':[{host:'github.com',active:true,state:'success',login:'author'}]}}));\nelse if(JSON.stringify(args)===JSON.stringify(['auth','token','--hostname','github.com','--user','author']))\n process.stdout.write(${JSON.stringify(token)}+'\\\\n');\nelse process.exit(91);\n`,\n { mode: 0o755 },\n );\n const originalEnv = process.env;\n const restore = () => {\n process.env = originalEnv;\n vi.unstubAllGlobals();\n rmSync(home, { recursive: true });\n };\n process.env = { HOME: home, PATH: bin };\n context.config.roles.author = {\n authSource: 'personal',\n identity: context.config.roles.author.identity,\n credentialEnv: { token: 'GH_TOKEN' },\n };\n vi.stubGlobal('fetch', async (input: string | URL | Request, init?: RequestInit) => {\n const url = new URL(input instanceof Request ? input.url : String(input));\n assert.equal(url.origin, 'https://api.github.com');\n const path = url.pathname;\n const method = init?.method ?? 'GET';\n const body = (typeof init?.body === 'string' ? JSON.parse(init.body) : {}) as {\n query?: unknown;\n draft?: unknown;\n head?: unknown;\n body?: unknown;\n };\n let result: { status?: number; headers?: Record<string, string | number | undefined>; data: unknown };\n if (path === '/user') result = { data: { id: 42, login: 'author', type: 'User' } };\n else if (path === '/graphql') {\n assert.ok(typeof body.query === 'string');\n result = { data: { data: await graphql(body.query) } };\n } else {\n const prefix = '/repos/example/widget';\n assert.ok(path.startsWith(prefix));\n const suffix = path.slice(prefix.length);\n if (suffix === '') {\n const native = await rest.repos.get({ owner: 'example', repo: 'widget' });\n const visible = evidence.repository as { status: number; data: Record<string, unknown> };\n result = { status: visible.status, data: { ...native.data, ...visible.data } };\n } else if (suffix === '/branches/main/protection') {\n if (evidence.protection !== undefined) result = evidence.protection as typeof result;\n else {\n const error = evidence.protectionError as { status: number; response: { data: object } };\n result = {\n status: error.status,\n data: { ...error.response.data, private: token },\n headers: { 'x-private': token },\n };\n }\n } else if (suffix === '/rules/branches/main') result = evidence.rules as typeof result;\n else if (suffix === '/branches/main') result = evidence.branch as typeof result;\n else if (suffix === '/rulesets') {\n assert.equal(url.searchParams.get('includes_parents'), 'true');\n assert.equal(url.searchParams.get('per_page'), '100');\n assert.equal(url.searchParams.get('page'), '1');\n result = evidence.rulesets as typeof result;\n } else if (suffix === '/issues/17')\n result = await rest.issues.get({ owner: 'example', repo: 'widget', issue_number: 17 });\n else if (suffix.startsWith('/git/ref/'))\n result = await rest.git.getRef({\n owner: 'example',\n repo: 'widget',\n ref: decodeURIComponent(suffix.slice('/git/ref/'.length)),\n });\n else if (suffix.startsWith('/git/commits/'))\n result = await rest.git.getCommit({ owner: 'example', repo: 'widget', commit_sha: head });\n else if (suffix.startsWith('/compare/'))\n result = await rest.repos.compareCommitsWithBasehead({\n owner: 'example',\n repo: 'widget',\n basehead: `${base}...${head}`,\n });\n else if (suffix === '/pulls' && method === 'POST') {\n assert.ok(typeof body.draft === 'boolean' && typeof body.head === 'string' && typeof body.body === 'string');\n result = await rest.pulls.create({\n owner: 'example',\n repo: 'widget',\n title: 'Improve widget',\n base: 'main',\n draft: body.draft,\n head: body.head,\n body: body.body,\n });\n } else if (suffix === '/pulls') result = await rest.pulls.list({ owner: 'example', repo: 'widget' });\n else if (suffix === '/pulls/23')\n result = await rest.pulls.get({ owner: 'example', repo: 'widget', pull_number: 23 });\n else if (suffix === '/pulls/23/files')\n result = await rest.pulls.listFiles({ owner: 'example', repo: 'widget', pull_number: 23 });\n else if (suffix === '/pulls/23/reviews')\n result = await rest.pulls.listReviews({ owner: 'example', repo: 'widget', pull_number: 23 });\n else throw new Error(`Unexpected fictional machine route ${method} ${suffix}`);\n if (evidence.deniedRoute && suffix === evidence.deniedRoute) result = { status: 403, data: { message: token } };\n }\n const response = new Response(JSON.stringify(result.data), {\n status: result.status ?? 200,\n headers: {\n 'content-type': 'application/json',\n ...Object.fromEntries(\n Object.entries(result.headers ?? {}).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string',\n ),\n ),\n },\n });\n Object.defineProperty(response, 'url', { value: url.href });\n return response;\n });\n try {\n context.clients = await github.createDeliveryGitHubClients({\n config: context.config,\n role: 'author',\n identity: 'author',\n env: process.env,\n });\n github.retainMachineAuthorForConfiguration(context.config, context.clients);\n return { ...current, restore, token };\n } catch (error) {\n restore();\n throw error;\n }\n}\n\ndescribe('native exact PR association after publication', () => {\n it('replays native start, push, draft publication, empty branch links, author inspection and distinct App review', async () => {\n const { context, reviewerContext, state, artifact } = fixture(false);\n const started = await startIssueBranch(context, 17);\n assert.equal(started.reused, false);\n assert.equal(started.headSha, base);\n state.remoteHead = head;\n state.events.push('push');\n await publishPr(context, { issueNumber: 17, body: 'Improve widget', draft: true });\n assert.deepEqual(state.events, ['native-start', 'push', 'draft-publication-replaces-branch-link']);\n assert.equal(state.linked, false);\n assert.equal((await prInfo(context, { issueNumber: 17, prNumber: 23 })).headSha, head);\n assert.equal(\n (await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact, dryRun: true })).headSha,\n head,\n );\n assert.equal(state.submissions, 0);\n const submitted = await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n const reused = await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.deepEqual(reused, submitted);\n assert.equal(state.submissions, 1);\n });\n\n it('gives an exact-PR next action for issue-only lookup with empty branch links', async () => {\n const { context } = fixture();\n await assert.rejects(prInfo(context, { issueNumber: 17 }), (error: unknown) => {\n assert.ok(error instanceof Error);\n assert.match(error.message, /exact issue and PR numbers.*--issue and --pr/u);\n assert.doesNotMatch(error.message, /zero or multiple PRs|start again|repeat.*start/u);\n return true;\n });\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n });\n\n it('verifies native association when issue-only lookup still has a linked branch', async () => {\n const { context, state } = fixture();\n state.linked = true;\n assert.equal((await prInfo(context, { issueNumber: 17 })).prNumber, 23);\n state.issueNumber = 18;\n await assert.rejects(prInfo(context, { issueNumber: 17 }), /association/u);\n });\n\n for (const [name, change] of [\n ['wrong closing issue', { issueNumber: 18 }],\n ['wrong PR repository', { headRepo: 'other/widget' }],\n ['wrong base repository', { baseRepo: 'other/widget' }],\n ['wrong native repository', { associationRepo: 'other/widget' }],\n ['wrong native PR', { associationPr: 24 }],\n ['remote head drift', { remoteHead: 'd'.repeat(40) }],\n ['remote ref mismatch', { remoteRef: 'refs/heads/other' }],\n ['incomplete remote ref', { remoteType: '' }],\n ['invalid head branch', { headRef: '../other' }],\n ['invalid PR head', { headSha: 'missing' }],\n ['incomplete PR state', { prState: '' }],\n ['incomplete merged state', { merged: undefined }],\n ['incomplete draft state', { draft: undefined }],\n ['conflicting merged state', { merged: true }],\n ] as const) {\n it(`refuses ${name} before inspection or review mutation`, async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n Object.assign(state, change);\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23 }));\n await assert.rejects(submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }));\n assert.equal(state.submissions, 0);\n });\n }\n\n for (const [name, response] of [\n ['missing connection', { repository: { nameWithOwner: repo, pullRequest: { number: 23 } } }],\n [\n 'empty closing issues',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: { number: 23, closingIssuesReferences: { nodes: [], pageInfo } },\n },\n },\n ],\n [\n 'foreign closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: 'other/widget' } }],\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'incomplete closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: { number: 23, closingIssuesReferences: { nodes: [null], pageInfo } },\n },\n },\n ],\n [\n 'duplicate closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: Array.from({ length: 2 }, () => ({ number: 17, repository: { nameWithOwner: repo } })),\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'missing pagination',\n { repository: { nameWithOwner: repo, pullRequest: { number: 23, closingIssuesReferences: { nodes: [] } } } },\n ],\n [\n 'nonadvancing pagination',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: { nodes: [], pageInfo: { hasNextPage: true, endCursor: null } },\n },\n },\n },\n ],\n ] as const) {\n it(`refuses ${name} before App submission`, async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.closingReadback = response;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /association|identity|pagination/u,\n );\n assert.equal(state.submissions, 0);\n });\n }\n\n for (const [name, response] of [\n ['incomplete linked branches', { repository: { issue: { linkedBranches: { nodes: [], pageInfo: {} } } } }],\n [\n 'conflicting linked branch',\n {\n repository: {\n issue: {\n linkedBranches: {\n nodes: [{ ref: { name: 'other', target: { oid: head }, repository: { nameWithOwner: repo } } }],\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'stale linked head',\n {\n repository: {\n issue: {\n linkedBranches: {\n nodes: [{ ref: { name: 'issue/17', target: { oid: base }, repository: { nameWithOwner: repo } } }],\n pageInfo,\n },\n },\n },\n },\n ],\n ] as const) {\n it(`accepts ${name} when the native PR closing association and head are current`, async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.branchReadback = response;\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.equal(state.submissions, 1);\n });\n }\n\n it('refuses configured/selected repository disagreement', async () => {\n const { context } = fixture();\n context.repo = { owner: 'other', repo: 'widget' };\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23 }), /repository identities/u);\n });\n\n it('reads the complete closing-issue connection before accepting a later-page association', async () => {\n const { context, state } = fixture();\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 18, repository: { nameWithOwner: repo } }],\n pageInfo: { hasNextPage: true, endCursor: 'NEXT' },\n },\n },\n },\n },\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: repo } }],\n pageInfo,\n },\n },\n },\n },\n ];\n assert.equal((await prInfo(context, { issueNumber: 17, prNumber: 23 })).headSha, head);\n assert.equal(state.closingPageIndex, 2);\n });\n\n it('refuses an incomplete later page even after finding the intended closing issue', async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: repo } }],\n pageInfo: { hasNextPage: true, endCursor: 'NEXT' },\n },\n },\n },\n },\n { repository: null },\n ];\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /association/u,\n );\n assert.equal(state.closingPageIndex, 2);\n assert.equal(state.submissions, 0);\n });\n\n it('preserves configured reviewer separation and stale artifact/head refusals', async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n await assert.rejects(submitFormalReview(context, { issueNumber: 17, prNumber: 23, artifact }), /reviewer.*role/u);\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }), /differ/u);\n state.reviewerActor = 'reviewer[bot]';\n state.movedOnRead = state.reads + 2;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /head|moved/u,\n );\n assert.equal(state.submissions, 0);\n });\n\n it('submits a fresh valid artifact despite an older remapped App review', async () => {\n const { reviewerContext, state, artifact } = fixture();\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n state.reviews[0]!.body = `<!-- ai-delivery-review-artifact: sha256:${'f'.repeat(64)} -->`;\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.equal(state.submissions, 2);\n });\n});\n\ndescribe('authoritative existing PR promotion', () => {\n const input = { issueNumber: 17, headBranch: 'issue/17', draft: false };\n\n it('promotes after publication and exact-head review, then reuses authoritative ready readback', async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(preview.prNumber, 23);\n assert.ok('dryRun' in preview);\n assert.equal(preview.draft, true);\n assert.equal(state.promotions, 0);\n const promoted = await publishPr(context, input);\n const reused = await publishPr(context, input);\n assert.equal(promoted.prNumber, 23);\n assert.ok('state' in promoted);\n assert.equal(promoted.state, 'open');\n assert.deepEqual(reused, promoted);\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 1);\n assert.equal(state.linked, false);\n assert.deepEqual(state.events, []);\n });\n\n for (const [name, change] of [\n ['wrong issue', { issueNumber: 18 }],\n ['foreign PR head repository', { headRepo: 'other/widget' }],\n ['foreign PR base repository', { baseRepo: 'other/widget' }],\n ['foreign native repository', { associationRepo: 'other/widget' }],\n ['wrong native PR', { associationPr: 24 }],\n ['wrong author', { prAuthor: 'collaborator' }],\n ['wrong head', { headSha: 'd'.repeat(40) }],\n ['moved remote head', { remoteHead: 'd'.repeat(40) }],\n ['wrong ref', { headRef: 'other' }],\n ['wrong base', { baseRef: 'release' }],\n ['closed PR', { prState: 'closed' }],\n ['missing node identity', { nodeId: '' }],\n ['incomplete draft state', { draft: undefined }],\n ['ambiguous matches', { matchReadback: [{ number: 23 }, { number: 24 }] }],\n ['incomplete match identity', { matchReadback: [{}] }],\n ['incomplete match connection', { matchReadback: {} }],\n ['incomplete association', { closingReadback: { repository: null } }],\n ] as const) {\n it(`refuses ${name} before promotion, including already-ready reuse`, async () => {\n for (const draft of [true, false]) {\n const { context, state } = fixture();\n state.draft = draft;\n Object.assign(state, change);\n await assert.rejects(publishPr(context, input));\n assert.equal(state.promotions, 0);\n assert.equal(state.creations, 0);\n assert.deepEqual(state.events, []);\n }\n });\n }\n\n for (const read of [2, 3]) {\n it(`refuses head drift on authoritative PR read ${read} before mutation`, async () => {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === read) state.headSha = state.remoteHead = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, input), /drift/u);\n assert.equal(state.promotions, 0);\n });\n }\n\n it('refuses author and native node drift immediately before mutation', async () => {\n for (const field of ['prAuthor', 'nodeId'] as const) {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === 3) state[field] = 'changed';\n };\n await assert.rejects(publishPr(context, input), /drift/u);\n assert.equal(state.promotions, 0);\n }\n });\n\n for (const response of [\n {},\n { markPullRequestReadyForReview: null },\n { markPullRequestReadyForReview: { pullRequest: { id: 'PR24', isDraft: false } } },\n { markPullRequestReadyForReview: { pullRequest: { id: 'PR23' } } },\n ]) {\n it('refuses incomplete or conflicting mutation acknowledgement without retrying it', async () => {\n const { context, state } = fixture();\n state.promotionReadback = response;\n await assert.rejects(publishPr(context, input), /mutation readback/u);\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n });\n }\n\n it('refuses a still-draft authoritative readback after a ready acknowledgement', async () => {\n const { context, state } = fixture();\n state.keepDraftOnPromotion = true;\n await assert.rejects(publishPr(context, input), /still draft/u);\n assert.equal(state.promotions, 1);\n });\n\n it('refuses post-mutation head or association drift without another mutation', async () => {\n for (const kind of ['head', 'association']) {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === 4) {\n if (kind === 'head') state.headSha = state.remoteHead = 'd'.repeat(40);\n else state.closingReadback = { repository: null };\n }\n };\n await assert.rejects(publishPr(context, input), /drift|association/u);\n assert.equal(state.promotions, 1);\n }\n });\n\n it('requires an explicit head after branch links disappear and preserves draft on reuse', async () => {\n const { context, state } = fixture();\n await assert.rejects(publishPr(context, { issueNumber: 17, draft: false }), /linked/u);\n await publishPr(context, { ...input, draft: true });\n assert.equal(state.promotions, 0);\n });\n\n it('creates a ready PR directly from a pushed remote head without native branch setup', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.expectedCreationDraft = false;\n const created = await publishPr(context, input);\n assert.ok('state' in created);\n assert.equal(created.state, 'open');\n assert.equal(state.creations, 1);\n assert.equal(state.promotions, 0);\n assert.equal(state.events.includes('native-start'), false);\n });\n\n it('keeps incomplete native branch readback behind the unchanged start gate', async () => {\n const { context, state } = fixture(false);\n state.branchReadback = { repository: null };\n await assert.rejects(startIssueBranch(context, 17), /Incomplete/u);\n assert.deepEqual(state.events, []);\n });\n\n it('retains the configured author role before promotion', async () => {\n const { reviewerContext, state } = fixture();\n await assert.rejects(publishPr(reviewerContext, input), /author/u);\n assert.equal(state.promotions, 0);\n });\n});\n\ndescribe('canonical publication footer and exact-body recovery', () => {\n const footer = '\\n\\n<!-- ai-delivery:pr@1 -->';\n const substantive = 'Original intent.\\r\\nKeep trailing spaces. \\n\\n';\n\n for (const ready of [false, true]) {\n it(`marks new closing publication once and reuses original unmarked input (${ready ? 'ready' : 'draft'})`, async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.expectedCreationDraft = !ready;\n const input = { issueNumber: 17, headBranch: 'issue/17', body: substantive, draft: !ready };\n const expected = `Closes #17\\n\\n${substantive}${footer}`;\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(Reflect.get(preview, 'body'), expected);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n await publishPr(context, input);\n assert.equal(state.body, expected);\n await publishPr(context, input);\n await publishPr(context, { ...input, draft: false });\n await publishPr(context, { ...input, body: expected, draft: false });\n assert.equal(state.body, expected);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.promotions, ready ? 0 : 1);\n });\n }\n\n it('marks admitted non-closing creation and continues with original unmarked intent', async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n const input = { ...nonClosingCreation, body: `References ${repo}#17\\n\\n${substantive}` };\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(Reflect.get(preview, 'body'), input.body + footer);\n await publishPr(context, input);\n await publishPr(context, { ...input, prNumber: 23 });\n await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: input.body, draft: false });\n assert.equal(state.body, input.body + footer);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.promotions, 1);\n assert.equal(state.issueState, 'open');\n });\n\n for (const nonClosing of [false, true]) {\n it(`reconciles lost creation acknowledgement with original body without another mutation (${nonClosing})`, async () => {\n const { context, state } = fixture(false, nonClosing);\n state.linked = true;\n state.remoteHead = head;\n state.failCreateAck = true;\n const input = nonClosing ? nonClosingCreation : { issueNumber: 17, body: substantive };\n await assert.rejects(publishPr(context, input), /acknowledgement is uncertain/u);\n const expected = nonClosing ? nonClosingCreation.body : `Closes #17\\n\\n${substantive}`;\n assert.equal(state.body, expected + footer);\n state.failCreateAck = false;\n await publishPr(context, { ...input, prNumber: 23 });\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.body, expected + footer);\n });\n\n it(`does not backfill a historical unmarked PR or permit a marker-only transition (${nonClosing})`, async () => {\n const { context, state } = fixture(true, nonClosing);\n const original = state.body;\n const input = { issueNumber: 17, prNumber: 23, nonClosing, body: original };\n await publishPr(context, input);\n assert.equal(state.body, original);\n await assert.rejects(publishPr(context, { ...input, body: original + footer }), /marker|footer|conflict/iu);\n assert.equal(state.body, original);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n });\n }\n\n for (const malformed of [\n 'Closes #17\\n\\n<!-- ai-delivery:pr@2 -->',\n `Closes #17${footer}\\n`,\n `Closes #17${footer}${footer}`,\n `Closes #17${footer}\\n\\nLater text.`,\n `Closes #17\\n\\n<div>\\n${footer}\\n</div>`,\n ]) {\n for (const published of [false, true]) {\n it(`refuses malformed or ambiguous publication markers without repair (${published}, ${JSON.stringify(malformed)})`, async () => {\n const { context, state } = fixture(published);\n state.linked = true;\n state.remoteHead = head;\n if (published) state.body = malformed;\n await assert.rejects(publishPr(context, { issueNumber: 17, body: malformed }), /marker|footer|conflict/iu);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n });\n }\n }\n\n it('preserves quoted marker examples and substantive bytes while adding one active footer', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n const body = 'Closes #17\\n\\nExample:\\n\\n```md\\n<!-- ai-delivery:pr@1 -->\\n```\\n\\nText. \\r\\n';\n await publishPr(context, { issueNumber: 17, body });\n await publishPr(context, { issueNumber: 17, prNumber: 23, body });\n assert.equal(state.body, body + footer);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n });\n});\n\ndescribe('directory-independent exact-PR contract', () => {\n it('uses the existing MCP selector for author dry-run, promotion and ready reuse outside a checkout', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-promotion-'));\n const { context, state } = fixture();\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n assert.equal(input.role, 'author');\n return context;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'promotion-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const input = { repo, issueNumber: 17, headBranch: 'issue/17', draft: false };\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const preview = await client.callTool({ name: 'issue_pr_create', arguments: { ...input, dryRun: true } });\n assert.equal(preview.isError, undefined);\n assert.equal(state.promotions, 0);\n for (let call = 0; call < 2; call++) {\n const result = await client.callTool({ name: 'issue_pr_create', arguments: input });\n assert.equal(result.isError, undefined);\n }\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n assert.equal(state.draft, false);\n assert.equal(state.linked, false);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('dispatches native inspection and App dry-run through MCP from a non-Git directory', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-association-'));\n const { context, reviewerContext, state, artifact } = fixture();\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n const loader = vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n return input.role === 'reviewer' ? reviewerContext : context;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'exact-pr-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const info = await client.callTool({ name: 'issue_pr_info', arguments: { repo, issueNumber: 17, prNumber: 23 } });\n assert.equal(info.isError, undefined, JSON.stringify(info.content));\n const review = await client.callTool({\n name: 'issue_pr_review',\n arguments: { repo, issueNumber: 17, prNumber: 23, artifact, dryRun: true },\n });\n assert.equal(review.isError, undefined);\n state.issueNumber = 18;\n await assert.rejects(\n executeTool('issue_pr_info', { repo, issueNumber: 17, prNumber: 23 }, { repoRoot: root }),\n /association/u,\n );\n assert.deepEqual(\n loader.mock.calls.map(([input]) => input.role),\n ['author', 'reviewer', 'author'],\n );\n assert.equal(state.submissions, 0);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it(\n 'documents explicit issue/PR selection in actual CLI help without credentials or a checkout',\n { tags: ['release'] },\n () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-help-'));\n try {\n const help = execFileSync(process.execPath, [resolve('dist/cli.js'), 'pr:info', '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n });\n assert.match(help, /combine --issue and --pr/u);\n assert.match(help, /issue-only lookup requires a GitHub-linked\\s+branch/u);\n const creationHelp = execFileSync(process.execPath, [resolve('dist/cli.js'), 'pr:create', '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n }).replace(/\\s+/gu, ' ');\n assert.match(creationHelp, /Create or reuse an issue-closing PR from a pushed --head, from any directory/u);\n assert.match(creationHelp, /--base <branch>/u);\n assert.match(creationHelp, /Pushed remote head/u);\n assert.match(creationHelp, /--pr <number>/u);\n assert.match(creationHelp, /--reconcile-non-closing-reference/u);\n assert.match(creationHelp, /--expected-head <sha>/u);\n assert.match(creationHelp, /--expected-base <sha>/u);\n for (const command of ['pr:create', 'pr:info', 'pr:review']) {\n const modeHelp = execFileSync(process.execPath, [resolve('dist/cli.js'), command, '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n });\n assert.match(modeHelp, /--non-closing/u);\n }\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n },\n );\n});\n\ndescribe('explicit native non-closing reference delivery', () => {\n const input = { issueNumber: 17, prNumber: 23, nonClosing: true };\n\n it.each(['ruleset-only', 'ruleset-only with disabled protection summary', 'confirmed-unprotected'])(\n 'creates and reviews %s protection through the real machine client and sanitizer',\n async (mode) => {\n const { context, reviewerContext, state, artifact, evidence, restore, token } =\n await machineRulesetOnlyFixture(false);\n try {\n if (mode === 'ruleset-only with disabled protection summary')\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled: false } } };\n if (mode === 'confirmed-unprotected') {\n evidence.rules = { status: 200, headers: {}, data: [] };\n evidence.rulesets = { status: 200, headers: {}, data: [] };\n evidence.branch = { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } };\n }\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.equal(state.creations, 0);\n const created = await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n const route = await preflightReviewRoute(context, 'main');\n assert.equal(route.rules.visibility, 'complete');\n assert.equal(route.rules.observedRequiredApprovals, mode === 'confirmed-unprotected' ? 0 : 1);\n const reviewPreview = await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n const reviewed = await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.reviews[0]?.user.login, 'reviewer[bot]');\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n assert.equal(state.updates, 0);\n assert.equal(JSON.stringify([preview, created, reviewPreview, reviewed]).includes(token), false);\n } finally {\n restore();\n }\n },\n );\n\n for (const [name, change] of [\n ['generic protection 404', { protectionError: { status: 404, response: { data: { message: 'Not Found' } } } }],\n [\n 'denied protection',\n { protectionError: { status: 403, response: { data: { message: 'Branch not protected' } } } },\n ],\n ['denied applicable rules', { deniedRoute: '/rules/branches/main' }],\n [\n 'denied repository',\n { deniedRoute: '', repository: { status: 403, data: { full_name: repo, permissions: { push: true } } } },\n ],\n ['denied parent rulesets', { deniedRoute: '/rulesets' }],\n [\n 'incomplete rules',\n { rules: { status: 200, headers: { link: '<https://api.github.com/next>; rel=\"next\"' }, data: [] } },\n ],\n ] as const) {\n it(`refuses ${name} through real machine sanitization before publication or review`, async () => {\n const { context, reviewerContext, state, artifact, evidence, restore, token } =\n await machineRulesetOnlyFixture(false);\n try {\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled: false } } };\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n Object.assign(evidence, change);\n for (const operation of [\n () => publishPr(context, nonClosingCreation),\n () => {\n state.published = true;\n return submitFormalReview(reviewerContext, { ...input, artifact });\n },\n ])\n await assert.rejects(operation(), (error: unknown) => {\n assert.ok(error instanceof DeliveryError);\n assert.equal(JSON.stringify(error).includes(token), false);\n return true;\n });\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.updates, 0);\n } finally {\n restore();\n }\n });\n }\n\n it.each([true, false])(\n 'creates and independently reviews a non-closing PR with corroborated rulesets and protection summary %s',\n async (enabled) => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture(false);\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled } } };\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.equal(preview.nonClosing, true);\n assert.equal(state.creations, 0);\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.reviews[0]?.user.login, 'reviewer[bot]');\n assert.equal(state.updates, 0);\n },\n );\n\n for (const [name, change] of [\n ['generic 404', { protectionError: { status: 404, response: { status: 404, data: { message: 'Not Found' } } } }],\n [\n 'permission 404',\n { protectionError: { status: 404, response: { status: 403, data: { message: 'Branch not protected' } } } },\n ],\n ['denied protection', { deniedRoute: 'GET /repos/{owner}/{repo}/branches/{branch}/protection' }],\n ['denied applicable rules', { deniedRoute: 'GET /repos/{owner}/{repo}/rules/branches/{branch}' }],\n ['denied repository', { deniedRoute: 'GET /repos/{owner}/{repo}' }],\n ['denied branch', { deniedRoute: 'GET /repos/{owner}/{repo}/branches/{branch}' }],\n ['denied parent rulesets', { deniedRoute: 'GET /repos/{owner}/{repo}/rulesets' }],\n [\n 'foreign repository',\n { repository: { status: 200, data: { full_name: 'other/widget', permissions: { push: true } } } },\n ],\n ['unknown author write access', { repository: { status: 200, data: { full_name: repo, permissions: {} } } }],\n [\n 'foreign branch',\n { branch: { status: 200, data: { name: 'other', protected: true, protection: { enabled: true } } } },\n ],\n [\n 'conflicting branch protection',\n { branch: { status: 200, data: { name: 'main', protected: false, protection: { enabled: true } } } },\n ],\n [\n 'unprotected branch with active rulesets',\n { branch: { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } } },\n ],\n ['missing protected branch summary', { branch: { status: 200, data: { name: 'main', protected: true } } }],\n ['missing enabled summary', { branch: { status: 200, data: { name: 'main', protected: true, protection: {} } } }],\n [\n 'null enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: null } } } },\n ],\n [\n 'string enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: 'false' } } } },\n ],\n [\n 'numeric enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: 0 } } } },\n ],\n ['missing ruleset page headers', { rulesets: { status: 200, data: [] } }],\n [\n 'incomplete parent ruleset page',\n { rulesets: { status: 200, headers: { link: '<https://api.github.com/next>; rel=\"next\"' }, data: [] } },\n ],\n ['malformed parent rulesets', { rulesets: { status: 200, headers: {}, data: null } }],\n ['uncorroborated rulesets', { rulesets: { status: 200, headers: {}, data: [] } }],\n [\n 'inactive applicable ruleset',\n {\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: repo, enforcement: 'evaluate' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n },\n },\n ],\n [\n 'conflicting source identity',\n {\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: 'other/widget', enforcement: 'active' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n },\n },\n ],\n ] as const) {\n it(`refuses non-closing creation and review with ruleset-only ${name} without mutation`, async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture(false);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n Object.assign(evidence, change);\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n await assert.rejects(publishPr(context, nonClosingCreation), /complete native rule visibility/u);\n assert.equal(state.creations, 0);\n state.published = true;\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.submissions, 0);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n assert.equal(state.issueState, 'open');\n });\n }\n\n it('keeps reviewer permission, distinct-actor and exact-head guards with complete ruleset-only protection', async () => {\n const { context, reviewerContext, state, artifact } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n context.reviewerClients!.effectiveContentsPermission = 'read';\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n context.reviewerClients!.effectiveContentsPermission = 'write';\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /differ|same GitHub actor/u);\n state.reviewerActor = 'reviewer[bot]';\n state.headSha = 'd'.repeat(40);\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /head|artifact/u);\n assert.equal(state.submissions, 0);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 0);\n });\n\n it('does not treat a sanitized machine-session 404 as proof of absent classic protection', async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n const error = Object.assign(new DeliveryError('Machine GitHub session cannot access the selected operation.'), {\n status: 404,\n });\n setMachineRequestDiagnostics(error, {\n phase: 'rest.request',\n endpoint: 'UNKNOWN',\n status: 404,\n code: undefined,\n requestId: undefined,\n });\n evidence.protectionError = error;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /complete native rule visibility/u);\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.promotions, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.updates, 0);\n });\n\n for (const name of [\n 'incomplete applicable page',\n 'incomplete parent page',\n 'missing applicable headers',\n 'non-success applicable response',\n 'malformed applicable rules',\n 'missing applicable ruleset identity',\n 'malformed approval count',\n 'duplicate corroborating ruleset',\n 'protected branch with empty rules',\n ]) {\n it(`refuses ${name} despite observed ruleset-only protection without mutation`, async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n const rules = evidence.rules as { status: number; headers?: { link?: string }; data: unknown };\n const rulesets = evidence.rulesets as { headers: { link?: string }; data: unknown[] };\n switch (name) {\n case 'incomplete applicable page':\n rules.headers = { link: '<https://api.github.com/next>; rel=\"next\"' };\n break;\n case 'incomplete parent page':\n rulesets.headers = { link: '<https://api.github.com/next>; rel=\"next\"' };\n break;\n case 'missing applicable headers':\n delete rules.headers;\n break;\n case 'non-success applicable response':\n rules.status = 206;\n break;\n case 'malformed applicable rules':\n rules.data = [null];\n break;\n case 'missing applicable ruleset identity':\n rules.data = [{ type: 'pull_request', parameters: { required_approving_review_count: 1 } }];\n break;\n case 'malformed approval count':\n rules.data = [\n {\n type: 'pull_request',\n ruleset_id: 42,\n ruleset_source_type: 'Organization',\n ruleset_source: 'example',\n parameters: { required_approving_review_count: '1' },\n },\n ];\n break;\n case 'duplicate corroborating ruleset':\n rulesets.data.push(rulesets.data[0]);\n break;\n case 'protected branch with empty rules':\n rules.data = [];\n rulesets.data = [];\n break;\n }\n await assert.rejects(publishPr(context, { ...input, draft: false }), /complete native rule visibility/u);\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n });\n }\n\n it('preserves non-closing publication and exact-head review with readable classic protection', async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n evidence.protection = {\n status: 200,\n data: { required_pull_request_reviews: { required_approving_review_count: 2 } },\n };\n await publishPr(context, { ...input, draft: false });\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.promotions, 1);\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.issueState, 'open');\n });\n\n it('submits confirmed-unprotected exact-head review while preserving distinct reviewer and stale-head guards', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n let protectionMessage = 'Branch not protected';\n const request = async (route: string) => {\n if (route.endsWith('/protection'))\n throw { status: 404, response: { status: 404, data: { message: protectionMessage } } };\n if (route.endsWith('/rules/branches/{branch}') || route.endsWith('/rulesets'))\n return { status: 200, headers: {}, data: [] };\n if (route.endsWith('/branches/{branch}'))\n return { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } };\n if (route === 'GET /repos/{owner}/{repo}')\n return { status: 200, data: { full_name: repo, permissions: { push: true } } };\n throw new Error(`Unexpected fictional route ${route}`);\n };\n context.clients.rest.request = request as typeof context.clients.rest.request;\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n protectionMessage = 'Not Found';\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n protectionMessage = 'Branch not protected';\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /differ|same GitHub actor/u);\n state.reviewerActor = 'reviewer[bot]';\n state.headSha = 'd'.repeat(40);\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /head|artifact/u);\n state.headSha = head;\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n });\n\n it('accepts the exact native historical reference with empty branch/closing connections', async () => {\n const { context, state } = fixture(true, true);\n assert.equal((await prInfo(context, input)).headSha, head);\n const preview = await publishPr(context, { ...input, draft: false, dryRun: true });\n assert.equal(preview.prNumber, 23);\n assert.equal(preview.nonClosing, true);\n await publishPr(context, { ...input, draft: false });\n await publishPr(context, { ...input, draft: false });\n assert.equal(state.promotions, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.creations, 0);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n });\n\n it('transitions only an exact selected author PR, then reuses the verified body without another update', async () => {\n const { context, state } = fixture();\n const transition = { ...input, body: 'Deliver widget while retaining its issue.' };\n const preview = await publishPr(context, { ...transition, dryRun: true });\n assert.ok('bodyTransition' in preview);\n assert.equal(preview.bodyTransition, true);\n assert.equal(state.updates, 0);\n await publishPr(context, transition);\n await publishPr(context, transition);\n assert.equal(state.body, `References ${repo}#17\\n\\nDeliver widget while retaining its issue.`);\n assert.equal(state.updates, 1);\n assert.equal(state.creations, 0);\n });\n\n it('keeps new PR publication behind the exact pushed head and checks introduced messages first', async () => {\n const { context, state } = fixture(false, true);\n await assert.rejects(publishPr(context, nonClosingCreation), /expected head/u);\n state.linked = true;\n state.remoteHead = head;\n state.commitMessage = 'Fixes: example/widget#99';\n await assert.rejects(publishPr(context, nonClosingCreation), /closing directives/u);\n assert.equal(state.creations, 0);\n state.commitMessage = 'Improve widget';\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.linked, false);\n assert.equal(state.issueState, 'open');\n });\n\n it('submits exact non-closing review after the default base advances and refuses invalid refs', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n state.remoteBase.object.sha = 'd'.repeat(40);\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n await submitFormalReview(reviewerContext, { ...input, artifact });\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.issueState, 'open');\n for (const ref of [\n { ref: '', object: { type: 'commit', sha: base } },\n { ref: 'refs/heads/other', object: { type: 'commit', sha: base } },\n { ref: 'refs/heads/main', object: { type: 'tag', sha: base } },\n { ref: 'refs/heads/main', object: { type: 'commit', sha: '' } },\n { ref: 'refs/heads/main', object: { type: 'commit', sha: 'not-a-sha' } },\n ]) {\n state.remoteBase = ref;\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }));\n assert.equal(state.submissions, 1);\n }\n });\n\n for (const directive of [\n 'Closes #17',\n 'CLOSE: #17, #18',\n 'closed example/widget#17',\n 'Fixes: other_owner/other_repo#9',\n 'fixed https://github.com/example/widget/issues/17',\n 'Resolves: https://github.com/example/widget/pull/23',\n 'Resolved **#17**',\n 'Fixes [the issue](https://github.com/example/widget/issues/17)',\n 'Closes \\\\#17',\n ]) {\n it(`refuses closure syntax in introduced messages: ${directive}`, async () => {\n const { context, state } = fixture(true, true);\n state.commitMessage = directive;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing directives/u);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n });\n }\n\n for (const [name, change] of [\n [\n 'removed current intent',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body = 'Improve widget';\n },\n ],\n [\n 'changed intended issue',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body = `References ${repo}#18`;\n },\n ],\n [\n 'conflicting intent declarations',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body += `\\nReferences ${repo}#18`;\n },\n ],\n [\n 'body closure',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body += '\\nFixes #18';\n },\n ],\n [\n 'title closure',\n (state: ReturnType<typeof fixture>['state']) => {\n state.title = 'Fixes #17';\n },\n ],\n [\n 'closing native event',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceCloses = true;\n },\n ],\n [\n 'unknown native event intent',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceCloses = null;\n },\n ],\n [\n 'unauthorized reference actor',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceActor = 'collaborator';\n },\n ],\n [\n 'wrong PR author',\n (state: ReturnType<typeof fixture>['state']) => {\n state.prAuthor = 'collaborator';\n },\n ],\n [\n 'closed issue',\n (state: ReturnType<typeof fixture>['state']) => {\n state.issueState = 'closed';\n },\n ],\n [\n 'foreign PR repository',\n (state: ReturnType<typeof fixture>['state']) => {\n state.headRepo = 'other/widget';\n },\n ],\n [\n 'moved default base',\n (state: ReturnType<typeof fixture>['state']) => {\n state.baseSha = 'd'.repeat(40);\n },\n ],\n [\n 'incomplete commits',\n (state: ReturnType<typeof fixture>['state']) => {\n state.commitReadback = { repository: null };\n },\n ],\n [\n 'missing native reference',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceReadback = {\n repository: {\n id: 'REPO',\n nameWithOwner: repo,\n issue: { id: 'ISSUE17', number: 17, state: 'OPEN', timelineItems: { nodes: [], pageInfo } },\n },\n };\n },\n ],\n ] as const) {\n it(`refuses ${name} without mutation`, async () => {\n const { context, state } = fixture(true, true);\n change(state);\n await assert.rejects(publishPr(context, { ...input, draft: false }));\n assert.equal(state.promotions + state.creations + state.updates, 0);\n });\n }\n\n it('requires complete empty closing associations including later pages', async () => {\n const { context, state } = fixture(true, true);\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n closingIssuesReferences: { nodes: [], pageInfo: { hasNextPage: true, endCursor: 'NEXT' } },\n },\n },\n },\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n closingIssuesReferences: { nodes: [{ number: 99, repository: { nameWithOwner: repo } }], pageInfo },\n },\n },\n },\n ];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing association/u);\n assert.equal(state.promotions, 0);\n });\n\n it('accepts equivalent duplicate native events without duplicating authority, but refuses conflicts', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: Array<{ willCloseTarget: boolean }> } } };\n };\n const event = native.repository.issue.timelineItems.nodes[0]!;\n native.repository.issue.timelineItems.nodes.push({ ...event });\n state.referenceReadback = native;\n await prInfo(context, input);\n native.repository.issue.timelineItems.nodes[1]!.willCloseTarget = true;\n await assert.rejects(prInfo(context, input), /Conflicting/u);\n });\n\n it('refuses incomplete reference pagination after a matching observation', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { pageInfo: { hasNextPage: boolean; endCursor: string | null } } } };\n };\n native.repository.issue.timelineItems.pageInfo = { hasNextPage: true, endCursor: 'NEXT' };\n state.referencePages = [native, { repository: null }];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /Incomplete/u);\n assert.equal(state.promotions, 0);\n });\n\n it('does not create again after a server-created draft fails association verification', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.closingReadback = { repository: null };\n await assert.rejects(\n publishPr(context, { issueNumber: 17 }),\n /created PR #23.*post-publication association\\/identity verification is unresolved/u,\n );\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n await assert.rejects(publishPr(context, { issueNumber: 17 }));\n assert.equal(state.creations, 1);\n assert.equal(state.published, true);\n });\n\n it('preserves uncertain create/update acknowledgements and reconciles without another mutation', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.failCreateAck = true;\n await assert.rejects(publishPr(context, { issueNumber: 17 }), /acknowledgement is uncertain/u);\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n state.failCreateAck = false;\n await publishPr(context, { issueNumber: 17, prNumber: 23 });\n assert.equal(state.creations, 1);\n state.failUpdateAck = true;\n const transition = { ...input, body: 'Keep the issue open.' };\n await assert.rejects(publishPr(context, transition), /Transport lost after body update/u);\n state.failUpdateAck = false;\n await publishPr(context, transition);\n assert.equal(state.updates, 1);\n });\n\n it('refuses explicit ambiguity and requires exact numbers for non-closing inspection', async () => {\n const { context, state } = fixture(true, true);\n await assert.rejects(prInfo(context, { issueNumber: 17, nonClosing: true }), /explicit/u);\n state.matchReadback = [{ number: 23 }, { number: 24 }];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /conflicting/u);\n assert.equal(state.promotions, 0);\n });\n});\n\ndescribe('non-closing complete native graph and mutation drift', () => {\n const input = { issueNumber: 17, prNumber: 23, nonClosing: true };\n it('checks earlier introduced commits rather than only the safe head message', async () => {\n const { context, state } = fixture(true, true);\n const graph = (await context.clients.graphql('DeliveryNonClosingCommits', {})) as {\n repository: {\n pullRequest: {\n commits: {\n totalCount: number;\n nodes: Array<{\n commit: {\n oid: string;\n message: string;\n parents: { totalCount: number; nodes: Array<{ oid: string }>; pageInfo: typeof pageInfo };\n };\n }>;\n };\n };\n };\n };\n graph.repository.pullRequest.commits.totalCount = 2;\n graph.repository.pullRequest.commits.nodes.unshift({\n commit: {\n oid: 'e'.repeat(40),\n message: 'Closes: #999',\n parents: { totalCount: 1, nodes: [{ oid: base }], pageInfo },\n },\n });\n state.commitReadback = graph;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing directives/u);\n assert.equal(state.promotions, 0);\n graph.repository.pullRequest.commits.nodes[0]!.commit.message = 'Earlier improvement';\n await prInfo(context, input);\n graph.repository.pullRequest.commits.totalCount = 3;\n await assert.rejects(prInfo(context, input), /count\\/head is incomplete/u);\n });\n\n for (const kind of [\n 'source-node',\n 'source-number',\n 'source-repository',\n 'source-type',\n 'target-node',\n 'target-number',\n 'target-repository',\n 'cross-repository',\n 'missing-actor',\n 'wrong-pr-node',\n ] as const) {\n it(`refuses conflicting native identity ${kind}`, async () => {\n const { context, state } = fixture(true, true);\n type Subject = {\n __typename: string;\n id: string;\n number: number;\n repository: { id: string; nameWithOwner: string };\n };\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: {\n issue: {\n timelineItems: {\n nodes: Array<{\n source: Subject;\n target: Subject;\n isCrossRepository: boolean;\n actor: { login: string } | null;\n }>;\n };\n };\n };\n };\n const event = native.repository.issue.timelineItems.nodes[0]!;\n if (kind === 'source-node') event.source.id = 'PROTHER';\n if (kind === 'source-number') event.source.number = 24;\n if (kind === 'source-repository') event.source.repository.nameWithOwner = 'other/widget';\n if (kind === 'source-type') event.source.__typename = 'Issue';\n if (kind === 'target-node') event.target.id = 'ISSUEOTHER';\n if (kind === 'target-number') event.target.number = 18;\n if (kind === 'target-repository') event.target.repository.id = 'OTHER';\n if (kind === 'cross-repository') event.isCrossRepository = true;\n if (kind === 'missing-actor') event.actor = null;\n if (kind === 'wrong-pr-node') state.nodeId = 'OTHER';\n state.referenceReadback = native;\n await assert.rejects(publishPr(context, { ...input, draft: false }));\n assert.equal(state.promotions + state.creations + state.updates, 0);\n });\n }\n\n it('refuses changed issue criteria on promotion readback without another ready mutation', async () => {\n const { context, state } = fixture(true, true);\n state.readHook = () => {\n if (state.promotions) state.issueBody = 'External changed criteria';\n };\n await assert.rejects(publishPr(context, { ...input, draft: false }), /criteria drifted/u);\n assert.equal(state.promotions, 1);\n assert.equal(state.issueState, 'open');\n });\n\n it('refuses changed body during formal review readback without a duplicate review', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n state.readHook = () => {\n if (state.submissions) state.body = 'External removed reference';\n };\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /References line/u);\n assert.equal(state.submissions, 1);\n assert.equal(state.issueState, 'open');\n });\n});\n\ndescribe('exact created intent and native reader bounds', () => {\n for (const drift of ['body', 'title', 'draft', 'closed', 'base'] as const) {\n it(`reports created identity but refuses post-publication ${drift} drift without a replacement`, async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.readHook = () => {\n if (!state.creations) return;\n if (drift === 'body') state.body = `References ${repo}#17\\n\\nOther safe intent`;\n if (drift === 'title') state.title = 'Other safe title';\n if (drift === 'draft') state.draft = false;\n if (drift === 'closed') state.prState = 'closed';\n if (drift === 'base') state.baseSha = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /created PR #23.*differs from publication intent/u);\n assert.equal(state.creations, 1);\n await assert.rejects(publishPr(context, nonClosingCreation));\n assert.equal(state.creations, 1);\n });\n }\n for (const id of [1, true, {}, null, '', ' ']) {\n it(`refuses malformed native event ID ${JSON.stringify(id)} before ready`, async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: Array<{ id: unknown }> } } };\n };\n native.repository.issue.timelineItems.nodes[0]!.id = id;\n state.referenceReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /event identity/u,\n );\n assert.equal(state.promotions + state.updates + state.creations, 0);\n });\n }\n it('refuses an oversized reference page despite equivalent observations', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: unknown[] } } };\n };\n native.repository.issue.timelineItems.nodes = Array.from(\n { length: 101 },\n () => native.repository.issue.timelineItems.nodes[0],\n );\n state.referenceReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /Incomplete/u,\n );\n assert.equal(state.promotions, 0);\n });\n it('refuses oversized introduced commit and parent pages', async () => {\n for (const kind of ['commits', 'parents']) {\n const { context, state } = fixture(true, true);\n type Commit = { oid: string; parents: { nodes: Array<{ oid: string }>; totalCount: number } };\n const native = (await context.clients.graphql('DeliveryNonClosingCommits', {})) as {\n repository: { pullRequest: { commits: { nodes: Array<{ commit: Commit }>; totalCount: number } } };\n };\n const commits = native.repository.pullRequest.commits;\n if (kind === 'commits') {\n commits.nodes = Array.from({ length: 101 }, () => commits.nodes[0]!);\n commits.totalCount = 101;\n } else {\n commits.nodes[0]!.commit.parents.nodes = Array.from({ length: 101 }, () => ({ oid: base }));\n commits.nodes[0]!.commit.parents.totalCount = 101;\n }\n state.commitReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /Incomplete/u,\n );\n assert.equal(state.promotions, 0);\n }\n });\n it('refuses body-transition draft drift before promotion, with no second body mutation', async () => {\n const { context, state } = fixture();\n state.readHook = () => {\n if (state.updates) state.draft = false;\n };\n await assert.rejects(\n publishPr(context, {\n issueNumber: 17,\n prNumber: 23,\n nonClosing: true,\n body: 'Safe partial intent',\n draft: false,\n }),\n /drifted/u,\n );\n assert.equal(state.updates, 1);\n assert.equal(state.promotions, 0);\n assert.equal(state.creations, 0);\n });\n it('does not use the closing-transition exception for stale body with empty closing associations', async () => {\n const { context, state } = fixture(true, true);\n state.body = 'Stale intent with removed References line';\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'New safe intent' }),\n /closing-issue association/u,\n );\n assert.equal(state.updates + state.creations + state.promotions, 0);\n });\n});\n\ndescribe('explicit metadata transition typed authority', () => {\n for (const closing of [\n { number: 17, repository: { nameWithOwner: repo } },\n { __typename: 'PullRequest', id: 'ISSUE17', number: 17, repository: { id: 'REPO', nameWithOwner: repo } },\n { __typename: 'Issue', id: 'OTHER', number: 17, repository: { id: 'REPO', nameWithOwner: repo } },\n { __typename: 'Issue', id: 'ISSUE17', number: 17, repository: { id: 'OTHER', nameWithOwner: repo } },\n ]) {\n it(`refuses incomplete/foreign typed closing identity ${JSON.stringify(closing)}`, async () => {\n const { context, state } = fixture();\n state.closingReadback = {\n repository: {\n nameWithOwner: repo,\n pullRequest: { id: 'PR23', number: 23, closingIssuesReferences: { nodes: [closing], pageInfo } },\n },\n };\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'Safe partial intent' }),\n /typed closing/u,\n );\n assert.equal(state.updates + state.creations + state.promotions, 0);\n });\n }\n});\n\ndescribe('explicit closing-reference reconciliation', () => {\n function pending(published = false) {\n const f = fixture(published, true);\n f.state.linked = !published;\n f.state.remoteHead = head;\n f.state.closingOnCreate = true;\n if (published) {\n f.state.manualClosing = true;\n f.state.referenceCloses = true;\n }\n return f;\n }\n for (const published of [false, true]) {\n it(`refuses a reviewer-context library mutation before publication/removal; existing PR ${published}`, async () => {\n const { context, reviewerContext, state } = pending(published);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n await assert.rejects(\n publishPr(reviewerContext, { ...nonClosingCreation, ...(published ? { prNumber: 23 } : {}) }),\n /configured authenticated author/u,\n );\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n }\n it('refuses the wrong credential source on the direct library mutation', async () => {\n const { context, state } = pending(true);\n const wrongSource = { ...context, clients: { ...context.clients, authSource: 'app' as const } };\n await assert.rejects(publishPr(wrongSource, { ...nonClosingCreation, prNumber: 23 }), /configured.*author/u);\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n it('refuses bare nonClosing before creating the linked-branch PR with supported prerequisites', async () => {\n const { context, state } = pending();\n await assert.rejects(\n publishPr(context, { issueNumber: 17, nonClosing: true }),\n /reconcile-non-closing-reference.*expected-head.*expected-base/u,\n );\n assert.equal(state.creations + state.removals, 0);\n });\n it('creates one draft and removes only the exact manual closing pair before strict success', async () => {\n const { context, state } = pending();\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.ok('nonClosingVerified' in preview);\n assert.equal(preview.nonClosingVerified, false);\n assert.equal(state.creations + state.removals, 0);\n const result = await publishPr(context, nonClosingCreation);\n assert.equal(result.prNumber, 23);\n assert.ok('nonClosingVerified' in result);\n assert.equal(result.nonClosingVerified, true);\n assert.deepEqual(state.events, ['draft-publication-replaces-branch-link', 'remove-exact-closing-pair']);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n assert.equal(state.updates + state.promotions + state.submissions, 0);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n await prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n });\n it('skips removal when the new draft already satisfies the complete non-closing graph', async () => {\n const { context, state } = pending();\n state.closingOnCreate = false;\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 0);\n });\n for (const change of [\n { nonClosing: false },\n { draft: false },\n { body: undefined },\n { expectedHeadSha: undefined },\n { expectedBaseSha: undefined },\n { expectedHeadSha: 'd'.repeat(40) },\n { expectedBaseSha: 'd'.repeat(40) },\n { expectedHeadSha: 'bad' },\n { body: 'Closes #17' },\n ]) {\n it(`refuses incompatible action ${JSON.stringify(change)} before publication`, async () => {\n const { context, state } = pending();\n await assert.rejects(publishPr(context, Object.assign({ ...nonClosingCreation }, change)));\n assert.equal(state.creations + state.removals + state.updates + state.promotions, 0);\n });\n }\n it('does not infer removal authority from an implicitly matched existing PR', async () => {\n const { context, state } = pending(true);\n state.linked = true;\n await assert.rejects(publishPr(context, nonClosingCreation), /explicit.*PR|--pr/u);\n assert.equal(state.creations + state.removals, 0);\n });\n it('continues a caller-admitted exact pending PR without creating another', async () => {\n const { context, state } = pending(true);\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.equal(state.creations, 0);\n assert.equal(state.removals, 1);\n });\n it('reads the complete manual connection before acting and checks both connections afterward', async () => {\n const { context, state } = pending(true);\n const first = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n pullRequest: {\n closingIssuesReferences: { nodes: unknown[]; pageInfo: { hasNextPage: boolean; endCursor: string | null } };\n };\n };\n };\n const last = structuredClone(first);\n first.repository.pullRequest.closingIssuesReferences.nodes = [];\n first.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'manual-next' };\n state.manualPages = [first, last];\n state.removalHook = () => {\n state.manualPages = [];\n };\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.ok(state.manualPageIndex >= 4);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 0);\n await prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n });\n for (const kind of [\n 'foreign-later',\n 'duplicate-later',\n 'missing-node',\n 'wrong-pr',\n 'wrong-repo',\n 'incomplete-page',\n ] as const) {\n it(`refuses manual graph ${kind} before removal`, async () => {\n const { context, state } = pending(true);\n const graph = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n nameWithOwner: string;\n pullRequest: {\n id: string;\n closingIssuesReferences: {\n nodes: Array<{ id: string; number: number }>;\n pageInfo?: { hasNextPage: boolean; endCursor: string | null };\n };\n };\n };\n };\n if (kind === 'missing-node') graph.repository.pullRequest.closingIssuesReferences.nodes[0]!.id = '';\n if (kind === 'wrong-pr') graph.repository.pullRequest.id = 'FOREIGN';\n if (kind === 'wrong-repo') graph.repository.nameWithOwner = 'other/widget';\n if (kind === 'incomplete-page') delete graph.repository.pullRequest.closingIssuesReferences.pageInfo;\n state.manualReadback = graph;\n if (kind.endsWith('-later')) {\n const next = structuredClone(graph);\n if (kind === 'foreign-later') next.repository.pullRequest.closingIssuesReferences.nodes[0]!.number = 18;\n graph.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'next' };\n state.manualReadback = undefined;\n state.manualPages = [graph, next];\n }\n await assert.rejects(publishPr(context, { ...nonClosingCreation, prNumber: 23 }));\n assert.equal(state.removals + state.creations, 0);\n });\n }\n it('treats malformed removal acknowledgement as uncertain and does not retry even after the edge disappeared', async () => {\n const { context, state } = pending();\n state.removalReadback = { removeCloseIssueReferences: { issue: { id: 'OTHER' } } };\n await assert.rejects(publishPr(context, nonClosingCreation), /removal.*uncertain/u);\n await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n });\n for (const kind of [\n 'auto-only',\n 'foreign',\n 'duplicate',\n 'truncated',\n 'cursor',\n 'actor',\n 'crossref',\n 'keyword',\n ] as const) {\n it(`refuses ${kind} graph without removing any pair`, async () => {\n const { context, state } = pending(true);\n const graph = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n pullRequest: {\n closingIssuesReferences: {\n nodes: Array<{\n __typename: string;\n id: string;\n number: number;\n repository: { id: string; nameWithOwner: string };\n }>;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n };\n };\n };\n };\n if (kind === 'auto-only') {\n state.closingReadback = graph;\n state.manualClosing = false;\n }\n if (kind === 'foreign')\n graph.repository.pullRequest.closingIssuesReferences.nodes.push({\n __typename: 'Issue',\n id: 'OTHER',\n number: 18,\n repository: { id: 'REPO', nameWithOwner: repo },\n });\n if (kind === 'duplicate')\n graph.repository.pullRequest.closingIssuesReferences.nodes.push(\n graph.repository.pullRequest.closingIssuesReferences.nodes[0]!,\n );\n if (kind === 'truncated') graph.repository.pullRequest.closingIssuesReferences.pageInfo.hasNextPage = true;\n if (kind === 'cursor')\n graph.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'same' };\n if (['foreign', 'duplicate', 'truncated', 'cursor'].includes(kind)) state.closingReadback = graph;\n if (kind === 'actor') state.referenceActor = 'other';\n if (kind === 'crossref') state.referenceCloses = false;\n if (kind === 'keyword') state.commitMessage = 'Fixes #18';\n await assert.rejects(publishPr(context, { ...nonClosingCreation, prNumber: 23 }));\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n }\n for (const remains of [false, true]) {\n it(`reports uncertain removal once and permits only read-only reconciliation; edge remains ${remains}`, async () => {\n const { context, state } = pending();\n state.failRemovalAck = true;\n state.keepClosingOnRemoval = remains;\n await assert.rejects(publishPr(context, nonClosingCreation), /PR #23.*removal.*uncertain/u);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n // An unresolved receipt does not authorize the trusted caller to request another removal.\n if (remains) await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true }));\n else await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n });\n }\n it('recovers a proven pre-action non-attempt with caller-admitted continuation on the same PR', async () => {\n const { context, state } = pending();\n state.referenceActor = 'other';\n await assert.rejects(publishPr(context, nonClosingCreation), /removal not attempted/u);\n assert.equal(state.removals, 0);\n state.referenceActor = 'author';\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n });\n it('does not remove anything after uncertain create acknowledgement or create again on read-only inspection', async () => {\n const { context, state } = pending();\n state.failCreateAck = true;\n await assert.rejects(publishPr(context, nonClosingCreation), /acknowledgement is uncertain/u);\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true }));\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 0);\n });\n it('refuses post-removal drift without rollback, promotion or another attempt', async () => {\n const { context, state } = pending();\n state.removalHook = () => {\n state.draft = false;\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /unresolved/u);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n assert.equal(state.updates + state.promotions, 0);\n });\n});\n\ndescribe('later-read publication and pre-creation parent bound', () => {\n for (const drift of ['body', 'title', 'draft', 'closed', 'merged', 'base'] as const) {\n it(`refuses later ${drift} drift after the first correct created PR read`, async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.readHook = (count) => {\n if (!state.creations || count < 2) return;\n if (drift === 'body') state.body = `References ${repo}#17\\n\\nOther safe intent`;\n if (drift === 'title') state.title = 'Other safe title';\n if (drift === 'draft') state.draft = false;\n if (drift === 'closed') state.prState = 'closed';\n if (drift === 'merged') {\n state.prState = 'closed';\n state.merged = true;\n }\n if (drift === 'base') state.baseSha = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /created PR #23.*unresolved/u);\n assert.equal(state.creations, 1);\n });\n }\n it('rejects state drift observed only by the verifier final internal PR read', async () => {\n const { context, state } = fixture(true, true);\n state.readHook = (count) => {\n if (count === 3) state.draft = false;\n };\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true }),\n /state\\/draft\\/merged/u,\n );\n assert.equal(state.updates + state.promotions + state.creations, 0);\n });\n it('refuses oversized REST parent arrays before creating any PR', async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.comparisonReadback = {\n base_commit: { sha: base },\n merge_base_commit: { sha: base },\n status: 'ahead',\n total_commits: 1,\n commits: [\n { sha: head, commit: { message: 'Safe message' }, parents: Array.from({ length: 101 }, () => ({ sha: base })) },\n ],\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /Incomplete/u);\n assert.equal(state.creations, 0);\n });\n});\n\n// Recorded Oct 24\u201331 (aviaratech/ai-delivery#239): issue_pr_create failed 35 of 42 calls.\ndescribe('first-call PR creation', () => {\n const recorded = { issueNumber: 17, headBranch: 'issue/17' };\n\n it('opens a closing PR with only the author identity configured', async () => {\n const { context, state } = fixture(false);\n Reflect.deleteProperty(context, 'reviewerClients');\n vi.spyOn(github, 'createDeliveryGitHubClients').mockRejectedValue(\n new DeliveryError('Missing GitHub App credentials for reviewer role. Set GH_APP_ID_GPT_REVIEWER.'),\n );\n state.remoteHead = head;\n assert.equal((await publishPr(context, recorded)).prNumber, 23);\n assert.equal(state.creations, 1);\n });\n\n it('returns the created PR with a warning while GitHub has not yet listed its closing link', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.closingReadback = {\n repository: {\n nameWithOwner: repo,\n pullRequest: { id: 'PR23', number: 23, closingIssuesReferences: { nodes: [], pageInfo } },\n },\n };\n const created = await publishPr(context, recorded);\n assert.equal(created.prNumber, 23);\n assert.match(String(Reflect.get(created, 'warnings')), /not yet listed PR #23 as closing #17/u);\n state.closingReadback = undefined;\n assert.equal((await publishPr(context, recorded)).prNumber, 23);\n assert.equal(state.creations, 1);\n });\n\n it('names an unlinked worktree branch and the step that publishes it', async () => {\n const { context, state } = fixture(false, true);\n await assert.rejects(\n publishPr(context, { ...nonClosingCreation, headBranch: 'claude/17-widget' }),\n /Branch claude\\/17-widget is not linked to issue #17 \\(GitHub-linked: none\\); push the work as issue\\/17\\./u,\n );\n assert.equal(state.creations, 0);\n });\n});\n\n// aviaratech/ai-delivery#238: PR #237 referenced #236 without closing it, and a body update was refused.\ndescribe('non-closing body update', () => {\n it('updates an already non-closing PR body and keeps its issue open', async () => {\n const { context, state } = fixture(true, true);\n const update = { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'Revised widget scope.' };\n await publishPr(context, update);\n assert.equal(state.body, `References ${repo}#17\\n\\nRevised widget scope.`);\n await publishPr(context, update);\n assert.equal(state.updates, 1);\n assert.equal(state.issueState, 'open');\n await assert.rejects(publishPr(context, { ...update, body: 'Closes #17' }), /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CAAC;AAGD,SAAS,2BAA2B,MAAM;AACxC,KAAG,mEAAmE,YAAY;AAChF,UAAM,EAAE,SAAS,MAAM,IAAI,QAAQ,MAAM,IAAI;AAC7C,UAAM,SAAS,EAAE,aAAa,IAAI,UAAU,IAAI,YAAY,MAAM,MAAM,wBAAwB;AAChG,UAAM,UAAU,SAAS,MAAM;AAC/B,WAAO,MAAM,MAAM,MAAM,cAAc,IAAI;AAAA;AAAA,sBAA8B;AACzE,UAAM,UAAU,SAAS,MAAM;AAC/B,WAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,WAAO,MAAM,MAAM,YAAY,MAAM;AACrC,UAAM,OAAO,QAAQ,UAAU,SAAS,EAAE,GAAG,QAAQ,MAAM,aAAa,CAAC,GAAG,qBAAqB;AACjG,WAAO,MAAM,MAAM,SAAS,CAAC;AAAA,EAC/B,CAAC;AACH,CAAC;",
|
|
4
|
+
"sourcesContent": ["import { syntheticDiscoveryClients, syntheticDiscoveryConfig } from './fixtures/discovery.js';\nimport { issueProjectItemsResponse } from './fixtures/issueProjectItems.js';\nimport { quietReadViewResponse } from './fixtures/readView.js';\nimport assert from 'node:assert/strict';\nimport { execFileSync } from 'node:child_process';\nimport { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join, resolve } from 'node:path';\nimport { afterEach, describe, expect, it, vi } from 'vitest';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport * as settings from './config/deliveryConfig.js';\nimport * as github from './github/client.js';\nimport { digestValue } from './delivery/common.js';\nimport { DeliveryError, setMachineRequestDiagnostics } from './errors.js';\nimport { executeTool } from './dispatch.js';\nimport * as issues from './issue.js';\nimport type { DeliveryContext } from './issue.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport { preflightReviewRoute, prInfo, publishPr, startIssueBranch, submitFormalReview } from './pr.js';\n\nconst repo = 'example/widget';\nconst head = 'a'.repeat(40);\nconst base = 'b'.repeat(40);\nconst tree = 'c'.repeat(40);\nconst pageInfo = { hasNextPage: false, endCursor: null };\nconst nonClosingCreation = {\n issueNumber: 17,\n nonClosing: true,\n body: `References ${repo}#17\\n\\nImprove widget.`,\n};\n\nfunction fixture(published = true, nonClosing = false) {\n const state = {\n published,\n nonClosing,\n body: nonClosing ? `References ${repo}#17\\n\\nImprove widget.` : 'Closes #17',\n title: 'Improve widget',\n issueBody: 'Four retained criteria',\n issueState: 'open',\n referenceReadback: undefined as unknown,\n referencePages: [] as unknown[],\n referencePageIndex: 0,\n commitReadback: undefined as unknown,\n comparisonReadback: undefined as unknown,\n commitMessage: 'Improve widget',\n referenceActor: 'author',\n referenceCloses: false as unknown,\n updates: 0,\n failCreateAck: false,\n failUpdateAck: false,\n linked: false,\n remoteHead: published ? head : base,\n headSha: head,\n headRef: 'issue/17',\n headRepo: repo,\n baseRepo: repo,\n baseSha: base,\n baseRef: 'main',\n remoteBase: { ref: 'refs/heads/main', object: { type: 'commit', sha: base } },\n nodeId: 'PR23',\n prAuthor: 'author',\n prState: 'open',\n merged: false as unknown,\n draft: true as unknown,\n remoteRef: 'refs/heads/issue/17',\n remoteType: 'commit',\n issueNumber: 17,\n associationRepo: repo,\n associationPr: 23,\n closingReadback: undefined as unknown,\n closingPages: [] as unknown[],\n closingPageIndex: 0,\n closingOnCreate: false,\n manualClosing: false,\n manualReadback: undefined as unknown,\n manualPages: [] as unknown[],\n manualPageIndex: 0,\n removals: 0,\n failRemovalAck: false,\n removalReadback: undefined as unknown,\n keepClosingOnRemoval: false,\n removalHook: undefined as (() => void) | undefined,\n branchReadback: undefined as unknown,\n reviewerActor: 'reviewer[bot]',\n movedOnRead: 0,\n reads: 0,\n readHook: undefined as ((reads: number) => void) | undefined,\n matchReadback: undefined as unknown,\n promotionReadback: undefined as unknown,\n keepDraftOnPromotion: false,\n promotions: 0,\n creations: 0,\n expectedCreationDraft: true,\n events: [] as string[],\n reviews: [] as Array<{\n id: number;\n body: string;\n user: { login: string };\n state: string;\n commit_id: string;\n html_url: string;\n }>,\n submissions: 0,\n };\n const pr = () => ({\n number: 23,\n node_id: state.nodeId,\n changed_files: 1,\n title: state.title,\n body: state.body,\n html_url: `https://github.com/${repo}/pull/23`,\n state: state.prState,\n draft: state.draft,\n merged: state.merged,\n head: { sha: state.headSha, ref: state.headRef, repo: { full_name: state.headRepo } },\n base: { sha: state.baseSha, ref: state.baseRef, repo: { full_name: state.baseRepo } },\n user: { login: state.prAuthor },\n });\n const rest = {\n request: async () => ({ data: [] }),\n repos: {\n get: async () => ({ data: { node_id: 'REPO', full_name: repo, default_branch: 'main' } }),\n compareCommitsWithBasehead: async () => ({\n data: state.comparisonReadback ?? {\n base_commit: { sha: base },\n merge_base_commit: { sha: base },\n status: 'ahead',\n total_commits: 1,\n commits: [{ sha: head, commit: { message: state.commitMessage }, parents: [{ sha: base }] }],\n },\n }),\n },\n issues: {\n get: async () => ({\n data: {\n node_id: 'ISSUE17',\n number: 17,\n state: state.issueState,\n title: 'Improve widget',\n body: state.issueBody,\n html_url: `https://github.com/${repo}/issues/17`,\n },\n }),\n },\n git: {\n getRef: async (input: { owner: string; repo: string; ref: string }) => {\n assert.equal(`${input.owner}/${input.repo}`, repo);\n return {\n data:\n input.ref === 'heads/main'\n ? state.remoteBase\n : { ref: state.remoteRef, object: { type: state.remoteType, sha: state.remoteHead } },\n };\n },\n getCommit: async () => ({ data: { sha: head, tree: { sha: tree } } }),\n },\n pulls: {\n get: async () => {\n state.reads++;\n state.readHook?.(state.reads);\n if (state.movedOnRead && state.reads >= state.movedOnRead) state.headSha = 'd'.repeat(40);\n return { data: pr() };\n },\n list: async () => ({ data: state.matchReadback ?? (state.published ? [{ number: 23 }] : []) }),\n create: async (input: { draft: boolean; head: string; body: string }) => {\n assert.equal(input.draft, state.expectedCreationDraft);\n assert.equal(input.head, 'issue/17');\n state.creations++;\n state.body = input.body;\n if (state.closingOnCreate) {\n state.manualClosing = true;\n state.referenceCloses = true;\n }\n if (state.failCreateAck) {\n state.published = true;\n throw new Error('Transport lost after creation');\n }\n state.draft = input.draft;\n state.published = true;\n state.linked = false;\n state.events.push('draft-publication-replaces-branch-link');\n return { data: pr() };\n },\n update: async (input: { body: string }) => {\n state.updates++;\n state.body = input.body;\n state.nonClosing = input.body.startsWith('References ');\n if (state.failUpdateAck) throw new Error('Transport lost after body update');\n return { data: pr() };\n },\n listFiles: async () => ({ data: [{ filename: 'change.ts' }] }),\n listReviews: async () => ({ data: state.reviews }),\n getReview: async (input: { review_id: number }) => ({\n data: state.reviews.find((review) => review.id === input.review_id),\n }),\n createReview: async (input: { commit_id: string; body: string; event: string }) => {\n assert.equal(input.commit_id, head);\n assert.equal(input.event, 'APPROVE');\n state.submissions++;\n const review = {\n id: 98 + state.submissions,\n body: input.body,\n user: { login: state.reviewerActor },\n state: 'APPROVED',\n commit_id: head,\n html_url: `https://github.com/${repo}/pull/23#pullrequestreview-${98 + state.submissions}`,\n };\n state.reviews.push(review);\n return { data: review };\n },\n },\n };\n const graphql = async (query: string, variables: Record<string, unknown> = {}) => {\n if (query.includes('DeliveryRemoveClosingReference')) {\n assert.deepEqual(variables.issueId, 'ISSUE17');\n assert.deepEqual(variables.pullRequestIds, ['PR23']);\n assert.equal(typeof variables.clientMutationId, 'string');\n state.removals++;\n state.events.push('remove-exact-closing-pair');\n if (!state.keepClosingOnRemoval) {\n state.manualClosing = false;\n state.referenceCloses = false;\n }\n state.removalHook?.();\n if (state.failRemovalAck) throw new Error('Lost reference-removal acknowledgement');\n return state.removalReadback ?? { removeCloseIssueReferences: { issue: { id: 'ISSUE17' } } };\n }\n if (query.includes('DeliveryNonClosingReferences')) {\n if (state.referencePages.length) return state.referencePages[state.referencePageIndex++];\n return (\n state.referenceReadback ?? {\n repository: {\n id: 'REPO',\n nameWithOwner: repo,\n issue: {\n id: 'ISSUE17',\n number: 17,\n state: 'OPEN',\n timelineItems: {\n nodes: [\n {\n id: 'REFERENCE',\n actor: { login: state.referenceActor },\n isCrossRepository: false,\n willCloseTarget: state.referenceCloses,\n source: {\n __typename: 'PullRequest',\n id: 'PR23',\n number: 23,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n target: {\n __typename: 'Issue',\n id: 'ISSUE17',\n number: 17,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n }\n if (query.includes('DeliveryNonClosingCommits'))\n return (\n state.commitReadback ?? {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n headRefOid: head,\n baseRefOid: base,\n baseRefName: 'main',\n commits: {\n totalCount: 1,\n nodes: [\n {\n commit: {\n oid: head,\n message: state.commitMessage,\n parents: { totalCount: 1, nodes: [{ oid: base }], pageInfo },\n },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n if (query.includes('DeliveryStartBranch')) {\n state.linked = true;\n state.events.push('native-start');\n return { createLinkedBranch: { linkedBranch: { ref: { name: 'issue/17', target: { oid: base } } } } };\n }\n if (query.includes('DeliveryIssueBranches'))\n return (\n state.branchReadback ?? {\n repository: {\n issue: {\n linkedBranches: {\n nodes: state.linked\n ? [\n {\n ref: {\n name: 'issue/17',\n target: { oid: state.remoteHead },\n repository: { nameWithOwner: repo },\n },\n },\n ]\n : [],\n pageInfo,\n },\n },\n },\n }\n );\n const manual = query.includes('userLinkedOnly');\n if (query.includes('DeliveryClosingIssues') && manual && state.manualPages.length > 0)\n return state.manualPages[state.manualPageIndex++ % state.manualPages.length];\n if (query.includes('DeliveryClosingIssues') && manual && state.manualReadback !== undefined)\n return state.manualReadback;\n if (query.includes('DeliveryClosingIssues') && !manual && state.closingPages.length > 0)\n return state.closingPages[state.closingPageIndex++];\n if (query.includes('DeliveryClosingIssues'))\n return (\n (manual ? undefined : state.closingReadback) ?? {\n repository: {\n nameWithOwner: state.associationRepo,\n pullRequest: {\n id: state.nodeId,\n number: state.associationPr,\n closingIssuesReferences: {\n nodes: (manual ? !state.manualClosing : state.nonClosing && !state.manualClosing)\n ? []\n : [\n {\n __typename: 'Issue',\n id: 'ISSUE17',\n number: state.issueNumber,\n repository: { id: 'REPO', nameWithOwner: repo },\n },\n ],\n pageInfo,\n },\n },\n },\n }\n );\n if (query.includes('DeliveryReadyPr')) {\n state.promotions++;\n if (!state.keepDraftOnPromotion) state.draft = false;\n return (\n state.promotionReadback ?? { markPullRequestReadyForReview: { pullRequest: { id: 'PR23', isDraft: false } } }\n );\n }\n if (query.includes('ProjectDeliveryIssueItems')) return issueProjectItemsResponse(variables, []);\n if (query.includes('ProjectDeliveryConfiguration')) return syntheticDiscoveryClients().graphql(query, variables);\n const quiet = quietReadViewResponse(query, variables);\n if (quiet !== undefined) return quiet;\n throw new Error(`Unexpected synthetic query: ${query}`);\n };\n const reviewer = {\n role: 'reviewer',\n authSource: 'app',\n effectiveContentsPermission: 'write',\n appActorLogin: async () => state.reviewerActor,\n rest,\n graphql,\n };\n const context = {\n root: '/nonexistent-launch-directory',\n repo: { owner: 'example', repo: 'widget' },\n config: {\n schemaVersion: 'ai-delivery.github@1',\n repository: repo,\n roles: { author: { authSource: 'personal', identity: 'author' }, reviewer: { identity: 'reviewer' } },\n native: syntheticDiscoveryConfig.native,\n },\n clients: {\n role: 'author',\n authSource: 'personal',\n authenticatedAuthor: async () => ({ actorLogin: 'author', credentialIdentity: 'synthetic-author' }),\n rest,\n graphql,\n },\n reviewerClients: reviewer,\n } as unknown as DeliveryContext;\n const content = {\n schemaVersion: 'ai-delivery.review-artifact@1',\n authorIdentity: 'author',\n reviewerIdentity: 'reviewer',\n checks: ['Synthetic exact-head checks'],\n diffScopeHash: digestValue(['change.ts']),\n elapsedMs: 1,\n findings: [],\n head: { sha: head, tree },\n issueNumber: 17,\n prNumber: 23,\n readOnly: true,\n requestedEffort: 'xhigh',\n requestedModel: 'gpt-6-astra',\n effectiveEffort: 'unknown',\n effectiveModel: 'unknown',\n summary: 'Synthetic independent review.',\n verdict: 'approve',\n };\n const artifact = JSON.stringify({ ...content, artifactId: digestValue(content) });\n return { state, context, reviewerContext: { ...context, clients: reviewer } as unknown as DeliveryContext, artifact };\n}\n\nafterEach(() => vi.restoreAllMocks());\n\nit('publishes a pushed canonical branch without native creation and preserves the open issue', async () => {\n const { context, state } = fixture(false, true);\n state.remoteHead = head;\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.issueState, 'open');\n state.issueState = 'closed';\n await assert.rejects(issues.issueBranch(context, 17), /open|OPEN/u);\n await assert.rejects(issues.issueBranch(context, 17, 'issue/18'), /Branch issue\\/18 is not linked/u);\n});\n\nit('accepts a hyphenated close mention while refusing an actual closing directive', async () => {\n const { context, state } = fixture(true, true);\n state.title = 'absent-close (#3777)';\n await publishPr(context, { issueNumber: 17, nonClosing: true, prNumber: 23, draft: false });\n state.title = 'closes #3777';\n await assert.rejects(\n publishPr(context, { issueNumber: 17, nonClosing: true, prNumber: 23, draft: false }),\n /closing directives/u,\n );\n});\n\ndescribe('remote closing PR creation', () => {\n it('replays a plain-git head from a temporary non-git directory through the public tool', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.issueBody =\n '## Outcome\\n\\nWidgets improve.\\n\\n## Acceptance criteria\\n\\n- [ ] Reject invalid widgets.\\n Verified by: A synthetic widget test.';\n const root = realpathSync(mkdtempSync(join(tmpdir(), 'delivery-pr-open-')));\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n return { ...context, root };\n });\n const branchLinks = vi\n .spyOn(issues, 'linkedIssueBranches')\n .mockRejectedValue(new Error('No ai-delivery branch lifecycle'));\n try {\n const result = await executeTool(\n 'issue_pr_create',\n { repo, issueNumber: 17, head: 'issue/17', base: 'main' },\n { repoRoot: root },\n );\n assert.equal(state.creations, 1);\n assert.equal(branchLinks.mock.calls.length, 0);\n assert.equal(\n state.body,\n 'Closes #17\\n\\n## Outcome\\n\\nWidgets improve.\\n\\n## Acceptance criteria\\n\\n- [ ] Reject invalid widgets.\\n Verified by: A synthetic widget test.\\n\\n<!-- ai-delivery:pr@1 -->',\n );\n assert.deepEqual(result, {\n prNumber: 23,\n url: 'https://github.com/example/widget/pull/23',\n headSha: head,\n state: 'draft',\n });\n expect(JSON.stringify(result)).toMatchInlineSnapshot(\n '\"{\"prNumber\":23,\"url\":\"https://github.com/example/widget/pull/23\",\"headSha\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"state\":\"draft\"}\"',\n );\n assert.ok(JSON.stringify(result).length < 1000);\n } finally {\n rmSync(root, { recursive: true });\n }\n });\n\n it('reuses an open PR for an unlinked remote head without changing its body', async () => {\n const { context, state } = fixture();\n state.body = 'Closes #17\\n\\nRetain the author explanation.';\n const result = await publishPr(context, { issueNumber: 17, headBranch: 'issue/17' });\n assert.equal(result.prNumber, 23);\n assert.equal(state.creations + state.updates, 0);\n assert.equal(state.body, 'Closes #17\\n\\nRetain the author explanation.');\n });\n\n it('restores a lost closing link once and reports the repair without replacing user content', async () => {\n const { context, state } = fixture();\n state.body = 'Retain the author explanation.';\n state.nonClosing = true;\n const input = { issueNumber: 17, headBranch: 'issue/17' };\n assert.deepEqual(await publishPr(context, input), {\n prNumber: 23,\n url: 'https://github.com/example/widget/pull/23',\n headSha: head,\n state: 'draft',\n closingLinkAdded: true,\n });\n assert.equal(state.body, 'Closes #17\\n\\nRetain the author explanation.');\n await publishPr(context, input);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 1);\n });\n\n it('previews a closing-link repair without a mutation', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n await publishPr(context, { issueNumber: 17, headBranch: 'issue/17', dryRun: true });\n assert.equal(state.updates + state.creations, 0);\n });\n\n it('refuses a conflicting association without rewriting the existing body', async () => {\n const { context, state } = fixture();\n state.body = 'Closes #18';\n state.issueNumber = 18;\n await assert.rejects(publishPr(context, { issueNumber: 17, headBranch: 'issue/17' }), /conflicting/u);\n assert.equal(state.updates + state.creations, 0);\n });\n\n it('refuses body drift during the final association read before repair', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n const graphql = context.clients.graphql;\n let associationReads = 0;\n vi.spyOn(context.clients, 'graphql').mockImplementation(async (query, variables) => {\n const result = await graphql(query, variables);\n if (String(query).includes('DeliveryClosingIssues') && ++associationReads === 2)\n state.body = 'Concurrent author edit';\n return result;\n });\n await assert.rejects(publishPr(context, { issueNumber: 17, headBranch: 'issue/17' }), /drifted/u);\n assert.equal(state.updates, 0);\n assert.equal(state.body, 'Concurrent author edit');\n });\n\n it('reconciles a lost repair acknowledgement without repeating the applied update', async () => {\n const { context, state } = fixture();\n state.body = 'Retain explanation';\n state.nonClosing = true;\n state.failUpdateAck = true;\n const input = { issueNumber: 17, headBranch: 'issue/17' };\n await assert.rejects(publishPr(context, input), /repair acknowledgement is uncertain/u);\n state.failUpdateAck = false;\n await publishPr(context, input);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 1);\n });\n\n it('names the missing closing line and exact repair call before independent review', async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.body = 'Lost closing link';\n state.nonClosing = true;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n (error: unknown) => {\n assert.ok(error instanceof Error);\n assert.match(error.message, /Missing `Closes #17`/u);\n assert.ok(\n error.message.includes('issue_pr_create({\"repo\":\"example/widget\",\"issueNumber\":17,\"head\":\"issue/17\"})'),\n );\n assert.doesNotMatch(error.message, /association does not identify/u);\n return true;\n },\n );\n assert.equal(state.submissions + state.updates, 0);\n });\n});\n\nfunction rulesetOnlyFixture(published = true) {\n const current = fixture(published, true);\n const evidence = {\n deniedRoute: '',\n protectionError: { status: 404, response: { status: 404, data: { message: 'Branch not protected' } } } as unknown,\n protection: undefined as unknown,\n rules: {\n status: 200,\n headers: {},\n data: [\n {\n type: 'required_status_checks',\n ruleset_id: 41,\n ruleset_source_type: 'Repository',\n ruleset_source: repo,\n parameters: {\n strict_required_status_checks_policy: true,\n required_status_checks: [{ context: 'local-verify' }],\n },\n },\n {\n type: 'pull_request',\n ruleset_id: 42,\n ruleset_source_type: 'Organization',\n ruleset_source: 'example',\n parameters: { required_approving_review_count: 1, dismiss_stale_reviews_on_push: true },\n },\n ],\n } as unknown,\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: repo, enforcement: 'active' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n } as unknown,\n branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: true } } } as unknown,\n repository: { status: 200, data: { full_name: repo, permissions: { push: true } } } as unknown,\n };\n current.context.clients.rest.request = (async (route: string, input: Record<string, unknown>) => {\n assert.equal(input.owner, 'example');\n assert.equal(input.repo, 'widget');\n if (route === evidence.deniedRoute) throw { status: 403 };\n if (route.endsWith('/protection')) {\n if (evidence.protection !== undefined) return evidence.protection;\n throw evidence.protectionError;\n }\n if (route.endsWith('/rules/branches/{branch}')) return evidence.rules;\n if (route.endsWith('/rulesets')) {\n assert.equal(input.includes_parents, true);\n assert.equal(input.page, 1);\n assert.equal(input.per_page, 100);\n return evidence.rulesets;\n }\n if (route.endsWith('/branches/{branch}')) {\n assert.equal(input.branch, 'main');\n return evidence.branch;\n }\n if (route === 'GET /repos/{owner}/{repo}') return evidence.repository;\n throw new Error(`Unexpected fictional route ${route}`);\n }) as typeof current.context.clients.rest.request;\n return { ...current, evidence };\n}\n\nasync function machineRulesetOnlyFixture(published = true) {\n const current = rulesetOnlyFixture(published);\n const { context, evidence } = current;\n const rest = context.clients.rest;\n const graphql = context.clients.graphql;\n const home = realpathSync(mkdtempSync(join(tmpdir(), 'ai-delivery-machine-protection-')));\n const bin = join(home, 'bin');\n mkdirSync(bin);\n const token = 'fictional_machine_protection_token';\n writeFileSync(\n join(bin, 'gh'),\n `#!${process.execPath}\nconst args=process.argv.slice(2);\nif(JSON.stringify(args)===JSON.stringify(['auth','status','--hostname','github.com','--active','--json','hosts']))\n process.stdout.write(JSON.stringify({hosts:{'github.com':[{host:'github.com',active:true,state:'success',login:'author'}]}}));\nelse if(JSON.stringify(args)===JSON.stringify(['auth','token','--hostname','github.com','--user','author']))\n process.stdout.write(${JSON.stringify(token)}+'\\\\n');\nelse process.exit(91);\n`,\n { mode: 0o755 },\n );\n const originalEnv = process.env;\n const restore = () => {\n process.env = originalEnv;\n vi.unstubAllGlobals();\n rmSync(home, { recursive: true });\n };\n process.env = { HOME: home, PATH: bin };\n context.config.roles.author = {\n authSource: 'personal',\n identity: context.config.roles.author.identity,\n credentialEnv: { token: 'GH_TOKEN' },\n };\n vi.stubGlobal('fetch', async (input: string | URL | Request, init?: RequestInit) => {\n const url = new URL(input instanceof Request ? input.url : String(input));\n assert.equal(url.origin, 'https://api.github.com');\n const path = url.pathname;\n const method = init?.method ?? 'GET';\n const body = (typeof init?.body === 'string' ? JSON.parse(init.body) : {}) as {\n query?: unknown;\n draft?: unknown;\n head?: unknown;\n body?: unknown;\n };\n let result: { status?: number; headers?: Record<string, string | number | undefined>; data: unknown };\n if (path === '/user') result = { data: { id: 42, login: 'author', type: 'User' } };\n else if (path === '/graphql') {\n assert.ok(typeof body.query === 'string');\n result = { data: { data: await graphql(body.query) } };\n } else {\n const prefix = '/repos/example/widget';\n assert.ok(path.startsWith(prefix));\n const suffix = path.slice(prefix.length);\n if (suffix === '') {\n const native = await rest.repos.get({ owner: 'example', repo: 'widget' });\n const visible = evidence.repository as { status: number; data: Record<string, unknown> };\n result = { status: visible.status, data: { ...native.data, ...visible.data } };\n } else if (suffix === '/branches/main/protection') {\n if (evidence.protection !== undefined) result = evidence.protection as typeof result;\n else {\n const error = evidence.protectionError as { status: number; response: { data: object } };\n result = {\n status: error.status,\n data: { ...error.response.data, private: token },\n headers: { 'x-private': token },\n };\n }\n } else if (suffix === '/rules/branches/main') result = evidence.rules as typeof result;\n else if (suffix === '/branches/main') result = evidence.branch as typeof result;\n else if (suffix === '/rulesets') {\n assert.equal(url.searchParams.get('includes_parents'), 'true');\n assert.equal(url.searchParams.get('per_page'), '100');\n assert.equal(url.searchParams.get('page'), '1');\n result = evidence.rulesets as typeof result;\n } else if (suffix === '/issues/17')\n result = await rest.issues.get({ owner: 'example', repo: 'widget', issue_number: 17 });\n else if (suffix.startsWith('/git/ref/'))\n result = await rest.git.getRef({\n owner: 'example',\n repo: 'widget',\n ref: decodeURIComponent(suffix.slice('/git/ref/'.length)),\n });\n else if (suffix.startsWith('/git/commits/'))\n result = await rest.git.getCommit({ owner: 'example', repo: 'widget', commit_sha: head });\n else if (suffix.startsWith('/compare/'))\n result = await rest.repos.compareCommitsWithBasehead({\n owner: 'example',\n repo: 'widget',\n basehead: `${base}...${head}`,\n });\n else if (suffix === '/pulls' && method === 'POST') {\n assert.ok(typeof body.draft === 'boolean' && typeof body.head === 'string' && typeof body.body === 'string');\n result = await rest.pulls.create({\n owner: 'example',\n repo: 'widget',\n title: 'Improve widget',\n base: 'main',\n draft: body.draft,\n head: body.head,\n body: body.body,\n });\n } else if (suffix === '/pulls') result = await rest.pulls.list({ owner: 'example', repo: 'widget' });\n else if (suffix === '/pulls/23')\n result = await rest.pulls.get({ owner: 'example', repo: 'widget', pull_number: 23 });\n else if (suffix === '/pulls/23/files')\n result = await rest.pulls.listFiles({ owner: 'example', repo: 'widget', pull_number: 23 });\n else if (suffix === '/pulls/23/reviews')\n result = await rest.pulls.listReviews({ owner: 'example', repo: 'widget', pull_number: 23 });\n else throw new Error(`Unexpected fictional machine route ${method} ${suffix}`);\n if (evidence.deniedRoute && suffix === evidence.deniedRoute) result = { status: 403, data: { message: token } };\n }\n const response = new Response(JSON.stringify(result.data), {\n status: result.status ?? 200,\n headers: {\n 'content-type': 'application/json',\n ...Object.fromEntries(\n Object.entries(result.headers ?? {}).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string',\n ),\n ),\n },\n });\n Object.defineProperty(response, 'url', { value: url.href });\n return response;\n });\n try {\n context.clients = await github.createDeliveryGitHubClients({\n config: context.config,\n role: 'author',\n identity: 'author',\n env: process.env,\n });\n github.retainMachineAuthorForConfiguration(context.config, context.clients);\n return { ...current, restore, token };\n } catch (error) {\n restore();\n throw error;\n }\n}\n\ndescribe('native exact PR association after publication', () => {\n it('replays native start, push, draft publication, empty branch links, author inspection and distinct App review', async () => {\n const { context, reviewerContext, state, artifact } = fixture(false);\n const started = await startIssueBranch(context, 17);\n assert.equal(started.reused, false);\n assert.equal(started.headSha, base);\n state.remoteHead = head;\n state.events.push('push');\n await publishPr(context, { issueNumber: 17, body: 'Improve widget', draft: true });\n assert.deepEqual(state.events, ['native-start', 'push', 'draft-publication-replaces-branch-link']);\n assert.equal(state.linked, false);\n assert.equal((await prInfo(context, { issueNumber: 17, prNumber: 23 })).headSha, head);\n assert.equal(\n (await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact, dryRun: true })).headSha,\n head,\n );\n assert.equal(state.submissions, 0);\n const submitted = await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n const reused = await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.deepEqual(reused, submitted);\n assert.equal(state.submissions, 1);\n });\n\n it('gives an exact-PR next action for issue-only lookup with empty branch links', async () => {\n const { context } = fixture();\n await assert.rejects(prInfo(context, { issueNumber: 17 }), (error: unknown) => {\n assert.ok(error instanceof Error);\n assert.match(error.message, /exact issue and PR numbers.*--issue and --pr/u);\n assert.doesNotMatch(error.message, /zero or multiple PRs|start again|repeat.*start/u);\n return true;\n });\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n });\n\n it('verifies native association when issue-only lookup still has a linked branch', async () => {\n const { context, state } = fixture();\n state.linked = true;\n assert.equal((await prInfo(context, { issueNumber: 17 })).prNumber, 23);\n state.issueNumber = 18;\n await assert.rejects(prInfo(context, { issueNumber: 17 }), /association/u);\n });\n\n for (const [name, change] of [\n ['wrong closing issue', { issueNumber: 18 }],\n ['wrong PR repository', { headRepo: 'other/widget' }],\n ['wrong base repository', { baseRepo: 'other/widget' }],\n ['wrong native repository', { associationRepo: 'other/widget' }],\n ['wrong native PR', { associationPr: 24 }],\n ['remote head drift', { remoteHead: 'd'.repeat(40) }],\n ['remote ref mismatch', { remoteRef: 'refs/heads/other' }],\n ['incomplete remote ref', { remoteType: '' }],\n ['invalid head branch', { headRef: '../other' }],\n ['invalid PR head', { headSha: 'missing' }],\n ['incomplete PR state', { prState: '' }],\n ['incomplete merged state', { merged: undefined }],\n ['incomplete draft state', { draft: undefined }],\n ['conflicting merged state', { merged: true }],\n ] as const) {\n it(`refuses ${name} before inspection or review mutation`, async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n Object.assign(state, change);\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23 }));\n await assert.rejects(submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }));\n assert.equal(state.submissions, 0);\n });\n }\n\n for (const [name, response] of [\n ['missing connection', { repository: { nameWithOwner: repo, pullRequest: { number: 23 } } }],\n [\n 'empty closing issues',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: { number: 23, closingIssuesReferences: { nodes: [], pageInfo } },\n },\n },\n ],\n [\n 'foreign closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: 'other/widget' } }],\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'incomplete closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: { number: 23, closingIssuesReferences: { nodes: [null], pageInfo } },\n },\n },\n ],\n [\n 'duplicate closing issue',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: Array.from({ length: 2 }, () => ({ number: 17, repository: { nameWithOwner: repo } })),\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'missing pagination',\n { repository: { nameWithOwner: repo, pullRequest: { number: 23, closingIssuesReferences: { nodes: [] } } } },\n ],\n [\n 'nonadvancing pagination',\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: { nodes: [], pageInfo: { hasNextPage: true, endCursor: null } },\n },\n },\n },\n ],\n ] as const) {\n it(`refuses ${name} before App submission`, async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.closingReadback = response;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /association|identity|pagination/u,\n );\n assert.equal(state.submissions, 0);\n });\n }\n\n for (const [name, response] of [\n ['incomplete linked branches', { repository: { issue: { linkedBranches: { nodes: [], pageInfo: {} } } } }],\n [\n 'conflicting linked branch',\n {\n repository: {\n issue: {\n linkedBranches: {\n nodes: [{ ref: { name: 'other', target: { oid: head }, repository: { nameWithOwner: repo } } }],\n pageInfo,\n },\n },\n },\n },\n ],\n [\n 'stale linked head',\n {\n repository: {\n issue: {\n linkedBranches: {\n nodes: [{ ref: { name: 'issue/17', target: { oid: base }, repository: { nameWithOwner: repo } } }],\n pageInfo,\n },\n },\n },\n },\n ],\n ] as const) {\n it(`accepts ${name} when the native PR closing association and head are current`, async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.branchReadback = response;\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.equal(state.submissions, 1);\n });\n }\n\n it('refuses configured/selected repository disagreement', async () => {\n const { context } = fixture();\n context.repo = { owner: 'other', repo: 'widget' };\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23 }), /repository identities/u);\n });\n\n it('reads the complete closing-issue connection before accepting a later-page association', async () => {\n const { context, state } = fixture();\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 18, repository: { nameWithOwner: repo } }],\n pageInfo: { hasNextPage: true, endCursor: 'NEXT' },\n },\n },\n },\n },\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: repo } }],\n pageInfo,\n },\n },\n },\n },\n ];\n assert.equal((await prInfo(context, { issueNumber: 17, prNumber: 23 })).headSha, head);\n assert.equal(state.closingPageIndex, 2);\n });\n\n it('refuses an incomplete later page even after finding the intended closing issue', async () => {\n const { reviewerContext, state, artifact } = fixture();\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n number: 23,\n closingIssuesReferences: {\n nodes: [{ number: 17, repository: { nameWithOwner: repo } }],\n pageInfo: { hasNextPage: true, endCursor: 'NEXT' },\n },\n },\n },\n },\n { repository: null },\n ];\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /association/u,\n );\n assert.equal(state.closingPageIndex, 2);\n assert.equal(state.submissions, 0);\n });\n\n it('preserves configured reviewer separation and stale artifact/head refusals', async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n await assert.rejects(submitFormalReview(context, { issueNumber: 17, prNumber: 23, artifact }), /reviewer.*role/u);\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }), /differ/u);\n state.reviewerActor = 'reviewer[bot]';\n state.movedOnRead = state.reads + 2;\n await assert.rejects(\n submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact }),\n /head|moved/u,\n );\n assert.equal(state.submissions, 0);\n });\n\n it('submits a fresh valid artifact despite an older remapped App review', async () => {\n const { reviewerContext, state, artifact } = fixture();\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n state.reviews[0]!.body = `<!-- ai-delivery-review-artifact: sha256:${'f'.repeat(64)} -->`;\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n assert.equal(state.submissions, 2);\n });\n});\n\ndescribe('authoritative existing PR promotion', () => {\n const input = { issueNumber: 17, headBranch: 'issue/17', draft: false };\n\n it('promotes after publication and exact-head review, then reuses authoritative ready readback', async () => {\n const { context, reviewerContext, state, artifact } = fixture();\n await submitFormalReview(reviewerContext, { issueNumber: 17, prNumber: 23, artifact });\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(preview.prNumber, 23);\n assert.ok('dryRun' in preview);\n assert.equal(preview.draft, true);\n assert.equal(state.promotions, 0);\n const promoted = await publishPr(context, input);\n const reused = await publishPr(context, input);\n assert.equal(promoted.prNumber, 23);\n assert.ok('state' in promoted);\n assert.equal(promoted.state, 'open');\n assert.deepEqual(reused, promoted);\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 1);\n assert.equal(state.linked, false);\n assert.deepEqual(state.events, []);\n });\n\n for (const [name, change] of [\n ['wrong issue', { issueNumber: 18 }],\n ['foreign PR head repository', { headRepo: 'other/widget' }],\n ['foreign PR base repository', { baseRepo: 'other/widget' }],\n ['foreign native repository', { associationRepo: 'other/widget' }],\n ['wrong native PR', { associationPr: 24 }],\n ['wrong author', { prAuthor: 'collaborator' }],\n ['wrong head', { headSha: 'd'.repeat(40) }],\n ['moved remote head', { remoteHead: 'd'.repeat(40) }],\n ['wrong ref', { headRef: 'other' }],\n ['wrong base', { baseRef: 'release' }],\n ['closed PR', { prState: 'closed' }],\n ['missing node identity', { nodeId: '' }],\n ['incomplete draft state', { draft: undefined }],\n ['ambiguous matches', { matchReadback: [{ number: 23 }, { number: 24 }] }],\n ['incomplete match identity', { matchReadback: [{}] }],\n ['incomplete match connection', { matchReadback: {} }],\n ['incomplete association', { closingReadback: { repository: null } }],\n ] as const) {\n it(`refuses ${name} before promotion, including already-ready reuse`, async () => {\n for (const draft of [true, false]) {\n const { context, state } = fixture();\n state.draft = draft;\n Object.assign(state, change);\n await assert.rejects(publishPr(context, input));\n assert.equal(state.promotions, 0);\n assert.equal(state.creations, 0);\n assert.deepEqual(state.events, []);\n }\n });\n }\n\n for (const read of [2, 3]) {\n it(`refuses head drift on authoritative PR read ${read} before mutation`, async () => {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === read) state.headSha = state.remoteHead = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, input), /drift/u);\n assert.equal(state.promotions, 0);\n });\n }\n\n it('refuses author and native node drift immediately before mutation', async () => {\n for (const field of ['prAuthor', 'nodeId'] as const) {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === 3) state[field] = 'changed';\n };\n await assert.rejects(publishPr(context, input), /drift/u);\n assert.equal(state.promotions, 0);\n }\n });\n\n for (const response of [\n {},\n { markPullRequestReadyForReview: null },\n { markPullRequestReadyForReview: { pullRequest: { id: 'PR24', isDraft: false } } },\n { markPullRequestReadyForReview: { pullRequest: { id: 'PR23' } } },\n ]) {\n it('refuses incomplete or conflicting mutation acknowledgement without retrying it', async () => {\n const { context, state } = fixture();\n state.promotionReadback = response;\n await assert.rejects(publishPr(context, input), /mutation readback/u);\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n });\n }\n\n it('refuses a still-draft authoritative readback after a ready acknowledgement', async () => {\n const { context, state } = fixture();\n state.keepDraftOnPromotion = true;\n await assert.rejects(publishPr(context, input), /still draft/u);\n assert.equal(state.promotions, 1);\n });\n\n it('refuses post-mutation head or association drift without another mutation', async () => {\n for (const kind of ['head', 'association']) {\n const { context, state } = fixture();\n state.readHook = (count) => {\n if (count === 4) {\n if (kind === 'head') state.headSha = state.remoteHead = 'd'.repeat(40);\n else state.closingReadback = { repository: null };\n }\n };\n await assert.rejects(publishPr(context, input), /drift|association/u);\n assert.equal(state.promotions, 1);\n }\n });\n\n it('requires an explicit head after branch links disappear and preserves draft on reuse', async () => {\n const { context, state } = fixture();\n await assert.rejects(publishPr(context, { issueNumber: 17, draft: false }), /linked/u);\n await publishPr(context, { ...input, draft: true });\n assert.equal(state.promotions, 0);\n });\n\n it('creates a ready PR directly from a pushed remote head without native branch setup', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.expectedCreationDraft = false;\n const created = await publishPr(context, input);\n assert.ok('state' in created);\n assert.equal(created.state, 'open');\n assert.equal(state.creations, 1);\n assert.equal(state.promotions, 0);\n assert.equal(state.events.includes('native-start'), false);\n });\n\n it('keeps incomplete native branch readback behind the unchanged start gate', async () => {\n const { context, state } = fixture(false);\n state.branchReadback = { repository: null };\n await assert.rejects(startIssueBranch(context, 17), /Incomplete/u);\n assert.deepEqual(state.events, []);\n });\n\n it('retains the configured author role before promotion', async () => {\n const { reviewerContext, state } = fixture();\n await assert.rejects(publishPr(reviewerContext, input), /author/u);\n assert.equal(state.promotions, 0);\n });\n});\n\ndescribe('canonical publication footer and exact-body recovery', () => {\n const footer = '\\n\\n<!-- ai-delivery:pr@1 -->';\n const substantive = 'Original intent.\\r\\nKeep trailing spaces. \\n\\n';\n\n for (const ready of [false, true]) {\n it(`marks new closing publication once and reuses original unmarked input (${ready ? 'ready' : 'draft'})`, async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.expectedCreationDraft = !ready;\n const input = { issueNumber: 17, headBranch: 'issue/17', body: substantive, draft: !ready };\n const expected = `Closes #17\\n\\n${substantive}${footer}`;\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(Reflect.get(preview, 'body'), expected);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n await publishPr(context, input);\n assert.equal(state.body, expected);\n await publishPr(context, input);\n await publishPr(context, { ...input, draft: false });\n await publishPr(context, { ...input, body: expected, draft: false });\n assert.equal(state.body, expected);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.promotions, ready ? 0 : 1);\n });\n }\n\n it('marks admitted non-closing creation and continues with original unmarked intent', async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n const input = { ...nonClosingCreation, body: `References ${repo}#17\\n\\n${substantive}` };\n const preview = await publishPr(context, { ...input, dryRun: true });\n assert.equal(Reflect.get(preview, 'body'), input.body + footer);\n await publishPr(context, input);\n await publishPr(context, { ...input, prNumber: 23 });\n await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: input.body, draft: false });\n assert.equal(state.body, input.body + footer);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.promotions, 1);\n assert.equal(state.issueState, 'open');\n });\n\n for (const nonClosing of [false, true]) {\n it(`reconciles lost creation acknowledgement with original body without another mutation (${nonClosing})`, async () => {\n const { context, state } = fixture(false, nonClosing);\n state.linked = true;\n state.remoteHead = head;\n state.failCreateAck = true;\n const input = nonClosing ? nonClosingCreation : { issueNumber: 17, body: substantive };\n await assert.rejects(publishPr(context, input), /acknowledgement is uncertain/u);\n const expected = nonClosing ? nonClosingCreation.body : `Closes #17\\n\\n${substantive}`;\n assert.equal(state.body, expected + footer);\n state.failCreateAck = false;\n await publishPr(context, { ...input, prNumber: 23 });\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.body, expected + footer);\n });\n\n it(`does not backfill a historical unmarked PR or permit a marker-only transition (${nonClosing})`, async () => {\n const { context, state } = fixture(true, nonClosing);\n const original = state.body;\n const input = { issueNumber: 17, prNumber: 23, nonClosing, body: original };\n await publishPr(context, input);\n assert.equal(state.body, original);\n await assert.rejects(publishPr(context, { ...input, body: original + footer }), /marker|footer|conflict/iu);\n assert.equal(state.body, original);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n });\n }\n\n for (const malformed of [\n 'Closes #17\\n\\n<!-- ai-delivery:pr@2 -->',\n `Closes #17${footer}\\n`,\n `Closes #17${footer}${footer}`,\n `Closes #17${footer}\\n\\nLater text.`,\n `Closes #17\\n\\n<div>\\n${footer}\\n</div>`,\n ]) {\n for (const published of [false, true]) {\n it(`refuses malformed or ambiguous publication markers without repair (${published}, ${JSON.stringify(malformed)})`, async () => {\n const { context, state } = fixture(published);\n state.linked = true;\n state.remoteHead = head;\n if (published) state.body = malformed;\n await assert.rejects(publishPr(context, { issueNumber: 17, body: malformed }), /marker|footer|conflict/iu);\n assert.equal(state.creations + state.updates + state.promotions, 0);\n });\n }\n }\n\n it('preserves quoted marker examples and substantive bytes while adding one active footer', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n const body = 'Closes #17\\n\\nExample:\\n\\n```md\\n<!-- ai-delivery:pr@1 -->\\n```\\n\\nText. \\r\\n';\n await publishPr(context, { issueNumber: 17, body });\n await publishPr(context, { issueNumber: 17, prNumber: 23, body });\n assert.equal(state.body, body + footer);\n assert.equal(state.creations, 1);\n assert.equal(state.updates, 0);\n });\n});\n\ndescribe('directory-independent exact-PR contract', () => {\n it('uses the existing MCP selector for author dry-run, promotion and ready reuse outside a checkout', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-promotion-'));\n const { context, state } = fixture();\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n assert.equal(input.role, 'author');\n return context;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'promotion-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const input = { repo, issueNumber: 17, headBranch: 'issue/17', draft: false };\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const preview = await client.callTool({ name: 'issue_pr_create', arguments: { ...input, dryRun: true } });\n assert.equal(preview.isError, undefined);\n assert.equal(state.promotions, 0);\n for (let call = 0; call < 2; call++) {\n const result = await client.callTool({ name: 'issue_pr_create', arguments: input });\n assert.equal(result.isError, undefined);\n }\n assert.equal(state.promotions, 1);\n assert.equal(state.creations, 0);\n assert.equal(state.draft, false);\n assert.equal(state.linked, false);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it('dispatches native inspection and App dry-run through MCP from a non-Git directory', async () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-association-'));\n const { context, reviewerContext, state, artifact } = fixture();\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n const loader = vi.spyOn(issues, 'loadDeliveryContext').mockImplementation(async (input) => {\n assert.equal(input.repository, repo);\n assert.equal(input.repoRoot, root);\n return input.role === 'reviewer' ? reviewerContext : context;\n });\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'exact-pr-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const info = await client.callTool({ name: 'issue_pr_info', arguments: { repo, issueNumber: 17, prNumber: 23 } });\n assert.equal(info.isError, undefined, JSON.stringify(info.content));\n const review = await client.callTool({\n name: 'issue_pr_review',\n arguments: { repo, issueNumber: 17, prNumber: 23, artifact, dryRun: true },\n });\n assert.equal(review.isError, undefined);\n state.issueNumber = 18;\n await assert.rejects(\n executeTool('issue_pr_info', { repo, issueNumber: 17, prNumber: 23 }, { repoRoot: root }),\n /association/u,\n );\n assert.deepEqual(\n loader.mock.calls.map(([input]) => input.role),\n ['author', 'reviewer', 'author'],\n );\n assert.equal(state.submissions, 0);\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n });\n\n it(\n 'documents explicit issue/PR selection in actual CLI help without credentials or a checkout',\n { tags: ['release'] },\n () => {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-help-'));\n try {\n const help = execFileSync(process.execPath, [resolve('dist/cli.js'), 'pr:info', '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n });\n assert.match(help, /combine --issue and --pr/u);\n assert.match(help, /issue-only lookup requires a GitHub-linked\\s+branch/u);\n const creationHelp = execFileSync(process.execPath, [resolve('dist/cli.js'), 'pr:create', '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n }).replace(/\\s+/gu, ' ');\n assert.match(creationHelp, /Create or reuse an issue-closing PR from a pushed --head, from any directory/u);\n assert.match(creationHelp, /--base <branch>/u);\n assert.match(creationHelp, /Pushed remote head/u);\n assert.match(creationHelp, /--pr <number>/u);\n assert.match(creationHelp, /--expected-head <sha>/u);\n for (const command of ['pr:create', 'pr:info', 'pr:review']) {\n const modeHelp = execFileSync(process.execPath, [resolve('dist/cli.js'), command, '--help'], {\n cwd: root,\n env: { HOME: root, PATH: process.env.PATH },\n encoding: 'utf8',\n });\n assert.match(modeHelp, /--non-closing/u);\n }\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n },\n );\n});\n\ndescribe('explicit native non-closing reference delivery', () => {\n const input = { issueNumber: 17, prNumber: 23, nonClosing: true };\n\n it.each(['ruleset-only', 'ruleset-only with disabled protection summary', 'confirmed-unprotected'])(\n 'creates and reviews %s protection through the real machine client and sanitizer',\n async (mode) => {\n const { context, reviewerContext, state, artifact, evidence, restore, token } =\n await machineRulesetOnlyFixture(false);\n try {\n if (mode === 'ruleset-only with disabled protection summary')\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled: false } } };\n if (mode === 'confirmed-unprotected') {\n evidence.rules = { status: 200, headers: {}, data: [] };\n evidence.rulesets = { status: 200, headers: {}, data: [] };\n evidence.branch = { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } };\n }\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.equal(state.creations, 0);\n const created = await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n const route = await preflightReviewRoute(context, 'main');\n assert.equal(route.rules.visibility, 'complete');\n assert.equal(route.rules.observedRequiredApprovals, mode === 'confirmed-unprotected' ? 0 : 1);\n const reviewPreview = await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n const reviewed = await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.reviews[0]?.user.login, 'reviewer[bot]');\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n assert.equal(state.updates, 0);\n assert.equal(JSON.stringify([preview, created, reviewPreview, reviewed]).includes(token), false);\n } finally {\n restore();\n }\n },\n );\n\n for (const [name, change] of [\n ['generic protection 404', { protectionError: { status: 404, response: { data: { message: 'Not Found' } } } }],\n [\n 'denied protection',\n { protectionError: { status: 403, response: { data: { message: 'Branch not protected' } } } },\n ],\n ['denied applicable rules', { deniedRoute: '/rules/branches/main' }],\n [\n 'denied repository',\n { deniedRoute: '', repository: { status: 403, data: { full_name: repo, permissions: { push: true } } } },\n ],\n ['denied parent rulesets', { deniedRoute: '/rulesets' }],\n [\n 'incomplete rules',\n { rules: { status: 200, headers: { link: '<https://api.github.com/next>; rel=\"next\"' }, data: [] } },\n ],\n ] as const) {\n it(`refuses ${name} through real machine sanitization before publication or review`, async () => {\n const { context, reviewerContext, state, artifact, evidence, restore, token } =\n await machineRulesetOnlyFixture(false);\n try {\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled: false } } };\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n Object.assign(evidence, change);\n for (const operation of [\n () => publishPr(context, nonClosingCreation),\n () => {\n state.published = true;\n return submitFormalReview(reviewerContext, { ...input, artifact });\n },\n ])\n await assert.rejects(operation(), (error: unknown) => {\n assert.ok(error instanceof DeliveryError);\n assert.equal(JSON.stringify(error).includes(token), false);\n return true;\n });\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.updates, 0);\n } finally {\n restore();\n }\n });\n }\n\n it.each([true, false])(\n 'creates and independently reviews a non-closing PR with corroborated rulesets and protection summary %s',\n async (enabled) => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture(false);\n evidence.branch = { status: 200, data: { name: 'main', protected: true, protection: { enabled } } };\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.equal(preview.nonClosing, true);\n assert.equal(state.creations, 0);\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.reviews[0]?.user.login, 'reviewer[bot]');\n assert.equal(state.updates, 0);\n },\n );\n\n for (const [name, change] of [\n ['generic 404', { protectionError: { status: 404, response: { status: 404, data: { message: 'Not Found' } } } }],\n [\n 'permission 404',\n { protectionError: { status: 404, response: { status: 403, data: { message: 'Branch not protected' } } } },\n ],\n ['denied protection', { deniedRoute: 'GET /repos/{owner}/{repo}/branches/{branch}/protection' }],\n ['denied applicable rules', { deniedRoute: 'GET /repos/{owner}/{repo}/rules/branches/{branch}' }],\n ['denied repository', { deniedRoute: 'GET /repos/{owner}/{repo}' }],\n ['denied branch', { deniedRoute: 'GET /repos/{owner}/{repo}/branches/{branch}' }],\n ['denied parent rulesets', { deniedRoute: 'GET /repos/{owner}/{repo}/rulesets' }],\n [\n 'foreign repository',\n { repository: { status: 200, data: { full_name: 'other/widget', permissions: { push: true } } } },\n ],\n ['unknown author write access', { repository: { status: 200, data: { full_name: repo, permissions: {} } } }],\n [\n 'foreign branch',\n { branch: { status: 200, data: { name: 'other', protected: true, protection: { enabled: true } } } },\n ],\n [\n 'conflicting branch protection',\n { branch: { status: 200, data: { name: 'main', protected: false, protection: { enabled: true } } } },\n ],\n [\n 'unprotected branch with active rulesets',\n { branch: { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } } },\n ],\n ['missing protected branch summary', { branch: { status: 200, data: { name: 'main', protected: true } } }],\n ['missing enabled summary', { branch: { status: 200, data: { name: 'main', protected: true, protection: {} } } }],\n [\n 'null enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: null } } } },\n ],\n [\n 'string enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: 'false' } } } },\n ],\n [\n 'numeric enabled summary',\n { branch: { status: 200, data: { name: 'main', protected: true, protection: { enabled: 0 } } } },\n ],\n ['missing ruleset page headers', { rulesets: { status: 200, data: [] } }],\n [\n 'incomplete parent ruleset page',\n { rulesets: { status: 200, headers: { link: '<https://api.github.com/next>; rel=\"next\"' }, data: [] } },\n ],\n ['malformed parent rulesets', { rulesets: { status: 200, headers: {}, data: null } }],\n ['uncorroborated rulesets', { rulesets: { status: 200, headers: {}, data: [] } }],\n [\n 'inactive applicable ruleset',\n {\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: repo, enforcement: 'evaluate' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n },\n },\n ],\n [\n 'conflicting source identity',\n {\n rulesets: {\n status: 200,\n headers: {},\n data: [\n { id: 41, source_type: 'Repository', source: 'other/widget', enforcement: 'active' },\n { id: 42, source_type: 'Organization', source: 'example', enforcement: 'active' },\n ],\n },\n },\n ],\n ] as const) {\n it(`refuses non-closing creation and review with ruleset-only ${name} without mutation`, async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture(false);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n Object.assign(evidence, change);\n await startIssueBranch(context, 17);\n state.remoteHead = head;\n await assert.rejects(publishPr(context, nonClosingCreation), /complete native rule visibility/u);\n assert.equal(state.creations, 0);\n state.published = true;\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.submissions, 0);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n assert.equal(state.issueState, 'open');\n });\n }\n\n it('keeps reviewer permission, distinct-actor and exact-head guards with complete ruleset-only protection', async () => {\n const { context, reviewerContext, state, artifact } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n context.reviewerClients!.effectiveContentsPermission = 'read';\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n context.reviewerClients!.effectiveContentsPermission = 'write';\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /differ|same GitHub actor/u);\n state.reviewerActor = 'reviewer[bot]';\n state.headSha = 'd'.repeat(40);\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /head|artifact/u);\n assert.equal(state.submissions, 0);\n assert.equal(state.creations, 0);\n assert.equal(state.updates, 0);\n });\n\n it('does not treat a sanitized machine-session 404 as proof of absent classic protection', async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n const error = Object.assign(new DeliveryError('Machine GitHub session cannot access the selected operation.'), {\n status: 404,\n });\n setMachineRequestDiagnostics(error, {\n phase: 'rest.request',\n endpoint: 'UNKNOWN',\n status: 404,\n code: undefined,\n requestId: undefined,\n });\n evidence.protectionError = error;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /complete native rule visibility/u);\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.promotions, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.updates, 0);\n });\n\n for (const name of [\n 'incomplete applicable page',\n 'incomplete parent page',\n 'missing applicable headers',\n 'non-success applicable response',\n 'malformed applicable rules',\n 'missing applicable ruleset identity',\n 'malformed approval count',\n 'duplicate corroborating ruleset',\n 'protected branch with empty rules',\n ]) {\n it(`refuses ${name} despite observed ruleset-only protection without mutation`, async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n const rules = evidence.rules as { status: number; headers?: { link?: string }; data: unknown };\n const rulesets = evidence.rulesets as { headers: { link?: string }; data: unknown[] };\n switch (name) {\n case 'incomplete applicable page':\n rules.headers = { link: '<https://api.github.com/next>; rel=\"next\"' };\n break;\n case 'incomplete parent page':\n rulesets.headers = { link: '<https://api.github.com/next>; rel=\"next\"' };\n break;\n case 'missing applicable headers':\n delete rules.headers;\n break;\n case 'non-success applicable response':\n rules.status = 206;\n break;\n case 'malformed applicable rules':\n rules.data = [null];\n break;\n case 'missing applicable ruleset identity':\n rules.data = [{ type: 'pull_request', parameters: { required_approving_review_count: 1 } }];\n break;\n case 'malformed approval count':\n rules.data = [\n {\n type: 'pull_request',\n ruleset_id: 42,\n ruleset_source_type: 'Organization',\n ruleset_source: 'example',\n parameters: { required_approving_review_count: '1' },\n },\n ];\n break;\n case 'duplicate corroborating ruleset':\n rulesets.data.push(rulesets.data[0]);\n break;\n case 'protected branch with empty rules':\n rules.data = [];\n rulesets.data = [];\n break;\n }\n await assert.rejects(publishPr(context, { ...input, draft: false }), /complete native rule visibility/u);\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n assert.equal(state.creations, 0);\n assert.equal(state.submissions, 0);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n });\n }\n\n it('preserves non-closing publication and exact-head review with readable classic protection', async () => {\n const { context, reviewerContext, state, artifact, evidence } = rulesetOnlyFixture();\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n evidence.protection = {\n status: 200,\n data: { required_pull_request_reviews: { required_approving_review_count: 2 } },\n };\n await publishPr(context, { ...input, draft: false });\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.promotions, 1);\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n assert.equal(state.issueState, 'open');\n });\n\n it('submits confirmed-unprotected exact-head review while preserving distinct reviewer and stale-head guards', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n let protectionMessage = 'Branch not protected';\n const request = async (route: string) => {\n if (route.endsWith('/protection'))\n throw { status: 404, response: { status: 404, data: { message: protectionMessage } } };\n if (route.endsWith('/rules/branches/{branch}') || route.endsWith('/rulesets'))\n return { status: 200, headers: {}, data: [] };\n if (route.endsWith('/branches/{branch}'))\n return { status: 200, data: { name: 'main', protected: false, protection: { enabled: false } } };\n if (route === 'GET /repos/{owner}/{repo}')\n return { status: 200, data: { full_name: repo, permissions: { push: true } } };\n throw new Error(`Unexpected fictional route ${route}`);\n };\n context.clients.rest.request = request as typeof context.clients.rest.request;\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n protectionMessage = 'Not Found';\n await assert.rejects(\n submitFormalReview(reviewerContext, { ...input, artifact }),\n /complete native rule visibility/u,\n );\n protectionMessage = 'Branch not protected';\n state.reviewerActor = 'author';\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /differ|same GitHub actor/u);\n state.reviewerActor = 'reviewer[bot]';\n state.headSha = 'd'.repeat(40);\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /head|artifact/u);\n state.headSha = head;\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.reviews[0]?.commit_id, head);\n });\n\n it('accepts the exact native historical reference with empty branch/closing connections', async () => {\n const { context, state } = fixture(true, true);\n assert.equal((await prInfo(context, input)).headSha, head);\n const preview = await publishPr(context, { ...input, draft: false, dryRun: true });\n assert.equal(preview.prNumber, 23);\n assert.equal(preview.nonClosing, true);\n await publishPr(context, { ...input, draft: false });\n await publishPr(context, { ...input, draft: false });\n assert.equal(state.promotions, 1);\n assert.equal(state.updates, 0);\n assert.equal(state.creations, 0);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n });\n\n it('transitions only an exact selected author PR, then reuses the verified body without another update', async () => {\n const { context, state } = fixture();\n const transition = { ...input, body: 'Deliver widget while retaining its issue.' };\n const preview = await publishPr(context, { ...transition, dryRun: true });\n assert.ok('bodyTransition' in preview);\n assert.equal(preview.bodyTransition, true);\n assert.equal(state.updates, 0);\n await publishPr(context, transition);\n await publishPr(context, transition);\n assert.equal(state.body, `References ${repo}#17\\n\\nDeliver widget while retaining its issue.`);\n assert.equal(state.updates, 1);\n assert.equal(state.creations, 0);\n });\n\n it('keeps new PR publication behind the exact pushed head and checks introduced messages first', async () => {\n const { context, state } = fixture(false, true);\n await assert.rejects(publishPr(context, { ...nonClosingCreation, expectedHeadSha: head }), /not expectedHeadSha/u);\n state.linked = true;\n state.remoteHead = head;\n state.commitMessage = 'Fixes: example/widget#99';\n await assert.rejects(publishPr(context, nonClosingCreation), /closing directives/u);\n assert.equal(state.creations, 0);\n state.commitMessage = 'Improve widget';\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.linked, false);\n assert.equal(state.issueState, 'open');\n });\n\n it('submits exact non-closing review after the default base advances and refuses invalid refs', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n state.remoteBase.object.sha = 'd'.repeat(40);\n await submitFormalReview(reviewerContext, { ...input, artifact, dryRun: true });\n assert.equal(state.submissions, 0);\n await submitFormalReview(reviewerContext, { ...input, artifact });\n await submitFormalReview(reviewerContext, { ...input, artifact });\n assert.equal(state.submissions, 1);\n assert.equal(state.issueState, 'open');\n for (const ref of [\n { ref: '', object: { type: 'commit', sha: base } },\n { ref: 'refs/heads/other', object: { type: 'commit', sha: base } },\n { ref: 'refs/heads/main', object: { type: 'tag', sha: base } },\n { ref: 'refs/heads/main', object: { type: 'commit', sha: '' } },\n { ref: 'refs/heads/main', object: { type: 'commit', sha: 'not-a-sha' } },\n ]) {\n state.remoteBase = ref;\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }));\n assert.equal(state.submissions, 1);\n }\n });\n\n for (const directive of [\n 'Closes #17',\n 'CLOSE: #17, #18',\n 'closed example/widget#17',\n 'Fixes: other_owner/other_repo#9',\n 'fixed https://github.com/example/widget/issues/17',\n 'Resolves: https://github.com/example/widget/pull/23',\n 'Resolved **#17**',\n 'Fixes [the issue](https://github.com/example/widget/issues/17)',\n 'Closes \\\\#17',\n ]) {\n it(`refuses closure syntax in introduced messages: ${directive}`, async () => {\n const { context, state } = fixture(true, true);\n state.commitMessage = directive;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing directives/u);\n assert.equal(state.promotions, 0);\n assert.equal(state.updates, 0);\n });\n }\n\n for (const [name, change] of [\n [\n 'removed current intent',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body = 'Improve widget';\n },\n ],\n [\n 'changed intended issue',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body = `References ${repo}#18`;\n },\n ],\n [\n 'conflicting intent declarations',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body += `\\nReferences ${repo}#18`;\n },\n ],\n [\n 'body closure',\n (state: ReturnType<typeof fixture>['state']) => {\n state.body += '\\nFixes #18';\n },\n ],\n [\n 'title closure',\n (state: ReturnType<typeof fixture>['state']) => {\n state.title = 'Fixes #17';\n },\n ],\n [\n 'closing native event',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceCloses = true;\n },\n ],\n [\n 'unknown native event intent',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceCloses = null;\n },\n ],\n [\n 'unauthorized reference actor',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceActor = 'collaborator';\n },\n ],\n [\n 'wrong PR author',\n (state: ReturnType<typeof fixture>['state']) => {\n state.prAuthor = 'collaborator';\n },\n ],\n [\n 'closed issue',\n (state: ReturnType<typeof fixture>['state']) => {\n state.issueState = 'closed';\n },\n ],\n [\n 'foreign PR repository',\n (state: ReturnType<typeof fixture>['state']) => {\n state.headRepo = 'other/widget';\n },\n ],\n [\n 'moved default base',\n (state: ReturnType<typeof fixture>['state']) => {\n state.baseSha = 'd'.repeat(40);\n },\n ],\n [\n 'incomplete commits',\n (state: ReturnType<typeof fixture>['state']) => {\n state.commitReadback = { repository: null };\n },\n ],\n [\n 'missing native reference',\n (state: ReturnType<typeof fixture>['state']) => {\n state.referenceReadback = {\n repository: {\n id: 'REPO',\n nameWithOwner: repo,\n issue: { id: 'ISSUE17', number: 17, state: 'OPEN', timelineItems: { nodes: [], pageInfo } },\n },\n };\n },\n ],\n ] as const) {\n it(`refuses ${name} without mutation`, async () => {\n const { context, state } = fixture(true, true);\n change(state);\n await assert.rejects(publishPr(context, { ...input, draft: false }));\n assert.equal(state.promotions + state.creations + state.updates, 0);\n });\n }\n\n it('requires complete empty closing associations including later pages', async () => {\n const { context, state } = fixture(true, true);\n state.closingPages = [\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n closingIssuesReferences: { nodes: [], pageInfo: { hasNextPage: true, endCursor: 'NEXT' } },\n },\n },\n },\n {\n repository: {\n nameWithOwner: repo,\n pullRequest: {\n id: 'PR23',\n number: 23,\n closingIssuesReferences: { nodes: [{ number: 99, repository: { nameWithOwner: repo } }], pageInfo },\n },\n },\n },\n ];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing association/u);\n assert.equal(state.promotions, 0);\n });\n\n it('accepts equivalent duplicate native events without duplicating authority, but refuses conflicts', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: Array<{ willCloseTarget: boolean }> } } };\n };\n const event = native.repository.issue.timelineItems.nodes[0]!;\n native.repository.issue.timelineItems.nodes.push({ ...event });\n state.referenceReadback = native;\n await prInfo(context, input);\n native.repository.issue.timelineItems.nodes[1]!.willCloseTarget = true;\n await assert.rejects(prInfo(context, input), /Conflicting/u);\n });\n\n it('refuses incomplete reference pagination after a matching observation', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { pageInfo: { hasNextPage: boolean; endCursor: string | null } } } };\n };\n native.repository.issue.timelineItems.pageInfo = { hasNextPage: true, endCursor: 'NEXT' };\n state.referencePages = [native, { repository: null }];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /Incomplete/u);\n assert.equal(state.promotions, 0);\n });\n\n it('does not create again after a server-created draft fails association verification', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.closingReadback = { repository: null };\n await assert.rejects(\n publishPr(context, { issueNumber: 17 }),\n /created PR #23.*post-publication association\\/identity verification is unresolved/u,\n );\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n await assert.rejects(publishPr(context, { issueNumber: 17 }));\n assert.equal(state.creations, 1);\n assert.equal(state.published, true);\n });\n\n it('preserves uncertain create/update acknowledgements and reconciles without another mutation', async () => {\n const { context, state } = fixture(false);\n state.linked = true;\n state.remoteHead = head;\n state.failCreateAck = true;\n await assert.rejects(publishPr(context, { issueNumber: 17 }), /acknowledgement is uncertain/u);\n assert.equal((await prInfo(context, { prNumber: 23 })).prNumber, 23);\n state.failCreateAck = false;\n await publishPr(context, { issueNumber: 17, prNumber: 23 });\n assert.equal(state.creations, 1);\n state.failUpdateAck = true;\n const transition = { ...input, body: 'Keep the issue open.' };\n await assert.rejects(publishPr(context, transition), /Transport lost after body update/u);\n state.failUpdateAck = false;\n await publishPr(context, transition);\n assert.equal(state.updates, 1);\n });\n\n it('refuses explicit ambiguity and requires exact numbers for non-closing inspection', async () => {\n const { context, state } = fixture(true, true);\n await assert.rejects(prInfo(context, { issueNumber: 17, nonClosing: true }), /explicit/u);\n state.matchReadback = [{ number: 23 }, { number: 24 }];\n await assert.rejects(publishPr(context, { ...input, draft: false }), /conflicting/u);\n assert.equal(state.promotions, 0);\n });\n});\n\ndescribe('non-closing complete native graph and mutation drift', () => {\n const input = { issueNumber: 17, prNumber: 23, nonClosing: true };\n it('checks earlier introduced commits rather than only the safe head message', async () => {\n const { context, state } = fixture(true, true);\n const graph = (await context.clients.graphql('DeliveryNonClosingCommits', {})) as {\n repository: {\n pullRequest: {\n commits: {\n totalCount: number;\n nodes: Array<{\n commit: {\n oid: string;\n message: string;\n parents: { totalCount: number; nodes: Array<{ oid: string }>; pageInfo: typeof pageInfo };\n };\n }>;\n };\n };\n };\n };\n graph.repository.pullRequest.commits.totalCount = 2;\n graph.repository.pullRequest.commits.nodes.unshift({\n commit: {\n oid: 'e'.repeat(40),\n message: 'Closes: #999',\n parents: { totalCount: 1, nodes: [{ oid: base }], pageInfo },\n },\n });\n state.commitReadback = graph;\n await assert.rejects(publishPr(context, { ...input, draft: false }), /closing directives/u);\n assert.equal(state.promotions, 0);\n graph.repository.pullRequest.commits.nodes[0]!.commit.message = 'Earlier improvement';\n await prInfo(context, input);\n graph.repository.pullRequest.commits.totalCount = 3;\n await assert.rejects(prInfo(context, input), /count\\/head is incomplete/u);\n });\n\n for (const kind of [\n 'source-node',\n 'source-number',\n 'source-repository',\n 'source-type',\n 'target-node',\n 'target-number',\n 'target-repository',\n 'cross-repository',\n 'missing-actor',\n 'wrong-pr-node',\n ] as const) {\n it(`refuses conflicting native identity ${kind}`, async () => {\n const { context, state } = fixture(true, true);\n type Subject = {\n __typename: string;\n id: string;\n number: number;\n repository: { id: string; nameWithOwner: string };\n };\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: {\n issue: {\n timelineItems: {\n nodes: Array<{\n source: Subject;\n target: Subject;\n isCrossRepository: boolean;\n actor: { login: string } | null;\n }>;\n };\n };\n };\n };\n const event = native.repository.issue.timelineItems.nodes[0]!;\n if (kind === 'source-node') event.source.id = 'PROTHER';\n if (kind === 'source-number') event.source.number = 24;\n if (kind === 'source-repository') event.source.repository.nameWithOwner = 'other/widget';\n if (kind === 'source-type') event.source.__typename = 'Issue';\n if (kind === 'target-node') event.target.id = 'ISSUEOTHER';\n if (kind === 'target-number') event.target.number = 18;\n if (kind === 'target-repository') event.target.repository.id = 'OTHER';\n if (kind === 'cross-repository') event.isCrossRepository = true;\n if (kind === 'missing-actor') event.actor = null;\n if (kind === 'wrong-pr-node') state.nodeId = 'OTHER';\n state.referenceReadback = native;\n await assert.rejects(publishPr(context, { ...input, draft: false }));\n assert.equal(state.promotions + state.creations + state.updates, 0);\n });\n }\n\n it('refuses changed issue criteria on promotion readback without another ready mutation', async () => {\n const { context, state } = fixture(true, true);\n state.readHook = () => {\n if (state.promotions) state.issueBody = 'External changed criteria';\n };\n await assert.rejects(publishPr(context, { ...input, draft: false }), /criteria drifted/u);\n assert.equal(state.promotions, 1);\n assert.equal(state.issueState, 'open');\n });\n\n it('refuses changed body during formal review readback without a duplicate review', async () => {\n const { context, reviewerContext, state, artifact } = fixture(true, true);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n state.readHook = () => {\n if (state.submissions) state.body = 'External removed reference';\n };\n await assert.rejects(submitFormalReview(reviewerContext, { ...input, artifact }), /References line/u);\n assert.equal(state.submissions, 1);\n assert.equal(state.issueState, 'open');\n });\n});\n\ndescribe('exact created intent and native reader bounds', () => {\n for (const drift of ['body', 'title', 'draft', 'closed', 'base'] as const) {\n it(`reports created identity but refuses post-publication ${drift} drift without a replacement`, async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.readHook = () => {\n if (!state.creations) return;\n if (drift === 'body') state.body = `References ${repo}#17\\n\\nOther safe intent`;\n if (drift === 'title') state.title = 'Other safe title';\n if (drift === 'draft') state.draft = false;\n if (drift === 'closed') state.prState = 'closed';\n if (drift === 'base') state.baseSha = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /created PR #23.*differs from publication intent/u);\n assert.equal(state.creations, 1);\n const retry = await publishPr(context, nonClosingCreation).then(\n () => 'reused',\n () => 'refused',\n );\n assert.equal(retry, drift === 'title' || drift === 'draft' ? 'reused' : 'refused');\n assert.equal(state.creations, 1);\n });\n }\n for (const id of [1, true, {}, null, '', ' ']) {\n it(`refuses malformed native event ID ${JSON.stringify(id)} before ready`, async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: Array<{ id: unknown }> } } };\n };\n native.repository.issue.timelineItems.nodes[0]!.id = id;\n state.referenceReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /event identity/u,\n );\n assert.equal(state.promotions + state.updates + state.creations, 0);\n });\n }\n it('refuses an oversized reference page despite equivalent observations', async () => {\n const { context, state } = fixture(true, true);\n const native = (await context.clients.graphql('DeliveryNonClosingReferences', {})) as {\n repository: { issue: { timelineItems: { nodes: unknown[] } } };\n };\n native.repository.issue.timelineItems.nodes = Array.from(\n { length: 101 },\n () => native.repository.issue.timelineItems.nodes[0],\n );\n state.referenceReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /Incomplete/u,\n );\n assert.equal(state.promotions, 0);\n });\n it('refuses oversized introduced commit and parent pages', async () => {\n for (const kind of ['commits', 'parents']) {\n const { context, state } = fixture(true, true);\n type Commit = { oid: string; parents: { nodes: Array<{ oid: string }>; totalCount: number } };\n const native = (await context.clients.graphql('DeliveryNonClosingCommits', {})) as {\n repository: { pullRequest: { commits: { nodes: Array<{ commit: Commit }>; totalCount: number } } };\n };\n const commits = native.repository.pullRequest.commits;\n if (kind === 'commits') {\n commits.nodes = Array.from({ length: 101 }, () => commits.nodes[0]!);\n commits.totalCount = 101;\n } else {\n commits.nodes[0]!.commit.parents.nodes = Array.from({ length: 101 }, () => ({ oid: base }));\n commits.nodes[0]!.commit.parents.totalCount = 101;\n }\n state.commitReadback = native;\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, draft: false }),\n /Incomplete/u,\n );\n assert.equal(state.promotions, 0);\n }\n });\n it('refuses body-transition draft drift before promotion, with no second body mutation', async () => {\n const { context, state } = fixture();\n state.readHook = () => {\n if (state.updates) state.draft = false;\n };\n await assert.rejects(\n publishPr(context, {\n issueNumber: 17,\n prNumber: 23,\n nonClosing: true,\n body: 'Safe partial intent',\n draft: false,\n }),\n /drifted/u,\n );\n assert.equal(state.updates, 1);\n assert.equal(state.promotions, 0);\n assert.equal(state.creations, 0);\n });\n it('does not use the closing-transition exception for stale body with empty closing associations', async () => {\n const { context, state } = fixture(true, true);\n state.body = 'Stale intent with removed References line';\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'New safe intent' }),\n /closing-issue association/u,\n );\n assert.equal(state.updates + state.creations + state.promotions, 0);\n });\n});\n\ndescribe('explicit metadata transition typed authority', () => {\n for (const closing of [\n { number: 17, repository: { nameWithOwner: repo } },\n { __typename: 'PullRequest', id: 'ISSUE17', number: 17, repository: { id: 'REPO', nameWithOwner: repo } },\n { __typename: 'Issue', id: 'OTHER', number: 17, repository: { id: 'REPO', nameWithOwner: repo } },\n { __typename: 'Issue', id: 'ISSUE17', number: 17, repository: { id: 'OTHER', nameWithOwner: repo } },\n ]) {\n it(`refuses incomplete/foreign typed closing identity ${JSON.stringify(closing)}`, async () => {\n const { context, state } = fixture();\n state.closingReadback = {\n repository: {\n nameWithOwner: repo,\n pullRequest: { id: 'PR23', number: 23, closingIssuesReferences: { nodes: [closing], pageInfo } },\n },\n };\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'Safe partial intent' }),\n /typed closing/u,\n );\n assert.equal(state.updates + state.creations + state.promotions, 0);\n });\n }\n});\n\ndescribe('explicit closing-reference reconciliation', () => {\n function pending(published = false) {\n const f = fixture(published, true);\n f.state.linked = !published;\n f.state.remoteHead = head;\n f.state.closingOnCreate = true;\n if (published) {\n f.state.manualClosing = true;\n f.state.referenceCloses = true;\n }\n return f;\n }\n for (const published of [false, true]) {\n it(`refuses a reviewer-context library mutation before publication/removal; existing PR ${published}`, async () => {\n const { context, reviewerContext, state } = pending(published);\n vi.spyOn(github, 'createDeliveryGitHubClients').mockResolvedValue(context.clients);\n await assert.rejects(\n publishPr(reviewerContext, { ...nonClosingCreation, ...(published ? { prNumber: 23 } : {}) }),\n /configured author credentials/u,\n );\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n }\n it('refuses the wrong credential source on the direct library mutation', async () => {\n const { context, state } = pending(true);\n const wrongSource = { ...context, clients: { ...context.clients, authSource: 'app' as const } };\n await assert.rejects(publishPr(wrongSource, { ...nonClosingCreation, prNumber: 23 }), /configured.*author/u);\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n it('opens a bare nonClosing draft with the default reference body and removes the branch closing link', async () => {\n const { context, state } = pending();\n await publishPr(context, { issueNumber: 17, nonClosing: true });\n assert.equal(state.body, `References ${repo}#17\\n\\n<!-- ai-delivery:pr@1 -->`);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n });\n it('creates one draft and removes only the exact manual closing pair before strict success', async () => {\n const { context, state } = pending();\n const preview = await publishPr(context, { ...nonClosingCreation, dryRun: true });\n assert.ok('nonClosingVerified' in preview);\n assert.equal(preview.nonClosingVerified, false);\n assert.equal(state.creations + state.removals, 0);\n const result = await publishPr(context, nonClosingCreation);\n assert.equal(result.prNumber, 23);\n assert.ok('nonClosingVerified' in result);\n assert.equal(result.nonClosingVerified, true);\n assert.deepEqual(state.events, ['draft-publication-replaces-branch-link', 'remove-exact-closing-pair']);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n assert.equal(state.updates + state.promotions + state.submissions, 0);\n assert.equal(state.issueState, 'open');\n assert.equal(state.issueBody, 'Four retained criteria');\n await prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n });\n it('skips removal when the new draft already satisfies the complete non-closing graph', async () => {\n const { context, state } = pending();\n state.closingOnCreate = false;\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 0);\n });\n for (const change of [\n { draft: false },\n { expectedHeadSha: 'd'.repeat(40) },\n { expectedHeadSha: 'bad' },\n { body: 'Closes #17' },\n ]) {\n it(`refuses incompatible action ${JSON.stringify(change)} before publication`, async () => {\n const { context, state } = pending();\n await assert.rejects(publishPr(context, Object.assign({ ...nonClosingCreation }, change)));\n assert.equal(state.creations + state.removals + state.updates + state.promotions, 0);\n });\n }\n it('removes the branch closing link from an implicitly matched draft without creating another', async () => {\n const { context, state } = pending(true);\n state.linked = true;\n await publishPr(context, nonClosingCreation);\n assert.equal(state.creations, 0);\n assert.equal(state.removals, 1);\n });\n it('continues a caller-admitted exact pending PR without creating another', async () => {\n const { context, state } = pending(true);\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.equal(state.creations, 0);\n assert.equal(state.removals, 1);\n });\n it('reads the complete manual connection before acting and checks both connections afterward', async () => {\n const { context, state } = pending(true);\n const first = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n pullRequest: {\n closingIssuesReferences: { nodes: unknown[]; pageInfo: { hasNextPage: boolean; endCursor: string | null } };\n };\n };\n };\n const last = structuredClone(first);\n first.repository.pullRequest.closingIssuesReferences.nodes = [];\n first.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'manual-next' };\n state.manualPages = [first, last];\n state.removalHook = () => {\n state.manualPages = [];\n };\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.ok(state.manualPageIndex >= 4);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 0);\n await prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n });\n for (const kind of [\n 'foreign-later',\n 'duplicate-later',\n 'missing-node',\n 'wrong-pr',\n 'wrong-repo',\n 'incomplete-page',\n ] as const) {\n it(`refuses manual graph ${kind} before removal`, async () => {\n const { context, state } = pending(true);\n const graph = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n nameWithOwner: string;\n pullRequest: {\n id: string;\n closingIssuesReferences: {\n nodes: Array<{ id: string; number: number }>;\n pageInfo?: { hasNextPage: boolean; endCursor: string | null };\n };\n };\n };\n };\n if (kind === 'missing-node') graph.repository.pullRequest.closingIssuesReferences.nodes[0]!.id = '';\n if (kind === 'wrong-pr') graph.repository.pullRequest.id = 'FOREIGN';\n if (kind === 'wrong-repo') graph.repository.nameWithOwner = 'other/widget';\n if (kind === 'incomplete-page') delete graph.repository.pullRequest.closingIssuesReferences.pageInfo;\n state.manualReadback = graph;\n if (kind.endsWith('-later')) {\n const next = structuredClone(graph);\n if (kind === 'foreign-later') next.repository.pullRequest.closingIssuesReferences.nodes[0]!.number = 18;\n graph.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'next' };\n state.manualReadback = undefined;\n state.manualPages = [graph, next];\n }\n await assert.rejects(publishPr(context, { ...nonClosingCreation, prNumber: 23 }));\n assert.equal(state.removals + state.creations, 0);\n });\n }\n it('treats malformed removal acknowledgement as uncertain and does not retry even after the edge disappeared', async () => {\n const { context, state } = pending();\n state.removalReadback = { removeCloseIssueReferences: { issue: { id: 'OTHER' } } };\n await assert.rejects(publishPr(context, nonClosingCreation), /removal.*uncertain/u);\n await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n });\n for (const kind of [\n 'auto-only',\n 'foreign',\n 'duplicate',\n 'truncated',\n 'cursor',\n 'actor',\n 'crossref',\n 'keyword',\n ] as const) {\n it(`refuses ${kind} graph without removing any pair`, async () => {\n const { context, state } = pending(true);\n const graph = structuredClone(await context.clients.graphql('DeliveryClosingIssues', {})) as {\n repository: {\n pullRequest: {\n closingIssuesReferences: {\n nodes: Array<{\n __typename: string;\n id: string;\n number: number;\n repository: { id: string; nameWithOwner: string };\n }>;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n };\n };\n };\n };\n if (kind === 'auto-only') {\n state.closingReadback = graph;\n state.manualClosing = false;\n }\n if (kind === 'foreign')\n graph.repository.pullRequest.closingIssuesReferences.nodes.push({\n __typename: 'Issue',\n id: 'OTHER',\n number: 18,\n repository: { id: 'REPO', nameWithOwner: repo },\n });\n if (kind === 'duplicate')\n graph.repository.pullRequest.closingIssuesReferences.nodes.push(\n graph.repository.pullRequest.closingIssuesReferences.nodes[0]!,\n );\n if (kind === 'truncated') graph.repository.pullRequest.closingIssuesReferences.pageInfo.hasNextPage = true;\n if (kind === 'cursor')\n graph.repository.pullRequest.closingIssuesReferences.pageInfo = { hasNextPage: true, endCursor: 'same' };\n if (['foreign', 'duplicate', 'truncated', 'cursor'].includes(kind)) state.closingReadback = graph;\n if (kind === 'actor') state.referenceActor = 'other';\n if (kind === 'crossref') state.referenceCloses = false;\n if (kind === 'keyword') state.commitMessage = 'Fixes #18';\n await assert.rejects(publishPr(context, { ...nonClosingCreation, prNumber: 23 }));\n assert.equal(state.creations + state.removals + state.promotions + state.updates, 0);\n });\n }\n for (const remains of [false, true]) {\n it(`reports uncertain removal once and permits only read-only reconciliation; edge remains ${remains}`, async () => {\n const { context, state } = pending();\n state.failRemovalAck = true;\n state.keepClosingOnRemoval = remains;\n await assert.rejects(publishPr(context, nonClosingCreation), /PR #23.*removal.*uncertain/u);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n // An unresolved receipt does not authorize the trusted caller to request another removal.\n if (remains) await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true }));\n else await publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true });\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n });\n }\n it('recovers a proven pre-action non-attempt with caller-admitted continuation on the same PR', async () => {\n const { context, state } = pending();\n state.referenceActor = 'other';\n await assert.rejects(publishPr(context, nonClosingCreation), /removal not attempted/u);\n assert.equal(state.removals, 0);\n state.referenceActor = 'author';\n await publishPr(context, { ...nonClosingCreation, prNumber: 23 });\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n });\n it('does not remove anything after uncertain create acknowledgement or create again on read-only inspection', async () => {\n const { context, state } = pending();\n state.failCreateAck = true;\n await assert.rejects(publishPr(context, nonClosingCreation), /acknowledgement is uncertain/u);\n await assert.rejects(prInfo(context, { issueNumber: 17, prNumber: 23, nonClosing: true }));\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 0);\n });\n it('refuses post-removal drift without rollback, promotion or another attempt', async () => {\n const { context, state } = pending();\n state.removalHook = () => {\n state.draft = false;\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /unresolved/u);\n assert.equal(state.removals, 1);\n assert.equal(state.creations, 1);\n assert.equal(state.updates + state.promotions, 0);\n });\n});\n\ndescribe('later-read publication and pre-creation parent bound', () => {\n for (const drift of ['body', 'title', 'draft', 'closed', 'merged', 'base'] as const) {\n it(`refuses later ${drift} drift after the first correct created PR read`, async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.readHook = (count) => {\n if (!state.creations || count < 2) return;\n if (drift === 'body') state.body = `References ${repo}#17\\n\\nOther safe intent`;\n if (drift === 'title') state.title = 'Other safe title';\n if (drift === 'draft') state.draft = false;\n if (drift === 'closed') state.prState = 'closed';\n if (drift === 'merged') {\n state.prState = 'closed';\n state.merged = true;\n }\n if (drift === 'base') state.baseSha = 'd'.repeat(40);\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /created PR #23.*unresolved/u);\n assert.equal(state.creations, 1);\n });\n }\n it('rejects state drift observed only by the verifier final internal PR read', async () => {\n const { context, state } = fixture(true, true);\n state.readHook = (count) => {\n if (count === 3) state.draft = false;\n };\n await assert.rejects(\n publishPr(context, { issueNumber: 17, prNumber: 23, nonClosing: true }),\n /state\\/draft\\/merged/u,\n );\n assert.equal(state.updates + state.promotions + state.creations, 0);\n });\n it('refuses oversized REST parent arrays before creating any PR', async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.comparisonReadback = {\n base_commit: { sha: base },\n merge_base_commit: { sha: base },\n status: 'ahead',\n total_commits: 1,\n commits: [\n { sha: head, commit: { message: 'Safe message' }, parents: Array.from({ length: 101 }, () => ({ sha: base })) },\n ],\n };\n await assert.rejects(publishPr(context, nonClosingCreation), /Incomplete/u);\n assert.equal(state.creations, 0);\n });\n});\n\n// Recorded Oct 24\u201331 (aviaratech/ai-delivery#239): issue_pr_create failed 35 of 42 calls.\ndescribe('first-call PR creation', () => {\n const recorded = { issueNumber: 17, headBranch: 'issue/17' };\n\n it('opens a closing PR with only the author identity configured', async () => {\n const { context, state } = fixture(false);\n Reflect.deleteProperty(context, 'reviewerClients');\n vi.spyOn(github, 'createDeliveryGitHubClients').mockRejectedValue(\n new DeliveryError('Missing GitHub App credentials for reviewer role. Set GH_APP_ID_GPT_REVIEWER.'),\n );\n state.remoteHead = head;\n assert.equal((await publishPr(context, recorded)).prNumber, 23);\n assert.equal(state.creations, 1);\n });\n\n it('returns the created PR with a warning while GitHub has not yet listed its closing link', async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n state.closingReadback = {\n repository: {\n nameWithOwner: repo,\n pullRequest: { id: 'PR23', number: 23, closingIssuesReferences: { nodes: [], pageInfo } },\n },\n };\n const created = await publishPr(context, recorded);\n assert.equal(created.prNumber, 23);\n assert.match(String(Reflect.get(created, 'warnings')), /not yet listed PR #23 as closing #17/u);\n state.closingReadback = undefined;\n assert.equal((await publishPr(context, recorded)).prNumber, 23);\n assert.equal(state.creations, 1);\n });\n\n it('names an unlinked worktree branch and the step that publishes it', async () => {\n const { context, state } = fixture(false, true);\n await assert.rejects(\n publishPr(context, { ...nonClosingCreation, headBranch: 'claude/17-widget' }),\n /Branch claude\\/17-widget is not linked to issue #17 \\(GitHub-linked: none\\); push the work as issue\\/17\\./u,\n );\n assert.equal(state.creations, 0);\n });\n});\n\n// aviaratech/ai-delivery#238: PR #237 referenced #236 without closing it, and a body update was refused.\ndescribe('non-closing body update', () => {\n it('updates an already non-closing PR body and keeps its issue open', async () => {\n const { context, state } = fixture(true, true);\n const update = { issueNumber: 17, prNumber: 23, nonClosing: true, body: 'Revised widget scope.' };\n await publishPr(context, update);\n assert.equal(state.body, `References ${repo}#17\\n\\nRevised widget scope.`);\n await publishPr(context, update);\n assert.equal(state.updates, 1);\n assert.equal(state.issueState, 'open');\n await assert.rejects(publishPr(context, { ...update, body: 'Closes #17' }), /closing directives/u);\n assert.equal(state.updates, 1);\n });\n});\n\n// Recorded issue_pr_create calls that failed on 0.3.37/0.3.38 hosts (#239). Repo, issue, branch,\n// SHA and body text are redacted to the fixture; keys, flags and body shape are as recorded.\ndescribe('recorded issue_pr_create failures open on the first call', () => {\n async function callCreate(context: DeliveryContext, args: Record<string, unknown>) {\n const root = mkdtempSync(join(tmpdir(), 'delivery-pr-replay-'));\n vi.spyOn(settings, 'loadDeliverySettings').mockResolvedValue(\n context.config as unknown as Awaited<ReturnType<typeof settings.loadDeliverySettings>>,\n );\n vi.spyOn(issues, 'loadDeliveryContext').mockResolvedValue(context);\n const server = createAiDeliveryMcpServer({ repoRoot: root });\n const client = new Client({ name: 'replay-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n const result = await client.callTool({ name: 'issue_pr_create', arguments: { repo, ...args } });\n return { isError: result.isError === true, text: JSON.stringify(result.content) };\n } catch (error) {\n return { isError: true, text: error instanceof Error ? error.message : String(error) };\n } finally {\n await client.close();\n await server.close();\n rmSync(root, { recursive: true, force: true });\n }\n }\n const closing = [\n ['ai-delivery#257 Oct 31', { headBranch: 'issue/17', body: 'Closes #17.\\n\\nRedacted.' }],\n ['ai#3889 Oct 31', { headBranch: 'issue/17', base: 'main', body: `Fixes ${repo}#17\\n\\nRedacted.` }],\n ['ai#3894 Nov 1 (twice)', { headBranch: 'issue/17', body: `Fixes ${repo}#17\\nRedacted.` }],\n ['ai#3901 Nov 1', { headBranch: 'issue/17', body: `Fixes ${repo}#17\\nRedacted.` }],\n ['ai#3907 Nov 1', { headBranch: 'issue/17', body: `Fixes ${repo}#17\\n\\nRedacted.` }],\n ] as const;\n for (const [name, args] of closing)\n it(`opens the closing PR from ${name} that pinned expectedHeadSha`, async () => {\n const { context, state } = fixture(false);\n state.remoteHead = head;\n const result = await callCreate(context, {\n issueNumber: 17,\n title: 'Improve widget',\n expectedHeadSha: head,\n ...args,\n });\n assert.equal(result.isError, false, result.text);\n assert.equal(state.creations, 1);\n });\n\n const nonClosing = [\n ['ai#3907 Nov 1 after merged #3908', 'merged', { body: `Refs ${repo}#17 (stays open until the readout)` }],\n ['ai-delivery#240 Nov 1 after closed #245', 'closed', { body: 'Refs #17 (AC1 and AC2). Leaves #17 open.' }],\n ['ai#3700 Oct 26 with no earlier PR', 'none', { body: 'Redacted.' }],\n ] as const;\n for (const [name, earlier, args] of nonClosing)\n it(`opens the non-closing draft from ${name} and keeps the issue open`, async () => {\n const { context, state } = fixture(false, true);\n state.linked = true;\n state.remoteHead = head;\n state.closingOnCreate = true;\n if (earlier !== 'none') {\n const old = {\n ...(await context.clients.rest.pulls.get({ ...context.repo, pull_number: 23 })).data,\n number: 22,\n node_id: 'PR22',\n html_url: `https://github.com/${repo}/pull/22`,\n state: 'closed',\n draft: false,\n merged: earlier === 'merged',\n body: 'Closes #17',\n };\n const { get } = context.clients.rest.pulls;\n Object.assign(context.clients.rest.pulls, {\n list: async (input: { state: string }) => ({\n data: [...(input.state === 'open' ? [] : [{ number: 22 }]), ...(state.published ? [{ number: 23 }] : [])],\n }),\n get: async (input: { pull_number: number }) =>\n input.pull_number === 22 ? { data: old } : get(input as never),\n });\n }\n const result = await callCreate(context, {\n issueNumber: 17,\n headBranch: 'issue/17',\n nonClosing: true,\n title: 'Improve widget',\n ...args,\n });\n assert.equal(result.isError, false, result.text);\n assert.equal(state.creations, 1);\n assert.equal(state.removals, 1);\n assert.equal(state.draft, true);\n assert.equal(state.manualClosing, false);\n assert.equal(state.issueState, 'open');\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,2BAA2B,gCAAgC;AACpE,SAAS,iCAAiC;AAC1C,SAAS,6BAA6B;AACtC,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,WAAW,aAAa,cAAc,QAAQ,qBAAqB;AAC5E,SAAS,cAAc;AACvB,SAAS,MAAM,eAAe;AAC9B,SAAS,WAAW,UAAU,QAAQ,IAAI,UAAU;AACpD,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,YAAY,cAAc;AAC1B,YAAY,YAAY;AACxB,SAAS,mBAAmB;AAC5B,SAAS,eAAe,oCAAoC;AAC5D,SAAS,mBAAmB;AAC5B,YAAY,YAAY;AAExB,SAAS,iCAAiC;AAC1C,SAAS,sBAAsB,QAAQ,WAAW,kBAAkB,0BAA0B;AAE9F,MAAM,OAAO;AACb,MAAM,OAAO,IAAI,OAAO,EAAE;AAC1B,MAAM,OAAO,IAAI,OAAO,EAAE;AAC1B,MAAM,OAAO,IAAI,OAAO,EAAE;AAC1B,MAAM,WAAW,EAAE,aAAa,OAAO,WAAW,KAAK;AACvD,MAAM,qBAAqB;AAAA,EACzB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,MAAM,cAAc,IAAI;AAAA;AAAA;AAC1B;AAEA,SAAS,QAAQ,YAAY,MAAM,aAAa,OAAO;AACrD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,MAAM,aAAa,cAAc,IAAI;AAAA;AAAA,mBAA2B;AAAA,IAChE,OAAO;AAAA,IACP,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,mBA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